- serialization support for BitArray.

This commit is contained in:
Christoph Oelckers 2021-11-21 00:24:47 +01:00
parent d5c27e6239
commit 1665e340be
2 changed files with 7 additions and 3 deletions

View file

@ -302,6 +302,11 @@ FSerializer& Serialize(FSerializer& arc, const char* key, FixedBitArray<size>& v
return arc.SerializeMemory(key, value.Storage(), value.StorageSize());
}
inline FSerializer& Serialize(FSerializer& arc, const char* key, BitArray& value, BitArray* def)
{
return arc.SerializeMemory(key, value.Storage().Data(), value.Storage().Size());
}
template<> FSerializer& Serialize(FSerializer& arc, const char* key, PClass*& clst, PClass** def);
template<> FSerializer& Serialize(FSerializer& arc, const char* key, FFont*& font, FFont** def);
template<> FSerializer &Serialize(FSerializer &arc, const char *key, Dictionary *&dict, Dictionary **def);

View file

@ -267,9 +267,8 @@ void SerializeAutomap(FSerializer& arc)
{
arc("automapping", automapping)
("fullmap", gFullMap)
// Only store what's needed. Unfortunately for sprites it is not that easy
.SerializeMemory("mappedsectors", show2dsector.Storage().Data(), (numsectors + 7) / 8)
.SerializeMemory("mappedwalls", show2dwall.Storage().Data(), (numwalls + 7) / 8)
("mappedsectors", show2dsector)
("mappedwalls", show2dwall)
.EndObject();
}
}