- split P_SetupLevel so that the main part of it can be made part of the MapLoader class.

- allocate BlockNodes from the same memory arena as SecNodes.
This commit is contained in:
Christoph Oelckers 2018-12-27 23:34:07 +01:00
commit 467c73b2d7
5 changed files with 348 additions and 472 deletions

View file

@ -565,41 +565,7 @@ void AActor::SetOrigin(double x, double y, double z, bool moving)
if (!moving) ClearInterpolation();
}
//===========================================================================
//
// FBlockNode - allows to link actors into multiple blocks in the blockmap
//
//===========================================================================
FBlockNode *FBlockNode::FreeBlocks = NULL;
FBlockNode *FBlockNode::Create (AActor *who, int x, int y, int group)
{
FBlockNode *block;
if (FreeBlocks != NULL)
{
block = FreeBlocks;
FreeBlocks = block->NextBlock;
}
else
{
block = new FBlockNode;
}
block->BlockIndex = x + y*level.blockmap.bmapwidth;
block->Me = who;
block->NextActor = NULL;
block->PrevActor = NULL;
block->PrevBlock = NULL;
block->NextBlock = NULL;
return block;
}
void FBlockNode::Release ()
{
NextBlock = FreeBlocks;
FreeBlocks = this;
}
//
// BLOCK MAP ITERATORS