Browse Source

0x00186868,CGfxPlayer::InitKits,116,116 bugfix

DESKTOP-AB9OQPJ\RED-10 3 years ago
parent
commit
e7e3b5f99f
3 changed files with 45 additions and 5 deletions
  1. 2 1
      jni/CGfxKits.cpp
  2. 2 1
      jni/CGfxKits.h
  3. 41 3
      jni/CGfxPlayer.cpp

+ 2 - 1
jni/CGfxKits.cpp

@@ -15,7 +15,8 @@
 #include "XSYS.h"
 #include "CKitGenShader.h"
 #include "CFTTTextureManager.h"
-
+// 0045FBA8
+TBuildKitTeamTextures GFXPLAYER_tGameKitTextures[2];
 CachedKitTemplate CGfxKits::ms_tCachedKitTemplates[16];
 int CGfxKits::ms_iNumCachedKitTemplates;
 int CGfxKits::ms_tBuildKitSetup;

+ 2 - 1
jni/CGfxKits.h

@@ -104,5 +104,6 @@ public:
   static int ms_iNumCachedKitTemplates;
   static int ms_tBuildKitSetup;
 };
-
+// 0045FBA8
+extern TBuildKitTeamTextures GFXPLAYER_tGameKitTextures[2];
 #endif  //_CGFXKITS_H_

+ 41 - 3
jni/CGfxPlayer.cpp

@@ -4,10 +4,12 @@
 #include "CGFXSpec.h"
 #include "CFTTBatchModelManager.h"
 #include "memctrl.h"
-
+#include "CGfxKits.h"
+#include "CMatchSetup.h"
+#include "TGame.h"
 //0033F40C
 int GFXPLAYER_spBatchBinMats[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
-
+int GFXPLAYER_iKitTextureID[7];
 //0045FC68
 CFTTBatchModelBin *GFXPLAYER_spBatchBins[8];
 
@@ -59,7 +61,43 @@ void CGfxPlayer::FreeBuildKitTextures() {
 }
 //-------------------------------------------------------------------------------------------------
 //00186868
-void CGfxPlayer::InitKits(int) {
+// 00186868 经过单元测试,功能正常,每个分支都走到了
+void CGfxPlayer::InitKits(int i0) {
+  switch (i0) {
+    case 0:
+      // loc_186886
+      CGfxKits::BeginBuildKit(0);
+      break;
+
+    case 1:
+      // loc_186890
+      CGfxKits::GetTexture(GFXPLAYER_iKitTextureID[0], &GFXPLAYER_tGameKitTextures[tGame.mTLogic_6678.field_0], CMatchSetup::ms_tInfo.field_18[0], EKitTextureType_0, nullptr);
+      break;
+
+    case 2:
+      // loc_1868B2
+      CGfxKits::GetTexture(GFXPLAYER_iKitTextureID[1], &GFXPLAYER_tGameKitTextures[tGame.mTLogic_6678.field_0^1], CMatchSetup::ms_tInfo.field_18[1], EKitTextureType_0, nullptr);
+      break;
+
+    case 3:
+      // loc_1868E6
+      CGfxKits::GetTexture(GFXPLAYER_iKitTextureID[2], &GFXPLAYER_tGameKitTextures[tGame.mTLogic_6678.field_0], CMatchSetup::ms_tInfo.field_20[0], EKitTextureType_1, nullptr);
+      CGfxKits::GetTexture(GFXPLAYER_iKitTextureID[3], &GFXPLAYER_tGameKitTextures[tGame.mTLogic_6678.field_0^1], CMatchSetup::ms_tInfo.field_20[1], EKitTextureType_1, nullptr);
+      break;
+
+    case 4:
+      // loc_186934
+      CGfxKits::GetTexture(GFXPLAYER_iKitTextureID[4], 0, CMatchSetup::ms_tInfo.field_20[2], EKitTextureType_2, 0);
+      CGfxKits::GetTexture(GFXPLAYER_iKitTextureID[5], &GFXPLAYER_tGameKitTextures[tGame.mTLogic_6678.field_0], CMatchSetup::ms_tInfo.field_18[0], EKitTextureType_3, nullptr);
+      break;
+
+    case 5:
+      CGfxKits::GetTexture(GFXPLAYER_iKitTextureID[6], &GFXPLAYER_tGameKitTextures[tGame.mTLogic_6678.field_0^1], CMatchSetup::ms_tInfo.field_18[1], EKitTextureType_4, nullptr);
+      CGfxKits::EndBuildKit();
+      break;
+    default:
+      break;
+  }
 }
 //-------------------------------------------------------------------------------------------------
 //001869E8 -_-