mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- spriteGetSlope/spriteSetSlope take spritetype pointer arguments.
This commit is contained in:
parent
c32ff483a9
commit
b7465ab67b
2 changed files with 5 additions and 7 deletions
|
@ -132,9 +132,8 @@ inline void copyfloorpal(spritetype* spr, const sectortype* sect)
|
|||
if (!lookups.noFloorPal(sect->floorpal)) spr->pal = sect->floorpal;
|
||||
}
|
||||
|
||||
inline void spriteSetSlope(int spritenum, int heinum)
|
||||
inline void spriteSetSlope(spritetype* spr, int heinum)
|
||||
{
|
||||
auto spr = &sprite[spritenum];
|
||||
int cstat = spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK;
|
||||
if (spr->cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)
|
||||
{
|
||||
|
@ -144,9 +143,8 @@ inline void spriteSetSlope(int spritenum, int heinum)
|
|||
}
|
||||
}
|
||||
|
||||
inline int spriteGetSlope(int spritenum)
|
||||
inline int spriteGetSlope(spritetype* spr)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -4399,7 +4399,7 @@ bool condCheckSprite(XSPRITE* pXCond, int cmpOp, bool PUSH) {
|
|||
case 0: return condCmp((pSpr->ang & 2047), arg1, arg2, cmpOp);
|
||||
case 5: return condCmp(pSpr->statnum, arg1, arg2, cmpOp);
|
||||
case 6: return ((pSpr->flags & kHitagRespawn) || pSpr->statnum == kStatRespawn);
|
||||
case 7: return condCmp(spriteGetSlope(pSpr->index), arg1, arg2, cmpOp);
|
||||
case 7: return condCmp(spriteGetSlope(pSpr), arg1, arg2, cmpOp);
|
||||
case 10: return condCmp(pSpr->clipdist, arg1, arg2, cmpOp);
|
||||
case 15:
|
||||
if (!spriRangeIsFine(pSpr->owner)) return false;
|
||||
|
@ -6474,7 +6474,7 @@ void sprite2sectorSlope(spritetype* pSprite, sectortype* pSector, char rel, bool
|
|||
break;
|
||||
}
|
||||
|
||||
spriteSetSlope(pSprite->index, slope);
|
||||
spriteSetSlope(pSprite, slope);
|
||||
if (forcez) pSprite->z = z;
|
||||
}
|
||||
|
||||
|
@ -6613,7 +6613,7 @@ void useSlopeChanger(XSPRITE* pXSource, int objType, int objIndex) {
|
|||
}
|
||||
break;
|
||||
default:
|
||||
spriteSetSlope(objIndex, slope);
|
||||
spriteSetSlope(pSpr, slope);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue