Blood: Constify some {u,t,}spritetype templates

This is important where tracked spritetype could be involved.
This commit is contained in:
Evan Ramos 2020-01-02 22:51:06 -06:00 committed by Christoph Oelckers
parent d7a7bb3e78
commit 148c8770e9
3 changed files with 4 additions and 4 deletions

View file

@ -204,14 +204,14 @@ extern short gAffectedXWalls[kMaxXWalls];
extern extern
#endif #endif
inline bool IsPlayerSprite(spritetype *pSprite) inline bool IsPlayerSprite(spritetype const * const pSprite)
{ {
if (pSprite->type >= kDudePlayer1 && pSprite->type <= kDudePlayer8) if (pSprite->type >= kDudePlayer1 && pSprite->type <= kDudePlayer8)
return 1; return 1;
return 0; return 0;
} }
template<typename T> bool IsDudeSprite(T *pSprite) template<typename T> bool IsDudeSprite(T const * const pSprite)
{ {
if (pSprite->type >= kDudeBase && pSprite->type < kDudeMax) if (pSprite->type >= kDudeBase && pSprite->type < kDudeMax)
return 1; return 1;

View file

@ -312,7 +312,7 @@ static inline int GetWallType(int nWall)
return wall[nWall].type; return wall[nWall].type;
} }
template<typename T> void GetSpriteExtents(T *pSprite, int *top, int *bottom) template<typename T> void GetSpriteExtents(T const * const pSprite, int *top, int *bottom)
{ {
*top = *bottom = pSprite->z; *top = *bottom = pSprite->z;
if ((pSprite->cstat & 0x30) != 0x20) if ((pSprite->cstat & 0x30) != 0x20)

View file

@ -1887,7 +1887,7 @@ void viewDrawInterface(ClockTicks arg)
static fix16_t gCameraAng; static fix16_t gCameraAng;
template<typename T> tspritetype* viewInsertTSprite(int nSector, int nStatnum, T *pSprite) template<typename T> tspritetype* viewInsertTSprite(int nSector, int nStatnum, T const * const pSprite)
{ {
int nTSprite = spritesortcnt; int nTSprite = spritesortcnt;
tspritetype *pTSprite = &tsprite[nTSprite]; tspritetype *pTSprite = &tsprite[nTSprite];