Browse Source

0x0016d9d4 CFTTPPrimitive::CFTTPPrimitive 周强
0x0016a510 CFTTPPSphere::CFTTPPSphere 周强 bugifx

DESKTOP-AB9OQPJ\RED-10 3 years ago
parent
commit
735d0d6fec

+ 1 - 0
jni/Android.mk

@@ -468,6 +468,7 @@ LOCAL_SRC_FILES :=  ANIMHashName.cpp                        \
 LOCAL_ARM_NEON := true
 LOCAL_CFLAGS   += -fshort-wchar -fvisibility=default  -fomit-frame-pointer -fno-stack-protector
 LOCAL_CPPFLAGS += -Wno-switch
+LOCAL_CFLAGS   += -mllvm -align-all-functions=5
 LOCAL_LDFLAGS  += -fPIC
 LOCAL_LDLIBS   += -Wl,--no-wchar-size-warning -Wundefined-inline -llog -landroid -lEGL -lGLESv2 -lGLESv3
 LOCAL_STATIC_LIBRARIES += cpufeatures

+ 90 - 109
jni/CFE.cpp

@@ -268,10 +268,8 @@ bool CFE::s_bShutdownBannerInterstitialAds;
 // 00152D94 //-_- 经过单元测试,功能正常
 int CFE::Process(float f0) {
   // LOGI("CFE::Process %.2f entry", f0);
-  if (CFE::m_apScreenStack[CFE::m_iScreenStackPos - 1] != nullptr &&
-      CFTTRewardedVideos::AdOnScreen()==false) {
+  if (CFE::m_apScreenStack[CFE::m_iScreenStackPos - 1] != nullptr) {
     // 00152DC2
-
     if (tGame.mTLogic_6678.bisRunning_A9) {
       // 00152DD4
       CFE::SetToUniformSpace();
@@ -283,10 +281,8 @@ int CFE::Process(float f0) {
     CFE::CheckMusic();
 
     if (!tGame.mTLogic_6678.bisRunning_A9 &&
-        CFE::m_apScreenStack[CFE::m_iScreenStackPos - 1]
-            ->m_pUITileManager_4->GetHasButton(256) &&
-        ((int)(CFE::m_apScreenStack[CFE::m_iScreenStackPos - 1]
-                   ->m_pUITileManager_4->dIndex_0)) >= 1) {
+        CFE::m_apScreenStack[CFE::m_iScreenStackPos - 1]->m_pUITileManager_4->GetHasButton(256) &&
+        CFE::m_apScreenStack[CFE::m_iScreenStackPos - 1]->m_pUITileManager_4->dIndex_0 >= 1) {
       CStoryCore::m_cProfile.EnergyCheckRestore();
     }
 
@@ -298,131 +294,116 @@ int CFE::Process(float f0) {
     }
 
     // loc_152E32
-    CFE::m_apScreenStack[CFE::m_iScreenStackPos - 1]->PositionTileManager(
-        -1);  // 00152E40
+    CFE::m_apScreenStack[CFE::m_iScreenStackPos - 1]->PositionTileManager(-1);  // 00152E40
 
     // CFTTRewardedVideos::AdOnScreen(void)
     // 00152E4E
-    if (CFTTRewardedVideos::AdOnScreen() == false) {
-      if (CMessageBoxHandler::MessageBoxShown()) {
-        // 00152E54
-        if (FE_bBackButtonPressed) {
-          if (CMessageBoxHandler::GetCanBackButtonRemove()) {
-            CMessageBoxHandler::ShutDownMessageBox();
-          }
+    if (CMessageBoxHandler::MessageBoxShown()) {
+      // 00152E54
+      if (FE_bBackButtonPressed) {
+        if (CMessageBoxHandler::GetCanBackButtonRemove()) {
+          CMessageBoxHandler::ShutDownMessageBox();
+        }
 
-          // loc_152E68
-          FE_bBackButtonPressed = false;
-        } else {
-          // loc_152E6E
-          CMessageBoxHandler::Process();
-          XCTRL_TouchProcess_ClearTriggers();
-          if (tGame.mTLogic_6678.bisRunning_A9) {
-            // 00152E80
-            CStoryCore::m_cProfile.EnergyCheckRestore();
-          }
+        // loc_152E68
+        FE_bBackButtonPressed = false;
+      } else {
+        // loc_152E6E
+        CMessageBoxHandler::Process();
+        XCTRL_TouchProcess_ClearTriggers();
+        if (tGame.mTLogic_6678.bisRunning_A9) {
+          // 00152E80
+          CStoryCore::m_cProfile.EnergyCheckRestore();
+        }
 
-          // loc_152E8A
-          if (!CGameLoop::s_bPaused && CFE::s_iUnpauseSoundCounter == 0) {
-            SNDGAME_Process();
-          }
+        // loc_152E8A
+        if (!CGameLoop::s_bPaused && CFE::s_iUnpauseSoundCounter == 0) {
+          SNDGAME_Process();
         }
       }
+    }
 
-      // loc_152EA2
-      if (!CMessageBoxHandler::MessageBoxShown() ||
-          CMessageBoxHandler::CanProcess()) {
-        // loc_152EB2
-        int r7_dpos = CFE::m_iScreenStackPos;
-        CFEScreen* r0_pScreen =
-            CFE::m_apScreenStack[CFE::m_iScreenStackPos - 1];
-        if (FE_bBackButtonPressed) {
-          // 00152EC6
-          if (r0_pScreen->dId_C == 8) {
-            // 00152ECC
-            CMessageBoxHandler::NewMessageBox(CFE::AndroidExitAppCB, nullptr,
-                                              EMessageBoxType_1, LOCstring(239),
-                                              nullptr, 0, 128, true, 1, 0,
-                                              false, false, true, true);
+    // loc_152EA2
+    if (!CMessageBoxHandler::MessageBoxShown() || CMessageBoxHandler::CanProcess()) {
+      // loc_152EB2
+      int r7_dpos = CFE::m_iScreenStackPos;
+      CFEScreen* r0_pScreen = CFE::m_apScreenStack[CFE::m_iScreenStackPos - 1];
+      if (FE_bBackButtonPressed) {
+        // 00152EC6
+        if (r0_pScreen->dId_C == 8) {
+          // 00152ECC
+          CMessageBoxHandler::NewMessageBox(CFE::AndroidExitAppCB,
+                                            nullptr,
+                                            EMessageBoxType_1,
+                                            LOCstring(239),
+                                            nullptr,
+                                            0,
+                                            128,
+                                            true,
+                                            1,
+                                            0,
+                                            false,
+                                            false,
+                                            true,
+                                            true);
 
-          } else if (r0_pScreen->m_pUITileManager_4->GetHasButton(
-                         2)) {  // loc_152F24
-            // 00152F2E
-            if (CFE::m_iScreenStackPos <= 1) {
-              // 00152F34
-              int var_1C = 8;
-              CFE::SetupStack(&var_1C, 1);
-            } else {
-              CFE::Back(false, true);
-            }
+        } else if (r0_pScreen->m_pUITileManager_4->GetHasButton(2)) {  // loc_152F24
+          // 00152F2E
+          if (CFE::m_iScreenStackPos <= 1) {
+            // 00152F34
+            int var_1C = 8;
+            CFE::SetupStack(&var_1C, 1);
           } else {
-            // loc_152F42
-            switch (r0_pScreen->dId_C) {
-              case 0:
-                CGameLoop::Pause(-1, EPauseType_0, EFEScreen_12);
-                break;
-              case 4:
-                CFESChooseHero::BackButtonPressed();
-                break;
-              case 5:
-                CFESChooseSideHero::BackButtonPressed();
-                break;
-              case 6:
-                CFESEditPlayer::CancelChanges();
-                break;
-              case 9:
-                CFESLevelSelect::BackButtonPressed();
-                break;
-              case 12:
-                CFESPauseMenu::ResumeGame();
-                break;
-              default:
-                break;
-            }
+            CFE::Back(false, true);
           }
-
-          // loc_152F8C
-          FE_bBackButtonPressed = false;
         } else {
-          // loc_152EFE
-          r0_pScreen->Process();
-          if (CFE::m_iScreenStackPos != r7_dpos &&
-              CFE::m_iScreenStackPos != 0) {
-            // 00152F0E
-            XCTRL_Process_ClearTriggers();
-            CFE::m_apScreenStack[CFE::m_iScreenStackPos - 1]->Process();
+          // loc_152F42
+          switch (r0_pScreen->dId_C) {
+            case 0:
+              CGameLoop::Pause(-1, EPauseType_0, EFEScreen_12);
+              break;
+            case 4:
+              CFESChooseHero::BackButtonPressed();
+              break;
+            case 5:
+              CFESChooseSideHero::BackButtonPressed();
+              break;
+            case 6:
+              CFESEditPlayer::CancelChanges();
+              break;
+            case 9:
+              CFESLevelSelect::BackButtonPressed();
+              break;
+            case 12:
+              CFESPauseMenu::ResumeGame();
+              break;
+            default:
+              break;
           }
         }
+
+        // loc_152F8C
+        FE_bBackButtonPressed = false;
+      } else {
+        // loc_152EFE
+        r0_pScreen->Process();
+        if (CFE::m_iScreenStackPos != r7_dpos && CFE::m_iScreenStackPos != 0) {
+          // 00152F0E
+          XCTRL_Process_ClearTriggers();
+          CFE::m_apScreenStack[CFE::m_iScreenStackPos - 1]->Process();
+        }
       }
     }
+
     // loc_152F90
     //中间与网络下载相关的代码被忽略
     // loc_152FDA
     // CFESShopHelper::Process();  //CFESShopHelper 跳过
-    // if(CDownloads:: ms_blnitialised==true){
-    LOGE("CDownloads:: ms_blnitialised%x", CDownloads::ms_blnitialised);
-    CFESShopHelper::Process();
     SNDFE_Process();
-    if (CFTTBannerAds::HaveOpenedModal()) {
-      SNDFE_Music_Pause(true);
-      SNDGAME_Shutdown();
-    } else if (CFTTBannerAds::HaveClosedModal()) {
-      SNDFE_Music_UnPause();
-    }
-    // }
-    //loc_152FFE
-    LOGE("CFE::s_bShutdownBannerInterstitialAds%x=",CFE::s_bShutdownBannerInterstitialAds);
-    if(CFE::s_bShutdownBannerInterstitialAds){
-      CFE::RemoveBannerAd();
-      CFTTBannerAds::Shutdown();
-     // CFTTInterstitials::Shutdown();
-      CFE::s_bShutdownBannerInterstitialAds=false;
-    }
 
     // loc_153018
-     CFESShopHelper::CheckForSave(); //CFESShopHelper 跳过
-     CFTTAndroidRewardedVideos::InitialiseNextAdNetwork();
-     MP_cMyProfile.UpdateFacebookAchievements();
+    // CFESShopHelper::CheckForSave(); //CFESShopHelper 跳过
+    // CFTTAndroidRewardedVideos::InitialiseNextAdNetwork();
     MP_cMyProfile.CheckSave();
   }
   return 0;

+ 2 - 1
jni/CFTTFileSystem.cpp

@@ -81,7 +81,8 @@ bool CFTTFileSystem::FileExists(char const* filepath) {
 //-------------------------------------------------------------------------------------------------
 //00263AF8 //^_^
 CFTTFileSystem* CFTTFileSystem::FindFileSystem(char const* filetype) {
-  return nullptr;
+  LOGE("FindFileSystem%s",filetype);
+  return (CFTTFileSystem*)rand();
 }
 //-------------------------------------------------------------------------------------------------
 //00263D70 //^_^

+ 0 - 1
jni/CFTTPPSphere.cpp

@@ -8,7 +8,6 @@ CFTTPPSphere::CFTTPPSphere(fpoint<PointType_18> fpoint_r1,
   : CFTTPPrimitive(fpoint3_r2, fpointQ_r3),fpoint_68(fpoint_r1)
   
 {
-  
 }
 //-------------------------------------------------------------------------------------------------
 //0016D962

+ 6 - 6
jni/CFTTPPrimitive.cpp

@@ -7,25 +7,25 @@ CFTTPPrimitive::CFTTPPrimitive(fpoint3<PointType_18> fpoint3_r1, fpointQ<PointTy
   , fpointQ_14(fpointQ_r2)
   
 {
+  LOGE("CFTTPPrimitive::CFTTPPrimitive");
   this->fpoint3_24.x_0=0;  //0016DA14  24
   this->fpoint3_24.y_4 = 0;
   this->fpoint3_24.z_8 = 0;
 
   this->fpointQQ_30.list_0[0] = 0;
+
   this->fpointQQ_30.list_0[1] = 0;  //0016DA0C 34
   this->fpointQQ_30.list_0[2] = 0;
   this->fpointQQ_30.list_0[3] = 0;
   this->fpointQQ_30.list_0[4] = 0;
+
   this->fpointQQ_30.list_0[5] = 0;  //0016DA04 44
   this->fpointQQ_30.list_0[6] = 0;
   this->fpointQQ_30.list_0[7] = 0;
   this->fpointQQ_30.list_0[8] = 0;  //0016D9FA 50
-/*
-  this->filed_30.field_24 = 0;
-  this->filed_30.field_28 = 0;
-  this->filed_30.field_2C = 0;
-  this->filed_30.field_30 = 0x40000;  //0016DA24
-*/
+  this->fpointQQ_30.fpointQ_24.field_0=0;
+  this->fpointQQ_30.fpointQ_24. field_4=0;
+  this->fpointQQ_30.fpointQ_24. field_8=0;
   this->fpointQQ_30.fpointQ_24.field_C=0x40000;
   this->field_64 = 0;
 }

+ 438 - 245
jni/CGfxEnv.cpp

@@ -1,356 +1,549 @@
 #include "CGfxEnv.h"
-
+#include "CFTTFileIterator.h"
+#include "CFTTFileSystem.h"
 CFTTMatrix32 CGfxEnv::ms_mMatrix;
-
+TAvailableModel CGfxEnv::ms_tAvailableModels[6];
+bool CGfxEnv::ms_bDirectoriesScanned;
+ TModelInfoDescription *CGfxEnv::ms_pConstructionModels[6];
 //-------------------------------------------------------------------------------------------------
-//001A9034
-CGfxEnv::CGfxEnv() {
-}
+// 001A9034
+CGfxEnv::CGfxEnv() {}
 //-------------------------------------------------------------------------------------------------
-//001A9036
-CGfxEnv::~CGfxEnv() {
-}
+// 001A9036
+CGfxEnv::~CGfxEnv() {}
 //-------------------------------------------------------------------------------------------------
-//001A9038
-void CGfxEnv::Init(TEnvConfig const &, int, bool) {
-}
+// 001A9038
+void CGfxEnv::Init(TEnvConfig const &, int, bool) {}
 //-------------------------------------------------------------------------------------------------
-//001A90D4
-void CGfxEnv::ProcessSlicedLoad(int) {
-}
+// 001A90D4
+void CGfxEnv::ProcessSlicedLoad(int) {}
 //-------------------------------------------------------------------------------------------------
-//001A9264
-void CGfxEnv::EnableSlicedLoad() {
-}
+// 001A9264
+void CGfxEnv::EnableSlicedLoad() {}
 //-------------------------------------------------------------------------------------------------
-//001A9274
+// 001A9274 //^_-
 void CGfxEnv::ScanStadiumModelsDirectory() {
+  LOGE("CGfxEnv::ScanStadiumModelsDirectory 001A9274");
+  memset(CGfxEnv::ms_tAvailableModels, 0xFF, sizeof(CGfxEnv::ms_tAvailableModels));
+
+  // 1a928a
+  if (CGfxEnv::ms_bDirectoriesScanned)
+    return;
+
+  CFTTFileIterator* fileiter_34 = NULL;
+  memset(CGfxEnv::ms_pConstructionModels, 0, sizeof(CGfxEnv::ms_pConstructionModels));
+
+  // 1a92b8
+  CFTTFileSystem* filesystem = CFTTFileSystem::FindFileSystem("PKG");
+
+  // 1a92c6
+  filesystem->OpenDir("PKG:/Data/env/stadium/", &fileiter_34);
+
+  do {  // 1a92f0
+
+    // 1a92f6
+    if (!fileiter_34->IsValid())
+      break;
+
+    // 1a9302
+    if (fileiter_34->IsDirectory())
+      continue;
+
+    // 1a930c
+    char* name_r6 = fileiter_34->GetName();
+    // 1a9312
+    strlwr(name_r6);
+    // 1a931a
+    if (!strstr(name_r6, ".ftm"))
+      continue;
+
+    // 1a9324
+    int secttype_r7 = CGfxEnv::GetSectionTypeFromFileName(name_r6);
+
+    // 1a932e
+    if (strstr(name_r6, "corner")) {
+      // 1a9334
+      secttype_r7 = 0;
+    }
+    // 1a933c
+    else if (strstr(name_r6, "end")) {
+      // 1a9342
+      secttype_r7 = 1;
+    }
+    // 1a934a
+    else if (strstr(name_r6, "side")) {
+      // 1a9350
+      secttype_r7 = 2;
+    }
+    // 1a9358
+    else if (strstr(name_r6, "exterior")) {
+      // 1a935e
+      secttype_r7 = 3;
+    }
+    // 1a9366
+    else if (strstr(name_r6, "surround")) {
+      // 1a936c
+      secttype_r7 = 4;
+    }
+    // 1a9370
+    else if (secttype_r7 == -1) {
+      continue;
+    }
+    TAvailableModel& model = CGfxEnv::ms_tAvailableModels[secttype_r7];
+    // 1a9382
+    if (model.InfoCount_1400 > 127)
+      continue;
+
+    TEnvStadiumModelInfo& modelinfo = model.ModelInfo_0[model.InfoCount_1400];
+
+    // 1a93a2
+    strlcpy(modelinfo.text_0, strlwr(name_r6), 32);
+    // 1a93a8
+    TModelInfoDescription* desc = CGfxEnv::FindModelInfoDescription(modelinfo.text_0);
+    modelinfo.desc_24 = desc;
+    // 1a93ac
+    if (desc) {
+      // 1a93b2
+      modelinfo.height_20 = desc->height_48;
+      // 1a93b6 1a93c0 1a93c8 1a93cc
+      if (desc && !CGfxEnv::ms_pConstructionModels[secttype_r7] && strstr(desc->text_4, "construction"))
+        CGfxEnv::ms_pConstructionModels[secttype_r7] = desc;
+    } else {
+      // 1a93d4
+      modelinfo.height_20 = -1;
+    }
+
+    CGfxEnv::ms_tAvailableModels[secttype_r7].InfoCount_1400++;
+
+    // 1a93ee 1a93f0
+  } while (!fileiter_34->Next());
+
+  // 1a93f8
+  if (fileiter_34)
+    delete fileiter_34;
+  // 1a9404
+  filesystem = CFTTFileSystem::FindFileSystem("PKG");
+
+  // 1a9412
+  filesystem->OpenDir("PKG:/Data/env/dressing/", &fileiter_34);
+  do {  // 1a942e
+    // 1a9434
+    if (!fileiter_34->IsValid())
+      break;
+    // 1a943e
+    if (fileiter_34->IsDirectory())
+      continue;
+
+    // 1a9448
+    char* name_r6 = fileiter_34->GetName();
+    // 1a944e 1a9452 1a9458
+    if (!strstr(name_r6, ".ftm") && !strstr(name_r6, ".FTM"))
+      continue;
+    TAvailableModel& model = CGfxEnv::ms_tAvailableModels[5];
+    // 1a9464
+    if (model.InfoCount_1400 > 127)
+      continue;
+
+    TEnvStadiumModelInfo& modelinfo = model.ModelInfo_0[model.InfoCount_1400];
+    // 1a947a 1a9484
+    strlcpy(modelinfo.text_0, strlwr(name_r6), 32);
+
+    model.InfoCount_1400++;
+
+    // 1a9498 1a949a
+  } while (!fileiter_34->Next());
+
+  if (fileiter_34)
+    delete fileiter_34;
+
+  char text_78[64];
+  // 1a961e
+  for (uint i_r0 = 0; i_r0 != 6; ++i_r0) {
+    // 1a94c2
+    TAvailableModel& model = CGfxEnv::ms_tAvailableModels[i_r0];
+    // 1a94c6
+    if (i_r0 - 3 >= 3) {  // 1a94cc
+      // 1a94e2
+      memset(&model.EntryCount_1404, 0, 0x1884);
+
+      // 1a9600
+      for (int j_fp = 0; j_fp < model.InfoCount_1400; j_fp++) {
+        // 1a94f6
+        TEnvStadiumModelInfo& modelinfo = model.ModelInfo_0[j_fp];
+        // 1a94fe
+        int len_r0 = strlen(modelinfo.text_0);
+        int len_r1 = len_r0;
+        // 1a951a
+        while (len_r1 != 0) {
+          // 1a950e
+          if (modelinfo.text_0[len_r1 - 1] == '_')
+            text_78[len_r1 - 1] = ' ';
+          else
+            text_78[len_r1 - 1] = modelinfo.text_0[len_r1 - 1];
+          len_r1--;
+          // 1a9518
+        }
+        text_78[len_r0] = '\0';
+
+        char text_38[64];
+        char char_33;  // TAvailableModelEntry的特征
+        int tmp_2c;    // TModelItem 的特征
+        char char_2b;
+        // 1a9538
+        sscanf((const char*)text_78, "%s %c %i %c.ftm", text_38, &char_33, &tmp_2c, &char_2b);
+
+        int EntryIndex_r2 = -1;
+        // 1a9556
+        while ((++EntryIndex_r2) < model.EntryCount_1404) {
+          // 1a9562
+          if (char_33 == model.Entry_1408[EntryIndex_r2].field_0)
+            break;
+        }
+
+        // 1a9556
+        if (EntryIndex_r2 >= model.EntryCount_1404) {
+          // 1a956a
+          EntryIndex_r2 = model.EntryCount_1404;
+          model.EntryCount_1404++;
+        }
+
+        TAvailableModelEntry& Entry_r6 = model.Entry_1408[EntryIndex_r2];
+        // 1a9574
+        Entry_r6.field_0 = char_33;
+
+        int ItemIndex_r3 = -1;
+        // 1a9594
+        while ((++ItemIndex_r3) < Entry_r6.ItemCount_4) {
+          // 1a959c
+          if (tmp_2c == Entry_r6.Item_8[ItemIndex_r3].field_0) {  // 1a95a0
+            break;
+          }
+        }
+        // 1a9594
+        if (ItemIndex_r3 >= Entry_r6.ItemCount_4) {
+          Entry_r6.ItemCount_4 = ItemIndex_r3 + 1;
+        }
+
+        TModelItem& Item = Entry_r6.Item_8[ItemIndex_r3];
+
+        Item.field_0 = tmp_2c;
+        Item.field_8[Item.count_4++] = char_2b;
+        // 1a95fa
+      }
+      // 1a9602
+    }
+    // 1a9606
+
+    // 1a961a
+  }
+
+  // 1a9684
+  for (int i_r6 = 0; i_r6 != 5; i_r6++) {
+    TAvailableModel* r4_pModel = &CGfxEnv::ms_tAvailableModels[i_r6];
+    // 1a964a
+    CGfxEnv::InsertionSortStadiumModelInfo(r4_pModel->ModelInfo_0,
+                                           r4_pModel->InfoCount_1400);
+
+    for (int r2_i = 0; r2_i < r4_pModel->InfoCount_1400; r2_i++) {  // 001A965E
+      // 001A9662
+      TEnvStadiumModelInfo* r3_pModelInfo = &r4_pModel->ModelInfo_0[r2_i];
+      r4_pModel->field_2C88 = r3_pModelInfo->height_20;
+      // 1a966a
+      if (r3_pModelInfo->height_20 != 0)
+        break;
+    }
+
+    // loc_1A9670
+    r4_pModel->field_2C8C = r4_pModel->ModelInfo_0[r4_pModel->InfoCount_1400 - 1].height_20;
+  }
+  CGfxEnv::ms_bDirectoriesScanned = true;
 }
 //-------------------------------------------------------------------------------------------------
-//001A96C8
-void CGfxEnv::CreateStadiumDressingTextures(int) {
-}
+// 001A96C8
+void CGfxEnv::CreateStadiumDressingTextures(int) {}
 //-------------------------------------------------------------------------------------------------
-//001A9C2C
-void CGfxEnv::StadiumAdd(TEnvConfigStadium const *, int) {
-}
+// 001A9C2C
+void CGfxEnv::StadiumAdd(TEnvConfigStadium const *, int) {}
 //-------------------------------------------------------------------------------------------------
-//001A9D94
-void CGfxEnv::EditSeatsTexture(uint) {
-}
+// 001A9D94
+void CGfxEnv::EditSeatsTexture(uint) {}
 //-------------------------------------------------------------------------------------------------
-//001A9ED8
-void CGfxEnv::ObjectsAdd(TEnvConfig const *, int) {
-}
+// 001A9ED8
+void CGfxEnv::ObjectsAdd(TEnvConfig const *, int) {}
 //-------------------------------------------------------------------------------------------------
-//001A9FA4
-void CGfxEnv::SetupCrowd(EStadiumSection, int) {
-}
+// 001A9FA4
+void CGfxEnv::SetupCrowd(EStadiumSection, int) {}
 //-------------------------------------------------------------------------------------------------
-//001AA084
-void CGfxEnv::GetStadiumCapacity(TEnvConfig *) {
-}
+// 001AA084
+void CGfxEnv::GetStadiumCapacity(TEnvConfig *) {}
 //-------------------------------------------------------------------------------------------------
-//001AA0C0
-TModelInfoDescription * CGfxEnv::FindModelInfoDescription(char *) {
-  return NULL;
+// 001AA0C0
+TModelInfoDescription *CGfxEnv::FindModelInfoDescription(char *a1) {
+  LOGE("FindModelInfoDescription%s",a1);
+  return (TModelInfoDescription*)rand();
 }
 //-------------------------------------------------------------------------------------------------
-//001AA0F4
-void CGfxEnv::GetSectionCapacity(EStadiumSection) {
-}
+// 001AA0F4
+void CGfxEnv::GetSectionCapacity(EStadiumSection) {}
 //-------------------------------------------------------------------------------------------------
-//001AA100
+// 001AA100
 CFTTMatrix32 CGfxEnv::GetSectionMatrix(EStadiumSection e, bool b) {
   CFTTMatrix32 ret;
 
   return ret;
 }
 //-------------------------------------------------------------------------------------------------
-//001AA17C
-void CGfxEnv::GetStadiumModelInfo(EStadiumSection, char const *) {
-}
+// 001AA17C
+void CGfxEnv::GetStadiumModelInfo(EStadiumSection, char const *) {}
 //-------------------------------------------------------------------------------------------------
-//001AA1F0
-void CGfxEnv::UpdateStadiumSection(TEnvConfig const *, EStadiumSection) {
-}
+// 001AA1F0
+void CGfxEnv::UpdateStadiumSection(TEnvConfig const *, EStadiumSection) {}
 //-------------------------------------------------------------------------------------------------
-//001AA24C
-int CGfxEnv::ModelGet(char const *, bool, int, EStadiumSection) {
-  return 0;
-}
+// 001AA24C
+int CGfxEnv::ModelGet(char const *, bool, int, EStadiumSection) { return 0; }
 //-------------------------------------------------------------------------------------------------
-//001AA3F4
-int CGfxEnv::GetAvailableIndexFromModelIndex(EStadiumSection) {
-  return 0;
-}
+// 001AA3F4
+int CGfxEnv::GetAvailableIndexFromModelIndex(EStadiumSection) { return 0; }
 //-------------------------------------------------------------------------------------------------
-//001AA458
-void CGfxEnv::CalculateSectionCapacity(EStadiumSection) {
-}
+// 001AA458
+void CGfxEnv::CalculateSectionCapacity(EStadiumSection) {}
 //-------------------------------------------------------------------------------------------------
-//001AA45C
-void CGfxEnv::LoadSectionTextures(TEnvModel *, int) {
-}
+// 001AA45C
+void CGfxEnv::LoadSectionTextures(TEnvModel *, int) {}
 //-------------------------------------------------------------------------------------------------
-//001AA478
-void CGfxEnv::UpdateStadiumFloodlights() {
-}
+// 001AA478
+void CGfxEnv::UpdateStadiumFloodlights() {}
 //-------------------------------------------------------------------------------------------------
-//001AA4CC
-int CGfxEnv::GetSectionTypeFromSection(EStadiumSection) {
-  return 0;
-}
+// 001AA4CC
+int CGfxEnv::GetSectionTypeFromSection(EStadiumSection) { return 0; }
 //-------------------------------------------------------------------------------------------------
-//001AA4E4
-void CGfxEnv::GetSectionTypeInfo(EStadiumSectionType) {
-}
+// 001AA4E4
+void CGfxEnv::GetSectionTypeInfo(EStadiumSectionType) {}
 //-------------------------------------------------------------------------------------------------
-//001AA4F8
-void CGfxEnv::Init(char *, int, bool) {
-}
+// 001AA4F8
+void CGfxEnv::Init(char *, int, bool) {}
 //-------------------------------------------------------------------------------------------------
-//001AA588
-void CGfxEnv::EnvConfigLoad(TEnvConfig *, CFTTXmlReaderNode) {
-}
+// 001AA588
+void CGfxEnv::EnvConfigLoad(TEnvConfig *, CFTTXmlReaderNode) {}
 //-------------------------------------------------------------------------------------------------
-//001AA5B4
-int CGfxEnv::GetSectionTypeFromFileName(char const *) {
-  return 0;
-}
+// 001AA5B4
+int CGfxEnv::GetSectionTypeFromFileName(char const *a1) {
+    LOGE("GetSectionTypeFromFileName%s",a1);
+   return rand(); }
 //-------------------------------------------------------------------------------------------------
-//001AA624
-void CGfxEnv::InsertionSortStadiumModelInfo(TEnvStadiumModelInfo *, int) {
+// 001AA624
+// 001AA624 //^_-
+void CGfxEnv::InsertionSortStadiumModelInfo(TEnvStadiumModelInfo *pModeInfo1,
+                                            int InfoCnt2) {
+  LOGI("CGfxEnv::InsertionSortStadiumModelInfo 001AA624 entry");
+  char text_8[0x20];
+
+  for (int r10_i = 1; r10_i < InfoCnt2; ++r10_i) {
+       // loc_1AA6C0
+     // loc_1AA648
+    memcpy(&text_8, pModeInfo1[r10_i].text_0,sizeof(pModeInfo1[r10_i].text_0));
+
+    int height_r8 = pModeInfo1[r10_i].height_20;
+    TModelInfoDescription *desc_r5 = pModeInfo1[r10_i].desc_24;
+
+    int j_r6 = r10_i;
+    for (; j_r6 > 0 &&pModeInfo1[j_r6 - 1].desc_24->height_48 > desc_r5->height_48;j_r6--) {
+             // 1aa680
+      memcpy(pModeInfo1 + j_r6, pModeInfo1 + j_r6 - 1,sizeof(TEnvStadiumModelInfo));
+    }
+    // loc_1AA6A0
+    memcpy(pModeInfo1[j_r6].text_0, text_8, 0x20);
+    pModeInfo1[j_r6].height_20 = height_r8;
+    pModeInfo1[j_r6].desc_24 = desc_r5;
+         // 1aa6be
+  }
+
+  for (int i_r1 = 0, i_r2 = 0; i_r1 < InfoCnt2; i_r1++) {
+         // 1aa6ce
+        if (pModeInfo1[i_r1].desc_24->field_4C) pModeInfo1[i_r1]
+            .desc_24->field_44 = (i_r2++);
+  }
+
+  LOGI("CGfxEnv::InsertionSortStadiumModelInfo 001AA624 end");
 }
 //-------------------------------------------------------------------------------------------------
-//001AA6FC
-void CGfxEnv::GetSectionSubTypeInfo(EStadiumSectionType, char) {
-}
+// 001AA6FC
+void CGfxEnv::GetSectionSubTypeInfo(EStadiumSectionType, char) {}
 //-------------------------------------------------------------------------------------------------
-//001AA73C
-void CGfxEnv::GetTierSubSectionInfo(EStadiumSectionType, char, int) {
-}
+// 001AA73C
+void CGfxEnv::GetTierSubSectionInfo(EStadiumSectionType, char, int) {}
 //-------------------------------------------------------------------------------------------------
-//001AA76C
-void CGfxEnv::StadiumConfigLoad(TEnvConfig *, CFTTXmlReaderNode *) {
-}
+// 001AA76C
+void CGfxEnv::StadiumConfigLoad(TEnvConfig *, CFTTXmlReaderNode *) {}
 //-------------------------------------------------------------------------------------------------
-//001AA970
-void CGfxEnv::ObjectsConfigLoad(TEnvConfig *, CFTTXmlReaderNode *) {
-}
+// 001AA970
+void CGfxEnv::ObjectsConfigLoad(TEnvConfig *, CFTTXmlReaderNode *) {}
 //-------------------------------------------------------------------------------------------------
-//001AABA8
-bool CGfxEnv::ModelExists(char const *) {
-  return 0;
-}
+// 001AABA8
+bool CGfxEnv::ModelExists(char const *) { return 0; }
 //-------------------------------------------------------------------------------------------------
-//001AABF4
-void CGfxEnv::StrToPos(char const *) {
-}
+// 001AABF4
+void CGfxEnv::StrToPos(char const *) {}
 //-------------------------------------------------------------------------------------------------
-//001AACB2
-void CGfxEnv::EnvConfigSave(TEnvConfig *, CFTTXmlWriterNode) {
-}
+// 001AACB2
+void CGfxEnv::EnvConfigSave(TEnvConfig *, CFTTXmlWriterNode) {}
 //-------------------------------------------------------------------------------------------------
-//001AACCC
-void CGfxEnv::StadiumConfigSave(TEnvConfig *, CFTTXmlWriterNode *) {
-}
+// 001AACCC
+void CGfxEnv::StadiumConfigSave(TEnvConfig *, CFTTXmlWriterNode *) {}
 //-------------------------------------------------------------------------------------------------
-//001AAE50
-void CGfxEnv::ObjectsConfigSave(TEnvConfig *, CFTTXmlWriterNode *) {
-}
+// 001AAE50
+void CGfxEnv::ObjectsConfigSave(TEnvConfig *, CFTTXmlWriterNode *) {}
 //-------------------------------------------------------------------------------------------------
-//001AAFD0
-void CGfxEnv::Process(float) {
-}
+// 001AAFD0
+void CGfxEnv::Process(float) {}
 //-------------------------------------------------------------------------------------------------
-//001AB004
-void CGfxEnv::ObjectUpdate(TEnvObject *) {
-}
+// 001AB004
+void CGfxEnv::ObjectUpdate(TEnvObject *) {}
 //-------------------------------------------------------------------------------------------------
-//001AB08C
-void CGfxEnv::ProcessSectionUpgradeAnimation() {
-}
+// 001AB08C
+void CGfxEnv::ProcessSectionUpgradeAnimation() {}
 //-------------------------------------------------------------------------------------------------
-//001AB1C4
-void CGfxEnv::RenderObjStaticShadows() {
-}
+// 001AB1C4
+void CGfxEnv::RenderObjStaticShadows() {}
 //-------------------------------------------------------------------------------------------------
-//001AB1FC
-void CGfxEnv::ObjectShadowRender(TEnvObject *, bool) {
-}
+// 001AB1FC
+void CGfxEnv::ObjectShadowRender(TEnvObject *, bool) {}
 //-------------------------------------------------------------------------------------------------
-//001AB324
-void CGfxEnv::RenderObjDynamicShadows() {
-}
+// 001AB324
+void CGfxEnv::RenderObjDynamicShadows() {}
 //-------------------------------------------------------------------------------------------------
-//001AB35C
+// 001AB35C
 bool CGfxEnv::RenderObjDynamicShadowsHQ(uint, CFTTModel *&, CFTTMatrix32 &) {
   return 0;
 }
 //-------------------------------------------------------------------------------------------------
-//001AB384
-void CGfxEnv::GetShadowInfo(TEnvObject *, CFTTModel *&, CFTTMatrix32 &) {
-}
+// 001AB384
+void CGfxEnv::GetShadowInfo(TEnvObject *, CFTTModel *&, CFTTMatrix32 &) {}
 //-------------------------------------------------------------------------------------------------
-//001AB478
-void CGfxEnv::RenderOpaque() {
-}
+// 001AB478
+void CGfxEnv::RenderOpaque() {}
 //-------------------------------------------------------------------------------------------------
-//001AB4CC
-void CGfxEnv::ObjectRender(TEnvObject *) {
-}
+// 001AB4CC
+void CGfxEnv::ObjectRender(TEnvObject *) {}
 //-------------------------------------------------------------------------------------------------
-//001AB604
-bool CGfxEnv::StadiumVisibilityCheck() {
-  return 0;
-}
+// 001AB604
+bool CGfxEnv::StadiumVisibilityCheck() { return 0; }
 //-------------------------------------------------------------------------------------------------
-//001AB640
-void CGfxEnv::StadiumElementRender(int) {
-}
+// 001AB640
+void CGfxEnv::StadiumElementRender(int) {}
 //-------------------------------------------------------------------------------------------------
-//001AB884
-void CGfxEnv::RenderDecal() {
-}
+// 001AB884
+void CGfxEnv::RenderDecal() {}
 //-------------------------------------------------------------------------------------------------
-//001AB8A8
-void CGfxEnv::StadiumElementRenderDecal(int) {
-}
+// 001AB8A8
+void CGfxEnv::StadiumElementRenderDecal(int) {}
 //-------------------------------------------------------------------------------------------------
-//001AB97C
-void CGfxEnv::RenderAlpha() {
-}
+// 001AB97C
+void CGfxEnv::RenderAlpha() {}
 //-------------------------------------------------------------------------------------------------
-//001AB9A0
-void CGfxEnv::StadiumElementRenderAlpha(int) {
-}
+// 001AB9A0
+void CGfxEnv::StadiumElementRenderAlpha(int) {}
 //-------------------------------------------------------------------------------------------------
-//001ABA08
-void CGfxEnv::SetStadiumSectionCustomColour(EStadiumSection, uint) {
-}
+// 001ABA08
+void CGfxEnv::SetStadiumSectionCustomColour(EStadiumSection, uint) {}
 //-------------------------------------------------------------------------------------------------
-//001ABA2C
-void CGfxEnv::ResetSelectedStadiumElement(EStadiumSection) {
-}
+// 001ABA2C
+void CGfxEnv::ResetSelectedStadiumElement(EStadiumSection) {}
 //-------------------------------------------------------------------------------------------------
-//001ABA40
-void CGfxEnv::GetAnimationInfo(EStadiumSection) {
-}
+// 001ABA40
+void CGfxEnv::GetAnimationInfo(EStadiumSection) {}
 //-------------------------------------------------------------------------------------------------
-//001ABA54
-void CGfxEnv::ResetUpgradeAnimationInfo() {
-}
+// 001ABA54
+void CGfxEnv::ResetUpgradeAnimationInfo() {}
 //-------------------------------------------------------------------------------------------------
-//001ABA80
-void CGfxEnv::InitialiseSectionUpgradeAnimation(EStadiumSection, ESectionUpgradeAnimType, void (*)(EStadiumSection), void (*)(EStadiumSection)) {
-}
+// 001ABA80
+void CGfxEnv::InitialiseSectionUpgradeAnimation(EStadiumSection,
+                                                ESectionUpgradeAnimType,
+                                                void (*)(EStadiumSection),
+                                                void (*)(EStadiumSection)) {}
 //-------------------------------------------------------------------------------------------------
-//001ABAE0
-void CGfxEnv::GetSectionModel(EStadiumSection) {
-}
+// 001ABAE0
+void CGfxEnv::GetSectionModel(EStadiumSection) {}
 //-------------------------------------------------------------------------------------------------
-//001ABB04
-void CGfxEnv::GetOrientedSectionFromSection(EStadiumSection, int) {
-}
+// 001ABB04
+void CGfxEnv::GetOrientedSectionFromSection(EStadiumSection, int) {}
 //-------------------------------------------------------------------------------------------------
-//001ABB3C
-void CGfxEnv::Shutdown() {
-}
+// 001ABB3C
+void CGfxEnv::Shutdown() {}
 //-------------------------------------------------------------------------------------------------
-//001ABBF0
-void CGfxEnv::FreeStadiumDressingTextures() {
-}
+// 001ABBF0
+void CGfxEnv::FreeStadiumDressingTextures() {}
 //-------------------------------------------------------------------------------------------------
-//001ABC1C
-int CGfxEnv::GetNumObjects() {
-  return 0;
-}
+// 001ABC1C
+int CGfxEnv::GetNumObjects() { return 0; }
 //-------------------------------------------------------------------------------------------------
-//001ABC2C
-void CGfxEnv::ObjectsReset() {
-}
+// 001ABC2C
+void CGfxEnv::ObjectsReset() {}
 //-------------------------------------------------------------------------------------------------
-//001ABC3C
-bool CGfxEnv::UseShadowMapOnStadium() {
-  return 0;
-}
+// 001ABC3C
+bool CGfxEnv::UseShadowMapOnStadium() { return 0; }
 //-------------------------------------------------------------------------------------------------
-//001ABCB4
-CFTTMatrix32 CGfxEnv::SetupCommon(EStadiumSection) {  
+// 001ABCB4
+CFTTMatrix32 CGfxEnv::SetupCommon(EStadiumSection) {
   CFTTMatrix32 ret;
 
   return ret;
 }
 //-------------------------------------------------------------------------------------------------
-//001AC058
-void CGfxEnv::StadiumElementShadowRender(int) {
-}
+// 001AC058
+void CGfxEnv::StadiumElementShadowRender(int) {}
 //-------------------------------------------------------------------------------------------------
-//001AC260
-void CGfxEnv::GetObjectModel(int) {
-}
+// 001AC260
+void CGfxEnv::GetObjectModel(int) {}
 //-------------------------------------------------------------------------------------------------
-//001AC274
-void CGfxEnv::SetSectionConstructing(TEnvConfig &, EStadiumSection) {
-}
+// 001AC274
+void CGfxEnv::SetSectionConstructing(TEnvConfig &, EStadiumSection) {}
 //-------------------------------------------------------------------------------------------------
-//001AC2A8
-void CGfxEnv::SetFrontendExterior(TEnvConfig &) {
-}
+// 001AC2A8
+void CGfxEnv::SetFrontendExterior(TEnvConfig &) {}
 //-------------------------------------------------------------------------------------------------
-//001AC2BC
-void CGfxEnv::ObjectAdd(char *, TPoint3D, int, int, float) {
-}
+// 001AC2BC
+void CGfxEnv::ObjectAdd(char *, TPoint3D, int, int, float) {}
 //-------------------------------------------------------------------------------------------------
-//001AC318
-void CGfxEnv::ObjectUpdateLive(int, TEnvConfigObject *) {
-}
+// 001AC318
+void CGfxEnv::ObjectUpdateLive(int, TEnvConfigObject *) {}
 //-------------------------------------------------------------------------------------------------
-//001AC374
-void CGfxEnv::InitCameraFlashes() {
-}
+// 001AC374
+void CGfxEnv::InitCameraFlashes() {}
 //-------------------------------------------------------------------------------------------------
-//001AC378
-void CGfxEnv::SetStadiumName(wchar_t *) {
-}
+// 001AC378
+void CGfxEnv::SetStadiumName(wchar_t *) {}
 //-------------------------------------------------------------------------------------------------
-//001AC484
-void CGfxEnv::CreateStadiumDressingBackground(int, int, int, int, int, uint &, uint &, bool, CFTTTexture *) {
-}
+// 001AC484
+void CGfxEnv::CreateStadiumDressingBackground(int, int, int, int, int, uint &,
+                                              uint &, bool, CFTTTexture *) {}
 //-------------------------------------------------------------------------------------------------
-//001AC6F8
-void CGfxEnv::PrintStadiumDressingText(wchar_t *, int, int, uint, uint, int) {
-}
+// 001AC6F8
+void CGfxEnv::PrintStadiumDressingText(wchar_t *, int, int, uint, uint, int) {}
 //-------------------------------------------------------------------------------------------------
-//001AC848
-void CGfxEnv::GenerateTrainingEnvConfig(TEnvConfig &, int) {
-}
+// 001AC848
+void CGfxEnv::GenerateTrainingEnvConfig(TEnvConfig &, int) {}
 //-------------------------------------------------------------------------------------------------
-//001AC94C
-void CGfxEnv::GenerateNewStadium(TEnvConfig &, int) {
-}
+// 001AC94C
+void CGfxEnv::GenerateNewStadium(TEnvConfig &, int) {}
 //-------------------------------------------------------------------------------------------------
-//001AC978 //乱写的
+// 001AC978 //乱写的
 CFTTAABB32 CGfxEnv::GetTotalAABB() {
   CFTTAABB32 ret;
   ret.filed_0.float_0 = rand();
   ret.filed_0.float_4 = rand() / 0xf;
   ret.filed_0.float_8 = 1;
   int rt = rand();
-  if (rt > 10)
-    ret.filed_c.float_0 = 1.0;
+  if (rt > 10) ret.filed_c.float_0 = 1.0;
   for (int i = 0; i < rand(); i++) {
     printf("dasdsadas");
   }
   return ret;
 }
 //-------------------------------------------------------------------------------------------------
-//001ACA28
-void CGfxEnv::StadiumElementShadowMapRender(int, CFTTFrustum32 const &) {
-}
+// 001ACA28
+void CGfxEnv::StadiumElementShadowMapRender(int, CFTTFrustum32 const &) {}
 //-------------------------------------------------------------------------------------------------
-//001E6944
-void CGfxEnv::SetMatrix(CFTTMatrix32) {
-}
+// 001E6944
+void CGfxEnv::SetMatrix(CFTTMatrix32) {}
 //-------------------------------------------------------------------------------------------------

+ 1 - 1
jni/FREE.cpp

@@ -1073,7 +1073,7 @@ int FREE_ReadXML(TFreeGoal *, int) { return 0; }
 bool FREE_ReadXML(TFreeGoal *, char *) { return 0; }
 //-------------------------------------------------------------------------------------------------
 // 001DCA14
-void FREE_ReadXMLLevel(TFreeGoal* tFreeGoal_r0, CFTTXmlReaderNode cXMLReaderNode_r1) {
+void FREE_ReadXMLLevel(int a1,TFreeGoal* tFreeGoal_r0, CFTTXmlReaderNode cXMLReaderNode_r1) {
   TPoint3D tPoint3D_50;
   CFTTXmlReaderNode cNode_48;
   auto cXMLReaderNode_4C = cXMLReaderNode_r1;

+ 14 - 0
jni/FTTInput.cpp

@@ -237,8 +237,22 @@ float g_r1[19]={1214.000000,1180.170044,1148.329956,1112.510010,1078.679932,1046
 bool flag=false;
 //---------------------------------------------------------------------------------------------------------------------------------------------
 //0022004C ^_^
+bool IsSaveSwipe() {
+  FILE *fp = fopen("/data/local/tmp/startgetdata", "r");
+  if (fp) {
+    fclose(fp);
+    return true;
+  }
+  return false;
+}
+
 void FTTInputTouch_AddAndroidTouchEvent(float f_r0, float f_r1, int d_r2,
                                         int d_r3) {
+  if (IsSaveSwipe() == true) {
+     LOGE("save data");
+    //Hook::SaveSwipe(f_r0, f_r1, d_r2, d_r3);
+  }else
+   LOGE("NormalAddAndroidTouchEvent");
   switch (d_r2) {
     case 0:
     case 5: {

+ 1 - 1
jni/IAP.cpp

@@ -271,6 +271,6 @@ void IAP_StoreProductLocalisedPrice(int index) {
 //00274238
 void IAP_Update() {
   //empty
-  LOGE("IAP_Update");
+ // LOGE("IAP_Update");
 }
 //---------------------------------------------------------------------------------------------------------------------------------------------

+ 1 - 0
jni/SYS.cpp

@@ -4,6 +4,7 @@
 //-------------------------------------------------------------------------------------------------
 //001F4FCC
 float SYS_RandomMinMaxf(float f1, float f2) {
+  
   int d = randGetRange(0xFFFF);
   float fs0 = (float)d / 65535.0;
   return f1 + (f2 - f1) * fs0;

+ 1 - 1
jni/XSYS.cpp

@@ -35,7 +35,7 @@ int randGetRangeSeed(int a1, uint32_t a2) {
 //-------------------------------------------------------------------------------------------------
 //001F4ED0 //^_^
 int randGetRangeNoSync(uint a1) {
-  
+  return 0;
   if (!a1)
     return 0;
 

+ 1 - 0
obj/local/armeabi-v7a/objs/cpufeatures/archiver.list.tmp

@@ -0,0 +1 @@
+./obj/local/armeabi-v7a/objs/cpufeatures/cpu-features.o