CGfxCharacter.cpp 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123
  1. #include "CGfxCharacter.h"
  2. #include "CGFXSpec.h"
  3. #include "CResourceManager.h"
  4. #include "CModelManager.h"
  5. #include "CGraphicsTexLoadOptions.h"
  6. #include "CFTTTextureManager.h"
  7. #include "CFTTColour.h"
  8. #include "Matrix.h"
  9. #include "CFTTGraphicsDevice.h"
  10. #include "CGfxShadow.h"
  11. #include "XSYS.h"
  12. #include "CFTTTexture.h"
  13. #include "CPlayerShader.h"
  14. #include "CGfxShadowMapManager.h"
  15. #include "CGfxShadowMap.h"
  16. #include "CGfxEnvironmentMap.h"
  17. #include "CFTTGraphicsDevice.h"
  18. #include "CPBRLighting.h"
  19. #include "CMatchSetup.h"
  20. #include "TGame.h"
  21. #include "CFTTVector32x4.h"
  22. #include "CGFXSpec.h"
  23. #include "CGfxDynNormMap.h"
  24. #include "CGfxPlayer.h"
  25. #include "CFTTBatchModelManager.h"
  26. #include "TFTTCacheLookup.h"
  27. #include "GFXRENDER.h"
  28. #include "CLinearDepthShader.h"
  29. #include "CFTTMaterialManager.h"
  30. #include "TAnimData.h"
  31. #include "CFTTCamera.h"
  32. #include "FTT2D.h"
  33. #include "FE2D.h"
  34. #include "global_func.h"
  35. #include "CShaderSetup.h"
  36. #include "CLegacyLitShader.h"
  37. #include "memctrl.h"
  38. #include "CFTTFile.h"
  39. void testcomplate(){
  40. TFTTFileAsyncEventData data;
  41. CFTTAsyncEvent<TFTTFileAsyncEventData> event;
  42. event.Complete(&data);
  43. }
  44. unsigned int s_uHairColours[8] = {0xFF202020, 0xFF64573E, 0xFF3D3323, 0xFFDDD499, 0xFFB1953F, 0xFFB86732, 0xFFB8B8B8, 0xFFFFFFFF};
  45. bool CGfxCharacter::s_bDefaultModelsLoaded; //003A4ABC
  46. CFTTModel *CGfxCharacter::s_pDefaultShadowModel[2]; //003A4AC0
  47. CFTTModel *CGfxCharacter::s_pDefaultBodyModel[50]; //003A4AC8
  48. //CFTTModel *CGfxCharacter::s_pDefaultHairModel[100]; //003A4B90
  49. CFTTModel *CGfxCharacter::s_pDefaultHeadModel[40]; //003A4D20
  50. CFTTModel *CGfxCharacter::s_pPropModel[12]; //003A4DC0
  51. CAnimLib *CGfxCharacter::s_pAnimLib; //003A4DF0
  52. int CGfxCharacter::s_iAtlasAmbientTextures[10]; //003A4DF4
  53. int CGfxCharacter::s_iSkinTextures[12]; //003A4E1C
  54. int CGfxCharacter::s_iFacialHairTextures[7]; //003A4E4C
  55. int CGfxCharacter::s_iHairMegaTexture; //003A4E68
  56. int CGfxCharacter::s_iHairSpecularTexture; //003A4E6C
  57. int CGfxCharacter::s_iHairNormalTexture; //003A4E70
  58. int CGfxCharacter::s_iGlovesTextures[5]; //003A4E74
  59. int CGfxCharacter::s_iBootsTextures[12]; //003A4E88
  60. float CGfxCharacter::s_fAtlasDiscardAlpha; //003A4EB8
  61. int CGfxCharacter::s_iCount; //003A4EBC
  62. int CGfxCharacter::s_iAtlasCount; //003A4EC0
  63. CFTTRenderToTexture *CGfxCharacter::s_pMegaRTT; //003A4ECC
  64. CFTTTexture *CGfxCharacter::s_pMegaMippedTex; //003A4ED0
  65. int CGfxCharacter::s_iWalkDirectionAnimLookUp[8] = {-1, -1, 0x675, -1, 0x677, -1, 0x676, -1}; //0033EC28
  66. int CGfxCharacter::s_iManagerDiffuseTextures[12] = {-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; //0033EC48
  67. int CGfxCharacter::s_iManagerSpecularTextures[3] = {-1, 0, 0}; //0033EC78
  68. int CGfxCharacter::s_iManagerNormalTextures[3] = {-1, 0, 0}; //0033EC84
  69. int CGfxCharacter::s_iManagerAmbientTextures[3] = {-1, 0, 0}; //0033EC90
  70. int CGfxCharacter::s_iTorsoSpecularTexture = -1; //0033EC9C
  71. int CGfxCharacter::s_iTorsoNormalTexture = -1; //0033ECA0
  72. int CGfxCharacter::s_iKitSpecularTexture = -1; //0033ECA4
  73. int CGfxCharacter::s_iKitDynamicNormalTexture = -1; //0033ECA8
  74. int CGfxCharacter::s_iKitDynamicAmbientTexture = -1; //0033ECAC
  75. int CGfxCharacter::s_iAtlasSpecularTexture = -1; //0033ECB0
  76. int CGfxCharacter::s_iAtlasNormalTexture = -1; //0033ECB4
  77. int CGfxCharacter::CHAR_ATLAS_W = 256; //0033ECB8
  78. int CGfxCharacter::CHAR_ATLAS_H = 256; //0033ECBC
  79. int CGfxCharacter::CHAR_MEGA_NUM_X = 4; //0033ECC0
  80. int CGfxCharacter::CHAR_MEGA_NUM_Y = 8; //0033ECC4
  81. int CGfxCharacter::CHAR_MEGA_W = CGfxCharacter::CHAR_MEGA_NUM_X * CGfxCharacter::CHAR_ATLAS_W; //003A4EC4
  82. int CGfxCharacter::CHAR_MEGA_H = CGfxCharacter::CHAR_ATLAS_H * CGfxCharacter::CHAR_ATLAS_H; //003A4EC8
  83. CFTTModel *list_model_3A4BA4[95];
  84. CFTTModel *list_model_3A4D20[40];
  85. static OfficialSkinHair_st unk_33EDDC[20] = {
  86. {0, 0, 1, 0xC, 1, 1},
  87. {0, 0, 2, 0xC, 1, 0},
  88. {0, 0, 7, 0xC, 2, 2},
  89. {0, 0, 1, 2, 2, 1},
  90. {0, 0, 2, 2, 1, 0},
  91. {3, 2, 0, 2, 1, 2},
  92. {4, 3, 0, 2, 2, 1},
  93. {0, 0, 2, 0xC, 2, 0},
  94. {1, 1, 2, 0xC, 1, 2},
  95. {3, 2, 0, 6, 1, 1},
  96. {4, 3, 0, 6, 2, 0},
  97. {3, 2, 2, 6, 2, 2},
  98. {4, 3, 2, 6, 1, 1},
  99. {0, 0, 1, 0, 1, 0},
  100. {1, 1, 1, 0, 2, 2},
  101. {3, 2, 1, 0, 2, 1},
  102. {4, 3, 1, 0, 1, 0},
  103. {5, 4, 0, 7, 1, 2},
  104. {5, 4, 0, 7, 2, 1},
  105. {5, 4, 0, 7, 2, 0},
  106. };
  107. const char *s_sShadowModelFile[] = {
  108. "data/models/player/body/shadow_1.ftm",
  109. "data/models/player/body/shadow_2.ftm",
  110. };
  111. const char *s_sBodyModelFile[] = {
  112. "body_skinny_short_1.ftm",
  113. "body_skinny_short_2.ftm",
  114. "body_skinny_short_3.ftm",
  115. "body_skinny_short_4.ftm",
  116. "body_skinny_short_5.ftm",
  117. "body_skinny_long_1.ftm",
  118. "body_skinny_long_2.ftm",
  119. "body_skinny_long_3.ftm",
  120. "body_skinny_long_4.ftm",
  121. "body_skinny_long_5.ftm",
  122. "body_regular_short_1.ftm",
  123. "body_regular_short_2.ftm",
  124. "body_regular_short_3.ftm",
  125. "body_regular_short_4.ftm",
  126. "body_regular_short_5.ftm",
  127. "body_regular_long_1.ftm",
  128. "body_regular_long_2.ftm",
  129. "body_regular_long_3.ftm",
  130. "body_regular_long_4.ftm",
  131. "body_regular_long_5.ftm",
  132. "body_stocky_short_1.ftm",
  133. "body_stocky_short_2.ftm",
  134. "body_stocky_short_3.ftm",
  135. "body_stocky_short_4.ftm",
  136. "body_stocky_short_5.ftm",
  137. "body_stocky_long_1.ftm",
  138. "body_stocky_long_2.ftm",
  139. "body_stocky_long_3.ftm",
  140. "body_stocky_long_4.ftm",
  141. "body_stocky_long_5.ftm",
  142. "mbody_1_1.ftm",
  143. "mbody_1_1.ftm",
  144. "mbody_1_2.ftm",
  145. "mbody_1_2.ftm",
  146. "mbody_1_2.ftm",
  147. "mbody_2_1.ftm",
  148. "mbody_2_1.ftm",
  149. "mbody_2_2.ftm",
  150. "mbody_2_2.ftm",
  151. "mbody_2_2.ftm",
  152. "mbody_3_1.ftm",
  153. "mbody_3_1.ftm",
  154. "mbody_3_2.ftm",
  155. "mbody_3_2.ftm",
  156. "mbody_3_2.ftm",
  157. "torso_0_1.ftm",
  158. "torso_0_1.ftm",
  159. "torso_0_2.ftm",
  160. "torso_0_2.ftm",
  161. "torso_0_2.ftm",
  162. };
  163. const char *s_sPropsModelFile[] = {
  164. "flag_02.ftm",
  165. "flag_01.ftm",
  166. "armband_01.ftm",
  167. "yellowcard_l.ftm",
  168. "redcard_l.ftm",
  169. "yellowcard_r.ftm",
  170. "redcard_r.ftm",
  171. "glove_0_1.ftm",
  172. "glove_0_2.ftm",
  173. "glove_0_3.ftm",
  174. "glove_0_4.ftm",
  175. "glove_0_5.ftm",
  176. };
  177. const char *s_sHairModelFile = "data/models/player/hair/hair_%i_%i.ftm";
  178. const char *s_sHeadModelFile = "data/models/player/head/head_%i_%i.ftm";
  179. const char *color_list_3230BC[] = {
  180. "white",
  181. "white_tan",
  182. "black_med",
  183. "black_med",
  184. "black_dark",
  185. "asian",
  186. };
  187. const char *hair_list_3230D4[7] = {
  188. "facialhair_moustache",
  189. "facialhair_goatee",
  190. "facialhair_chinstrap",
  191. "facialhair_lightbeard",
  192. "facialhair_beard",
  193. "facialhair_chops",
  194. "facialhair_stubble",
  195. };
  196. const char *s_sManagerTexturePrefixes[3] = {
  197. "ManagerFormal",
  198. "StylishCoat",
  199. "Trainningjacket",
  200. };
  201. static int dword_17D658[4] = {0, 1, 1, 0};
  202. const char *aStorsoSPng_0 = "%storso_%s.png";
  203. const char *aDataModelsPlay = "data/models/player/textures/";
  204. static const char *off_3230BC[12] = {0};
  205. static uint32 dword_3A4ED4[4] = {FTTHash("gloves"), 0, 0, 0};
  206. TSATAnim_TSX* GetAnim(uint a1){
  207. return CGfxCharacter::s_pAnimLib->GetAnim(a1,true);
  208. }
  209. TSATAnim_TSX* GetLegAnim(uint a1){
  210. return CGfxCharacter::s_pAnimLib->GetAnim(a1,true);
  211. }
  212. //-------------------------------------------------------------------------------------------------
  213. //0017D450
  214. CGfxCharacter::CGfxCharacter(int i1, int i2, int i3, TPlayerInfo *tPlayerInfo4, CPlayer *cPlayer5, int i6, int i7) {
  215. }
  216. //-------------------------------------------------------------------------------------------------
  217. //0017DC4C
  218. CGfxCharacter::~CGfxCharacter() {
  219. }
  220. //-------------------------------------------------------------------------------------------------
  221. //0017D688 ^_^
  222. void CGfxCharacter::SetAnimation(int i1, float f2, int i3) {
  223. }
  224. //-------------------------------------------------------------------------------------------------
  225. //0017D69C
  226. void CGfxCharacter::SetupPlayer(TPlayerInfo *, bool, int, int) {
  227. }
  228. //-------------------------------------------------------------------------------------------------
  229. //0017DD78 ^_^
  230. void CGfxCharacter::SetTeamID(int a1) {
  231. }
  232. //-------------------------------------------------------------------------------------------------
  233. //0017DD80 //^_^
  234. void CGfxCharacter::Init() {
  235. }
  236. //-------------------------------------------------------------------------------------------------
  237. //0017DDC0 //^_^ 经过单元测试,功能正常
  238. void CGfxCharacter::SetMegaAtlasDims(int a0, int a1, int a2, int a3) {
  239. //LOGI("CGfxCharacter::SetMegaAtlasDims 0017DDC0 entry");
  240. }
  241. //-------------------------------------------------------------------------------------------------
  242. int dword_2FE414[] = {19, 40};
  243. //0017DEF4
  244. void CGfxCharacter::LoadDefaultModels() {
  245. //loc_17E522
  246. }
  247. //-------------------------------------------------------------------------------------------------
  248. //0017E5EC ^_^
  249. void CGfxCharacter::Shutdown() {
  250. }
  251. //-------------------------------------------------------------------------------------------------
  252. //0017E640
  253. void CGfxCharacter::DeleteDefaultModels() {
  254. }
  255. //-------------------------------------------------------------------------------------------------
  256. //0017E8DC ^_^
  257. void CGfxCharacter::SetLOD(int i1, int i2, int i3) {
  258. }
  259. //-------------------------------------------------------------------------------------------------
  260. //0017E8E6 ^_^
  261. void CGfxCharacter::SetKit(int i1) {
  262. }
  263. //-------------------------------------------------------------------------------------------------
  264. //0017E8EC ^_^
  265. void CGfxCharacter::SetBootsColour(EPlayerBoots epBoots1) {
  266. }
  267. //-------------------------------------------------------------------------------------------------
  268. //0017E904
  269. void CGfxCharacter::SetFaceType(int i1) {
  270. //empty
  271. }
  272. //-------------------------------------------------------------------------------------------------
  273. //0017E906 ^_^
  274. void CGfxCharacter::SetSkinColour(EPlayerSkinColour epsColour1, int i2) {
  275. }
  276. //-------------------------------------------------------------------------------------------------
  277. //0017E910 ^_-
  278. void CGfxCharacter::SetFacialHair(EPlayerFacialHair efHair1, EPlayerHairColour ehColour2) {
  279. }
  280. //-------------------------------------------------------------------------------------------------
  281. //0017E960
  282. void CGfxCharacter::SetHairColour(EPlayerHairColour a1) {
  283. }
  284. //-------------------------------------------------------------------------------------------------
  285. //0017E968 ^_^
  286. OfficialSkinHair_st *CGfxCharacter::GetOfficialSkinHair() {
  287. return nullptr;
  288. }
  289. //-------------------------------------------------------------------------------------------------
  290. //0017E984 ^_^
  291. void CGfxCharacter::UpdateUVs() {
  292. }
  293. //-------------------------------------------------------------------------------------------------
  294. //0017E9C0
  295. void CGfxCharacter::CreateAtlasTextures(TPlayerInfo *, int, int, int, int) {
  296. }
  297. //-------------------------------------------------------------------------------------------------
  298. //0017F3D4
  299. void CGfxCharacter::SetBodyXTexture(TPlayerInfo *tPlayerInfo1) {
  300. //loc_17F4CE
  301. }
  302. //-------------------------------------------------------------------------------------------------
  303. //0017F530 ^_^
  304. void CGfxCharacter::SetAnimationBlend(int i1, int i2, float f3, float f4, float f5, float f6, int i7, int i8) {
  305. }
  306. //-------------------------------------------------------------------------------------------------
  307. //0017F564 ^_^
  308. void CGfxCharacter::SetVerts(CFTTModel *cModel1) {
  309. }
  310. //-------------------------------------------------------------------------------------------------
  311. //0017F5B4
  312. void CGfxCharacter::GenerateSamples(TSATFrameSample *, TCharAnimSpec *) {
  313. }
  314. //-------------------------------------------------------------------------------------------------
  315. //0017F7D8
  316. // 0017F7D8
  317. // 0017F7D8
  318. uint32 CGfxCharacter::GetHeadRot() {
  319. CFTTVector32 result_spC;
  320. CFTTVector32 cfttVector32_sp0; //= { 0.0f,1.0f,0.0f };
  321. cfttVector32_sp0.float_0 = 0.0f;
  322. cfttVector32_sp0.float_4 = 1.0f;
  323. cfttVector32_sp0.float_8 = 0.0f;
  324. VectorMatrixMultiply(&result_spC, &cfttVector32_sp0, &m_SalMatrix_E4[2]); // (char *)this + 0x164);
  325. float s0 = result_spC.float_0 - m_SalMatrix_E4[2].d[3][0];
  326. float s2 = result_spC.float_4 - m_SalMatrix_E4[2].d[3][1];
  327. float s4 = result_spC.float_8 - m_SalMatrix_E4[2].d[3][2];
  328. result_spC.float_0 = s0;
  329. result_spC.float_4 = s2;
  330. result_spC.float_8 = s4;
  331. s2 = atan2f(s4, s0);
  332. s0 = (s2 * (float)8192.0) / (float)3.1416;
  333. return (0x2000 - (int)s0) & 0x3FFF;
  334. }
  335. //-------------------------------------------------------------------------------------------------
  336. //0017F864
  337. void CGfxCharacter::UpdateMatrix(CFTTMatrix32 *cMatrix32_1) {
  338. //0017F86E LDR.W R0, [R0,#0x9C]
  339. }
  340. //-------------------------------------------------------------------------------------------------
  341. //0017F91C
  342. void CGfxCharacter::UpdateMatrices(CFTTMatrix32 *cfttMatrix32_1) {
  343. //TFTTHierarchyHeader *var_DE8;
  344. //loc_17FA56
  345. /*.text:0017FA56
  346. .text:0017FA56 loc_17FA56 ; CODE XREF: CGfxCharacter::UpdateMatrices(CFTTMatrix32 *)+B6¡üj
  347. .text:0017FA56 ; CGfxCharacter::UpdateMatrices(CFTTMatrix32 *)+F4¡üj
  348. .text:0017FA56 ADD.W SP, SP, #0xDD0
  349. .text:0017FA5A POP.W {R4-R8,PC}
  350. .text:0017FA5A ; End of function CGfxCharacter::UpdateMatrices(CFTTMatrix32 *)*/
  351. }
  352. //-------------------------------------------------------------------------------------------------
  353. //0017FA70 ^_^
  354. void CGfxCharacter::SkinShadow() {
  355. }
  356. //-------------------------------------------------------------------------------------------------
  357. //0017FA76 ^_^
  358. void CGfxCharacter::SkinModels() {
  359. //locret_17FAB0
  360. }
  361. //-------------------------------------------------------------------------------------------------
  362. // 0017FAB8 ^_- 经过单元测试,功能正常(5,6两关 2022.02.20)
  363. void CGfxCharacter::RenderBatch(ESHADOWMAP_SAMPLING eShadowMap1, int i2) {
  364. // 0017FAD2
  365. if (eShadowMap1 == ESHADOWMAP_SAMPLING_1 || eShadowMap1 == ESHADOWMAP_SAMPLING_2) {
  366. if (eShadowMap1 == ESHADOWMAP_SAMPLING_1) {
  367. // loc_17FAEA
  368. CPlayerShader::s_tInstance.SetShadowMap(EPlayerShader_ShadowMap_1);
  369. } else if (eShadowMap1 == ESHADOWMAP_SAMPLING_2) {
  370. // 0017FAE4
  371. CPlayerShader::s_tInstance.SetShadowMap(EPlayerShader_ShadowMap_2);
  372. }
  373. // 0017FAF4
  374. if (CGfxShadowMapManager::ms_pManager->filed_20.ch[0]) {
  375. // 0017FAFA !!!
  376. int r0_index=CGfxShadowMapManager::ms_pManager->filed_20.ch[0];
  377. if(CGfxShadowMapManager::ms_pManager->filed_20.ch[0]>=1){
  378. r0_index=0;
  379. }
  380. CFTTTexParam tTexPar(CGfxShadowMapManager::ms_pManager->filed_4[r0_index]->GetTexture());
  381. CPlayerShader::s_tInstance.SetShadowMapTex(tTexPar);
  382. } else {
  383. // loc_17FB12
  384. CFTTTexParam tTexPar(((CGfxShadowMap*)(NULL))->GetTexture());
  385. CPlayerShader::s_tInstance.SetShadowMapTex(tTexPar);
  386. }
  387. } else {
  388. // loc_17FB08
  389. CPlayerShader::s_tInstance.SetShadowMap(EPlayerShader_ShadowMap_0);
  390. }
  391. // loc_17FB22
  392. CFTTModel *pCFTTModel_sp58 = m_BodyModles_4[m_lod_7c.m_lod1];
  393. CFTTModel *pCFTTModel_sp64 = m_HairModeles_18[m_lod_7c.m_lod2];
  394. CFTTModel *pCFTTModel_r9 = m_HeaderModles_2c[m_lod_7c.m_lod3];
  395. // 0017FB3C
  396. CGfxEnvironmentMap *r11_pCGfxEnvironmentMap = CGfxEnvironmentMap::Get();
  397. ETimeOfDay r5_eETimeOfDay;
  398. // 0017FB46
  399. if (r11_pCGfxEnvironmentMap->GetForced() == EEnvMapOverride_1) {
  400. // 0017FB4E
  401. r5_eETimeOfDay = ETimeOfDay_0;
  402. } else if (r11_pCGfxEnvironmentMap->GetForced() == EEnvMapOverride_2 ||
  403. r11_pCGfxEnvironmentMap->GetForced() == EEnvMapOverride_3) { // loc_17FB52
  404. // loc_17FB68
  405. r5_eETimeOfDay = ETimeOfDay_1;
  406. } else {
  407. // loc_18075E
  408. // eETimeOfDay_r5 = ETimeOfDay_1; // 00180764 此行是编译优化的结果不需要写出来 Anderson
  409. if (r11_pCGfxEnvironmentMap->GetForced() == EEnvMapOverride_4 ||
  410. tGame.mTLogic_6678.bisRunning_A9==0 ||
  411. CMatchSetup::ms_tInfo.eTimeOfDay_0) {
  412. r5_eETimeOfDay = ETimeOfDay_1; // 0018076C
  413. } else {
  414. r5_eETimeOfDay = ETimeOfDay_0; // 00180786
  415. }
  416. }
  417. // loc_17FB6A
  418. int ePlayerLightingQuality_44_sp70 = GFXSPEC_pSpecification->ePlayerLightingQuality_44;
  419. int var_C0_sp78;
  420. if (GFXSPEC_pSpecification->bFloatEnvMap_3E &&
  421. g_pGraphicsDevice->FloatTextureSupported() &&
  422. g_pGraphicsDevice->TextureLODSupported() &&
  423. CGfxEnvironmentMap::Get()->GetForced() != EEnvMapOverride_3 &&
  424. CGfxEnvironmentMap::Get()->GetForced() != EEnvMapOverride_4) {
  425. var_C0_sp78 = 1;
  426. CPlayerShader::s_tInstance.SetFloatingPoint(EPlayerShader_FloatingPoint_1);
  427. } else {
  428. // loc_17FBB0
  429. var_C0_sp78 = 0;
  430. CPlayerShader::s_tInstance.SetFloatingPoint(EPlayerShader_FloatingPoint_0);
  431. }
  432. CFTTTexture *pTexture_118_sp20;
  433. CFTTTexture *pTexture_114_sp24;
  434. CFTTTexture *pTexture_110_sp28;
  435. CFTTTexture *pTexture_108_sp30;
  436. CFTTTexture *pTexture_104_sp34;
  437. CFTTTexture *pTexture_100_sp38;
  438. CFTTTexture *pTexture_FC_sp3C;
  439. CFTTTexture *pTexture_F8_sp40;
  440. CFTTTexture *pTexture_F0_sp48;
  441. CFTTTexture *pTexture_EC_sp4C;
  442. CFTTTexture *pTexture_D0_sp68;
  443. CFTTTexture *pTexture_CC_sp6C;
  444. // 0017FBC0
  445. if (r5_eETimeOfDay != ETimeOfDay_0) {
  446. CPlayerShader::s_tInstance.SetModel(EPlayerShader_Model_1); // 0017FBD2
  447. CFTTTexParam aTexParam(r11_pCGfxEnvironmentMap->GetDiffuseEnv()); // 0017FBD8 !!!
  448. CPlayerShader::s_tInstance.SetDiffuseEnv(aTexParam); // 0017FBE6
  449. aTexParam.setTexture(r11_pCGfxEnvironmentMap->GetBRDFLUT());
  450. CPlayerShader::s_tInstance.SetBRDFLUT(aTexParam); // 0017FBF6
  451. pTexture_118_sp20 = nullptr;
  452. pTexture_114_sp24 = nullptr;
  453. pTexture_110_sp28 = nullptr;
  454. pTexture_108_sp30 = nullptr;
  455. pTexture_104_sp34 = nullptr;
  456. pTexture_100_sp38 = nullptr;
  457. pTexture_FC_sp3C = nullptr;
  458. pTexture_F8_sp40 = nullptr;
  459. pTexture_F0_sp48 = nullptr;
  460. pTexture_EC_sp4C = nullptr;
  461. pTexture_D0_sp68 = nullptr;
  462. pTexture_CC_sp6C = nullptr;
  463. } else {
  464. // loc_17FC28
  465. CPlayerShader::s_tInstance.SetModel(EPlayerShader_Model_0);
  466. pTexture_EC_sp4C = CPBRLighting::Get()->GetDiffuse(EPBRLightingMat_0); // 0017FC40
  467. pTexture_CC_sp6C = CPBRLighting::Get()->GetDiffuse(EPBRLightingMat_6); // 0017FC48
  468. pTexture_FC_sp3C = CPBRLighting::Get()->GetDiffuse(EPBRLightingMat_1); // 0017FC50
  469. pTexture_108_sp30 = CPBRLighting::Get()->GetDiffuse(EPBRLightingMat_2); // 0017FC58
  470. pTexture_F8_sp40 = CPBRLighting::Get()->GetDiffuse(EPBRLightingMat_3); // 0017FC60
  471. pTexture_100_sp38 = CPBRLighting::Get()->GetDiffuse(EPBRLightingMat_4); // 0017FC68
  472. // 0017FC70
  473. if (var_C0_sp78) {
  474. // 0017FC72
  475. pTexture_F0_sp48 = CPBRLighting::Get()->GetVersatile();
  476. pTexture_114_sp24 = CPBRLighting::Get()->GetVersatile();
  477. pTexture_110_sp28 = CPBRLighting::Get()->GetVersatile();
  478. pTexture_118_sp20 = CPBRLighting::Get()->GetVersatile();
  479. pTexture_104_sp34 = CPBRLighting::Get()->GetVersatile();
  480. pTexture_D0_sp68 = CPBRLighting::Get()->GetVersatile();
  481. } else {
  482. // loc_17FC9A
  483. pTexture_F0_sp48 = CPBRLighting::Get()->GetSpecular(EPBRLightingMat_0);
  484. pTexture_114_sp24 = CPBRLighting::Get()->GetSpecular(EPBRLightingMat_1);
  485. pTexture_110_sp28 = CPBRLighting::Get()->GetSpecular(EPBRLightingMat_2);
  486. pTexture_118_sp20 = CPBRLighting::Get()->GetSpecular(EPBRLightingMat_3);
  487. pTexture_104_sp34 = CPBRLighting::Get()->GetSpecular(EPBRLightingMat_4);
  488. pTexture_D0_sp68 = CPBRLighting::Get()->GetSpecular(EPBRLightingMat_6);
  489. }
  490. }
  491. // loc_17FCCE
  492. float fs16 = 0.449999988f;
  493. float fs18 = 0.550000012f;
  494. float fs20 = 0.550000012f;
  495. float fs22 = 0.200000003f;
  496. //sp7C=this
  497. //sp60=r9
  498. //sp54=r11
  499. if (tGame.mTLogic_6678.bisRunning_A9) { // 0017FCF2
  500. // 0017FCF6
  501. if (CMatchSetup::ms_tInfo.eWeather_4) {
  502. // 0017FD04
  503. fs20 = 0.5f;
  504. if (CMatchSetup::ms_tInfo.eWeather_4 == EWeather_2) {
  505. fs16 = 0.449999988f;
  506. fs18 = 0.550000012f;
  507. fs20 = 0.550000012f;
  508. fs22 = 0.200000003f;
  509. } else {
  510. fs16 = 0.400000006f;
  511. fs18 = 0.400000006f;
  512. fs22 = 0.100000001f;
  513. }
  514. }
  515. }
  516. // loc_17FD7C
  517. float fr9 = powf(fs20, 3.0f);
  518. CFTTVector32x4 tVec32_60_spD8;
  519. tVec32_60_spD8.my[0] = fs20; // 0017FD9C
  520. float s_30 = 1.0f / (fr9 + fr9);
  521. tVec32_60_spD8.my[2] = s_30 * 0.75f;
  522. tVec32_60_spD8.my[1] = fs22;
  523. tVec32_60_spD8.my[3] = powf(fs20, 0.10000000149f);
  524. CFTTVector32x4 tVec32_78_spC0;
  525. tVec32_78_spC0.my[0] = 0.400000006f; // 0017FDAE
  526. tVec32_78_spC0.my[1] = 0.009999999776f;
  527. tVec32_78_spC0.my[2] = 7.812499523163f;
  528. tVec32_78_spC0.my[3] = 0.912443518639f;
  529. CFTTVector32x4 tVec32_88_spB0;
  530. tVec32_88_spB0.my[0] = fs20; // 0017FDCC
  531. tVec32_88_spB0.my[1] = fs22;
  532. tVec32_88_spB0.my[2] = 1.0f / (powf(fs20, 3.0f) + powf(fs20, 3.0f));
  533. tVec32_88_spB0.my[3] = powf(fs20, 0.10000000149f);
  534. CFTTVector32x4 tVec32_98_spA0;
  535. tVec32_98_spA0.my[0] = fs20; // 0017FDF6
  536. tVec32_98_spA0.my[1] = fs22;
  537. tVec32_98_spA0.my[2] = 1.0f / (powf(fs20, 3.0f) + powf(fs20, 3.0f));
  538. tVec32_98_spA0.my[3] = powf(fs20, 0.10000000149f);
  539. CFTTVector32x4 tVec32_A8_sp90;
  540. tVec32_A8_sp90.my[0] = fs18; // 0017FE2C
  541. tVec32_A8_sp90.my[1] = 0.028000000864f;
  542. tVec32_A8_sp90.my[2] = 1.0f / (powf(fs18, 3.0f) + powf(fs18, 3.0f));
  543. tVec32_A8_sp90.my[3] = powf(fs18, 0.10000000149f);
  544. CFTTVector32x4 tVec32_B8_sp80;
  545. tVec32_B8_sp80.my[0] = fs16; // 0017FE58
  546. tVec32_B8_sp80.my[1] = 0.028000000864f;
  547. tVec32_B8_sp80.my[2] = 1.0f / (powf(fs16, 3.0) + powf(fs16, 3.0));
  548. tVec32_B8_sp80.my[3] = powf(fs16, 0.100000001f);
  549. // 0017FE66
  550. fs22= tVec32_A8_sp90.my[2];
  551. float fs26 = 1.0f / (powf(fs16, 3.0) + powf(fs16, 3.0));
  552. if (ePlayerLightingQuality_44_sp70 <= 0) {
  553. // 0017FE72
  554. fs22 = fs22 * 0.75f;
  555. fs26 = fs26 * 0.75f;
  556. tVec32_60_spD8.my[2] = tVec32_60_spD8.my[2]* 0.75f;
  557. tVec32_78_spC0.my[2] = 5.859374523163f;
  558. tVec32_88_spB0.my[2] = tVec32_88_spB0.my[2] * 0.75f;
  559. tVec32_98_spA0.my[2] = tVec32_98_spA0.my[2] * 0.75f;
  560. tVec32_A8_sp90.my[2] = fs22;
  561. tVec32_B8_sp80.my[2] = fs26;
  562. }
  563. // loc_17FE9E
  564. if (CMatchSetup::ms_tInfo.eWeather_4 == EWeather_1) {
  565. tVec32_A8_sp90.my[2] = fs22 * 0.25f;
  566. fs22=tVec32_A8_sp90.my[2];
  567. }
  568. float flt_2FEF3C[7] = {8.0f, 8.0f, 8.0f, 8.0f, 8.0f, 8.0f, 0.0f};
  569. float flt_2FDEA8[8] = {1.0f, 1.0f, 1.0f, 0.5f, 0.75f, 0.75f, 0.5f, 0.25f};
  570. if ((r5_eETimeOfDay & var_C0_sp78) == 1) { // 0017FEC4
  571. // 0017FEC8
  572. tVec32_60_spD8.my[0] = sqrtf(fs20); // 0017FEE4
  573. tVec32_78_spC0.my[0] = 0.632455527782f; // 0017FEF6
  574. tVec32_88_spB0.my[0] = tVec32_60_spD8.my[0]; // 0017FF08
  575. tVec32_98_spA0.my[0] = tVec32_60_spD8.my[0]; // 0017FF24
  576. tVec32_A8_sp90.my[0] = sqrtf(fs18); // 0017FF40
  577. tVec32_B8_sp80.my[0] = sqrtf(fs16); // 0017FF68
  578. tVec32_60_spD8.my[2] = 0.75f;
  579. tVec32_78_spC0.my[2] = 1.0f;
  580. tVec32_88_spB0.my[2] = 1.0f;
  581. tVec32_98_spA0.my[2] = 1.0f;
  582. tVec32_A8_sp90.my[2] = flt_2FEF3C[m_Skincolor1_B8C] * 1.25f;
  583. tVec32_B8_sp80.my[2] = flt_2FDEA8[m_HairColour_BA4];
  584. } else {
  585. // loc_17FF94
  586. tVec32_A8_sp90.my[2] = flt_2FEF3C[m_Skincolor1_B8C] * fs22;
  587. tVec32_B8_sp80.my[2] = flt_2FDEA8[m_HairColour_BA4] * fs26;
  588. }
  589. // loc_17FFC4
  590. EPlayerShader_Bin r1_eShader = EPlayerShader_Bin_8;
  591. int i_r6 = m_Materials_C24[2];
  592. typedef void (*pfun)(void *, CFTTModel *, int, const CFTTMatrix32 *);
  593. pfun pFunc_10C_sp2C = NULL;
  594. // 0017FFD4
  595. if (GFXSPEC_pSpecification->bDynNormMap_3F) {
  596. // 0017FFD6
  597. if ((int)m_lod_7c.m_lod1 < 2) {
  598. pFunc_10C_sp2C = CGfxDynNormMap::PostSkinCB;
  599. r1_eShader = EPlayerShader_Bin_3;
  600. }
  601. } else {
  602. // loc_18001C
  603. pFunc_10C_sp2C = NULL;
  604. }
  605. // loc_180020
  606. CPlayerShader::s_tInstance.SetBin(r1_eShader, i_r6);
  607. CFTTTexParam tTexParam; // !!!
  608. tTexParam.setDataEx(m_KitTextureID_B94);
  609. CPlayerShader::s_tInstance.SetDiffuse(tTexParam, i_r6); // 00180052
  610. tTexParam.setDataEx(CGfxCharacter::s_iKitSpecularTexture); // !!!
  611. CPlayerShader::s_tInstance.SetSpecular(tTexParam, i_r6); // 0018006E
  612. tTexParam.setDataEx(CGfxCharacter::s_iKitDynamicNormalTexture); // !!!
  613. CPlayerShader::s_tInstance.SetNormal(tTexParam, i_r6); // 0018008C
  614. tTexParam.setDataEx(CGfxCharacter::s_iKitDynamicAmbientTexture); // !!!
  615. CPlayerShader::s_tInstance.SetAmbient(tTexParam, i_r6); // 001800AA
  616. tTexParam.setTexture(pTexture_EC_sp4C); // !!!
  617. CPlayerShader::s_tInstance.SetDiffRimLightLUT(tTexParam, i_r6); // 001800B6
  618. tTexParam.setTexture(pTexture_F0_sp48);
  619. CPlayerShader::s_tInstance.SetSpecLightLUT(tTexParam, i_r6); // 001800C2
  620. CPlayerShader::s_tInstance.SetPBR(tVec32_60_spD8, i_r6); // 001800CC
  621. int i_cc0 = m_Materials_C24[3];
  622. tTexParam.setDataEx(CGfxCharacter::m_KitTextureID_B94); // !!!
  623. CPlayerShader::s_tInstance.SetDiffuse(tTexParam, m_Materials_C24[3]); // 001800EA
  624. tTexParam.setTexture(pTexture_CC_sp6C); // !!!
  625. CPlayerShader::s_tInstance.SetDiffRimLightLUT(tTexParam, m_Materials_C24[3]); // 001800F4
  626. tTexParam.setTexture(pTexture_D0_sp68); // !!!
  627. CPlayerShader::s_tInstance.SetSpecLightLUT(tTexParam, m_Materials_C24[3]); // 00180100
  628. int i_sp44 = i_cc0;
  629. CPlayerShader::s_tInstance.SetPBR(tVec32_78_spC0, m_Materials_C24[3]); // 0018010C
  630. //int i_c28 = m_Materials_C24[1];
  631. tTexParam.setDataEx(m_UnknowTexture_BB4); // !!!
  632. CPlayerShader::s_tInstance.SetDiffuse(tTexParam, m_Materials_C24[1]); // 00180132
  633. int r5_i = m_UnknowType_A4 - 1;
  634. // 00180134
  635. if (r5_i >= 2) // 3
  636. r5_i = 2;
  637. else if (r5_i < 0)
  638. r5_i = 0;
  639. //最终r5_i只有可能是 2, 1, 0
  640. tTexParam.setDataEx(CGfxCharacter::s_iManagerSpecularTextures[r5_i]); // !!!
  641. CPlayerShader::s_tInstance.SetSpecular(tTexParam, m_Materials_C24[1]); // 0018015C
  642. tTexParam.setDataEx(CGfxCharacter::s_iManagerNormalTextures[r5_i]); // !!!
  643. CPlayerShader::s_tInstance.SetNormal(tTexParam, m_Materials_C24[1]); // 0018017C
  644. tTexParam.setDataEx(CGfxCharacter::s_iManagerAmbientTextures[r5_i]); // !!!
  645. CPlayerShader::s_tInstance.SetAmbient(tTexParam, m_Materials_C24[1]); // 0018019C
  646. if (((uint)(m_UnknowType_A4 - 1)) <= 1) {
  647. LOGE("CGfxCharacter::RenderBatch_29");
  648. tTexParam.setTexture(pTexture_F8_sp40);
  649. CPlayerShader::s_tInstance.SetDiffRimLightLUT(tTexParam, m_Materials_C24[1]); // 001801B6
  650. tTexParam.setTexture(pTexture_118_sp20);
  651. CPlayerShader::s_tInstance.SetSpecLightLUT(tTexParam, m_Materials_C24[1]); // 001801C2
  652. CPlayerShader::s_tInstance.SetPBR(tVec32_88_spB0, m_Materials_C24[1]);
  653. } else {
  654. // loc_1801EC
  655. tTexParam.setTexture(pTexture_100_sp38);
  656. CPlayerShader::s_tInstance.SetDiffRimLightLUT(tTexParam, m_Materials_C24[1]);
  657. tTexParam.setTexture(pTexture_104_sp34);
  658. CPlayerShader::s_tInstance.SetSpecLightLUT(tTexParam, m_Materials_C24[1]);
  659. CPlayerShader::s_tInstance.SetPBR(tVec32_98_spA0, m_Materials_C24[1]);
  660. }
  661. // 0018020E
  662. tTexParam.setDataEx(m_UnknowTexture_BB4); // !!!
  663. CPlayerShader::s_tInstance.SetDiffuse(tTexParam, m_Materials_C24[0]); // 00180230
  664. tTexParam.setDataEx(CGfxCharacter::s_iTorsoNormalTexture); // !!!
  665. CPlayerShader::s_tInstance.SetNormal(tTexParam, m_Materials_C24[0]); // 00180254
  666. tTexParam.setDataEx(CGfxCharacter::s_iTorsoSpecularTexture); // !!!
  667. CPlayerShader::s_tInstance.SetSpecular(tTexParam, m_Materials_C24[0]); // 00180278
  668. tTexParam.setTexture(pTexture_FC_sp3C);
  669. CPlayerShader::s_tInstance.SetDiffRimLightLUT(tTexParam, m_Materials_C24[0]); // 00180290
  670. tTexParam.setTexture(pTexture_114_sp24);
  671. CPlayerShader::s_tInstance.SetSpecLightLUT(tTexParam, m_Materials_C24[0]); // 001802A6
  672. CPlayerShader::s_tInstance.SetPBR(tVec32_A8_sp90, m_Materials_C24[0]); // 001802B6
  673. tTexParam.setTexture(GetMegaTexture()); // 001802BE
  674. CPlayerShader::s_tInstance.SetDiffuse(tTexParam, m_Materials_C24[5]); // 001802CA
  675. tTexParam.setDataEx(CGfxCharacter::s_iAtlasNormalTexture); // !!!
  676. CPlayerShader::s_tInstance.SetNormal(tTexParam, m_Materials_C24[5]); // 001802EC
  677. tTexParam.setDataEx(CGfxCharacter::s_iAtlasSpecularTexture); // !!!
  678. CPlayerShader::s_tInstance.SetSpecular(tTexParam, m_Materials_C24[5]); // 0018030C
  679. tTexParam.setDataEx(m_AtlasAmbientTexture_B98 ); // !!!
  680. CPlayerShader::s_tInstance.SetAmbient(tTexParam, m_Materials_C24[5]); // 00180326
  681. tTexParam.setTexture(pTexture_FC_sp3C);
  682. CPlayerShader::s_tInstance.SetDiffRimLightLUT(tTexParam, m_Materials_C24[5]); // 00180336
  683. tTexParam.setTexture(pTexture_114_sp24);
  684. CPlayerShader::s_tInstance.SetSpecLightLUT(tTexParam, m_Materials_C24[5]); // 00180342
  685. CPlayerShader::s_tInstance.SetPBR(tVec32_A8_sp90, m_Materials_C24[5]); // 0018034E
  686. // int v86 = m_Materials_C24[4];
  687. tTexParam.setTexture(GetMegaTexture()); // 00180358
  688. CPlayerShader::s_tInstance.SetDiffuse(tTexParam, m_Materials_C24[4]); // 00180364
  689. // tTexParam.setTexture(GetMegaTexture()); // 00180358
  690. // CPlayerShader::s_tInstance.SetDiffRimLightLUT(tTexParam, m_Materials_C24[4]); // 00180364
  691. tTexParam.setTexture(pTexture_CC_sp6C);
  692. CPlayerShader::s_tInstance.SetDiffRimLightLUT(tTexParam, m_Materials_C24[4]); // 0018036E
  693. tTexParam.setTexture(pTexture_D0_sp68);
  694. CPlayerShader::s_tInstance.SetSpecLightLUT(tTexParam, m_Materials_C24[4]); // 00180378
  695. CPlayerShader::s_tInstance.SetPBR(tVec32_78_spC0, m_Materials_C24[4]); // 00180380
  696. tTexParam.setDataEx(s_iHairMegaTexture); // !!!
  697. CPlayerShader::s_tInstance.SetDiffuse(tTexParam, m_Materials_C24[6]); // 001803AA
  698. tTexParam.setDataEx(CGfxCharacter::s_iHairNormalTexture); // !!!
  699. CPlayerShader::s_tInstance.SetNormal(tTexParam, m_Materials_C24[6]); // 001803CC
  700. tTexParam.setDataEx(CGfxCharacter::s_iHairSpecularTexture); // !!!
  701. CPlayerShader::s_tInstance.SetSpecular(tTexParam, m_Materials_C24[6]); // 001803EC
  702. tTexParam.setTexture(pTexture_108_sp30);
  703. CPlayerShader::s_tInstance.SetDiffRimLightLUT(tTexParam, m_Materials_C24[6]); // 001803F8
  704. tTexParam.setTexture(pTexture_110_sp28);
  705. CPlayerShader::s_tInstance.SetSpecLightLUT(tTexParam, m_Materials_C24[6]); // 00180406
  706. CPlayerShader::s_tInstance.SetPBR(tVec32_B8_sp80, m_Materials_C24[6]); // 0018040E
  707. tTexParam.setTexture(r11_pCGfxEnvironmentMap->GetSpecularEnv(EPBRLightingMat_0)); // 0018041E
  708. CPlayerShader::s_tInstance.SetSpecularEnv(tTexParam, m_Materials_C24[2]); // 00180430
  709. tTexParam.setTexture(r11_pCGfxEnvironmentMap->GetSpecularEnv(EPBRLightingMat_0));
  710. CPlayerShader::s_tInstance.SetSpecularEnv(tTexParam, i_sp44); // 00180442
  711. tTexParam.setTexture(r11_pCGfxEnvironmentMap->GetSpecularEnv(EPBRLightingMat_1)); // 00180448
  712. CPlayerShader::s_tInstance.SetSpecularEnv(tTexParam, m_Materials_C24[5]); // 00180454
  713. tTexParam.setTexture(r11_pCGfxEnvironmentMap->GetSpecularEnv(EPBRLightingMat_0)); // 0018045A
  714. CPlayerShader::s_tInstance.SetSpecularEnv(tTexParam, m_Materials_C24[4]); // 00180466
  715. tTexParam.setTexture(r11_pCGfxEnvironmentMap->GetSpecularEnv(EPBRLightingMat_2)); // 0018046C
  716. CPlayerShader::s_tInstance.SetSpecularEnv(tTexParam, m_Materials_C24[6]); // 0018047C
  717. tTexParam.setTexture(r11_pCGfxEnvironmentMap->GetSpecularEnv(EPBRLightingMat_0));
  718. CPlayerShader::s_tInstance.SetSpecularEnv(tTexParam, m_Materials_C24[1]); // 0018048E
  719. tTexParam.setTexture(r11_pCGfxEnvironmentMap->GetSpecularEnv(EPBRLightingMat_0));
  720. CPlayerShader::s_tInstance.SetSpecularEnv(tTexParam, m_Materials_C24[0]); // 001804A2
  721. CGfxPlayer::SetupBatchConstants(); // 001804A8
  722. for (int ir4 = 0; ir4 != 8; ir4++) { // loc_1804EA
  723. // 001804DC
  724. GFXPLAYER_spBatchBins[ir4]->SetMaterialID(m_Materials_C24[ir4]);
  725. }
  726. // 001804F4
  727. GFXPLAYER_spBatchBins[7]->SetMaterialID(m_Materials_C24[6]);
  728. // 00180500
  729. int d_sp70 = i2 + 1;
  730. // 001804F4
  731. TFTTCacheInstance pTFTTCacheLookup_0;
  732. pTFTTCacheLookup_0.ci_0 = (uint8)i2;
  733. pTFTTCacheLookup_0.ci_1 = 0;
  734. if (i2 == -1) {
  735. LOGE("CGfxCharacter::RenderBatch_34");
  736. pTFTTCacheLookup_0.ci_0 = pTFTTCacheLookup_0.ci_0;
  737. pTFTTCacheLookup_0.ci_1 = 0xff;
  738. }
  739. GFXPLAYER_pBatch->AddModel(pCFTTModel_sp58,
  740. m_SalMatrix_E4,
  741. m_BodyUV_40[m_lod_7c.m_lod1],
  742. pTFTTCacheLookup_0, // sp 138
  743. 2, // sp 134
  744. -1, // sp 130
  745. pFunc_10C_sp2C, // sp 12C
  746. nullptr); // 00180558
  747. GFXPLAYER_pBatch->AddModel(pCFTTModel_sp58,
  748. m_SalMatrix_E4,
  749. m_BodyUV_40[m_lod_7c.m_lod1],
  750. pTFTTCacheLookup_0,
  751. 3,
  752. -1,
  753. nullptr,
  754. nullptr); // 0018057A
  755. GFXPLAYER_pBatch->AddModel(pCFTTModel_sp58,
  756. m_SalMatrix_E4,
  757. m_BodyUV_40[m_lod_7c.m_lod1],
  758. pTFTTCacheLookup_0,
  759. 5,
  760. -1,
  761. nullptr,
  762. nullptr); // 0018059C
  763. GFXPLAYER_pBatch->AddModel(pCFTTModel_sp58,
  764. m_SalMatrix_E4,
  765. m_BodyUV_40[m_lod_7c.m_lod1],
  766. pTFTTCacheLookup_0,
  767. 4,
  768. -1,
  769. nullptr,
  770. nullptr); // 001805BE
  771. GFXPLAYER_pBatch->AddModel(pCFTTModel_sp58,
  772. m_SalMatrix_E4,
  773. m_BodyUV_40[m_lod_7c.m_lod1],
  774. pTFTTCacheLookup_0,
  775. 0,
  776. -1,
  777. nullptr,
  778. nullptr); // 001805DE
  779. GFXPLAYER_pBatch->AddModel(pCFTTModel_sp58,
  780. m_SalMatrix_E4,
  781. m_BodyUV_40[m_lod_7c.m_lod1],
  782. pTFTTCacheLookup_0,
  783. 1,
  784. -1,
  785. nullptr,
  786. nullptr); // 00180606
  787. int i_CC_sp6C = GFXPLAYER_spBatchBins[6]->GetDrawCalls(); // 00180610
  788. int ir8 = GFXPLAYER_spBatchBins[7]->GetDrawCalls(); // 0018061A
  789. if (m_HeaderModles_2c[m_lod_7c.m_lod3] != nullptr) {
  790. TFTTCacheInstance tCacheLookup;
  791. tCacheLookup.ci_0 = 0;
  792. tCacheLookup.ci_1 = 0xFF;
  793. if (i2 != -1) {
  794. tCacheLookup.ci_0 = 0;
  795. tCacheLookup.ci_1 = 0x1;
  796. }
  797. tCacheLookup.ci_0 |=pTFTTCacheLookup_0.ci_0;
  798. tCacheLookup.ci_1 |=pTFTTCacheLookup_0.ci_1;
  799. GFXPLAYER_pBatch->AddModel(m_HeaderModles_2c[m_lod_7c.m_lod3],
  800. m_SalMatrix_E4,
  801. m_HeaderUV_68[m_lod_7c.m_lod3],
  802. tCacheLookup,
  803. -1,
  804. -1,
  805. nullptr,
  806. nullptr); // 00180654
  807. }
  808. // loc_180658
  809. if (m_HairModeles_18[m_lod_7c.m_lod2] != nullptr) {
  810. TFTTCacheInstance tCacheLookup;
  811. tCacheLookup.ci_0 = 0xff;
  812. tCacheLookup.ci_1 = 0xff;
  813. GFXPLAYER_pBatch->AddModel(m_HairModeles_18[m_lod_7c.m_lod2],
  814. m_SalMatrix_E4,
  815. m_HairUV_54[m_lod_7c.m_lod2],
  816. tCacheLookup,
  817. -1,
  818. -1,
  819. nullptr,
  820. nullptr);
  821. }
  822. // loc_180684
  823. if (GFXRENDER_bIsDepthPass || GFXRENDER_bIsBlackDepthPass) {
  824. // 00180698
  825. int ir6 = GFXPLAYER_spBatchBins[6]->GetDrawCalls(); // 0018069C
  826. int ir5 = GFXPLAYER_spBatchBins[7]->GetDrawCalls(); // 001806A6
  827. if (i_CC_sp6C != ir6 && ir6 != 0) {
  828. // 001806B6
  829. LOGE("CGfxCharacter::RenderBatch_38");
  830. int ir4 = GFXPLAYER_spBatchBins[6]->GetLastMatID();
  831. CLinearDepthShader::s_tInstance.SetSource(ELinearDepthShader_Source_1, ir4);
  832. // 001806D6
  833. tTexParam.setDataEx(CGfxCharacter::s_iHairMegaTexture);
  834. CLinearDepthShader::s_tInstance.SetDiffuseMaterial(tTexParam, ir4);
  835. }
  836. // loc_1806F2
  837. if (ir8 != ir5 && ir5 != 0) {
  838. // 001806FA
  839. LOGE("CGfxCharacter::RenderBatch_39");
  840. int ir4 = GFXPLAYER_spBatchBins[7]->GetLastMatID(); // 001806FE
  841. CLinearDepthShader::s_tInstance.SetSource(ELinearDepthShader_Source_1, ir4);
  842. tTexParam.setDataEx(CGfxCharacter::s_iHairMegaTexture);
  843. CLinearDepthShader::s_tInstance.SetDiffuseMaterial(tTexParam, ir4);
  844. }
  845. }
  846. // loc_180730
  847. if (CGfxPlayer::ms_iNumHairMats <= 32) {
  848. CGfxPlayer::ms_iHairMatList[CGfxPlayer::ms_iNumHairMats++] = m_Materials_C24[6];
  849. }
  850. }
  851. //-------------------------------------------------------------------------------------------------
  852. //00180860 ^_^
  853. CFTTTexture *CGfxCharacter::GetMegaTexture() {
  854. LOGE("CGfxCharacter::GetMegaTexture");
  855. return (CFTTTexture *)rand();
  856. }
  857. //-------------------------------------------------------------------------------------------------
  858. //001808AC ^_- 经过单元测试,功能正常
  859. void CGfxCharacter::RenderShadowBatch(int i1) {
  860. //loc_1809B6
  861. }
  862. //-------------------------------------------------------------------------------------------------
  863. //001809C8 ^_^
  864. void CGfxCharacter::CreateMippedMegaTexture() {
  865. return;
  866. }
  867. //-------------------------------------------------------------------------------------------------
  868. //00180A30 ^_^
  869. void CGfxCharacter::SkinProp() {
  870. }
  871. //-------------------------------------------------------------------------------------------------
  872. //00180A64 ^_- 经过单元测试,功能正常
  873. void CGfxCharacter::RenderProp(CFTTMatrix32 &cfttMatrix32_1) {
  874. }
  875. //-------------------------------------------------------------------------------------------------
  876. //00180B20
  877. void CGfxCharacter::RenderShadow(CFTTMatrix32 *cMatrix32_1) {
  878. }
  879. //-------------------------------------------------------------------------------------------------
  880. //00180B70 ^_^
  881. void CGfxCharacter::GetInfo(CFTTModel *&cModel_1, CFTTMatrix32 &cMatrix32_2) {
  882. //00180B84 LDR.W R2, [R2,R3,LSL#2]
  883. }
  884. //-------------------------------------------------------------------------------------------------
  885. //00180BD4 ^_^
  886. void CGfxCharacter::ResetShadowMatrix() {
  887. }
  888. //-------------------------------------------------------------------------------------------------
  889. //00180BF0 ^_^
  890. void CGfxCharacter::LockVertexBuffers() {
  891. }
  892. //-------------------------------------------------------------------------------------------------
  893. //00180C00 ^_^
  894. void CGfxCharacter::UnlockVertexBuffers() {
  895. }
  896. //-------------------------------------------------------------------------------------------------
  897. //00180C0C
  898. int CGfxCharacter::UpdateAnimation(bool b1) {
  899. return 1;
  900. }
  901. //-------------------------------------------------------------------------------------------------
  902. //00180E00 ^_- 经过单元测试,功能正常
  903. int CGfxCharacter::GetUVScale(TBinUVScale *uvScale, int i2) {
  904. return 1;
  905. }
  906. //-------------------------------------------------------------------------------------------------
  907. //00180F28
  908. void CGfxCharacter::UpdateUVs(CFTTModel **cModel1, int i2, TUV **tuv3) {
  909. }
  910. //-------------------------------------------------------------------------------------------------
  911. //00181148 ^_^
  912. void CGfxCharacter::SetPlayerIsKeeper(bool a1) {
  913. }
  914. //-------------------------------------------------------------------------------------------------
  915. //0018114E ^_^
  916. void CGfxCharacter::UpdateBlinking() {
  917. }
  918. //-------------------------------------------------------------------------------------------------
  919. //00181188
  920. void CGfxCharacter::Blink(bool b1) {
  921. }
  922. //-------------------------------------------------------------------------------------------------
  923. //00181374 ^_^
  924. void CGfxCharacter::GetHeadInfo(int i1, CFTTModel *&cModel2, CFTTModel *&cModel3, TUV *&tuv4, TUV *&tuv5, int &i6, EPlayerSkinColour &eColor7) {
  925. }
  926. //-------------------------------------------------------------------------------------------------
  927. /*
  928. --------------------------------------------------------------------------
  929. 2021.12.17 这几个函数分配给八哥,做外包
  930. 2021.12.20 八哥完成这几个函数
  931. 0017e910 CGfxCharacter::SetFacialHair 24
  932. 0017f564 CGfxCharacter::SetVerts 26
  933. 00180b20 CGfxCharacter::RenderShadow 28
  934. 0017e5ec CGfxCharacter::Shutdown 30
  935. 00180b70 CGfxCharacter::GetInfo 33
  936. 0017f7d8 CGfxCharacter::GetHeadRot 38
  937. 001809c8 CGfxCharacter::CreateMippedMegaTexture 41
  938. 0017f864 CGfxCharacter::UpdateMatrix 47
  939. 2021.12.20 这几个函数分配给八哥,做外包
  940. 0017e904 CGfxCharacter::SetFaceType 1
  941. 0017e960 CGfxCharacter::SetHairColour 2
  942. 0017e8e6 CGfxCharacter::SetKit 2
  943. 00181148 CGfxCharacter::SetPlayerIsKeeper 2
  944. 0017dd78 CGfxCharacter::SetTeamID 2
  945. 0017fa70 CGfxCharacter::SkinShadow 2
  946. 0017e8dc CGfxCharacter::SetLOD 3
  947. 0017e906 CGfxCharacter::SetSkinColour 3
  948. 00180c00 CGfxCharacter::UnlockVertexBuffers 4
  949. 00180bf0 CGfxCharacter::LockVertexBuffers 5
  950. 0017d688 CGfxCharacter::SetAnimation 5
  951. 0017e8ec CGfxCharacter::SetBootsColour 7
  952. 0017e968 CGfxCharacter::GetOfficialSkinHair 8
  953. 00180bd4 CGfxCharacter::ResetShadowMatrix 9
  954. 00180860 CGfxCharacter::GetMegaTexture 13
  955. 0017f530 CGfxCharacter::SetAnimationBlend 14
  956. 00180a30 CGfxCharacter::SkinProp 19
  957. 0017dd80 CGfxCharacter::Init 20
  958. 0017fa76 CGfxCharacter::SkinModels 21
  959. 0018114e CGfxCharacter::UpdateBlinking 21
  960. 00181374 CGfxCharacter::GetHeadInfo 22
  961. 0017e984 CGfxCharacter::UpdateUVs 22
  962. 00180a64 CGfxCharacter::RenderProp 58
  963. 00180e00 CGfxCharacter::GetUVScale 90
  964. 001808ac CGfxCharacter::RenderShadowBatch 97
  965. --------------------------------------------------------------------------
  966. 未分配
  967. 0017f3d4 CGfxCharacter::SetBodyXTexture 104
  968. 0017f91c CGfxCharacter::UpdateMatrices 106
  969. 0017ddc0 CGfxCharacter::SetMegaAtlasDims 107
  970. 00180f28 CGfxCharacter::UpdateUVs 109
  971. 0017dc4c CGfxCharacter::~CGfxCharacter 114
  972. 00181188 CGfxCharacter::Blink 130
  973. 00180c0c CGfxCharacter::UpdateAnimation 151
  974. 0017f5b4 CGfxCharacter::GenerateSamples 168
  975. 0017d450 CGfxCharacter::CGfxCharacter 177
  976. 0017e640 CGfxCharacter::DeleteDefaultModels 237
  977. 0017d69c CGfxCharacter::SetupPlayer 489
  978. 0017def4 CGfxCharacter::LoadDefaultModels 614
  979. 0017e9c0 CGfxCharacter::CreateAtlasTextures 712
  980. 0017fab8 CGfxCharacter::RenderBatch 1208
  981. */