diff options
author | Roman Masanin <36927roma@gmail.com> | 2020-09-13 20:45:53 +0200 |
---|---|---|
committer | Roman Masanin <36927roma@gmail.com> | 2020-09-13 20:45:53 +0200 |
commit | 8f948228d5e60eb89055a8d40210e99e9f4f2c47 (patch) | |
tree | ee8c238c77e53e29c650d911e9d198452f5a7ba9 /src/save | |
parent | vehicle audio(first part) and temp fix for openAL (diff) | |
parent | Merge pull request #702 from Sergeanur/VC/MusicManager (diff) | |
download | re3-8f948228d5e60eb89055a8d40210e99e9f4f2c47.tar re3-8f948228d5e60eb89055a8d40210e99e9f4f2c47.tar.gz re3-8f948228d5e60eb89055a8d40210e99e9f4f2c47.tar.bz2 re3-8f948228d5e60eb89055a8d40210e99e9f4f2c47.tar.lz re3-8f948228d5e60eb89055a8d40210e99e9f4f2c47.tar.xz re3-8f948228d5e60eb89055a8d40210e99e9f4f2c47.tar.zst re3-8f948228d5e60eb89055a8d40210e99e9f4f2c47.zip |
Diffstat (limited to '')
-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); |