- extended walltype to directly manage Blood's XWALL.

Unfortunately this had to be done in the base class so that we can still maintain the walls in a global array.
The tradeoffs of better abstractions would be far too costly here than the added 16 bytes to the wall struct.
This commit is contained in:
Christoph Oelckers 2021-11-20 17:01:59 +01:00
parent 6217623c24
commit 94a37dfcdc
11 changed files with 301 additions and 262 deletions

View file

@ -46,6 +46,7 @@
#include "render.h"
#include "hw_sections.h"
#include "interpolate.h"
#include "games/blood/src/mapstructs.h"
// needed for skipping over to get the map size first.
enum
@ -58,6 +59,16 @@ enum
wallsize7 = 32,
};
// This arena stores the larger allocated game-specific extension data. Since this can be freed in bulk a memory arena is better suited than malloc.
static FMemArena mapDataArena;
void walltype::allocX()
{
using XWALL = BLD_NS::XWALL;
_xw = (XWALL*)mapDataArena.Alloc(sizeof(XWALL));
memset(_xw, 0, sizeof(XWALL));
}
static void ReadSectorV7(FileReader& fr, sectortype& sect)
{