#include "CFE.h" #include #include #include "AndroidApp.h" #include "CFEEffects.h" #include "CFEImages.h" #include "CFESAndroidGraphics.h" #include "CFESChooseHero.h" #include "CFESChooseSideHero.h" #include "CFESCredits.h" #include "CFESEditPlayer.h" #include "CFESGame.h" #include "CFESIntro.h" #include "CFESLevelSelect.h" #include "CFESMainMenu.h" #include "CFESOptions.h" #include "CFESPauseMenu.h" #include "CFESPlayerName.h" #include "CFESShop.h" #include "CFESTitle.h" #include "CFTTCamera.h" #include "CFTTDevice.h" #include "CFTTNativeDialog.h" #include "CFTTRenderTarget.h" #include "CFTTServerTime.h" #include "CGFXFX.h" #include "CGFXSpec.h" #include "CGameFeats.h" #include "CGraphicsTexLoadOptions.h" #include "CMessageBoxHandler.h" #include "CStoryCore.h" #include "FE2D.h" #include "FETU.h" #include "FTT2D.h" #include "FTTGraphics.h" #include "GFXCAMERA.h" #include "GFXFADE.h" #include "GFXRENDER.h" #include "LOCstring.h" #include "SNDFE.h" #include "SNDGAME.h" #include "SYSCORE.h" #include "TGame.h" #include "TStoryConfig.h" #include "XCTRL.h" //#include "CFESShopHelper.h" #include "CFTTRewardedVideos.h" #include "CDownloads.h" #include "CFESShopHelper.h" #include "CFTTBannerAds.h" #include "CFTTAndroidRewardedVideos.h" #include "memctrl.h" extern bool FE_bBackButtonPressed; float CFE::s_fUniformWidth; // 0034A41C float CFE::s_fUniformHeight; // 0034A420 float CFE::s_fHardwareWidth = 480.0f; // 00335024 float CFE::s_fHardwareHeight = 320.0f; // 00335028 TRect CFE::s_tOffsetAndResolution_Software; // 0034A444 TRect CFE::s_tOffsetAndResolution_Hardware; // 0034A454 TRect CFE::tOffsetAndResolution_SoftwareNative; // 0034A424 TRect CFE::tOffsetAndResolution_HardwareNative; // 0034A434 float CFE::ms_fDestCustomViewportPercentage = 1.0f; // 0033502C float CFE::ms_fCustomViewportPercentage = 1.0f; // 00335030 bool CFE::ms_bCustomViewportActive; // 0034A464 time_t CFE::m_tMinimiseTime = -1; // 003365F8 int CFE::m_iScreenStackPos; // 00354144 CFEScreen* CFE::m_apScreenStack[16]; // 003540BC EFEScreen CFE::m_apScreenStackID[16]; // 003540FC CFTTTexture* CFE::s_pBGTexture = nullptr; // 00354194 bool CFE::ms_bShuttingDown; // 003540B4 int CFE::s_iUnpauseSoundCounter; // 003540B8 CFTTJobQueue* CFE::ms_pJobQueue = nullptr; // 0035416C bool CFE::m_bDeleteTopScreen; // 0035414C int CFE::m_eScreen; // 00354140 int CFE::m_eLastFlowDirection; // 0035413C int CFE::ms_iFrame; // 00354160 int CFE::m_iFirstInGameScreen; // 00354148 int CFE::ms_iProcessFrames; // 0035415C bool CFE::s_bCouldHaveBannerAds; // 00354159 int GFXUTIL_eAspectRatio; // 00462728 int SCR_SAFE_TOP; // 00354198 int SCR_SAFE_BOTTOM; // 0035419C int SCR_SAFE_LEFT; // 003541A0 int SCR_SAFE_RIGHT; // 003541A4 int SCR_WID = 640; // 003365EC int SCR_HEI = 960; // 003365F0 FTTMutex CFE::s_tRenderMutex; // 00354170 //------------------------------------------------------------------------------------------------- // 001199F4 //^_^ void CFE::StoreUniformSpaceDimensions(float w, float h) {} //------------------------------------------------------------------------------------------------- // 00119A10 //^_^ 经过单元测试,功能正常 void CFE::SetToUniformSpace() { LOGE("CFE::SetToUniformSpace"); } //------------------------------------------------------------------------------------------------- // 00119AC0 //^_^ 经过单元测试,功能正常 void CFE::SetViewport_Uniform() {} //------------------------------------------------------------------------------------------------- // 00119BCC //^_^ 经过单元测试,功能正常 void CFE::Begin2DScene() {} //------------------------------------------------------------------------------------------------- // 00119BE0 //^_^ 经过单元测试,功能正常 void CFE::SetupUniformRes() {} //------------------------------------------------------------------------------------------------- // 00119C28 //^_^ void CFE::BeginCustom2DScene(float f) {} //------------------------------------------------------------------------------------------------- // 00119C58 //^_^ void CFE::SetupCustomRes(float f) {} //------------------------------------------------------------------------------------------------- // 00119D60 //^_^ void CFE::ResetCustom2DScene() {} //------------------------------------------------------------------------------------------------- // 00119D8C //^_^ void CFE::End2DScene() {} //------------------------------------------------------------------------------------------------- // 00119D90 //^_^ float CFE::GetUniformXFromNativeX(float f1) { return 0; } //------------------------------------------------------------------------------------------------- // 00119DCC //^_^ float CFE::GetUniformYFromNativeY(float f1) { return 0; } //------------------------------------------------------------------------------------------------- // 00119E08 //^_^ float CFE::GetNativeXFromUniformX(float f1) { return 0; } //------------------------------------------------------------------------------------------------- // 00119E48 //^_^ float CFE::GetNativeYFromUniformY(float f1) { return 0; } //------------------------------------------------------------------------------------------------- // 00119E88 //^_^ float CFE::RoundToNativeXPixel(float f1) { return 0; } //------------------------------------------------------------------------------------------------- // 00119ED4 //^_^ float CFE::RoundToNativeYPixel(float f1) { return 0; } //------------------------------------------------------------------------------------------------- // 00119F20 //^_^ void CFE::SetNativeHardwareSize(float fw, float fh) {} //------------------------------------------------------------------------------------------------- // 00119F30 //-_- 经过单元测试,功能正常 void CFE::ResolveScreenDims() {} //------------------------------------------------------------------------------------------------- // 001522AC //^_- 经过单元测试,功能正常 void CFE::Init() {} //------------------------------------------------------------------------------------------------- // 00152394 //^_- 经过单元测试,功能正常 void CFE::Forward(int eScreenID, bool b2, bool b3) { // locret_152442 } //------------------------------------------------------------------------------------------------- // 00152464 //^_^ void CFE::Exit() {} //------------------------------------------------------------------------------------------------- // 0015249C void CFE::InitialiseBannerAds() { // give up } //------------------------------------------------------------------------------------------------- // 001524BC bool CFE::AllowBannerAds() { return false; } //------------------------------------------------------------------------------------------------- // 00152508 void CFE::RemoveBannerAd() { // give up LOGE("CFE::RemoveBannerAd"); } //------------------------------------------------------------------------------------------------- // 0015251C void CFE::ShutDown() {} //------------------------------------------------------------------------------------------------- // 001525B4 void CFE::PauseSoundForRecording() { // SNDFE_Music_Pause(true); // SNDGAME_Crowd_Pause(true); } //------------------------------------------------------------------------------------------------- // 001525C6 void CFE::PlaySoundAfterRecording() { // SNDFE_Music_UnPause(); } //------------------------------------------------------------------------------------------------- // 001525CC bool CFE::CheckMusic() { LOGE("CFE::CheckMusic"); return rand(); } //------------------------------------------------------------------------------------------------- // 0015261C bool CFE::ProcessAdverts() { // give up return false; } //------------------------------------------------------------------------------------------------- // 0015263C void CFE::AttemptToPlayVideoAd(bool b1, int a2, bool b3, bool b4) { // give up } //------------------------------------------------------------------------------------------------- // 00152714 int CFE::AttemptToDisplayInterstitialAd() { // give up return 1; } //------------------------------------------------------------------------------------------------- // 00152770 void CFE::AttemptToStartVideoAdNetworks() { // give up } //------------------------------------------------------------------------------------------------- // 00152864 bool CFE::AllowVideoAds(EVideoAdZones) { // give up return false; } //------------------------------------------------------------------------------------------------- // 00152914 void CFE::VideoAnalytics(int a1) { // empty } //------------------------------------------------------------------------------------------------- // 00152918 void CFE::PlayRewardedVideo(int a1, void* pdat) { // give up } //------------------------------------------------------------------------------------------------- // 00152998 void CFE::VideoAdEnergyRewardCallback(int a1, int a2, bool b3, char const* pdata) { // give up } //------------------------------------------------------------------------------------------------- // 00152A74 void CFE::VideoAdCurrencyRewardCallback(int a1, int a2, bool b1, char const* pdata) { // give up } //------------------------------------------------------------------------------------------------- // 00152BB8 bool CFE::ReadyToPlayVideoAd(bool b1, int a2, bool b3) { return false; } //------------------------------------------------------------------------------------------------- // 00152C08 bool CFE::PassedVideoTime() { // give up return false; } //------------------------------------------------------------------------------------------------- // 00152C44 void CFE::UpdateAdvertTimings(bool b) { // give up } //------------------------------------------------------------------------------------------------- // 00152CD4 bool CFE::PassedFullScreenTime() { return false; } //------------------------------------------------------------------------------------------------- // 00152D0C //^_^ void CFE::AndroidExitAppCB(int a1, void* pData) { LOGE("AndroidExitAppCB"); } //------------------------------------------------------------------------------------------------- // 00152D50 EVideoAdZones CFE::GetAnalyticsVideoSourceFromZone(EVideoAdZones e) { // give up return EVideoAdZones_0; } 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) { // 00152DC2 if (tGame.mTLogic_6678.bisRunning_A9) { // 00152DD4 CFE::SetToUniformSpace(); } // 00152DD8 GFXFADE_Update(true); CFEEffects::Update(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) { CStoryCore::m_cProfile.EnergyCheckRestore(); } // loc_152E20 if (CFE::m_bDeleteTopScreen) { // 00152E2A CFE::DeleteTopScreen(); CFE::m_bDeleteTopScreen = false; } // loc_152E32 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(); } // 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_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 { // 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(); MP_cMyProfile.CheckSave(); } return 0; } //------------------------------------------------------------------------------------------------- // 0015307C //^_^ void CFE::DeleteTopScreen() { LOGE("CFE::DeleteTopScreen"); } //------------------------------------------------------------------------------------------------- // 001530C8 //^_^ 经过单元测试,功能正常 void CFE::SetupStack(int* pdata, int dCount) { LOGE("%pCFE::SetupStack%x", pdata, dCount); } //------------------------------------------------------------------------------------------------- // 001530EC //^_^ void CFE::Back(bool b1, bool b2) { LOGE("%xCFE::Back%x", b1, b2); } //------------------------------------------------------------------------------------------------- // 00153190 //^_^ 经过单元测试,功能正常 void CFE::RenderScreen(int a1) {} //------------------------------------------------------------------------------------------------- // 001531AC void CFE::RenderAdBackground(bool b) { // give up } //------------------------------------------------------------------------------------------------- // 00153208 void CFE::RenderFrameRate() { // empty } //------------------------------------------------------------------------------------------------- // 0015320C //^_^ 经过单元测试,功能正常 void CFE::Render() {} //------------------------------------------------------------------------------------------------- // 00153274 ^_^ 经过单元测试,功能正常 void CFE::RenderInner() {} //------------------------------------------------------------------------------------------------- // 00153318 //^_^ 经过单元测试,功能正常 int CFE::GetScreenID() { int dret = -1; // loc_153338 return dret; } //------------------------------------------------------------------------------------------------- // 00153348 //^_^ 经过单元测试,功能正常 CFEScreen* CFE::NewScreen(int a1) { CFEScreen* pRet = nullptr; return pRet; } //------------------------------------------------------------------------------------------------- // 00153528 //^_^ void CFE::BackToScreen(int a1, bool b2) {} //------------------------------------------------------------------------------------------------- // 001535B4 //^_^ 经过单元测试,功能正常 CFTTTexture* CFE::GetBGTexture() { return nullptr; } //------------------------------------------------------------------------------------------------- // typedef void (*CMessageBoxHandler_func)(int, void *); //这个函数两个参数没有用到 // 00153584 //^_^ void SeenStartupMessageCB(int a1, void* pbuf2) {} //------------------------------------------------------------------------------------------------- // 00153618 -_- 仅打log时,功能正常 void CFE::DisplayInitialMessage() { LOGI("CFE::DisplayInitialMessage entry"); // fixit STY_tConfig结构未知 // if (STY_tConfig->buf_5B91 && !MP_cMyProfile->ShowUpdateMessageBox() && // (STY_tConfig->field_6394 == -1 || STY_tConfig->field_6394 != // MP_cMyProfile->field_4)) { // //loc_15364C // wchar_t* tmp = new wchar_t[2048]; // UTF8ToUnicode(tmp, STY_tConfig->buf_5B91, 2047); //00268EDC // UTF8ToUnicode(wchar_t *,char const*,uint) // CMessageBoxHandler::NewMessageBox(SeenStartupMessageCB, 0, // EMessageBoxType_0, tmp, 0, 0, 128, 1, 1, 0, 0, 0, 1, 1); delete[] tmp; // } } //------------------------------------------------------------------------------------------------- // 001536AC //^_^ void CFE::ShopCB(int a1, void* pdata) {} //------------------------------------------------------------------------------------------------- // 001536B6 void CFE::ShowShop(bool b) { LOGI("CFE::ShowShop entry"); } //------------------------------------------------------------------------------------------------- // 001536FC void CFE::OpenFacebookLink() { // give up } //------------------------------------------------------------------------------------------------- // 0015371C void CFE::OpenTwitterLink() { // give up } //------------------------------------------------------------------------------------------------- // 0015373C //^_^ void CFE::DeleteScreenStack() {} //------------------------------------------------------------------------------------------------- // 00153758 void CFE::LoadSideStoryFirstNISIfExists() { //??? 会不会调用到不是十分确定 LOGI("CFE::LoadSideStoryFirstNISIfExists entry"); } //------------------------------------------------------------------------------------------------- // 00153820 void CFE::SetInitialAdvertTimings() { //??? 好像与广告相关,不是十分确定 } //------------------------------------------------------------------------------------------------- // 00153884 bool CFE::AllowInterstitials() { // give up return false; } //------------------------------------------------------------------------------------------------- // 001538DC bool CFE::AlwaysShowLevelSelectVideoAds() { return false; } //------------------------------------------------------------------------------------------------- // 00153908 bool CFE::CouldHaveVideoAds(EVideoAdZones e) { // give up return false; } //------------------------------------------------------------------------------------------------- // 0015399C bool CFE::CouldHaveInterstitials() { bool bret = false; // fixit // if (STY_tConfig[MP_cMyProfile->GetUserType()].field_63E8 > -1) { // bret = true; // } else { // bret = STORY_ShouldForceAdverts(); // } return bret; } //------------------------------------------------------------------------------------------------- // 001539D8 void CFE::AddBannerAd() { // give up } //------------------------------------------------------------------------------------------------- // 001539F4 //^_^ bool CFE::CurrentScreenHasBackButton() { bool bret = false; return bret; } //------------------------------------------------------------------------------------------------- // 00153A20 //^_^ void CFE::OpenTermsOfServiceURL() {} //------------------------------------------------------------------------------------------------- // 00153A2C //^_^ void CFE::OpenPrivacyPolicyURL() {} //------------------------------------------------------------------------------------------------- // 00153A38 void CFE::OpenTermsOfService() { // CHeroAnalytics::LogEvent(); LOGE("OpenTermsOfService"); } //------------------------------------------------------------------------------------------------- // 00153A88 void CFE::OpenPrivacyPolicy() { // CHeroAnalytics::LogEvent(); LOGE("OpenPrivacyPolicy"); } //------------------------------------------------------------------------------------------------- // 00153AD8 //^_- void CFE::ContinueTermsOfServiceNativeDialog() { // CHeroAnalytics::LogEvent() LOGE("ContinueTermsOfServiceNativeDialog"); } //------------------------------------------------------------------------------------------------- // 00153B4C //^_^ 经过单元测试,功能正常 bool CFE::ShowNativeDialogForTerms() { return true; } //------------------------------------------------------------------------------------------------- // 00153BEC //^_^ void CFE::StoreMinimiseTime() {} //------------------------------------------------------------------------------------------------- // 00153C04 void CFE::CheckTimeMinimised() { LOGE("CFE::CheckTimeMinimised"); // locret_153C32 } //------------------------------------------------------------------------------------------------- // 00153C3C //^_- 经过单元测试,功能正常 void CFE::PerformHousekeeping() { // locret_153CA4 return; } //------------------------------------------------------------------------------------------------- // 00153CC4 //^_^ void CFE::DeleteHeadshot() {} //------------------------------------------------------------------------------------------------- /* 第一个界面要调用到的函数 77, 0x7665ac04 in ?? () 00153C04 CFE::CheckTimeMinimised() 17, 0x76620f30 in ?? () 00119F30 CFE::ResolveScreenDims() 2, 0x76620a10 in ?? () 00119A10 CFE::SetToUniformSpace() 31, 0x76659770 in ?? () 00152770 CFE::AttemptToStartVideoAdNetworks() 64, 0x7665a884 in ?? () 00153884 CFE::AllowInterstitials() 67, 0x7665a99c in ?? () 0015399C CFE::CouldHaveInterstitials() 32, 0x76659864 in ?? () 00152864 CFE::AllowVideoAds(EVideoAdZones) 66, 0x7665a908 in ?? () 00153908 CFE::CouldHaveVideoAds(EVideoAdZones) 63, 0x7665a820 in ?? () 00153820 CFE::SetInitialAdvertTimings() 75, 0x7665ab4c in ?? () 00153B4C CFE::ShowNativeDialogForTerms() 18, 0x766592ac in ?? () 001522AC CFE::Init() 19, 0x76659394 in ?? () 00152394 CFE::Forward(int a1, bool b1, bool b2) 53, 0x7665a348 in ?? () 00153348 CFE::NewScreen(int) 43, 0x76659d94 in ?? () 00152D94 CFE::Process(float f) 27, 0x766595cc in ?? () 001525CC CFE::CheckMusic() 52, 0x7665a318 in ?? () 00153318 CFE::GetScreenID() 50, 0x7665a20c in ?? () 0015320C CFE::Render() 51, 0x7665a274 in ?? () 00153274 CFE::RenderInner() 3, 0x76620ac0 in ?? () 00119AC0 CFE::SetViewport_Uniform() 4, 0x76620bcc in ?? () 00119BCC CFE::Begin2DScene() 5, 0x76620be0 in ?? () 00119BE0 CFE::SetupUniformRes() 47, 0x7665a190 in ?? () 00153190 CFE::RenderScreen(int a1) 9, 0x76620d8c in ?? () 00119D8C CFE::End2DScene() 21, 0x7665949c in ?? () 0015249C CFE::InitialiseBannerAds() 22, 0x766594bc in ?? () 001524BC CFE::AllowBannerAds() 78, 0x7665ac3c in ?? () 00153C3C CFE::PerformHousekeeping() 55, 0x7665a5b4 in ?? () 001535B4 CFE::GetBGTexture() 56, 0x7665a618 in ?? () 00153618 CFE::DisplayInitialMessage() */