mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-21 18:32:08 +00:00
Swapped around in an attempt to streamline.
This commit is contained in:
parent
fc64feee60
commit
07e5fe9546
1 changed files with 10 additions and 8 deletions
18
src/p_mobj.c
18
src/p_mobj.c
|
@ -127,18 +127,20 @@ FUNCINLINE static ATTRINLINE void P_CycleStateAnimation(mobj_t *mobj)
|
|||
|
||||
mobj->anim_duration = (UINT16)mobj->state->var2;
|
||||
|
||||
if (mobj->sprite == SPR_PLAY)
|
||||
if (mobj->sprite != SPR_PLAY)
|
||||
{
|
||||
if (mobj->skin && (((++mobj->frame) & FF_FRAMEMASK) >= (UINT32)(((skin_t *)mobj->skin)->sprites[mobj->sprite2].numframes)))
|
||||
mobj->frame &= ~FF_FRAMEMASK;
|
||||
// compare the current sprite frame to the one we started from
|
||||
// if more than var1 away from it, swap back to the original
|
||||
// else just advance by one
|
||||
if (((++mobj->frame) & FF_FRAMEMASK) - (mobj->state->frame & FF_FRAMEMASK) > (UINT32)mobj->state->var1)
|
||||
mobj->frame = (mobj->state->frame & FF_FRAMEMASK) | (mobj->frame & ~FF_FRAMEMASK);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// compare the current sprite frame to the one we started from
|
||||
// if more than var1 away from it, swap back to the original
|
||||
// else just advance by one
|
||||
if (((++mobj->frame) & FF_FRAMEMASK) - (mobj->state->frame & FF_FRAMEMASK) > (UINT32)mobj->state->var1)
|
||||
mobj->frame = (mobj->state->frame & FF_FRAMEMASK) | (mobj->frame & ~FF_FRAMEMASK);
|
||||
// sprite2 version of above
|
||||
if (mobj->skin && (((++mobj->frame) & FF_FRAMEMASK) >= (UINT32)(((skin_t *)mobj->skin)->sprites[mobj->sprite2].numframes)))
|
||||
mobj->frame &= ~FF_FRAMEMASK;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue