- Blood: remove unneeded replacement functions.

changespritesect is the only one called from the engine.
This commit is contained in:
Christoph Oelckers 2021-11-16 18:26:14 +01:00
parent e9c79292ff
commit 53998c9cb7
5 changed files with 0 additions and 36 deletions

View file

@ -687,10 +687,7 @@ extern int32_t rintersect(int32_t x1, int32_t y1, int32_t z1,
extern int32_t(*animateoffs_replace)(int const tilenum, int fakevar);
extern void(*initspritelists_replace)(void);
extern int32_t(*insertsprite_replace)(int16_t sectnum, int16_t statnum);
extern int32_t(*deletesprite_replace)(int16_t spritenum);
extern int32_t(*changespritesect_replace)(int16_t spritenum, int16_t newsectnum);
extern int32_t(*changespritestat_replace)(int16_t spritenum, int16_t newstatnum);
// Masking these into the object index to keep it in 16 bit was probably the single most dumbest and pointless thing Build ever did.
// Gonna be fun to globally replace these to finally lift the limit this imposes on map size.

View file

@ -314,11 +314,8 @@ static void do_deletespritestat(int16_t deleteme)
//
// insertsprite
//
int32_t(*insertsprite_replace)(int16_t sectnum, int16_t statnum) = NULL;
int32_t insertsprite(int16_t sectnum, int16_t statnum)
{
if (insertsprite_replace)
return insertsprite_replace(sectnum, statnum);
// TODO: guard against bad sectnum?
int32_t const newspritenum = insertspritestat(statnum);
@ -338,12 +335,9 @@ int32_t insertsprite(int16_t sectnum, int16_t statnum)
//
// deletesprite
//
int32_t (*deletesprite_replace)(int16_t spritenum) = NULL;
int32_t deletesprite(int16_t spritenum)
{
Polymost::polymost_deletesprite(spritenum);
if (deletesprite_replace)
return deletesprite_replace(spritenum);
assert((sprite[spritenum].statnum == MAXSTATUS)
== (sprite[spritenum].sectnum == MAXSECTORS));
@ -401,11 +395,8 @@ int32_t changespritesect(int16_t spritenum, int16_t newsectnum)
//
// changespritestat
//
int32_t (*changespritestat_replace)(int16_t spritenum, int16_t newstatnum) = NULL;
int32_t changespritestat(int16_t spritenum, int16_t newstatnum)
{
if (changespritestat_replace)
return changespritestat_replace(spritenum, newstatnum);
// XXX: NOTE: MAXSTATUS is allowed
if ((newstatnum < 0 || newstatnum > MAXSTATUS) || (sprite[spritenum].statnum == MAXSTATUS))
return -1; // can't set the statnum of a sprite not in the world

View file

@ -203,11 +203,6 @@ int InsertSprite(int nSector, int nStat)
return nSprite;
}
int qinsertsprite(short nSector, short nStat) // Replace
{
return InsertSprite(nSector, nStat);
}
int DeleteSprite(int nSprite)
{
FVector3 pos = GetSoundPos(&sprite[nSprite].pos);
@ -230,11 +225,6 @@ int DeleteSprite(int nSprite)
return nSprite;
}
int qdeletesprite(short nSprite) // Replace
{
return DeleteSprite(nSprite);
}
int ChangeSpriteSect(int nSprite, int nSector)
{
assert(nSprite >= 0 && nSprite < kMaxSprites);
@ -261,11 +251,6 @@ int ChangeSpriteStat(int nSprite, int nStatus)
return 0;
}
int qchangespritestat(short nSprite, short nStatus)
{
return ChangeSpriteStat(nSprite, nStatus);
}
void InitFreeList(unsigned short *pList, int nCount)
{
for (int i = 1; i < nCount; i++)

View file

@ -354,13 +354,10 @@ void InsertSpriteStat(int nSprite, int nStat);
void RemoveSpriteStat(int nSprite);
void qinitspritelists(void);
int InsertSprite(int nSector, int nStat);
int qinsertsprite(short nSector, short nStat);
int DeleteSprite(int nSprite);
int qdeletesprite(short nSprite);
int ChangeSpriteSect(int nSprite, int nSector);
int qchangespritesect(short nSprite, short nSector);
int ChangeSpriteStat(int nSprite, int nStatus);
int qchangespritestat(short nSprite, short nStatus);
void InitFreeList(unsigned short *pList, int nCount);
void InitFreeList(unsigned short* pList, int nCount, FixedBitArray<MAXSPRITES>& activeXSprites);
void InsertFree(unsigned short *pList, int nIndex);

View file

@ -63,19 +63,13 @@ int qanimateoffs(int a1, int a2)
}
void qinitspritelists();
int32_t qinsertsprite(int16_t nSector, int16_t nStat);
int32_t qdeletesprite(int16_t nSprite);
int32_t qchangespritesect(int16_t nSprite, int16_t nSector);
int32_t qchangespritestat(int16_t nSprite, int16_t nStatus);
void HookReplaceFunctions(void)
{
animateoffs_replace = qanimateoffs;
initspritelists_replace = qinitspritelists;
insertsprite_replace = qinsertsprite;
deletesprite_replace = qdeletesprite;
changespritesect_replace = qchangespritesect;
changespritestat_replace = qchangespritestat;
}
END_BLD_NS