- Exhumed: items and move.

This commit is contained in:
Christoph Oelckers 2020-11-30 00:51:56 +01:00
parent bb0ef6ff70
commit 83ba046d04
3 changed files with 45 additions and 20 deletions

View file

@ -109,12 +109,16 @@ short nRegenerates;
short nFirstRegenerate;
short nMagicCount;
static SavegameHelper sghitems("items",
SV(nRegenerates),
SV(nFirstRegenerate),
SV(nMagicCount),
nullptr);
void SerializeItems(FSerializer& arc)
{
if (arc.BeginObject("items"))
{
arc("regenerates", nRegenerates)
("first", nFirstRegenerate)
("magiccount", nMagicCount)
.EndObject();
}
}
void BuildItemAnim(short nSprite)
{

View file

@ -53,21 +53,38 @@ BlockInfo sBlockInfo[kMaxPushBlocks];
short nChunkSprite[kMaxMoveChunks];
FSerializer& Serialize(FSerializer& arc, const char* keyname, BlockInfo& w, BlockInfo* def)
{
if (arc.BeginObject(keyname))
{
arc("at8", w.field_8)
("sprite", w.nSprite)
("x", w.x)
("y", w.y)
.EndObject();
}
return arc;
}
static SavegameHelper sghmove("move",
SV(nPushBlocks),
SV(overridesect),
SV(NearCount),
SV(hihit),
SV(sprceiling),
SV(sprfloor),
SV(lohit),
SA(nBodySprite),
SA(NearSector),
SA(sBlockInfo),
SA(nChunkSprite),
nullptr);
void SerializeMove(FSerializer& arc)
{
if (arc.BeginObject("move"))
{
arc("nearcount", NearCount)
.Array("nearsector", NearSector, NearCount)
("pushcount", nPushBlocks)
.Array("blocks", sBlockInfo, nPushBlocks)
("chunkcount", nCurChunkNum)
.Array("chunks", nChunkSprite, kMaxMoveChunks)
("overridesect", overridesect)
("hihit", hihit)
("lohit", lohit)
("sprceiling", sprceiling)
("sprfloor", sprfloor)
.Array("bodysprite", nBodySprite, 50)
.EndObject();
}
}
signed int lsqrt(int a1)
{

View file

@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS
void SerializeAnim(FSerializer& arc);
void SerializeItems(FSerializer& arc);
void SerializeMove(FSerializer& arc);
void SerializeObjects(FSerializer& arc);
void SerializePlayer(FSerializer& arc);
void SerializeRa(FSerializer& arc);
@ -71,6 +73,8 @@ void GameInterface::SerializeGameState(FSerializer& arc)
if (arc.BeginObject("exhumed"))
{
SerializeAnim(arc);
SerializeItems(arc);
SerializeMove(arc);
SerializeObjects(arc);
SerializePlayer(arc);
SerializeRa(arc);