diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2021-07-25 20:44:21 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2021-07-25 20:44:21 +0200 |
commit | bf4b39781ba64076c06e00825277a6c7f67c0949 (patch) | |
tree | 7a5bb0cbbbd0b58f168cfd9b792a74d78d039eee /src/core | |
parent | Merge remote-tracking branch 'upstream/lcs' into lcs (diff) | |
download | re3-bf4b39781ba64076c06e00825277a6c7f67c0949.tar re3-bf4b39781ba64076c06e00825277a6c7f67c0949.tar.gz re3-bf4b39781ba64076c06e00825277a6c7f67c0949.tar.bz2 re3-bf4b39781ba64076c06e00825277a6c7f67c0949.tar.lz re3-bf4b39781ba64076c06e00825277a6c7f67c0949.tar.xz re3-bf4b39781ba64076c06e00825277a6c7f67c0949.tar.zst re3-bf4b39781ba64076c06e00825277a6c7f67c0949.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Game.cpp | 34 | ||||
-rw-r--r-- | src/core/Game.h | 2 | ||||
-rw-r--r-- | src/core/config.h | 2 |
3 files changed, 28 insertions, 10 deletions
diff --git a/src/core/Game.cpp b/src/core/Game.cpp index a370c9d4..d2646512 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -648,7 +648,7 @@ bool CGame::ShutDown(void) return true; } -void CGame::ReInitGameObjectVariables(void) +bool CGame::ReInitGameObjectVariables(bool load) { CGameLogic::InitAtStartOfGame(); #ifdef PS2_MENU @@ -693,7 +693,7 @@ void CGame::ReInitGameObjectVariables(void) gPhoneInfo.Initialise(); PUSH_MEMID(MEMID_SCRIPT); - CTheScripts::Init(); + bool res = CTheScripts::Init(load); CGangs::Initialise(); POP_MEMID(); @@ -706,12 +706,14 @@ void CGame::ReInitGameObjectVariables(void) CStats::Init(); CPickups::Init(); CPacManPickups::Init(); - CGarages::Init(); + if (!load) + CGarages::Init(); CSpecialFX::Init(); CRopes::Init(); CWaterCannons::Init(); CScriptPaths::Init(); CParticle::ReloadConfig(); + CParticle::SetPixelData(); #ifdef PS2_MENU if ( !TheMemoryCard.m_bWantToLoad ) @@ -730,6 +732,8 @@ void CGame::ReInitGameObjectVariables(void) for (int32 i = 0; i < MAX_PADS; i++) CPad::GetPad(i)->Clear(true); + + return res; } void CGame::ReloadIPLs(void) @@ -800,13 +804,12 @@ void CGame::InitialiseWhenRestarting(void) RestoreForStartLoad(); } - ReInitGameObjectVariables(); + bool bLoadSuccessful = ReInitGameObjectVariables(FrontEndMenuManager.m_bWantToLoad); if ( FrontEndMenuManager.m_bWantToLoad == true ) { - FrontEndMenuManager.m_bWantToLoad = false; InitRadioStationPositionList(); - if ( GenericLoad() == true ) + if ( bLoadSuccessful == true ) { DMAudio.ResetTimers(CTimer::GetTimeInMilliseconds()); CFerry::InitFerrys(); @@ -825,8 +828,8 @@ void CGame::InitialiseWhenRestarting(void) ShutDownForRestart(); CTimer::Stop(); CTimer::Initialise(); - FrontEndMenuManager.m_bWantToLoad = false; - ReInitGameObjectVariables(); + //FrontEndMenuManager.m_bWantToLoad = false; + ReInitGameObjectVariables(false); currLevel = LEVEL_GENERIC; CCollision::SortOutCollisionAfterLoad(); } @@ -835,6 +838,7 @@ void CGame::InitialiseWhenRestarting(void) #endif } + FrontEndMenuManager.m_bWantToLoad = true; CTimer::Update(); DMAudio.ChangeMusicMode(MUSICMODE_GAME); @@ -845,6 +849,20 @@ void CGame::InitialiseWhenRestarting(void) void CGame::Process(void) { + if (FrontEndMenuManager.m_bWantToLoad) { + CTheScripts::StartTestScript(); + CTheScripts::Process(); + TheCamera.Process(); + CStreaming::LoadScene(TheCamera.GetPosition()); + //CGame::GenerateTempPedAtStartOfNetworkGame(); + if (/* ?*/true){ + CStreaming::RequestSpecialModel(MI_PLAYER, "player", STREAMFLAGS_DEPENDENCY | STREAMFLAGS_DONT_REMOVE); + CStreaming::LoadAllRequestedModels(false); + } + TheCamera.Process(); + CStreaming::LoadScene(TheCamera.GetPosition()); + FrontEndMenuManager.m_bWantToLoad = false; + } CPad::UpdatePads(); #ifdef USE_CUSTOM_ALLOCATOR ProcessTidyUpMemory(); diff --git a/src/core/Game.h b/src/core/Game.h index dd14278a..e6016888 100644 --- a/src/core/Game.h +++ b/src/core/Game.h @@ -62,7 +62,7 @@ public: static void FinalShutdown(void); static bool Initialise(const char *datFile); static bool ShutDown(void); - static void ReInitGameObjectVariables(void); + static bool ReInitGameObjectVariables(bool); static void ReloadIPLs(void); static void ShutDownForRestart(void); static void InitialiseWhenRestarting(void); diff --git a/src/core/config.h b/src/core/config.h index d8d62782..bee60489 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -274,7 +274,7 @@ enum Config { #define FIX_BUGS // fixes bugs that we've came across during reversing. You can undefine this only on release builds. //#define MORE_LANGUAGES // Add more translations to the game #define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible, and keeps saves compatible between platforms -#define FIX_INCOMPATIBLE_SAVES // try to fix incompatible saves, requires COMPATIBLE_SAVES +//#define FIX_INCOMPATIBLE_SAVES // try to fix incompatible saves, requires COMPATIBLE_SAVES #define LOAD_INI_SETTINGS // as the name suggests. fundamental for CUSTOM_FRONTEND_OPTIONS #define NO_MOVIES // add option to disable intro videos |