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/Game.cpp | |
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/Game.cpp')
-rw-r--r-- | src/core/Game.cpp | 34 |
1 files changed, 26 insertions, 8 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(); |