summaryrefslogtreecommitdiffstats
path: root/src/save/GenericGameStorage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/save/GenericGameStorage.cpp')
-rw-r--r--src/save/GenericGameStorage.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp
index 52c1aef7..90e7e122 100644
--- a/src/save/GenericGameStorage.cpp
+++ b/src/save/GenericGameStorage.cpp
@@ -37,9 +37,11 @@
#include "Weather.h"
#include "World.h"
#include "Zones.h"
+#include "Timecycle.h"
+#include "Fluff.h"
#define BLOCK_COUNT 20
-#define SIZE_OF_SIMPLEVARS 0xBC
+#define SIZE_OF_SIMPLEVARS 0xD4
const uint32 SIZE_OF_ONE_GAME_IN_BYTES = 201729;
@@ -56,7 +58,7 @@ wchar SlotSaveDate[SLOT_COUNT][70];
int CheckSum;
eLevelName m_LevelToLoad;
char SaveFileNameJustSaved[260];
-int Slots[SLOT_COUNT+1];
+int Slots[SLOT_COUNT];
CDate CompileDateAndTime;
bool b_FoundRecentSavedGameWantToLoad;
@@ -187,6 +189,14 @@ GenericSave(int file)
WriteDataToBufferPointer(buf, TheCamera.CarZoomIndicator);
WriteDataToBufferPointer(buf, TheCamera.PedZoomIndicator);
#endif
+ WriteDataToBufferPointer(buf, CGame::currArea);
+ WriteDataToBufferPointer(buf, CVehicle::bAllTaxisHaveNitro);
+ // TODO(Miami): Pad invert Y
+ bool invertY = 0;
+ WriteDataToBufferPointer(buf, invertY);
+ WriteDataToBufferPointer(buf, CTimeCycle::m_ExtraColour);
+ WriteDataToBufferPointer(buf, CTimeCycle::m_bExtraColourOn);
+ WriteDataToBufferPointer(buf, CTimeCycle::m_ExtraColourInter);
assert(buf - work_buff == SIZE_OF_SIMPLEVARS);
// Save scripts, block is nested within the same block as simple vars for some reason
@@ -217,6 +227,7 @@ GenericSave(int file)
WriteSaveDataBlock(CTheCarGenerators::SaveAllCarGenerators);
WriteSaveDataBlock(CParticleObject::SaveParticle);
WriteSaveDataBlock(cAudioScriptObject::SaveAllAudioScriptObjects);
+ WriteSaveDataBlock(CScriptPaths::Save);
WriteSaveDataBlock(CWorld::Players[CWorld::PlayerInFocus].SavePlayerInfo);
WriteSaveDataBlock(CStats::SaveStats);
WriteSaveDataBlock(CSetPieces::Save);
@@ -315,6 +326,14 @@ GenericLoad()
ReadDataFromBufferPointer(buf, TheCamera.CarZoomIndicator);
ReadDataFromBufferPointer(buf, TheCamera.PedZoomIndicator);
#endif
+ ReadDataFromBufferPointer(buf, CGame::currArea);
+ ReadDataFromBufferPointer(buf, CVehicle::bAllTaxisHaveNitro);
+ // TODO(Miami): Pad invert Y
+ bool invertY = 0;
+ ReadDataFromBufferPointer(buf, invertY);
+ ReadDataFromBufferPointer(buf, CTimeCycle::m_ExtraColour);
+ ReadDataFromBufferPointer(buf, CTimeCycle::m_bExtraColourOn);
+ ReadDataFromBufferPointer(buf, CTimeCycle::m_ExtraColourInter);
assert(buf - work_buff == SIZE_OF_SIMPLEVARS);
#ifdef MISSION_REPLAY
WaitForSave = 0;
@@ -360,6 +379,8 @@ GenericLoad()
LoadSaveDataBlock();
ReadDataFromBlock("Loading AudioScript Objects \n", cAudioScriptObject::LoadAllAudioScriptObjects);
LoadSaveDataBlock();
+ ReadDataFromBlock("Loading ScriptPaths \n", CScriptPaths::Load);
+ LoadSaveDataBlock();
ReadDataFromBlock("Loading Player Info \n", CWorld::Players[CWorld::PlayerInFocus].LoadPlayerInfo);
LoadSaveDataBlock();
ReadDataFromBlock("Loading Stats \n", CStats::LoadStats);