- fixed compilation (again.)

This commit is contained in:
Christoph Oelckers 2021-06-02 21:00:39 +02:00
parent 73683b3ebe
commit 207298aeb4
6 changed files with 30 additions and 30 deletions

View file

@ -123,3 +123,21 @@ inline void copyfloorpal(spritetype* spr, const sectortype* sect)
{
if (!lookups.noFloorPal(sect->floorpal)) spr->pal = sect->floorpal;
}
inline void spriteSetSlope(int spritenum, int heinum)
{
auto spr = &sprite[spritenum];
int cstat = spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK;
if (spr->cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)
{
spr->xoffset = heinum & 255;
spr->yoffset = (heinum >> 8) & 255;
spr->cstat = (spr->cstat & ~CSTAT_SPRITE_ALIGNMENT_MASK) | (heinum != 0 ? CSTAT_SPRITE_ALIGNMENT_SLOPE : CSTAT_SPRITE_ALIGNMENT_FLOOR);
}
}
inline int spriteGetSlope(int spritenum)
{
auto spr = &sprite[spritenum];
return ((spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_SLOPE) ? 0 : uint8_t(spr->xoffset) + (uint8_t(spr->yoffset) << 8);
}