* Support FF_SPR2ENDSTATE in interpoleration.

* Fix skidding interpoleration bug.
This commit is contained in:
toasterbabe 2017-08-27 16:35:19 +01:00
parent 973f700dcf
commit 79dab78fd3

View file

@ -1322,19 +1322,23 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
if (durs > INTERPOLERATION_LIMIT) if (durs > INTERPOLERATION_LIMIT)
durs = INTERPOLERATION_LIMIT; durs = INTERPOLERATION_LIMIT;
if (spr->mobj->frame & FF_ANIMATE if (spr->mobj->player && spr->mobj->player->skidtime && spr->mobj->state-states == S_PLAY_WALK) // temporary hack
;
else if (spr->mobj->frame & FF_ANIMATE
|| (spr->mobj->state->nextstate != S_NULL || (spr->mobj->state->nextstate != S_NULL
&& states[spr->mobj->state->nextstate].sprite == spr->mobj->sprite && states[spr->mobj->state->nextstate].sprite == spr->mobj->sprite
&& (states[spr->mobj->state->nextstate].frame & FF_FRAMEMASK) == spr->mobj->sprite2)) && (states[spr->mobj->state->nextstate].frame & FF_FRAMEMASK) == spr->mobj->sprite2))
{ {
UINT32 nextframe = (spr->mobj->frame & FF_FRAMEMASK) + 1; UINT32 nextframe = (spr->mobj->frame & FF_FRAMEMASK) + 1;
if (nextframe >= (UINT32)((skin_t*)spr->mobj->skin)->sprites[spr->mobj->sprite2].numframes) nextframe %= mod;
nextframe = 0; if (nextframe || !(spr->mobj->state->frame & FF_SPR2ENDSTATE))
nextframe = md2->model->spr2frames[spr2*2] + (nextframe % mod); {
nextframe += md2->model->spr2frames[spr2*2];
next = &md2->model->frames[nextframe]; next = &md2->model->frames[nextframe];
} }
} }
} }
}
else else
{ {
//FIXME: this is not yet correct //FIXME: this is not yet correct