- put the state pointer serializer in a virtual function so that types.cpp can operate without any knowledge of Doom states.

This commit is contained in:
Christoph Oelckers 2020-04-11 19:30:09 +02:00
commit ef8b4c7d5e
5 changed files with 78 additions and 51 deletions

View file

@ -165,6 +165,27 @@ FSerializer &FDoomSerializer::Sprite(const char *key, int32_t &spritenum, int32_
return *this;
}
//==========================================================================
//
//
//
//==========================================================================
FSerializer& FDoomSerializer::StatePointer(const char* key, void* ptraddr, bool *res)
{
if (isWriting())
{
if (res) *res = true;
(*this)(key, *(FState**)ptraddr);
}
else
{
::Serialize(*this, key, *(FState**)ptraddr, nullptr, res);
}
return *this;
}
template<> FSerializer &Serialize(FSerializer &ar, const char *key, FPolyObj *&value, FPolyObj **defval)
{