- helpers for wall sprite rendering improvement

This commit is contained in:
Christoph Oelckers 2022-05-27 13:55:38 +02:00
parent 5aabde1712
commit 1a788c9ba2
2 changed files with 18 additions and 0 deletions

View file

@ -396,6 +396,10 @@ void DCoreActor::OnDestroy()
assert(prevSect == nullptr && nextSect == nullptr);
}
Numsprites--;
if (wallspriteinfo) delete wallspriteinfo;
wallspriteinfo = nullptr;
}
//==========================================================================

View file

@ -10,6 +10,19 @@ enum
MAXSTATUS = 1024
};
struct FWallSpriteDesc
{
walltype* wall;
float offsetOnWall;
};
// This is for quick determination of walls a wall sprite is attached to.
struct FWallSpriteInfo
{
tspritetype base; // this is needed for checking if something has changed.
TArray<FWallSpriteDesc> connections[2]; // two lists - for front and back
};
class DCoreActor : public DObject
{
DECLARE_CLASS(DCoreActor, DObject)
@ -22,6 +35,7 @@ public:
sectortype* link_sector;
DCoreActor* prevStat, * nextStat;
DCoreActor* prevSect, * nextSect;
FWallSpriteInfo* wallspriteinfo; // this is render data but needs to be attached to the actor so it can be found.
spritetype spr;
spriteext_t sprext;