summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorWes Hampson <thehambone93@gmail.com>2020-03-11 04:25:50 +0100
committerWes Hampson <thehambone93@gmail.com>2020-03-11 04:26:07 +0100
commit28342405d37ae28fdf98546753e89d683480914f (patch)
tree3a7d990f29f9882cb180f14034078db107130206 /src/core
parentBegin work on GenericSave (diff)
downloadre3-28342405d37ae28fdf98546753e89d683480914f.tar
re3-28342405d37ae28fdf98546753e89d683480914f.tar.gz
re3-28342405d37ae28fdf98546753e89d683480914f.tar.bz2
re3-28342405d37ae28fdf98546753e89d683480914f.tar.lz
re3-28342405d37ae28fdf98546753e89d683480914f.tar.xz
re3-28342405d37ae28fdf98546753e89d683480914f.tar.zst
re3-28342405d37ae28fdf98546753e89d683480914f.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Clock.h2
-rw-r--r--src/core/Pools.cpp39
-rw-r--r--src/core/Pools.h6
-rw-r--r--src/core/Timer.h3
4 files changed, 32 insertions, 18 deletions
diff --git a/src/core/Clock.h b/src/core/Clock.h
index ea4263bd..6b9908ba 100644
--- a/src/core/Clock.h
+++ b/src/core/Clock.h
@@ -2,6 +2,7 @@
class CClock
{
+public:
static uint8 &ms_nGameClockHours;
static uint8 &ms_nGameClockMinutes;
static uint16 &ms_nGameClockSeconds;
@@ -11,7 +12,6 @@ class CClock
static uint32 &ms_nMillisecondsPerGameMinute;
static uint32 &ms_nLastClockTick;
static bool &ms_bClockHasBeenStored;
-public:
static void Initialise(uint32 scale);
static void Update(void);
diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp
index 8e66b049..75536b88 100644
--- a/src/core/Pools.cpp
+++ b/src/core/Pools.cpp
@@ -14,6 +14,13 @@ CObjectPool *&CPools::ms_pObjectPool = *(CObjectPool**)0x880E28;
CDummyPool *&CPools::ms_pDummyPool = *(CDummyPool**)0x8F2C18;
CAudioScriptObjectPool *&CPools::ms_pAudioScriptObjectPool = *(CAudioScriptObjectPool**)0x8F1B6C;
+WRAPPER void CPools::LoadObjectPool(uint8* buf, uint32 size) { EAXJMP(0x4a2550); }
+WRAPPER void CPools::LoadPedPool(uint8* buf, uint32 size) { EAXJMP(0x4a2b50); }
+WRAPPER void CPools::LoadVehiclePool(uint8* buf, uint32 size) { EAXJMP(0x4a1b40); }
+WRAPPER void CPools::SaveObjectPool(uint8* buf, uint32 *size) { EAXJMP(0x4a22d0); }
+WRAPPER void CPools::SavePedPool(uint8* buf, uint32 *size) { EAXJMP(0x4a29b0); }
+WRAPPER void CPools::SaveVehiclePool(uint8* buf, uint32 *size) { EAXJMP(0x4a2080); }
+
void
CPools::Initialise(void)
{
@@ -30,16 +37,16 @@ CPools::Initialise(void)
void
CPools::ShutDown(void)
-{
- debug("PtrNodes left %d\n", ms_pPtrNodePool->GetNoOfUsedSpaces());
- debug("EntryInfoNodes left %d\n", ms_pEntryInfoNodePool->GetNoOfUsedSpaces());
- debug("Peds left %d\n", ms_pPedPool->GetNoOfUsedSpaces());
- debug("Vehicles left %d\n", ms_pVehiclePool->GetNoOfUsedSpaces());
- debug("Buildings left %d\n", ms_pBuildingPool->GetNoOfUsedSpaces());
- debug("Treadables left %d\n", ms_pTreadablePool->GetNoOfUsedSpaces());
- debug("Objects left %d\n", ms_pObjectPool->GetNoOfUsedSpaces());
- debug("Dummys left %d\n", ms_pDummyPool->GetNoOfUsedSpaces());
- debug("AudioScriptObjects left %d\n", ms_pAudioScriptObjectPool->GetNoOfUsedSpaces());
+{
+ debug("PtrNodes left %d\n", ms_pPtrNodePool->GetNoOfUsedSpaces());
+ debug("EntryInfoNodes left %d\n", ms_pEntryInfoNodePool->GetNoOfUsedSpaces());
+ debug("Peds left %d\n", ms_pPedPool->GetNoOfUsedSpaces());
+ debug("Vehicles left %d\n", ms_pVehiclePool->GetNoOfUsedSpaces());
+ debug("Buildings left %d\n", ms_pBuildingPool->GetNoOfUsedSpaces());
+ debug("Treadables left %d\n", ms_pTreadablePool->GetNoOfUsedSpaces());
+ debug("Objects left %d\n", ms_pObjectPool->GetNoOfUsedSpaces());
+ debug("Dummys left %d\n", ms_pDummyPool->GetNoOfUsedSpaces());
+ debug("AudioScriptObjects left %d\n", ms_pAudioScriptObjectPool->GetNoOfUsedSpaces());
printf("Shutdown pool started\n");
delete ms_pPtrNodePool;
@@ -62,12 +69,12 @@ CVehicle *CPools::GetVehicle(int32 handle) { return ms_pVehiclePool->GetAt(handl
int32 CPools::GetObjectRef(CObject *object) { return ms_pObjectPool->GetIndex(object); }
CObject *CPools::GetObject(int32 handle) { return ms_pObjectPool->GetAt(handle); }
-void
-CPools::CheckPoolsEmpty()
-{
- assert(ms_pPedPool->GetNoOfUsedSpaces() == 0);
- assert(ms_pVehiclePool->GetNoOfUsedSpaces() == 0);
- printf("pools have beem cleared \n");
+void
+CPools::CheckPoolsEmpty()
+{
+ assert(ms_pPedPool->GetNoOfUsedSpaces() == 0);
+ assert(ms_pVehiclePool->GetNoOfUsedSpaces() == 0);
+ printf("pools have been cleared\n");
}
diff --git a/src/core/Pools.h b/src/core/Pools.h
index 862062ee..74b87585 100644
--- a/src/core/Pools.h
+++ b/src/core/Pools.h
@@ -52,4 +52,10 @@ public:
static CObject *GetObject(int32 handle);
static void CheckPoolsEmpty();
static void MakeSureSlotInObjectPoolIsEmpty(int32 slot);
+ static void LoadObjectPool(uint8 *buf, uint32 size);
+ static void LoadPedPool(uint8 *buf, uint32 size);
+ static void LoadVehiclePool(uint8 *buf, uint32 size);
+ static void SaveObjectPool(uint8 *buf, uint32 *size);
+ static void SavePedPool(uint8 *buf, uint32 *size);
+ static void SaveVehiclePool(uint8 *buf, uint32 *size);
};
diff --git a/src/core/Timer.h b/src/core/Timer.h
index 8f3b77c2..89c4a430 100644
--- a/src/core/Timer.h
+++ b/src/core/Timer.h
@@ -2,6 +2,7 @@
class CTimer
{
+public:
static uint32 &m_snTimeInMilliseconds;
static uint32 &m_snTimeInMillisecondsPauseMode;
static uint32 &m_snTimeInMillisecondsNonClipped;
@@ -12,7 +13,7 @@ class CTimer
static float &ms_fTimeStepNonClipped;
static bool &m_UserPause;
static bool &m_CodePause;
-public:
+
static float GetTimeStep(void) { return ms_fTimeStep; }
static void SetTimeStep(float ts) { ms_fTimeStep = ts; }
static float GetTimeStepInSeconds() { return ms_fTimeStep / 50.0f; }