- minor cleanup

This commit is contained in:
Christoph Oelckers 2022-08-31 23:30:04 +02:00
parent 5d9a1d5ad5
commit f78cfb590d
3 changed files with 4 additions and 15 deletions

View file

@ -239,29 +239,18 @@ inline int GetSpriteSizeZ(const spritetypebase* sp)
}
// Z size of top (TOS) and bottom (BOS) part of sprite
inline int GetSpriteSizeToTop(const spritetypebase* sp)
{
return ((GetSpriteSizeZ(sp) >> 1) + (tileTopOffset(sp->picnum) << 8));
}
inline int GetSpriteSizeToBottom(const spritetypebase* sp)
{
return ((GetSpriteSizeZ(sp) >> 1) - (tileTopOffset(sp->picnum) << 8));
}
// actual Z for TOS and BOS - handles both WYSIWYG and old style
inline int GetSpriteZOfTop(const spritetypebase* sp)
{
return (sp->cstat & CSTAT_SPRITE_YCENTER) ?
sp->int_pos().Z - GetSpriteSizeToTop(sp) :
sp->int_pos().Z - ((GetSpriteSizeZ(sp) >> 1) + (tileTopOffset(sp->picnum) << 8)) :
sp->int_pos().Z - GetSpriteSizeZ(sp);
}
inline int GetSpriteZOfBottom(const spritetypebase* sp)
{
return (sp->cstat & CSTAT_SPRITE_YCENTER) ?
sp->int_pos().Z + GetSpriteSizeToBottom(sp) :
sp->int_pos().Z + ((GetSpriteSizeZ(sp) >> 1) - (tileTopOffset(sp->picnum) << 8)) :
sp->int_pos().Z;
}

View file

@ -7036,7 +7036,7 @@ DEFINE_FIELD_X(SWPlayer, PLAYER, LadderSector)
//DEFINE_FIELD_X(SWPlayer, PLAYER, ly)
DEFINE_FIELD_X(SWPlayer, PLAYER, JumpDuration)
DEFINE_FIELD_X(SWPlayer, PLAYER, WadeDepth)
//DEFINE_FIELD_X(SWPlayer, PLAYER, bob_amt)
DEFINE_FIELD_X(SWPlayer, PLAYER, pbob_amt)
DEFINE_FIELD_X(SWPlayer, PLAYER, bob_ndx)
DEFINE_FIELD_X(SWPlayer, PLAYER, bcnt)
DEFINE_FIELD_X(SWPlayer, PLAYER, bob_z)

View file

@ -220,7 +220,7 @@ struct SWPlayer native
//native int16 LadderSector;
native int16 JumpDuration;
native int16 WadeDepth;
//native double bob_amt;
native double pbob_amt;
native int16 bob_ndx;
native int16 bcnt; // bob count
native int bob_z, obob_z;