From 54eec618287f90103055c00c7a76119b22c6f746 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 30 Nov 2020 01:08:19 +0100 Subject: [PATCH] - Exhumed: Init --- source/exhumed/src/init.cpp | 43 ++++++++++++++++++++----------------- source/exhumed/src/save.cpp | 2 ++ 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/source/exhumed/src/init.cpp b/source/exhumed/src/init.cpp index 75020af58..07c9e279d 100644 --- a/source/exhumed/src/init.cpp +++ b/source/exhumed/src/init.cpp @@ -909,25 +909,28 @@ void LoadObjects() nCameraz = initz; } - -static SavegameHelper sghinit("init", - SV(initx), - SV(inity), - SV(initz), - SV(inita), - SV(initsect), - SV(nCurChunkNum), - SA(nBodyGunSprite), - SV(nCurBodyGunNum), - SA(SectSoundSect), - SA(SectSound), - SA(SectFlag), - SA(SectDepth), - SA(SectAbove), - SA(SectDamage), - SA(SectSpeed), - SA(SectBelow), - nullptr); - +void SerializeInit(FSerializer& arc) +{ + if (arc.BeginObject("init")) + { + arc("initx", initx) + ("inity", inity) + ("initz", initz) + ("inita", inita) + ("initsect", initsect) + ("curchunk", nCurChunkNum) + .Array("bodygunsprite", nBodyGunSprite, countof(nBodyGunSprite)) + ("curbodygun", nCurBodyGunNum) + .Array("soundsect", SectSoundSect, numsectors) + .Array("sectsound", SectSound, numsectors) + .Array("sectflag", SectFlag, numsectors) + .Array("sectdepth", SectDepth, numsectors) + .Array("sectabove", SectAbove, numsectors) + .Array("sectdamage", SectDamage, numsectors) + .Array("sectspeed", SectSpeed, numsectors) + .Array("sectbelow", SectBelow, numsectors) + .EndObject(); + } +} END_PS_NS diff --git a/source/exhumed/src/save.cpp b/source/exhumed/src/save.cpp index 494b31bcd..5153ea3c1 100644 --- a/source/exhumed/src/save.cpp +++ b/source/exhumed/src/save.cpp @@ -32,6 +32,7 @@ BEGIN_PS_NS void SerializeAnim(FSerializer& arc); void SerializeBubbles(FSerializer& arc); void SerializeGun(FSerializer& arc); +void SerializeInit(FSerializer& arc); void SerializeItems(FSerializer& arc); void SerializeMove(FSerializer& arc); void SerializeLighting(FSerializer& arc); @@ -78,6 +79,7 @@ void GameInterface::SerializeGameState(FSerializer& arc) SerializeAnim(arc); SerializeBubbles(arc); SerializeGun(arc); + SerializeInit(arc); SerializeItems(arc); SerializeMove(arc); SerializeLighting(arc);