summaryrefslogtreecommitdiffstats
path: root/src/save
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-09-09 18:37:44 +0200
committerSergeanur <s.anureev@yandex.ua>2020-09-09 18:37:44 +0200
commit4f4b1f914540465a77aa8daf7e837042a96b3e31 (patch)
tree56fe4ae390e58e8a0d8f39ce555a382bdf635bbe /src/save
parentMore stinger fix (diff)
downloadre3-4f4b1f914540465a77aa8daf7e837042a96b3e31.tar
re3-4f4b1f914540465a77aa8daf7e837042a96b3e31.tar.gz
re3-4f4b1f914540465a77aa8daf7e837042a96b3e31.tar.bz2
re3-4f4b1f914540465a77aa8daf7e837042a96b3e31.tar.lz
re3-4f4b1f914540465a77aa8daf7e837042a96b3e31.tar.xz
re3-4f4b1f914540465a77aa8daf7e837042a96b3e31.tar.zst
re3-4f4b1f914540465a77aa8daf7e837042a96b3e31.zip
Diffstat (limited to 'src/save')
-rw-r--r--src/save/GenericGameStorage.cpp27
-rw-r--r--src/save/GenericGameStorage.h3
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);