Add EasyRPG specific savedata version chunk
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -37,11 +37,11 @@ add_library(lcf
src/encoder.cpp
src/encoder.h
src/enum_tags.h
+ src/flag_set.h
src/ini.cpp
src/ini.h
src/inireader.cpp
src/inireader.h
- src/flag_set.h
src/lcf_options.h
src/lcf_saveopt.h
src/ldb_equipment.cpp
@@ -126,6 +126,7 @@ add_library(lcf
src/generated/lsd_save.cpp
src/generated/lsd_saveactor.cpp
src/generated/lsd_savecommonevent.cpp
+ src/generated/lsd_saveeasyrpgdata.cpp
src/generated/lsd_saveeventcommands.cpp
src/generated/lsd_saveeventdata.cpp
src/generated/lsd_saveinventory.cpp
@@ -179,6 +180,7 @@ add_library(lcf
src/generated/rpg_save.h
src/generated/rpg_saveactor.h
src/generated/rpg_savecommonevent.h
+ src/generated/rpg_saveeasyrpgdata.h
src/generated/rpg_saveeventcommands.h
src/generated/rpg_saveeventdata.h
src/generated/rpg_saveinventory.h

MODIFY
Makefile.am
Makefile.am
@@ -99,6 +99,7 @@ liblcf_la_SOURCES = \
src/generated/lsd_save.cpp \
src/generated/lsd_saveactor.cpp \
src/generated/lsd_savecommonevent.cpp \
+ src/generated/lsd_saveeasyrpgdata.cpp \
src/generated/lsd_saveeventcommands.cpp \
src/generated/lsd_saveeventdata.cpp \
src/generated/lsd_saveinventory.cpp \
@@ -184,6 +185,7 @@ pkginclude_HEADERS = \
src/generated/rpg_save.h \
src/generated/rpg_saveactor.h \
src/generated/rpg_savecommonevent.h \
+ src/generated/rpg_saveeasyrpgdata.h \
src/generated/rpg_saveeventcommands.h \
src/generated/rpg_saveeventdata.h \
src/generated/rpg_saveinventory.h \

ADD
generator/csv/fields_easyrpg.csv
+#Structure,Field,Size Field?,Type,Index,Default Value,PersistIfDefault,Is2k3,Comment
+Save,easyrpg_data,f,SaveEasyRpgData,0xc8,,0,0,Additional save data written by EasyRPG Player
+SaveEasyRpgData,version,,Int32,1,0,0,0,Savegame version

ADD
generator/csv/structs_easyrpg.csv
+#Type,Structure,Base,Index available?
+lsd,SaveEasyRpgData,,0

MODIFY
generator/generate.py
generator/generate.py
@@ -410,8 +410,8 @@ def main(argv):
global structs, sfields, enums, flags, setup, constants, headers
global chunk_tmpl, lcf_struct_tmpl, rpg_header_tmpl, rpg_source_tmpl, flags_tmpl, enums_tmpl
- structs = get_structs('structs.csv')
- sfields = get_fields('fields.csv')
+ structs = get_structs('structs.csv','structs_easyrpg.csv')
+ sfields = get_fields('fields.csv','fields_easyrpg.csv')
enums = get_enums('enums.csv')
flags = get_flags('flags.csv')
setup = get_setup('setup.csv')

MODIFY
src/generated/lsd_chunks.h
src/generated/lsd_chunks.h
Binary files a/src/generated/lsd_chunks.h and b/src/generated/lsd_chunks.h differ

MODIFY
src/generated/lsd_save.cpp
src/generated/lsd_save.cpp
Binary files a/src/generated/lsd_save.cpp and b/src/generated/lsd_save.cpp differ

ADD
src/generated/lsd_saveeasyrpgdata.cpp
src/generated/lsd_saveeasyrpgdata.cpp
Binary files /dev/null and b/src/generated/lsd_saveeasyrpgdata.cpp differ

MODIFY
src/generated/rpg_save.h
src/generated/rpg_save.h
Binary files a/src/generated/rpg_save.h and b/src/generated/rpg_save.h differ

ADD
src/generated/rpg_saveeasyrpgdata.h
src/generated/rpg_saveeasyrpgdata.h
Binary files /dev/null and b/src/generated/rpg_saveeasyrpgdata.h differ

MODIFY
src/lsd_reader.cpp
src/lsd_reader.cpp
@@ -32,12 +32,12 @@ double LSD_Reader::GenerateTimestamp(std::time_t const t) {
return ToTDateTime(t);
}
-void LSD_Reader::PrepareSave(RPG::Save& save) {
+void LSD_Reader::PrepareSave(RPG::Save& save, int32_t version) {
++save.system.save_count;
save.title.timestamp = LSD_Reader::GenerateTimestamp();
+ save.easyrpg_data.version = version;
}
-
std::unique_ptr<RPG::Save> LSD_Reader::Load(const std::string& filename, const std::string& encoding) {
std::ifstream stream(filename.c_str(), std::ios::binary);
if (!stream.is_open()) {

MODIFY
src/lsd_reader.h
src/lsd_reader.h
#include <vector>
#include <memory>
#include <ctime>
+#include <stdint.h>
#include "rpg_save.h"
/**
@@ -25,7 +26,6 @@ namespace LSD_Reader {
*/
double ToTDateTime(std::time_t const t);
-
/**
* Converts from Delphi's TDateTime format to UNIX timestamp.
*/
@@ -39,7 +39,7 @@ namespace LSD_Reader {
/**
* Increment the save save_count and update the timestamp.
*/
- void PrepareSave(RPG::Save& save);
+ void PrepareSave(RPG::Save& save, int32_t version = 0);
/**
* Returns a copy of the save data with defaults cleared.

Add EasyRPG specific savedata version chunk