diff options
Diffstat (limited to 'src/core/Game.cpp')
-rw-r--r-- | src/core/Game.cpp | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/src/core/Game.cpp b/src/core/Game.cpp index c5e5224d..a370c9d4 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -22,6 +22,7 @@ #include "Darkel.h" #include "Debug.h" #include "EventList.h" +#include "Ferry.h" #include "FileLoader.h" #include "FileMgr.h" #include "Fire.h" @@ -322,7 +323,7 @@ bool CGame::InitialiseOnceAfterRW(void) { TheText.Load(); CTimer::Initialise(); - CTempColModels::Initialise(); + gpTempColModels->Initialise(); mod_HandlingManager.Initialise(); CSurfaceTable::Initialise("DATA\\SURFACE.DAT"); CPedStats::Initialise(); @@ -372,13 +373,16 @@ bool CGame::Initialise(const char* datFile) CPools::Initialise(); + if(gMakeResources) + CVehicleModelInfo::Load(nil); + #ifndef GTA_PS2 CIniFile::LoadIniFile(); #endif #ifdef USE_TEXTURE_POOL _TexturePoolsUnknown(false); #endif - currLevel = LEVEL_BEACH; + currLevel = LEVEL_INDUSTRIAL; currArea = AREA_MAIN_MAP; PUSH_MEMID(MEMID_TEXTURES); @@ -449,7 +453,7 @@ bool CGame::Initialise(const char* datFile) CdStreamAddImage("MODELS\\GTA3.IMG"); - CFileLoader::LoadLevel("DATA\\DEFAULT.DAT"); +// CFileLoader::LoadLevel("DATA\\DEFAULT.DAT"); CFileLoader::LoadLevel(datFile); LoadingScreen("Loading the Game", "Add Particles", nil); @@ -544,6 +548,7 @@ bool CGame::Initialise(const char* datFile) LoadingScreen("Loading the Game", "Position dynamic objects", nil); LoadingScreen("Loading the Game", "Initialise vehicle paths", nil); + CFerry::InitFerrys(); CTrain::InitTrains(); CPlane::InitPlanes(); CCredits::Init(); @@ -592,7 +597,7 @@ bool CGame::ShutDown(void) CPlane::Shutdown(); CTrain::Shutdown(); CScriptPaths::Shutdown(); - CWaterCreatures::RemoveAll(); + //CWaterCreatures::RemoveAll(); CSpecialFX::Shutdown(); CGarages::Shutdown(); CMovingThings::Shutdown(); @@ -666,8 +671,9 @@ void CGame::ReInitGameObjectVariables(void) CDraw::SetFOV(120.0f); CDraw::ms_fLODDistance = 500.0f; CStreaming::RequestBigBuildings(LEVEL_GENERIC); - CStreaming::RemoveIslandsNotUsed(LEVEL_BEACH); - CStreaming::RemoveIslandsNotUsed(LEVEL_MAINLAND); + CStreaming::RemoveIslandsNotUsed(LEVEL_INDUSTRIAL); + CStreaming::RemoveIslandsNotUsed(LEVEL_COMMERCIAL); + CStreaming::RemoveIslandsNotUsed(LEVEL_SUBURBAN); CStreaming::LoadAllRequestedModels(false); currArea = AREA_MAIN_MAP; CPed::Initialise(); @@ -717,6 +723,7 @@ void CGame::ReInitGameObjectVariables(void) CTheScripts::StartTestScript(); CTheScripts::Process(); TheCamera.Process(); + CFerry::InitFerrys(); CTrain::InitTrains(); CPlane::InitPlanes(); } @@ -753,7 +760,7 @@ void CGame::ShutDownForRestart(void) CRadar::RemoveRadarSections(); FrontEndMenuManager.UnloadTextures(); CParticleObject::RemoveAllExpireableParticleObjects(); - CWaterCreatures::RemoveAll(); + //CWaterCreatures::RemoveAll(); CSetPieces::Init(); CPedType::Shutdown(); CSpecialFX::Shutdown(); @@ -802,6 +809,7 @@ void CGame::InitialiseWhenRestarting(void) if ( GenericLoad() == true ) { DMAudio.ResetTimers(CTimer::GetTimeInMilliseconds()); + CFerry::InitFerrys(); CTrain::InitTrains(); CPlane::InitPlanes(); } @@ -858,9 +866,9 @@ void CGame::Process(void) gameProcessPirateCheck = 2; } #endif - uint32 startTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond(); + //uint32 startTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond(); CStreaming::Update(); - uint32 processTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond() - startTime; + //uint32 processTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond() - startTime; CWindModifiers::Number = 0; if (!CTimer::GetIsPaused()) { @@ -885,6 +893,7 @@ void CGame::Process(void) CCollision::Update(); CScriptPaths::Update(); + CFerry::UpdateFerrys(); CTrain::UpdateTrains(); CPlane::UpdatePlanes(); CHeli::UpdateHelis(); @@ -899,20 +908,20 @@ void CGame::Process(void) CEventList::Update(); CParticle::Update(); gFireManager.Update(); - if (processTime >= 2) { - CPopulation::Update(false); - } else { - uint32 startTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond(); + //if (processTime >= 2) { + // CPopulation::Update(false); + //} else { + // uint32 startTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond(); CPopulation::Update(true); - processTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond() - startTime; - } + // processTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond() - startTime; + //} CWeapon::UpdateWeapons(); if (!CCutsceneMgr::IsRunning()) CTheCarGenerators::Process(); if (!CReplay::IsPlayingBack()) CCranes::UpdateCranes(); CClouds::Update(); - CMovingThings::Update(); + //CMovingThings::Update(); // TODO CWaterCannons::Update(); CUserDisplay::Process(); CReplay::Update(); @@ -943,7 +952,7 @@ void CGame::Process(void) if (!CReplay::IsPlayingBack()) { PUSH_MEMID(MEMID_CARS); - if (processTime < 2) + //if (processTime < 2) CCarCtrl::GenerateRandomCars(); CRoadBlocks::GenerateRoadBlocks(); CCarCtrl::RemoveDistantCars(); |