Skip to content

Commit

Permalink
- preparations for unlimited tsprites.
Browse files Browse the repository at this point in the history
Right now it is a no-op because Polymost cannot deal with this properly.
  • Loading branch information
coelckers committed Jan 10, 2022
1 parent 2377b17 commit e892de2
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/core/coreactor.h
Expand Up @@ -428,3 +428,7 @@ inline int pushmove(vec3_t* const vect, sectortype** const sect, int32_t const w
}

tspritetype* renderAddTsprite(tspritetype* tsprite, int& spritesortcnt, DCoreActor* actor);
inline void validateTSpriteSize(tspritetype*& tsprite, int& spritesortcnt)
{

}
2 changes: 2 additions & 0 deletions source/core/gamefuncs.cpp
Expand Up @@ -412,6 +412,8 @@ void dragpoint(walltype* startwall, int newx, int newy)

tspritetype* renderAddTsprite(tspritetype* tsprite, int& spritesortcnt, DCoreActor* actor)
{
validateTSpriteSize(tsprite, spritesortcnt);

if (spritesortcnt >= MAXSPRITESONSCREEN) return nullptr;
auto tspr = &tsprite[spritesortcnt++];

Expand Down
1 change: 1 addition & 0 deletions source/games/blood/src/animatesprite.cpp
Expand Up @@ -553,6 +553,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in
int nViewSprites = spritesortcnt;
for (int nTSprite = spritesortcnt - 1; nTSprite >= 0; nTSprite--)
{
validateTSpriteSize(tsprite, spritesortcnt);
tspritetype* pTSprite = &tsprite[nTSprite];
auto owneractor = static_cast<DBloodActor*>(pTSprite->ownerActor);
if (owneractor->spr.detail > gDetail)
Expand Down
1 change: 1 addition & 0 deletions source/games/duke/src/animatesprites_d.cpp
Expand Up @@ -139,6 +139,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
//Between drawrooms() and drawmasks() is the perfect time to animate sprites
for (j = 0; j < spritesortcnt; j++)
{
validateTSpriteSize(tsprite, spritesortcnt);
t = &tsprite[j];
h = static_cast<DDukeActor*>(t->ownerActor);
auto OwnerAc = h->GetOwner();
Expand Down
1 change: 1 addition & 0 deletions source/games/duke/src/animatesprites_r.cpp
Expand Up @@ -124,6 +124,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
//Between drawrooms() and drawmasks() is the perfect time to animate sprites
for (j = 0; j < spritesortcnt; j++)
{
validateTSpriteSize(tsprite, spritesortcnt);
t = &tsprite[j];
h = static_cast<DDukeActor*>(t->ownerActor);
auto OwnerAc = h->GetOwner();
Expand Down
1 change: 1 addition & 0 deletions source/games/exhumed/src/view.cpp
Expand Up @@ -73,6 +73,7 @@ static void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int x, int
myspritesortcnt = &spritesortcnt;

for (int i = 0; i < spritesortcnt; i++) {
validateTSpriteSize(tsprite, spritesortcnt);
pTSprite = &tsprite[i];

if (pTSprite->ownerActor)
Expand Down
1 change: 1 addition & 0 deletions source/games/sw/src/draw.cpp
Expand Up @@ -605,6 +605,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie

for (tSpriteNum = spritesortcnt - 1; tSpriteNum >= 0; tSpriteNum--)
{
validateTSpriteSize(tsprite, spritesortcnt);
tspritetype* tsp = &tsprite[tSpriteNum];
auto tActor = static_cast<DSWActor*>(tsp->ownerActor);
auto tsectp = tsp->sectp;
Expand Down

0 comments on commit e892de2

Please sign in to comment.