moved all Is***Sprite function to animatesprite.cpp because that's the only place they still get used from.

Naked sprite pointers have been removed everywhere else.
This commit is contained in:
Christoph Oelckers 2023-09-28 11:41:35 +02:00
parent 7e63ccd57a
commit aea46548bd
2 changed files with 25 additions and 29 deletions

View file

@ -189,35 +189,6 @@ extern const VECTORDATA gVectorData[];
const int gDudeDrag = 0x2a00;
template<typename T> bool IsPlayerSprite(T const * const pSprite)
{
return pSprite->type >= kDudePlayer1 && pSprite->type <= kDudePlayer8;
}
template<typename T> bool IsDudeSprite(T const * const pSprite)
{
return pSprite->type >= kDudeBase && pSprite->type < kDudeMax;
}
template<typename T> bool IsThingSprite(T const* const pSprite)
{
return pSprite->type >= kThingBase && pSprite->type < kThingMax;
}
template<typename T> bool IsItemSprite(T const * const pSprite)
{
return pSprite->type >= kItemBase && pSprite->type < kItemMax;
}
template<typename T> bool IsWeaponSprite(T const * const pSprite)
{
return pSprite->type >= kItemWeaponBase && pSprite->type < kItemWeaponMax;
}
template<typename T> bool IsAmmoSprite(T const * const pSprite)
{
return pSprite->type >= kItemAmmoBase && pSprite->type < kItemAmmoMax;
}
#ifdef POLYMER

View file

@ -49,6 +49,31 @@ DAngle random_angles[16][3];
// to allow quick replacement later
bool IsPlayerSprite(tspritetype const* const pSprite)
{
return pSprite->type >= kDudePlayer1 && pSprite->type <= kDudePlayer8;
}
bool IsDudeSprite(tspritetype const* const pSprite)
{
return pSprite->type >= kDudeBase && pSprite->type < kDudeMax;
}
bool IsItemSprite(tspritetype const* const pSprite)
{
return pSprite->type >= kItemBase && pSprite->type < kItemMax;
}
bool IsWeaponSprite(tspritetype const* const pSprite)
{
return pSprite->type >= kItemWeaponBase && pSprite->type < kItemWeaponMax;
}
bool IsAmmoSprite(tspritetype const* const pSprite)
{
return pSprite->type >= kItemAmmoBase && pSprite->type < kItemAmmoMax;
}
//---------------------------------------------------------------------------
//
//