summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/FileLoader.cpp2
-rw-r--r--src/core/FileLoader.h2
-rw-r--r--src/core/Fire.cpp1
-rw-r--r--src/core/Fire.h1
-rw-r--r--src/core/Game.cpp152
-rw-r--r--src/core/Game.h1
-rw-r--r--src/core/User.cpp2
-rw-r--r--src/core/User.h2
-rw-r--r--src/core/World.cpp2
-rw-r--r--src/core/World.h2
10 files changed, 166 insertions, 1 deletions
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index e9c06201..6f3b0971 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -25,6 +25,8 @@
#include "CdStream.h"
#include "FileLoader.h"
+WRAPPER void CFileLoader::ReloadPaths(const char *filename) { EAXJMP(0x476DB0); }
+
char CFileLoader::ms_line[256];
const char*
diff --git a/src/core/FileLoader.h b/src/core/FileLoader.h
index f9121ace..c3f5fe52 100644
--- a/src/core/FileLoader.h
+++ b/src/core/FileLoader.h
@@ -39,4 +39,6 @@ public:
static void LoadPickup(const char *line);
static void LoadMapZones(const char *filename);
+
+ static void ReloadPaths(const char *filename);
};
diff --git a/src/core/Fire.cpp b/src/core/Fire.cpp
index 2181f91c..0317ccbe 100644
--- a/src/core/Fire.cpp
+++ b/src/core/Fire.cpp
@@ -32,4 +32,5 @@ CFire* CFireManager::FindNearestFire(CVector vecPos, float* pDistance)
}
WRAPPER void CFireManager::StartFire(CEntity *entityOnFire, CEntity *culprit, float, uint32) { EAXJMP(0x479590); }
+WRAPPER void CFireManager::Update(void) { EAXJMP(0x479310); }
WRAPPER CFire *CFireManager::FindFurthestFire_NeverMindFireMen(CVector coors, float, float) { EAXJMP(0x479430); }
diff --git a/src/core/Fire.h b/src/core/Fire.h
index 5080fd89..c752b2a6 100644
--- a/src/core/Fire.h
+++ b/src/core/Fire.h
@@ -31,6 +31,7 @@ class CFireManager
CFire m_aFires[NUM_FIRES];
public:
void StartFire(CEntity *entityOnFire, CEntity *culprit, float, uint32);
+ void Update(void);
CFire *FindFurthestFire_NeverMindFireMen(CVector coors, float, float);
CFire *FindNearestFire(CVector, float*);
uint32 GetTotalActiveFires() const { return m_nTotalFires; }
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
diff --git a/src/core/Game.h b/src/core/Game.h
index 3bc3e633..dca38bdb 100644
--- a/src/core/Game.h
+++ b/src/core/Game.h
@@ -30,6 +30,7 @@ public:
static void FinalShutdown(void);
static void ShutDownForRestart(void);
static void Process(void);
+ static void ReloadIPLs(void);
// NB: these do something on PS2
static void TidyUpMemory(bool, bool) {}
diff --git a/src/core/User.cpp b/src/core/User.cpp
index 890efcd6..693333b7 100644
--- a/src/core/User.cpp
+++ b/src/core/User.cpp
@@ -15,6 +15,8 @@ CCurrentVehicle& CUserDisplay::CurrentVehicle = *(CCurrentVehicle*)0x8F5FE8;
WRAPPER void CPager::AddMessage(wchar*, uint16, uint16, uint16) { EAXJMP(0x52B940); }
+WRAPPER void CUserDisplay::Process(void) { EAXJMP(0x4AD690); }
+
void COnscreenTimer::Init() {
m_bDisabled = false;
for(uint32 i = 0; i < NUMONSCREENTIMERENTRIES; i++) {
diff --git a/src/core/User.h b/src/core/User.h
index cac2a318..27bb7f9e 100644
--- a/src/core/User.h
+++ b/src/core/User.h
@@ -63,4 +63,6 @@ public:
static COnscreenTimer &OnscnTimer;
static CPager &Pager;
static CCurrentVehicle &CurrentVehicle;
+
+ static void Process(void);
};
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 3a8367f1..5dea09bd 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -39,6 +39,8 @@ bool &CWorld::bDoingCarCollisions = *(bool*)0x95CD8C;
bool &CWorld::bIncludeCarTyres = *(bool*)0x95CDAA;
WRAPPER void CWorld::ShutDown(void) { EAXJMP(0x4AE450); }
+WRAPPER void CWorld::RepositionCertainDynamicObjects() { EAXJMP(0x4B42B0); }
+WRAPPER void CWorld::RemoveStaticObjects() { EAXJMP(0x4B4D50); }
WRAPPER void CWorld::RemoveReferencesToDeletedObject(CEntity*) { EAXJMP(0x4B3BF0); }
WRAPPER void CWorld::FindObjectsKindaColliding(const CVector &, float, bool, int16*, int16, CEntity **, bool, bool, bool, bool, bool){ EAXJMP(0x4B2A30); }
WRAPPER void CWorld::ClearExcitingStuffFromArea(const CVector &pos, float radius, uint8) { EAXJMP(0x4B4E70) };
diff --git a/src/core/World.h b/src/core/World.h
index f420207c..a1aa0376 100644
--- a/src/core/World.h
+++ b/src/core/World.h
@@ -122,6 +122,8 @@ public:
static void Initialise();
static void ShutDown();
+ static void RepositionCertainDynamicObjects();
+ static void RemoveStaticObjects();
static void Process();
};