- moved the sidetemp array into the map loader.

This commit is contained in:
Christoph Oelckers 2018-12-28 15:30:23 +01:00
parent 11e9cdae33
commit e66e594dd0
4 changed files with 25 additions and 34 deletions

View file

@ -103,7 +103,6 @@
#include "fragglescript/t_fs.h"
#include "maploader.h"
sidei_t *sidetemp;
TArray<FMapThing> MapThingsConverted;
bool ForceNodeBuild;
@ -1830,7 +1829,7 @@ void MapLoader::LoadLineDefs2 (MapData * map)
Level->sides.Alloc(count);
memset(&Level->sides[0], 0, count * sizeof(side_t));
sidetemp = new sidei_t[MAX<int>(count, Level->vertexes.Size())];
sidetemp.Resize(MAX<int>(count, Level->vertexes.Size()));
for (i = 0; i < count; i++)
{
sidetemp[i].a.special = sidetemp[i].a.tag = 0;
@ -1857,12 +1856,8 @@ void MapLoader::LoopSidedefs (bool firstloop)
{
int i;
if (sidetemp != nullptr)
{
delete[] sidetemp;
}
int numsides = Level->sides.Size();
sidetemp = new sidei_t[MAX<int>(Level->vertexes.Size(), numsides)];
sidetemp.Resize(MAX<int>(Level->vertexes.Size(), numsides));
for (i = 0; i < (int)Level->vertexes.Size(); ++i)
{
@ -3231,8 +3226,4 @@ void MapLoader::LoadLevel(MapData *map, const char *lumpname, int position)
PO_Init(); // Initialize the polyobjs
if (!Level->IsReentering())
P_FinalizePortals(); // finalize line portals after polyobjects have been initialized. This info is needed for properly flagging them.
assert(sidetemp != nullptr);
delete[] sidetemp;
sidetemp = nullptr;
}

View file

@ -59,6 +59,27 @@ struct EDSector
double Overlayalpha[2];
};
struct sidei_t // [RH] Only keep BOOM sidedef init stuff around for init
{
union
{
// Used when unpacking sidedefs and assigning
// properties based on linedefs.
struct
{
short tag, special;
short alpha;
uint32_t map;
} a;
// Used when grouping sidedefs into loops.
struct
{
uint32_t first, next;
char lineside;
} b;
};
};
struct FMissingCount
{
@ -83,6 +104,7 @@ class MapLoader
TArray<FUDMFKey> MapThingsUserData;
int sidecount = 0;
TArray<int> linemap;
TArray<sidei_t> sidetemp;
// Extradata loader
TMap<int, EDLinedef> EDLines;

View file

@ -117,7 +117,7 @@ void MapLoader::IterFindPolySides (FPolyObj *po, side_t *side)
static TArray<uint32_t> vnum;
unsigned int vnumat;
assert(sidetemp != NULL);
assert(sidetemp.Size() > 0);
vnum.Clear();
vnum.Push(uint32_t(side->V1()->Index()));

View file

@ -170,28 +170,6 @@ void ReportUnpairedMinisegs();
// To be moved to maploader later!
struct sidei_t // [RH] Only keep BOOM sidedef init stuff around for init
{
union
{
// Used when unpacking sidedefs and assigning
// properties based on linedefs.
struct
{
short tag, special;
short alpha;
uint32_t map;
} a;
// Used when grouping sidedefs into loops.
struct
{
uint32_t first, next;
char lineside;
} b;
};
};
extern sidei_t *sidetemp;
extern TArray<FMapThing> MapThingsConverted;
extern bool ForceNodeBuild;