- Blood: Remove `lastframetic` hack from `QAV::Draw()` added in 99508e6f15 since we now use proper timing code.

This commit is contained in:
Mitchell Richters 2021-08-06 09:57:01 +10:00
parent 24fbaa527c
commit b01cef7f15
2 changed files with 3 additions and 15 deletions

View File

@ -76,21 +76,10 @@ void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, b
{
assert(ticksPerFrame > 0);
int nFrame = ticks / ticksPerFrame;
assert(nFrame >= 0 && nFrame < nFrames);
auto const nFrame = clamp(ticks / ticksPerFrame, 0, nFrames - 1);
FRAMEINFO *thisFrame = &frames[nFrame];
if ((nFrame == (nFrames - 1)) && !lastframetic)
{
lastframetic = ticks;
}
else if (lastframetic > ticks)
{
lastframetic = 0;
}
int oFrame = nFrame == 0 || (lastframetic && ticks > lastframetic) ? !looped ? nFrame : nFrames - 1 : nFrame - 1;
assert(oFrame >= 0 && oFrame < nFrames);
auto const oFrame = clamp((nFrame == 0 && looped ? nFrames : nFrame) - 1, 0, nFrames - 1);
FRAMEINFO *prevFrame = &frames[oFrame];
auto drawTile = [&](TILE_FRAME *thisTile, TILE_FRAME *prevTile, bool const interpolate = true)

View File

@ -75,8 +75,7 @@ struct QAV
int y; // 18
int nSprite; // 1c
//SPRITE *pSprite; // 1c
char pad3[1]; // 20
char lastframetic;
char pad3[2]; // 20
unsigned short res_id;
FRAMEINFO frames[1]; // 24
void Draw(double x, double y, int ticks, int stat, int shade, int palnum, bool to3dview, double const smoothratio = 65536, bool const looped = false);