CGfxCharacter.cpp 42 KB

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