diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-08-16 13:46:20 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-08-16 13:46:20 +0200 |
commit | 7669b97ac64bd77dc0932210f81e4a0def9bfb1b (patch) | |
tree | 51c7580701ea00abc769e68d14a83a25b8ebd0cf /src/save | |
parent | submodule (diff) | |
parent | Merge branch 'master' into miami (diff) | |
download | re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.tar re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.tar.gz re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.tar.bz2 re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.tar.lz re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.tar.xz re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.tar.zst re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.zip |
Diffstat (limited to 'src/save')
-rw-r--r-- | src/save/GenericGameStorage.cpp | 21 | ||||
-rw-r--r-- | src/save/GenericGameStorage.h | 2 | ||||
-rw-r--r-- | src/save/PCSave.cpp | 8 |
3 files changed, 24 insertions, 7 deletions
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp index 52c1aef7..4f69123b 100644 --- a/src/save/GenericGameStorage.cpp +++ b/src/save/GenericGameStorage.cpp @@ -37,9 +37,10 @@ #include "Weather.h" #include "World.h" #include "Zones.h" +#include "Timecycle.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 +57,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 +188,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 @@ -315,6 +324,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; diff --git a/src/save/GenericGameStorage.h b/src/save/GenericGameStorage.h index 069ba7cd..630b3b50 100644 --- a/src/save/GenericGameStorage.h +++ b/src/save/GenericGameStorage.h @@ -31,7 +31,7 @@ extern wchar SlotFileName[SLOT_COUNT][260]; extern wchar SlotSaveDate[SLOT_COUNT][70]; extern int CheckSum; extern enum eLevelName m_LevelToLoad; -extern int Slots[SLOT_COUNT+1]; +extern int Slots[SLOT_COUNT]; extern bool b_FoundRecentSavedGameWantToLoad; extern bool JustLoadedDontFadeInYet; diff --git a/src/save/PCSave.cpp b/src/save/PCSave.cpp index da8134fc..8514a2b6 100644 --- a/src/save/PCSave.cpp +++ b/src/save/PCSave.cpp @@ -88,7 +88,7 @@ void C_PcSave::PopulateSlotInfo() { for (int i = 0; i < SLOT_COUNT; i++) { - Slots[i + 1] = SLOT_EMPTY; + Slots[i] = SLOT_EMPTY; SlotFileName[i][0] = '\0'; SlotSaveDate[i][0] = '\0'; } @@ -108,14 +108,14 @@ C_PcSave::PopulateSlotInfo() if (file != 0) { CFileMgr::Read(file, (char*)&header, sizeof(header)); if (strncmp((char*)&header, TopLineEmptyFile, sizeof(TopLineEmptyFile)-1) != 0) { - Slots[i + 1] = SLOT_OK; + Slots[i] = SLOT_OK; memcpy(SlotFileName[i], &header.FileName, sizeof(header.FileName)); SlotFileName[i][24] = '\0'; } CFileMgr::CloseFile(file); } - if (Slots[i + 1] == SLOT_OK) { + if (Slots[i] == SLOT_OK) { if (CheckDataNotCorrupt(i, savename)) { SYSTEMTIME st; memcpy(&st, &header.SaveDateTime, sizeof(SYSTEMTIME)); @@ -147,7 +147,7 @@ C_PcSave::PopulateSlotInfo() } else { CMessages::InsertNumberInString(TheText.Get("FEC_SLC"), i + 1, -1, -1, -1, -1, -1, SlotFileName[i]); - Slots[i + 1] = SLOT_CORRUPTED; + Slots[i] = SLOT_CORRUPTED; } } } |