#include "GFXSCENE.h"
#include "CLegacyLitShader.h"
#include "CMatchSetup.h"
#include "CGfxEnv.h"
#include "Matrix.h"

CFTTVector32 GFXSCENE_vLightDir;  //004613D8
MYSTATIC int gs_i_3A4144;
 CLightingLUTSceneSettings *pLUTSceneSettings_33F448;
//------------------------------------------------------------------------------------------------
//0018BF4C
void GFXSCENE_Init() {
  //empty
}
//------------------------------------------------------------------------------------------------
//0018BF50
void GFXSCENE_Shutdown() {
  //没有调用到
}
//------------------------------------------------------------------------------------------------
//0018BF84
void GFXSCENE_Apply(CLightingLUTSceneSettings const* plightingLUTSceneSettings0) {
  //LOGE("GFXSCENE_Apply");
  LOGE("GFXSCENE_Apply=%x",plightingLUTSceneSettings0);
  //loc_18C0F6
  return;
}

//------------------------------------------------------------------------------------------------
//0018c19c  ^_^  resetgame到 加载Hero场景没问题
void GFXSCENE_CheckLUTs(ELightingLUTMat emat0) {
  //LOGI("GFXSCENE_CheckLUTs entry %d", emat0);
  //LOGE("GFXSCENE_CheckLUTs");
  //0018C19C
  if (gs_plightingLUTState_46121C[emat0].pTexture_0) {
    if (gs_plightingLUTState_46121C[emat0].Matches(emat0))
      return;

    //loc_18C1BC
    if (gs_plightingLUTState_46121C[emat0].pTexture_0) {
     // LOGE("GFXSCENE_CheckLUTs");
      delete gs_plightingLUTState_46121C[emat0].pTexture_0;
    }
    gs_plightingLUTState_46121C[emat0].pTexture_0 = 0;
    //loc_18C1C6
    if (gs_plightingLUTState_46121C[emat0].pTexture_4)
      delete gs_plightingLUTState_46121C[emat0].pTexture_4;
    gs_plightingLUTState_46121C[emat0].pTexture_4 = 0;
  }

  //LOGI("GFXSCENE_CheckLUTs loc_18C1DE");

  //loc_18C1DE
  memcpy(&gs_plightingLUTState_46121C[emat0].tSetting_8, pLUTSceneSettings_33F448, sizeof(CLightingLUTSceneSettings));
  gs_plightingLUTState_46121C[emat0].Generate(emat0);
  //LOGI("GFXSCENE_CheckLUTs end");
}
//------------------------------------------------------------------------------------------------
//0018c8d8 ^_^ resetgame 到没问题
CFTTTexture* GFXSCENE_GetDiffRimLUT(ELightingLUTMat emat0) {
  //LOGE("GFXSCENE_GetDiffRimLUT");
  GFXSCENE_CheckLUTs(emat0);
   return NULL;
}
//------------------------------------------------------------------------------------------------
//0018c8f0  ^_^  resetgame到没问题
CFTTTexture* GFXSCENE_GetSpecularLUT(ELightingLUTMat emat0) {
  //LOGE("GFXSCENE_GetSpecularLUT");
  return 0;
}
//------------------------------------------------------------------------------------------------
//0018c90c ^_^  测试玩俩关
CFTTVector32 GFXSCENE_GetLightDirConst() {
  //LOGE("GFXSCENE_GetLightDirConst");
 
  //loc_18C926
  return GFXSCENE_vLightDir;
}

//------------------------------------------------------------------------------------------------