diff options
Diffstat (limited to 'src/save')
-rw-r--r-- | src/save/GenericGameStorage.cpp | 27 | ||||
-rw-r--r-- | src/save/GenericGameStorage.h | 3 |
2 files changed, 29 insertions, 1 deletions
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp index 90e7e122..b38f1bd9 100644 --- a/src/save/GenericGameStorage.cpp +++ b/src/save/GenericGameStorage.cpp @@ -41,7 +41,7 @@ #include "Fluff.h" #define BLOCK_COUNT 20 -#define SIZE_OF_SIMPLEVARS 0xD4 +#define SIZE_OF_SIMPLEVARS 0xFC const uint32 SIZE_OF_ONE_GAME_IN_BYTES = 201729; @@ -67,6 +67,28 @@ bool StillToFadeOut; uint32 TimeStartedCountingForFade; uint32 TimeToStayFadedBeforeFadeOut = 1750; +uint32 RadioStationPosition[NUM_RADIOS]; + +void +InitRadioStationPositionList() +{ + for (int i = 0; i < NUM_RADIOS; i++) + RadioStationPosition[i] = 0; +} + +uint32 +GetSavedRadioStationPosition(int32 station) +{ + return RadioStationPosition[station]; +} + +void +PopulateRadioStationPositionList() +{ + for (int i = 0; i < NUM_RADIOS; i++) + RadioStationPosition[i] = DMAudio.GetRadioPosition(i); +} + #define ReadDataFromBufferPointer(buf, to) memcpy(&to, buf, sizeof(to)); buf += align4bytes(sizeof(to)); #define WriteDataToBufferPointer(buf, from) memcpy(buf, &from, sizeof(from)); buf += align4bytes(sizeof(from)); @@ -197,6 +219,8 @@ GenericSave(int file) WriteDataToBufferPointer(buf, CTimeCycle::m_ExtraColour); WriteDataToBufferPointer(buf, CTimeCycle::m_bExtraColourOn); WriteDataToBufferPointer(buf, CTimeCycle::m_ExtraColourInter); + PopulateRadioStationPositionList(); + WriteDataToBufferPointer(buf, RadioStationPosition); assert(buf - work_buff == SIZE_OF_SIMPLEVARS); // Save scripts, block is nested within the same block as simple vars for some reason @@ -334,6 +358,7 @@ GenericLoad() ReadDataFromBufferPointer(buf, CTimeCycle::m_ExtraColour); ReadDataFromBufferPointer(buf, CTimeCycle::m_bExtraColourOn); ReadDataFromBufferPointer(buf, CTimeCycle::m_ExtraColourInter); + ReadDataFromBufferPointer(buf, RadioStationPosition); 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 630b3b50..236e34f5 100644 --- a/src/save/GenericGameStorage.h +++ b/src/save/GenericGameStorage.h @@ -5,6 +5,9 @@ #define SLOT_COUNT (8) +void InitRadioStationPositionList(); +uint32 GetSavedRadioStationPosition(int32 station); +void PopulateRadioStationPositionList(); bool GenericSave(int file); bool GenericLoad(); bool ReadInSizeofSaveFileBuffer(int32 &file, uint32 &size); |