Skip to content

Commit

Permalink
- got rid of fxSpawn.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Oct 14, 2021
1 parent 085bd3a commit 1e1764e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
22 changes: 8 additions & 14 deletions source/games/blood/src/fx.cpp
Expand Up @@ -128,7 +128,7 @@ void CFX::remove(int nSprite)
actPostSprite(nSprite, kStatFree);
}

spritetype * CFX::fxSpawn(FX_ID nFx, int nSector, int x, int y, int z, unsigned int a6)
DBloodActor* CFX::fxSpawnActor(FX_ID nFx, int nSector, int x, int y, int z, unsigned int a6)
{
if (nSector < 0 || nSector >= numsectors)
return NULL;
Expand Down Expand Up @@ -157,13 +157,13 @@ spritetype * CFX::fxSpawn(FX_ID nFx, int nSector, int x, int y, int z, unsigned
FXDATA *pFX = &gFXData[nFx];
if (gStatCount[1] == 512)
{
StatIterator it(kStatFX);
int nSprite = it.NextIndex();
while (nSprite != -1 && (sprite[nSprite].flags & 32))
nSprite = it.NextIndex();
if (nSprite == -1)
BloodStatIterator it(kStatFX);
auto iactor = it.Next();
while (iactor && (iactor->s().flags & 32))
iactor = it.Next();
if (!iactor)
return NULL;
destroy(nSprite);
destroy(iactor->s().index);
}
auto actor = actSpawnSprite(nSector, x, y, z, 1, 0);
spritetype* pSprite = &actor->s();
Expand All @@ -190,7 +190,7 @@ spritetype * CFX::fxSpawn(FX_ID nFx, int nSector, int x, int y, int z, unsigned
a6 = pFX->ate;
if (a6)
evPost(actor, a6+Random2(a6>>1), kCallbackRemove);
return pSprite;
return actor;
}

void CFX::fxProcess(void)
Expand Down Expand Up @@ -356,10 +356,4 @@ void fxPrecache()
}


DBloodActor* CFX::fxSpawnActor(FX_ID nFx, int nSector, int x, int y, int z, unsigned int a6)
{
auto spr = fxSpawn(nFx, nSector, x, y, z, a6);
return spr ? &bloodActors[spr->index] : nullptr;
}

END_BLD_NS
1 change: 0 additions & 1 deletion source/games/blood/src/fx.h
Expand Up @@ -93,7 +93,6 @@ class CFX {
public:
void destroy(int);
void remove(int);
spritetype * fxSpawn(FX_ID, int, int, int, int, unsigned int);
DBloodActor* fxSpawnActor(FX_ID, int, int, int, int, unsigned int);
void fxProcess(void);
};
Expand Down

0 comments on commit 1e1764e

Please sign in to comment.