summaryrefslogtreecommitdiffstats
path: root/src/core/Game.cpp
diff options
context:
space:
mode:
authornmzik <nmzik@mail.ru>2019-10-19 00:23:40 +0200
committernmzik <nmzik@mail.ru>2019-10-19 00:23:40 +0200
commitf56684d04e06af21f423ad4bc1c47bc2b09fccea (patch)
tree27e8f9a501a2d909cae3b829d7c85cc91cb5f59f /src/core/Game.cpp
parentCPopulation::Initialise() (diff)
downloadre3-f56684d04e06af21f423ad4bc1c47bc2b09fccea.tar
re3-f56684d04e06af21f423ad4bc1c47bc2b09fccea.tar.gz
re3-f56684d04e06af21f423ad4bc1c47bc2b09fccea.tar.bz2
re3-f56684d04e06af21f423ad4bc1c47bc2b09fccea.tar.lz
re3-f56684d04e06af21f423ad4bc1c47bc2b09fccea.tar.xz
re3-f56684d04e06af21f423ad4bc1c47bc2b09fccea.tar.zst
re3-f56684d04e06af21f423ad4bc1c47bc2b09fccea.zip
Diffstat (limited to 'src/core/Game.cpp')
-rw-r--r--src/core/Game.cpp152
1 files changed, 151 insertions, 1 deletions
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index b488a217..f455757c 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -2,8 +2,59 @@
#include "patcher.h"
#include "Game.h"
#include "main.h"
+#include "AccidentManager.h"
+#include "Antennas.h"
+#include "Bridge.h"
+#include "Camera.h"
+#include "CarCtrl.h"
+#include "CarGen.h"
#include "CdStream.h"
+#include "Clock.h"
+#include "Clouds.h"
+#include "Collision.h"
+#include "Coronas.h"
+#include "Cranes.h"
+#include "CutsceneMgr.h"
+#include "Darkel.h"
+#include "EventList.h"
+#include "FileLoader.h"
#include "FileMgr.h"
+#include "Fire.h"
+#include "Fluff.h"
+#include "Font.h"
+#include "Frontend.h"
+#include "GameLogic.h"
+#include "Garages.h"
+#include "Glass.h"
+#include "Heli.h"
+#include "Pad.h"
+#include "Particle.h"
+#include "Phones.h"
+#include "Pickups.h"
+#include "Plane.h"
+#include "Population.h"
+#include "Record.h"
+#include "Renderer.h"
+#include "Replay.h"
+#include "RoadBlocks.h"
+#include "Rubbish.h"
+#include "SceneEdit.h"
+#include "Script.h"
+#include "Shadows.h"
+#include "Skidmarks.h"
+#include "SpecialFX.h"
+#include "Sprite2d.h"
+#include "Streaming.h"
+#include "TimeCycle.h"
+#include "TrafficLights.h"
+#include "Train.h"
+#include "User.h"
+#include "WaterCannon.h"
+#include "Weapon.h"
+#include "Weather.h"
+#include "World.h"
+#include "ZoneCull.h"
+#include "Zones.h"
eLevelName &CGame::currLevel = *(eLevelName*)0x941514;
bool &CGame::bDemoMode = *(bool*)0x5F4DD0;
@@ -25,9 +76,104 @@ CGame::InitialiseOnceBeforeRW(void)
}
WRAPPER void CGame::Initialise(const char *datFile) { EAXJMP(0x48BED0); }
+#if 0
WRAPPER void CGame::Process(void) { EAXJMP(0x48C850); }
+#else
+void CGame::Process(void)
+{
+ CPad::UpdatePads();
+ TheCamera.SetMotionBlurAlpha(0);
+ if (TheCamera.m_BlurType == 0 || TheCamera.m_BlurType == 1 || TheCamera.m_BlurType == 2)
+ TheCamera.SetMotionBlur(0, 0, 0, 0, 0);
+ CCutsceneMgr::Update();
+ if (!CCutsceneMgr::ms_cutsceneProcessing && !CTimer::GetIsCodePaused())
+ FrontEndMenuManager.Process();
+ CStreaming::Update();
+ if (!CTimer::GetIsPaused())
+ {
+ CTheZones::Update();
+ CSprite2d::SetRecipNearClip();
+ CSprite2d::InitPerFrame();
+ CFont::InitPerFrame();
+ CRecordDataForGame::SaveOrRetrieveDataForThisFrame();
+ CRecordDataForChase::SaveOrRetrieveDataForThisFrame();
+ CPad::DoCheats();
+ CClock::Update();
+ CWeather::Update();
+ CTheScripts::Process();
+ CCollision::Update();
+ CTrain::UpdateTrains();
+ CPlane::UpdatePlanes();
+ CHeli::UpdateHelis();
+ CDarkel::Update();
+ CSkidmarks::Update();
+ CAntennas::Update();
+ CGlass::Update();
+ CSceneEdit::Update();
+ CEventList::Update();
+ CParticle::Update();
+ gFireManager.Update();
+ CPopulation::Update();
+ CWeapon::UpdateWeapons();
+ if (!CCutsceneMgr::IsRunning())
+ CTheCarGenerators::Process();
+ if (!CReplay::IsPlayingBack())
+ CCranes::UpdateCranes();
+ CClouds::Update();
+ CMovingThings::Update();
+ CWaterCannons::Update();
+ CUserDisplay::Process();
+ CReplay::Update();
+ CWorld::Process();
+ gAccidentManager.Update();
+ CPacManPickups::Update();
+ CPickups::Update();
+ CGarages::Update();
+ CRubbish::Update();
+ CSpecialFX::Update();
+ CTimeCycle::Update();
+ if (CReplay::ShouldStandardCameraBeProcessed())
+ TheCamera.Process();
+ CCullZones::Update();
+ if (!CReplay::IsPlayingBack())
+ CGameLogic::Update();
+ CBridge::Update();
+ CCoronas::DoSunAndMoon();
+ CCoronas::Update();
+ CShadows::UpdateStaticShadows();
+ CShadows::UpdatePermanentShadows();
+ gPhoneInfo.Update();
+ if (!CReplay::IsPlayingBack())
+ {
+ CCarCtrl::GenerateRandomCars();
+ CRoadBlocks::GenerateRoadBlocks();
+ CCarCtrl::RemoveDistantCars();
+ }
+ }
+}
+#endif
-
+void CGame::ReloadIPLs(void)
+{
+ CTimer::Stop();
+ CWorld::RemoveStaticObjects();
+ ThePaths.Init();
+ CCullZones::Init();
+ CFileLoader::ReloadPaths("GTA3.IDE");
+ CFileLoader::LoadScene("INDUST.IPL");
+ CFileLoader::LoadScene("COMMER.IPL");
+ CFileLoader::LoadScene("SUBURBAN.IPL");
+ CFileLoader::LoadScene("CULL.IPL");
+ ThePaths.PreparePathData();
+ CTrafficLights::ScanForLightsOnMap();
+ CRoadBlocks::Init();
+ CCranes::InitCranes();
+ CGarages::Init();
+ CWorld::RepositionCertainDynamicObjects();
+ CCullZones::ResolveVisibilities();
+ CRenderer::SortBIGBuildings();
+ CTimer::Update();
+}
WRAPPER bool CGame::InitialiseRenderWare(void) { EAXJMP(0x48BBA0); }
WRAPPER void CGame::ShutdownRenderWare(void) { EAXJMP(0x48BCB0); }
@@ -36,3 +182,7 @@ WRAPPER void CGame::ShutDown(void) { EAXJMP(0x48C3A0); }
WRAPPER void CGame::ShutDownForRestart(void) { EAXJMP(0x48C6B0); }
WRAPPER void CGame::InitialiseWhenRestarting(void) { EAXJMP(0x48C740); }
WRAPPER bool CGame::InitialiseOnceAfterRW(void) { EAXJMP(0x48BD50); }
+
+STARTPATCHES
+InjectHook(0x48C850, CGame::Process, PATCH_JUMP);
+ENDPATCHES