- resorted portal render data.

Compiles but does not work...
This commit is contained in:
Christoph Oelckers 2018-04-01 22:26:57 +02:00
commit 248a29bf06
40 changed files with 204 additions and 195 deletions

View file

@ -111,6 +111,7 @@
#include "p_saveg.h"
#include "g_levellocals.h"
#include "c_dispatch.h"
#include "a_dynlight.h"
#ifndef NO_EDATA
#include "edata.h"
#endif
@ -3499,14 +3500,24 @@ static void P_PrecacheLevel()
extern polyblock_t **PolyBlockMap;
//===========================================================================
//==========================================================================
//
//
//
//===========================================================================
//==========================================================================
void P_FreeLevelData ()
{
TThinkerIterator<ADynamicLight> it(STAT_DLIGHT);
auto mo = it.Next();
while (mo)
{
auto next = it.Next();
mo->Destroy();
mo = next;
}
// [ZZ] delete per-map event handlers
E_Shutdown(true);
MapThingsConverted.Clear();
@ -3531,14 +3542,26 @@ void P_FreeLevelData ()
level.killed_monsters = level.found_items = level.found_secrets =
wminfo.maxfrags = 0;
// delete allocated data in the level arrays.
if (level.sectors.Size() > 0)
{
delete[] level.sectors[0].e;
if (level.sectors[0].subsectors)
{
delete[] level.sectors[0].subsectors;
level.sectors[0].subsectors = nullptr;
}
}
for (auto &sub : level.subsectors)
{
if (sub.BSP != nullptr) delete sub.BSP;
}
if (level.sides.Size() > 0 && level.sides[0].segs)
{
delete[] level.sides[0].segs;
level.sides[0].segs = nullptr;
}
FBehavior::StaticUnloadModules ();
level.segs.Clear();