123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494 |
- #include "CGfxCharacter.h"
- #include "CGFXSpec.h"
- #include "CResourceManager.h"
- #include "CModelManager.h"
- #include "CGraphicsTexLoadOptions.h"
- #include "CFTTTextureManager.h"
- #include "CFTTColour.h"
- #include "Matrix.h"
- #include "CFTTGraphicsDevice.h"
- #include "CGfxShadow.h"
- #include "XSYS.h"
- #include "CFTTTexture.h"
- #include "CPlayerShader.h"
- #include "CGfxShadowMapManager.h"
- #include "CGfxShadowMap.h"
- #include "CGfxEnvironmentMap.h"
- #include "CFTTGraphicsDevice.h"
- #include "CPBRLighting.h"
- #include "CMatchSetup.h"
- #include "TGame.h"
- #include "CFTTVector32x4.h"
- #include "CGFXSpec.h"
- #include "CGfxDynNormMap.h"
- #include "CGfxPlayer.h"
- #include "CFTTBatchModelManager.h"
- #include "TFTTCacheLookup.h"
- #include "GFXRENDER.h"
- #include "CLinearDepthShader.h"
- #include "CFTTMaterialManager.h"
- #include "TAnimData.h"
- #include "CFTTCamera.h"
- #include "FTT2D.h"
- #include "FE2D.h"
- #include "global_func.h"
- #include "CShaderSetup.h"
- #include "CLegacyLitShader.h"
- #include "memctrl.h"
- unsigned int s_uHairColours[8] = {0xFF202020, 0xFF64573E, 0xFF3D3323, 0xFFDDD499, 0xFFB1953F, 0xFFB86732, 0xFFB8B8B8, 0xFFFFFFFF};
- bool CGfxCharacter::s_bDefaultModelsLoaded; //003A4ABC
- CFTTModel *CGfxCharacter::s_pDefaultShadowModel[2]; //003A4AC0
- CFTTModel *CGfxCharacter::s_pDefaultBodyModel[50]; //003A4AC8
- //CFTTModel *CGfxCharacter::s_pDefaultHairModel[100]; //003A4B90
- CFTTModel *CGfxCharacter::s_pDefaultHeadModel[40]; //003A4D20
- CFTTModel *CGfxCharacter::s_pPropModel[12]; //003A4DC0
- CAnimLib *CGfxCharacter::s_pAnimLib; //003A4DF0
- int CGfxCharacter::s_iAtlasAmbientTextures[10]; //003A4DF4
- int CGfxCharacter::s_iSkinTextures[12]; //003A4E1C
- int CGfxCharacter::s_iFacialHairTextures[7]; //003A4E4C
- int CGfxCharacter::s_iHairMegaTexture; //003A4E68
- int CGfxCharacter::s_iHairSpecularTexture; //003A4E6C
- int CGfxCharacter::s_iHairNormalTexture; //003A4E70
- int CGfxCharacter::s_iGlovesTextures[5]; //003A4E74
- int CGfxCharacter::s_iBootsTextures[12]; //003A4E88
- float CGfxCharacter::s_fAtlasDiscardAlpha; //003A4EB8
- int CGfxCharacter::s_iCount; //003A4EBC
- int CGfxCharacter::s_iAtlasCount; //003A4EC0
- CFTTRenderToTexture *CGfxCharacter::s_pMegaRTT; //003A4ECC
- CFTTTexture *CGfxCharacter::s_pMegaMippedTex; //003A4ED0
- int CGfxCharacter::s_iWalkDirectionAnimLookUp[8] = {-1, -1, 0x675, -1, 0x677, -1, 0x676, -1}; //0033EC28
- int CGfxCharacter::s_iManagerDiffuseTextures[12] = {-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; //0033EC48
- int CGfxCharacter::s_iManagerSpecularTextures[3] = {-1, 0, 0}; //0033EC78
- int CGfxCharacter::s_iManagerNormalTextures[3] = {-1, 0, 0}; //0033EC84
- int CGfxCharacter::s_iManagerAmbientTextures[3] = {-1, 0, 0}; //0033EC90
- int CGfxCharacter::s_iTorsoSpecularTexture = -1; //0033EC9C
- int CGfxCharacter::s_iTorsoNormalTexture = -1; //0033ECA0
- int CGfxCharacter::s_iKitSpecularTexture = -1; //0033ECA4
- int CGfxCharacter::s_iKitDynamicNormalTexture = -1; //0033ECA8
- int CGfxCharacter::s_iKitDynamicAmbientTexture = -1; //0033ECAC
- int CGfxCharacter::s_iAtlasSpecularTexture = -1; //0033ECB0
- int CGfxCharacter::s_iAtlasNormalTexture = -1; //0033ECB4
- int CGfxCharacter::CHAR_ATLAS_W = 256; //0033ECB8
- int CGfxCharacter::CHAR_ATLAS_H = 256; //0033ECBC
- int CGfxCharacter::CHAR_MEGA_NUM_X = 4; //0033ECC0
- int CGfxCharacter::CHAR_MEGA_NUM_Y = 8; //0033ECC4
- int CGfxCharacter::CHAR_MEGA_W = CGfxCharacter::CHAR_MEGA_NUM_X * CGfxCharacter::CHAR_ATLAS_W; //003A4EC4
- int CGfxCharacter::CHAR_MEGA_H = CGfxCharacter::CHAR_ATLAS_H * CGfxCharacter::CHAR_ATLAS_H; //003A4EC8
- CFTTModel *list_model_3A4BA4[95];
- CFTTModel *list_model_3A4D20[40];
- static OfficialSkinHair_st unk_33EDDC[20] = {
- {0, 0, 1, 0xC, 1, 1},
- {0, 0, 2, 0xC, 1, 0},
- {0, 0, 7, 0xC, 2, 2},
- {0, 0, 1, 2, 2, 1},
- {0, 0, 2, 2, 1, 0},
- {3, 2, 0, 2, 1, 2},
- {4, 3, 0, 2, 2, 1},
- {0, 0, 2, 0xC, 2, 0},
- {1, 1, 2, 0xC, 1, 2},
- {3, 2, 0, 6, 1, 1},
- {4, 3, 0, 6, 2, 0},
- {3, 2, 2, 6, 2, 2},
- {4, 3, 2, 6, 1, 1},
- {0, 0, 1, 0, 1, 0},
- {1, 1, 1, 0, 2, 2},
- {3, 2, 1, 0, 2, 1},
- {4, 3, 1, 0, 1, 0},
- {5, 4, 0, 7, 1, 2},
- {5, 4, 0, 7, 2, 1},
- {5, 4, 0, 7, 2, 0},
- };
- const char *s_sShadowModelFile[] = {
- "data/models/player/body/shadow_1.ftm",
- "data/models/player/body/shadow_2.ftm",
- };
- const char *s_sBodyModelFile[] = {
- "body_skinny_short_1.ftm",
- "body_skinny_short_2.ftm",
- "body_skinny_short_3.ftm",
- "body_skinny_short_4.ftm",
- "body_skinny_short_5.ftm",
- "body_skinny_long_1.ftm",
- "body_skinny_long_2.ftm",
- "body_skinny_long_3.ftm",
- "body_skinny_long_4.ftm",
- "body_skinny_long_5.ftm",
- "body_regular_short_1.ftm",
- "body_regular_short_2.ftm",
- "body_regular_short_3.ftm",
- "body_regular_short_4.ftm",
- "body_regular_short_5.ftm",
- "body_regular_long_1.ftm",
- "body_regular_long_2.ftm",
- "body_regular_long_3.ftm",
- "body_regular_long_4.ftm",
- "body_regular_long_5.ftm",
- "body_stocky_short_1.ftm",
- "body_stocky_short_2.ftm",
- "body_stocky_short_3.ftm",
- "body_stocky_short_4.ftm",
- "body_stocky_short_5.ftm",
- "body_stocky_long_1.ftm",
- "body_stocky_long_2.ftm",
- "body_stocky_long_3.ftm",
- "body_stocky_long_4.ftm",
- "body_stocky_long_5.ftm",
- "mbody_1_1.ftm",
- "mbody_1_1.ftm",
- "mbody_1_2.ftm",
- "mbody_1_2.ftm",
- "mbody_1_2.ftm",
- "mbody_2_1.ftm",
- "mbody_2_1.ftm",
- "mbody_2_2.ftm",
- "mbody_2_2.ftm",
- "mbody_2_2.ftm",
- "mbody_3_1.ftm",
- "mbody_3_1.ftm",
- "mbody_3_2.ftm",
- "mbody_3_2.ftm",
- "mbody_3_2.ftm",
- "torso_0_1.ftm",
- "torso_0_1.ftm",
- "torso_0_2.ftm",
- "torso_0_2.ftm",
- "torso_0_2.ftm",
- };
- const char *s_sPropsModelFile[] = {
- "flag_02.ftm",
- "flag_01.ftm",
- "armband_01.ftm",
- "yellowcard_l.ftm",
- "redcard_l.ftm",
- "yellowcard_r.ftm",
- "redcard_r.ftm",
- "glove_0_1.ftm",
- "glove_0_2.ftm",
- "glove_0_3.ftm",
- "glove_0_4.ftm",
- "glove_0_5.ftm",
- };
- const char *s_sHairModelFile = "data/models/player/hair/hair_%i_%i.ftm";
- const char *s_sHeadModelFile = "data/models/player/head/head_%i_%i.ftm";
- const char *color_list_3230BC[] = {
- "white",
- "white_tan",
- "black_med",
- "black_med",
- "black_dark",
- "asian",
- };
- const char *hair_list_3230D4[7] = {
- "facialhair_moustache",
- "facialhair_goatee",
- "facialhair_chinstrap",
- "facialhair_lightbeard",
- "facialhair_beard",
- "facialhair_chops",
- "facialhair_stubble",
- };
- const char *s_sManagerTexturePrefixes[3] = {
- "ManagerFormal",
- "StylishCoat",
- "Trainningjacket",
- };
- static int dword_17D658[4] = {0, 1, 1, 0};
- const char *aStorsoSPng_0 = "%storso_%s.png";
- const char *aDataModelsPlay = "data/models/player/textures/";
- static const char *off_3230BC[12] = {0};
- static uint32 dword_3A4ED4[4] = {FTTHash("gloves"), 0, 0, 0};
- TSATAnim_TSX* GetAnim(uint a1){
- return CGfxCharacter::s_pAnimLib->GetAnim(a1,true);
- }
- TSATAnim_TSX* GetLegAnim(uint a1){
- return CGfxCharacter::s_pAnimLib->GetAnim(a1,true);
-
- }
- //-------------------------------------------------------------------------------------------------
- //0017D450
- CGfxCharacter::CGfxCharacter(int i1, int i2, int i3, TPlayerInfo *tPlayerInfo4, CPlayer *cPlayer5, int i6, int i7) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017DC4C
- CGfxCharacter::~CGfxCharacter() {
- }
- //-------------------------------------------------------------------------------------------------
- //0017D688 ^_^
- void CGfxCharacter::SetAnimation(int i1, float f2, int i3) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017D69C
- void CGfxCharacter::SetupPlayer(TPlayerInfo *, bool, int, int) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017DD78 ^_^
- void CGfxCharacter::SetTeamID(int a1) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017DD80 //^_^
- void CGfxCharacter::Init() {
- }
- //-------------------------------------------------------------------------------------------------
- //0017DDC0 //^_^ 经过单元测试,功能正常
- void CGfxCharacter::SetMegaAtlasDims(int a0, int a1, int a2, int a3) {
- //LOGI("CGfxCharacter::SetMegaAtlasDims 0017DDC0 entry");
- }
- //-------------------------------------------------------------------------------------------------
- int dword_2FE414[] = {19, 40};
- //0017DEF4
- void CGfxCharacter::LoadDefaultModels() {
- //loc_17E522
- }
- //-------------------------------------------------------------------------------------------------
- //0017E5EC ^_^
- void CGfxCharacter::Shutdown() {
- }
- //-------------------------------------------------------------------------------------------------
- //0017E640
- void CGfxCharacter::DeleteDefaultModels() {
- }
- //-------------------------------------------------------------------------------------------------
- //0017E8DC ^_^
- void CGfxCharacter::SetLOD(int i1, int i2, int i3) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017E8E6 ^_^
- void CGfxCharacter::SetKit(int i1) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017E8EC ^_^
- void CGfxCharacter::SetBootsColour(EPlayerBoots epBoots1) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017E904
- void CGfxCharacter::SetFaceType(int i1) {
- //empty
- }
- //-------------------------------------------------------------------------------------------------
- //0017E906 ^_^
- void CGfxCharacter::SetSkinColour(EPlayerSkinColour epsColour1, int i2) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017E910 ^_-
- void CGfxCharacter::SetFacialHair(EPlayerFacialHair efHair1, EPlayerHairColour ehColour2) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017E960
- void CGfxCharacter::SetHairColour(EPlayerHairColour a1) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017E968 ^_^
- OfficialSkinHair_st *CGfxCharacter::GetOfficialSkinHair() {
- return nullptr;
- }
- //-------------------------------------------------------------------------------------------------
- //0017E984 ^_^
- void CGfxCharacter::UpdateUVs() {
- }
- //-------------------------------------------------------------------------------------------------
- //0017E9C0
- void CGfxCharacter::CreateAtlasTextures(TPlayerInfo *, int, int, int, int) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017F3D4
- void CGfxCharacter::SetBodyXTexture(TPlayerInfo *tPlayerInfo1) {
- //loc_17F4CE
- }
- //-------------------------------------------------------------------------------------------------
- //0017F530 ^_^
- void CGfxCharacter::SetAnimationBlend(int i1, int i2, float f3, float f4, float f5, float f6, int i7, int i8) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017F564 ^_^
- void CGfxCharacter::SetVerts(CFTTModel *cModel1) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017F5B4
- void CGfxCharacter::GenerateSamples(TSATFrameSample *, TCharAnimSpec *) {
- }
- //-------------------------------------------------------------------------------------------------
- //0017F7D8
- uint32 CGfxCharacter::GetHeadRot() {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //0017F864
- void CGfxCharacter::UpdateMatrix(CFTTMatrix32 *cMatrix32_1) {
- //0017F86E LDR.W R0, [R0,#0x9C]
- }
- //-------------------------------------------------------------------------------------------------
- //0017F91C
- void CGfxCharacter::UpdateMatrices(CFTTMatrix32 *cfttMatrix32_1) {
- //TFTTHierarchyHeader *var_DE8;
- //loc_17FA56
- /*.text:0017FA56
- .text:0017FA56 loc_17FA56 ; CODE XREF: CGfxCharacter::UpdateMatrices(CFTTMatrix32 *)+B6¡üj
- .text:0017FA56 ; CGfxCharacter::UpdateMatrices(CFTTMatrix32 *)+F4¡üj
- .text:0017FA56 ADD.W SP, SP, #0xDD0
- .text:0017FA5A POP.W {R4-R8,PC}
- .text:0017FA5A ; End of function CGfxCharacter::UpdateMatrices(CFTTMatrix32 *)*/
- }
- //-------------------------------------------------------------------------------------------------
- //0017FA70 ^_^
- void CGfxCharacter::SkinShadow() {
- }
- //-------------------------------------------------------------------------------------------------
- //0017FA76 ^_^
- void CGfxCharacter::SkinModels() {
- //locret_17FAB0
- }
- //-------------------------------------------------------------------------------------------------
- //0017FAB8
- void CGfxCharacter::RenderBatch(ESHADOWMAP_SAMPLING e_1, int i_2) {
- }
- //-------------------------------------------------------------------------------------------------
- //00180860 ^_^
- CFTTTexture *CGfxCharacter::GetMegaTexture() {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //001808AC ^_- 经过单元测试,功能正常
- void CGfxCharacter::RenderShadowBatch(int i1) {
- //loc_1809B6
- }
- //-------------------------------------------------------------------------------------------------
- //001809C8 ^_^
- void CGfxCharacter::CreateMippedMegaTexture() {
- return;
- }
- //-------------------------------------------------------------------------------------------------
- //00180A30 ^_^
- void CGfxCharacter::SkinProp() {
- }
- //-------------------------------------------------------------------------------------------------
- //00180A64 ^_- 经过单元测试,功能正常
- void CGfxCharacter::RenderProp(CFTTMatrix32 &cfttMatrix32_1) {
- }
- //-------------------------------------------------------------------------------------------------
- //00180B20
- void CGfxCharacter::RenderShadow(CFTTMatrix32 *cMatrix32_1) {
- }
- //-------------------------------------------------------------------------------------------------
- //00180B70 ^_^
- void CGfxCharacter::GetInfo(CFTTModel *&cModel_1, CFTTMatrix32 &cMatrix32_2) {
- //00180B84 LDR.W R2, [R2,R3,LSL#2]
- }
- //-------------------------------------------------------------------------------------------------
- //00180BD4 ^_^
- void CGfxCharacter::ResetShadowMatrix() {
- }
- //-------------------------------------------------------------------------------------------------
- //00180BF0 ^_^
- void CGfxCharacter::LockVertexBuffers() {
- }
- //-------------------------------------------------------------------------------------------------
- //00180C00 ^_^
- void CGfxCharacter::UnlockVertexBuffers() {
- }
- //-------------------------------------------------------------------------------------------------
- //00180C0C
- int CGfxCharacter::UpdateAnimation(bool b1) {
- return 1;
- }
- //-------------------------------------------------------------------------------------------------
- //00180E00 ^_- 经过单元测试,功能正常
- int CGfxCharacter::GetUVScale(TBinUVScale *uvScale, int i2) {
- return 1;
- }
- //-------------------------------------------------------------------------------------------------
- //00180F28
- void CGfxCharacter::UpdateUVs(CFTTModel **cModel1, int i2, TUV **tuv3) {
- }
- //-------------------------------------------------------------------------------------------------
- //00181148 ^_^
- void CGfxCharacter::SetPlayerIsKeeper(bool a1) {
- }
- //-------------------------------------------------------------------------------------------------
- //0018114E ^_^
- void CGfxCharacter::UpdateBlinking() {
- }
- //-------------------------------------------------------------------------------------------------
- //00181188
- void CGfxCharacter::Blink(bool b1) {
- }
- //-------------------------------------------------------------------------------------------------
- //00181374 ^_^
- void CGfxCharacter::GetHeadInfo(int i1, CFTTModel *&cModel2, CFTTModel *&cModel3, TUV *&tuv4, TUV *&tuv5, int &i6, EPlayerSkinColour &eColor7) {
- }
- //-------------------------------------------------------------------------------------------------
- /*
- --------------------------------------------------------------------------
- 2021.12.17 这几个函数分配给八哥,做外包
- 2021.12.20 八哥完成这几个函数
- 0017e910 CGfxCharacter::SetFacialHair 24
- 0017f564 CGfxCharacter::SetVerts 26
- 00180b20 CGfxCharacter::RenderShadow 28
- 0017e5ec CGfxCharacter::Shutdown 30
- 00180b70 CGfxCharacter::GetInfo 33
- 0017f7d8 CGfxCharacter::GetHeadRot 38
- 001809c8 CGfxCharacter::CreateMippedMegaTexture 41
- 0017f864 CGfxCharacter::UpdateMatrix 47
- 2021.12.20 这几个函数分配给八哥,做外包
- 0017e904 CGfxCharacter::SetFaceType 1
- 0017e960 CGfxCharacter::SetHairColour 2
- 0017e8e6 CGfxCharacter::SetKit 2
- 00181148 CGfxCharacter::SetPlayerIsKeeper 2
- 0017dd78 CGfxCharacter::SetTeamID 2
- 0017fa70 CGfxCharacter::SkinShadow 2
- 0017e8dc CGfxCharacter::SetLOD 3
- 0017e906 CGfxCharacter::SetSkinColour 3
- 00180c00 CGfxCharacter::UnlockVertexBuffers 4
- 00180bf0 CGfxCharacter::LockVertexBuffers 5
- 0017d688 CGfxCharacter::SetAnimation 5
- 0017e8ec CGfxCharacter::SetBootsColour 7
- 0017e968 CGfxCharacter::GetOfficialSkinHair 8
- 00180bd4 CGfxCharacter::ResetShadowMatrix 9
- 00180860 CGfxCharacter::GetMegaTexture 13
- 0017f530 CGfxCharacter::SetAnimationBlend 14
- 00180a30 CGfxCharacter::SkinProp 19
- 0017dd80 CGfxCharacter::Init 20
- 0017fa76 CGfxCharacter::SkinModels 21
- 0018114e CGfxCharacter::UpdateBlinking 21
- 00181374 CGfxCharacter::GetHeadInfo 22
- 0017e984 CGfxCharacter::UpdateUVs 22
- 00180a64 CGfxCharacter::RenderProp 58
- 00180e00 CGfxCharacter::GetUVScale 90
- 001808ac CGfxCharacter::RenderShadowBatch 97
- --------------------------------------------------------------------------
- 未分配
- 0017f3d4 CGfxCharacter::SetBodyXTexture 104
- 0017f91c CGfxCharacter::UpdateMatrices 106
- 0017ddc0 CGfxCharacter::SetMegaAtlasDims 107
- 00180f28 CGfxCharacter::UpdateUVs 109
- 0017dc4c CGfxCharacter::~CGfxCharacter 114
- 00181188 CGfxCharacter::Blink 130
- 00180c0c CGfxCharacter::UpdateAnimation 151
- 0017f5b4 CGfxCharacter::GenerateSamples 168
- 0017d450 CGfxCharacter::CGfxCharacter 177
- 0017e640 CGfxCharacter::DeleteDefaultModels 237
- 0017d69c CGfxCharacter::SetupPlayer 489
- 0017def4 CGfxCharacter::LoadDefaultModels 614
- 0017e9c0 CGfxCharacter::CreateAtlasTextures 712
- 0017fab8 CGfxCharacter::RenderBatch 1208
- */
|