- 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 nFirstRegenerate;
short nMagicCount; short nMagicCount;
static SavegameHelper sghitems("items", void SerializeItems(FSerializer& arc)
SV(nRegenerates), {
SV(nFirstRegenerate), if (arc.BeginObject("items"))
SV(nMagicCount), {
nullptr); arc("regenerates", nRegenerates)
("first", nFirstRegenerate)
("magiccount", nMagicCount)
.EndObject();
}
}
void BuildItemAnim(short nSprite) void BuildItemAnim(short nSprite)
{ {

View file

@ -53,21 +53,38 @@ BlockInfo sBlockInfo[kMaxPushBlocks];
short nChunkSprite[kMaxMoveChunks]; 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", void SerializeMove(FSerializer& arc)
SV(nPushBlocks), {
SV(overridesect), if (arc.BeginObject("move"))
SV(NearCount), {
SV(hihit), arc("nearcount", NearCount)
SV(sprceiling), .Array("nearsector", NearSector, NearCount)
SV(sprfloor), ("pushcount", nPushBlocks)
SV(lohit), .Array("blocks", sBlockInfo, nPushBlocks)
SA(nBodySprite), ("chunkcount", nCurChunkNum)
SA(NearSector), .Array("chunks", nChunkSprite, kMaxMoveChunks)
SA(sBlockInfo), ("overridesect", overridesect)
SA(nChunkSprite), ("hihit", hihit)
nullptr); ("lohit", lohit)
("sprceiling", sprceiling)
("sprfloor", sprfloor)
.Array("bodysprite", nBodySprite, 50)
.EndObject();
}
}
signed int lsqrt(int a1) 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 BEGIN_PS_NS
void SerializeAnim(FSerializer& arc); void SerializeAnim(FSerializer& arc);
void SerializeItems(FSerializer& arc);
void SerializeMove(FSerializer& arc);
void SerializeObjects(FSerializer& arc); void SerializeObjects(FSerializer& arc);
void SerializePlayer(FSerializer& arc); void SerializePlayer(FSerializer& arc);
void SerializeRa(FSerializer& arc); void SerializeRa(FSerializer& arc);
@ -71,6 +73,8 @@ void GameInterface::SerializeGameState(FSerializer& arc)
if (arc.BeginObject("exhumed")) if (arc.BeginObject("exhumed"))
{ {
SerializeAnim(arc); SerializeAnim(arc);
SerializeItems(arc);
SerializeMove(arc);
SerializeObjects(arc); SerializeObjects(arc);
SerializePlayer(arc); SerializePlayer(arc);
SerializeRa(arc); SerializeRa(arc);