From fa4dbcab35733bb0b760cdb24a7d74b285360eb0 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Tue, 14 Jan 2020 01:13:42 +0200 Subject: save --- src/save/GenericGameStorage.h | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/save/GenericGameStorage.h (limited to 'src/save/GenericGameStorage.h') diff --git a/src/save/GenericGameStorage.h b/src/save/GenericGameStorage.h new file mode 100644 index 00000000..86861e5e --- /dev/null +++ b/src/save/GenericGameStorage.h @@ -0,0 +1,55 @@ +#pragma once + +#include "PCSave.h" + +class CDate +{ +public: + int m_nSecond; + int m_nMinute; + int m_nHour; + int m_nDay; + int m_nMonth; + int m_nYear; + + CDate(); + bool operator>(const CDate &right); + bool operator<(const CDate &right); + bool operator==(const CDate &right); + void PopulateDateFields(int8 &second, int8 &minute, int8 &hour, int8 &day, int8 &month, int16 year); +}; + +#define SLOT_COUNT (8) + +bool GenericSave(int file); +bool GenericLoad(); +bool ReadInSizeofSaveFileBuffer(int32 &file, uint32 &size); +bool ReadDataFromFile(int32 file, uint8 *buf, uint32 size); +bool CloseFile(int32 file); +void DoGameSpecificStuffAfterSucessLoad(); +bool CheckSlotDataValid(int32 slot); +void MakeSpaceForSizeInBufferPointer(uint8 *&presize, uint8 *&buf, uint8 *&postsize); +void CopySizeAndPreparePointer(uint8 *&buf, uint8 *&postbuf, uint8 *&postbuf2, uint32 &unused, uint32 &size); +void DoGameSpecificStuffBeforeSave(); +void MakeValidSaveName(int32 slot); +wchar *GetSavedGameDateAndTime(int32 slot); +wchar *GetNameOfSavedGame(int32 slot); +bool CheckDataNotCorrupt(int32 slot, char *name); +bool RestoreForStartLoad(); +int align4bytes(int32 size); + +extern CDate& CompileDateAndTime; + +extern char (&DefaultPCSaveFileName)[260]; +extern char (&ValidSaveName)[260]; +extern char (&LoadFileName)[256]; +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 char SaveFileNameJustSaved[260]; // 8F2570 + +const char TopLineEmptyFile[] = "THIS FILE IS NOT VALID YET"; +extern C_PcSave &PcSaveHelper; \ No newline at end of file -- cgit v1.2.3 From c6b6e9d0df11d408a14e7ea7bbe114e4726e23b8 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Tue, 28 Jan 2020 00:16:38 +0200 Subject: CDate separated --- src/save/GenericGameStorage.h | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/save/GenericGameStorage.h') diff --git a/src/save/GenericGameStorage.h b/src/save/GenericGameStorage.h index 86861e5e..b8be1e79 100644 --- a/src/save/GenericGameStorage.h +++ b/src/save/GenericGameStorage.h @@ -2,23 +2,6 @@ #include "PCSave.h" -class CDate -{ -public: - int m_nSecond; - int m_nMinute; - int m_nHour; - int m_nDay; - int m_nMonth; - int m_nYear; - - CDate(); - bool operator>(const CDate &right); - bool operator<(const CDate &right); - bool operator==(const CDate &right); - void PopulateDateFields(int8 &second, int8 &minute, int8 &hour, int8 &day, int8 &month, int16 year); -}; - #define SLOT_COUNT (8) bool GenericSave(int file); @@ -38,7 +21,7 @@ bool CheckDataNotCorrupt(int32 slot, char *name); bool RestoreForStartLoad(); int align4bytes(int32 size); -extern CDate& CompileDateAndTime; +extern class CDate& CompileDateAndTime; extern char (&DefaultPCSaveFileName)[260]; extern char (&ValidSaveName)[260]; -- cgit v1.2.3