serialization stuff
This commit is contained in:
@@ -42,8 +42,7 @@ namespace Puzzle
|
||||
void LoadStaticPuzzleData()
|
||||
{
|
||||
Deserializer ser;
|
||||
ser.Init("game/data/static/puzzle.dat");
|
||||
if (ser.ReadT("SPUZ", StaticData))
|
||||
if (ser.Init("game/data/static/puzzle.dat", "SPUZ") && ser.ReadT(StaticData))
|
||||
{
|
||||
LOG("Successfully loaded static puzzle data!");
|
||||
}
|
||||
@@ -54,8 +53,7 @@ namespace Puzzle
|
||||
{
|
||||
auto& data = GetStaticPuzzleData();
|
||||
Serializer ser;
|
||||
ser.Init("game/data/static/puzzle.dat");
|
||||
if (ser.WriteT("SPUZ", GetStaticPuzzleData()))
|
||||
if (ser.Init("game/data/static/puzzle.dat", "SPUZ") && ser.WriteT(GetStaticPuzzleData()))
|
||||
{
|
||||
LOG("Successfully saved static puzzle data!");
|
||||
}
|
||||
@@ -576,8 +574,7 @@ namespace Puzzle
|
||||
char path[128]{0};
|
||||
WritePuzzleFilePath(path, sizeof(path), obj.ID);
|
||||
Serializer ser;
|
||||
ser.Init(path);
|
||||
if (ser.WriteT("PZZL", obj))
|
||||
if (ser.Init(path, "PZZL") && ser.WriteT(obj))
|
||||
{
|
||||
LOG("Saved to %s", path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user