mirror of
https://github.com/ZDoom/Raze.git
synced 2025-06-02 10:11:04 +00:00
- implemented the automap serializer.
Also optimized the base64 encoder to avoid creating endless memory copies, thanks to using std::string which is a really poor container for this kind of stuff when workig with larger blocks of data.
This commit is contained in:
parent
809f8b5d4b
commit
e8452a79e8
8 changed files with 115 additions and 46 deletions
|
@ -32,6 +32,7 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
|
|||
#include "c_cvars.h"
|
||||
#include "gstrings.h"
|
||||
#include "printf.h"
|
||||
#include "serializer.h"
|
||||
|
||||
|
||||
bool automapping;
|
||||
|
@ -40,6 +41,27 @@ FixedBitArray<MAXSECTORS> show2dsector;
|
|||
FixedBitArray<MAXWALLS> show2dwall;
|
||||
FixedBitArray<MAXSPRITES> show2dsprite;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void SerializeAutomap(FSerializer& arc)
|
||||
{
|
||||
if (arc.BeginObject("automap"))
|
||||
{
|
||||
arc("automapping", automapping)
|
||||
("fullmap", gFullMap)
|
||||
// Only store what's needed. Unfortunately for sprites it is not that easy
|
||||
.SerializeMemory("mappedsectors", show2dsector.Storage(), (numsectors + 7) / 8)
|
||||
.SerializeMemory("mappedwalls", show2dwall.Storage(), (numwalls + 7) / 8)
|
||||
.SerializeMemory("mappedsprites", show2dsprite.Storage(), MAXSPRITES / 8)
|
||||
.EndObject();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue