mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-04 00:41:38 +00:00
Adapt re-enabled DrawMD2 code block for meshes
This commit is contained in:
parent
6653b9697f
commit
c13d3ff1dd
1 changed files with 8 additions and 7 deletions
|
@ -885,6 +885,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
GLPatch_t *gpatch;
|
GLPatch_t *gpatch;
|
||||||
INT32 durs = spr->mobj->state->tics;
|
INT32 durs = spr->mobj->state->tics;
|
||||||
INT32 tics = spr->mobj->tics;
|
INT32 tics = spr->mobj->tics;
|
||||||
|
//mdlframe_t *next = NULL;
|
||||||
const UINT8 flip = (UINT8)((spr->mobj->eflags & MFE_VERTICALFLIP) == MFE_VERTICALFLIP);
|
const UINT8 flip = (UINT8)((spr->mobj->eflags & MFE_VERTICALFLIP) == MFE_VERTICALFLIP);
|
||||||
spritedef_t *sprdef;
|
spritedef_t *sprdef;
|
||||||
spriteframe_t *sprframe;
|
spriteframe_t *sprframe;
|
||||||
|
@ -1004,19 +1005,19 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
// frames are handled differently for states with FF_ANIMATE, so get the next frame differently for the interpolation
|
// frames are handled differently for states with FF_ANIMATE, so get the next frame differently for the interpolation
|
||||||
if (spr->mobj->frame & FF_ANIMATE)
|
if (spr->mobj->frame & FF_ANIMATE)
|
||||||
{
|
{
|
||||||
UINT32 nextframe = (spr->mobj->frame & FF_FRAMEMASK) + 1;
|
nextFrame = (spr->mobj->frame & FF_FRAMEMASK) + 1;
|
||||||
if (nextframe >= (UINT32)spr->mobj->state->var1)
|
if (nextFrame >= spr->mobj->state->var1)
|
||||||
nextframe = (spr->mobj->state->frame & FF_FRAMEMASK);
|
nextFrame = (spr->mobj->state->frame & FF_FRAMEMASK);
|
||||||
nextframe %= md2->model->header.numFrames;
|
nextFrame %= md2->model->meshes[0].numFrames;
|
||||||
next = &md2->model->frames[nextframe];
|
//next = &md2->model->meshes[0].frames[nextFrame];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (spr->mobj->state->nextstate != S_NULL && states[spr->mobj->state->nextstate].sprite != SPR_NULL
|
if (spr->mobj->state->nextstate != S_NULL && states[spr->mobj->state->nextstate].sprite != SPR_NULL
|
||||||
&& !(spr->mobj->player && (spr->mobj->state->nextstate == S_PLAY_TAP1 || spr->mobj->state->nextstate == S_PLAY_TAP2) && spr->mobj->state == &states[S_PLAY_STND]))
|
&& !(spr->mobj->player && (spr->mobj->state->nextstate == S_PLAY_TAP1 || spr->mobj->state->nextstate == S_PLAY_TAP2) && spr->mobj->state == &states[S_PLAY_STND]))
|
||||||
{
|
{
|
||||||
const UINT32 nextframe = (states[spr->mobj->state->nextstate].frame & FF_FRAMEMASK) % md2->model->header.numFrames;
|
nextFrame = (states[spr->mobj->state->nextstate].frame & FF_FRAMEMASK) % md2->model->meshes[0].numFrames;
|
||||||
next = &md2->model->frames[nextframe];
|
//next = &md2->model->meshes[0].frames[nextFrame];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue