summaryrefslogtreecommitdiffstats
path: root/src/save/PCSave.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-04-26 21:03:15 +0200
committerSergeanur <s.anureev@yandex.ua>2020-04-26 21:03:15 +0200
commitf0890b11122291a22d6a65f349281cf1aed49bd0 (patch)
tree3b418b522c5fd097abac916693e59808ea4f5b4f /src/save/PCSave.cpp
parentMore japanese (diff)
parentRemove little hack (diff)
downloadre3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.gz
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.bz2
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.lz
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.xz
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.zst
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.zip
Diffstat (limited to '')
-rw-r--r--src/save/PCSave.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/save/PCSave.cpp b/src/save/PCSave.cpp
index 744f5e0d..6f1b1b45 100644
--- a/src/save/PCSave.cpp
+++ b/src/save/PCSave.cpp
@@ -1,6 +1,7 @@
-#define WITHWINDOWS
#include "common.h"
-#include "patcher.h"
+#define USEALTERNATIVEWINFUNCS
+#include "crossplatform.h"
+
#include "FileMgr.h"
#include "GenericGameStorage.h"
#include "Messages.h"
@@ -9,7 +10,7 @@
const char* _psGetUserFilesFolder();
-C_PcSave &PcSaveHelper = *(C_PcSave*)0x8E2C60;
+C_PcSave PcSaveHelper;
void
C_PcSave::SetSaveDirectory(const char *path)
@@ -86,11 +87,15 @@ C_PcSave::PopulateSlotInfo()
SlotSaveDate[i][0] = '\0';
}
for (int i = 0; i < SLOT_COUNT; i++) {
+#ifdef FIX_BUGS
+ char savename[MAX_PATH];
+#else
char savename[52];
+#endif
struct {
int size;
wchar FileName[24];
- _SYSTEMTIME SaveDateTime;
+ SYSTEMTIME SaveDateTime;
} header;
sprintf(savename, "%s%i%s", DefaultPCSaveFileName, i + 1, ".b");
int file = CFileMgr::OpenFile(savename, "rb");
@@ -106,8 +111,8 @@ C_PcSave::PopulateSlotInfo()
}
if (Slots[i + 1] == SLOT_OK) {
if (CheckDataNotCorrupt(i, savename)) {
- _SYSTEMTIME st;
- memcpy(&st, &header.SaveDateTime, sizeof(_SYSTEMTIME));
+ SYSTEMTIME st;
+ memcpy(&st, &header.SaveDateTime, sizeof(SYSTEMTIME));
const char *month;
switch (st.wMonth)
{
@@ -136,11 +141,3 @@ C_PcSave::PopulateSlotInfo()
}
}
}
-
-STARTPATCHES
- InjectHook(0x591EA0, C_PcSave::SetSaveDirectory, PATCH_JUMP);
- InjectHook(0x5922F0, &C_PcSave::DeleteSlot, PATCH_JUMP);
- InjectHook(0x591EC0, &C_PcSave::SaveSlot, PATCH_JUMP);
- InjectHook(0x591F80, &C_PcSave::PcClassSaveRoutine, PATCH_JUMP);
- InjectHook(0x592090, &C_PcSave::PopulateSlotInfo, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file