mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
Crappy support for pausing model animations
git-svn-id: https://svn.eduke32.com/eduke32@334 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
38e3d16aeb
commit
a289704d10
1 changed files with 13 additions and 3 deletions
|
@ -818,12 +818,22 @@ static long mdloadskin (md2model *m, int number, int pal, int surf)
|
|||
return(*texidx);
|
||||
}
|
||||
|
||||
char mdpause;
|
||||
|
||||
//Note: even though it says md2model, it works for both md2model&md3model
|
||||
static void updateanimation (md2model *m, spritetype *tspr)
|
||||
{
|
||||
mdanim_t *anim;
|
||||
long i, j;
|
||||
|
||||
if (mdpause)
|
||||
{
|
||||
// spriteext[tspr->owner].mdanimtims = mdtims;
|
||||
m->interpol = 0;
|
||||
m->nframe = m->cframe;
|
||||
return;
|
||||
}
|
||||
|
||||
m->cframe = m->nframe = tile2model[tspr->picnum].framenum;
|
||||
|
||||
for (anim = m->animations;
|
||||
|
@ -841,13 +851,13 @@ if (!anim) { m->interpol = 0; return; }
|
|||
return;
|
||||
}
|
||||
|
||||
i = (mdtims-spriteext[tspr->owner].mdanimtims)*anim->fpssc*timerticspersec/120;
|
||||
i = (mdtims-spriteext[tspr->owner].mdanimtims)*((anim->fpssc*timerticspersec)/120);
|
||||
j = ((anim->endframe+1-anim->startframe)<<16);
|
||||
//Just in case you play the game for a VERY long time...
|
||||
if (i < 0) { i = 0; spriteext[tspr->owner].mdanimtims = mdtims; }
|
||||
//compare with j*2 instead of j to ensure i stays > j-65536 for MDANIM_ONESHOT
|
||||
if ((i >= j+j) && (anim->fpssc)*timerticspersec/120) //Keep mdanimtims close to mdtims to avoid the use of MOD
|
||||
spriteext[tspr->owner].mdanimtims += j/anim->fpssc*timerticspersec/120;
|
||||
if ((i >= j+j) && (anim->fpssc)) //Keep mdanimtims close to mdtims to avoid the use of MOD
|
||||
spriteext[tspr->owner].mdanimtims += j/((anim->fpssc*timerticspersec)/120);
|
||||
|
||||
if (anim->flags&MDANIM_ONESHOT)
|
||||
{ if (i > j-65536) i = j-65536; }
|
||||
|
|
Loading…
Reference in a new issue