mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 20:20:40 +00:00
- Blood: Remove lastframetic
hack from QAV::Draw()
added in 99508e6f15
since we now use proper timing code.
This commit is contained in:
parent
24fbaa527c
commit
b01cef7f15
2 changed files with 3 additions and 15 deletions
|
@ -76,21 +76,10 @@ void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, b
|
||||||
{
|
{
|
||||||
assert(ticksPerFrame > 0);
|
assert(ticksPerFrame > 0);
|
||||||
|
|
||||||
int nFrame = ticks / ticksPerFrame;
|
auto const nFrame = clamp(ticks / ticksPerFrame, 0, nFrames - 1);
|
||||||
assert(nFrame >= 0 && nFrame < nFrames);
|
|
||||||
FRAMEINFO *thisFrame = &frames[nFrame];
|
FRAMEINFO *thisFrame = &frames[nFrame];
|
||||||
|
|
||||||
if ((nFrame == (nFrames - 1)) && !lastframetic)
|
auto const oFrame = clamp((nFrame == 0 && looped ? nFrames : nFrame) - 1, 0, nFrames - 1);
|
||||||
{
|
|
||||||
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);
|
|
||||||
FRAMEINFO *prevFrame = &frames[oFrame];
|
FRAMEINFO *prevFrame = &frames[oFrame];
|
||||||
|
|
||||||
auto drawTile = [&](TILE_FRAME *thisTile, TILE_FRAME *prevTile, bool const interpolate = true)
|
auto drawTile = [&](TILE_FRAME *thisTile, TILE_FRAME *prevTile, bool const interpolate = true)
|
||||||
|
|
|
@ -75,8 +75,7 @@ struct QAV
|
||||||
int y; // 18
|
int y; // 18
|
||||||
int nSprite; // 1c
|
int nSprite; // 1c
|
||||||
//SPRITE *pSprite; // 1c
|
//SPRITE *pSprite; // 1c
|
||||||
char pad3[1]; // 20
|
char pad3[2]; // 20
|
||||||
char lastframetic;
|
|
||||||
unsigned short res_id;
|
unsigned short res_id;
|
||||||
FRAMEINFO frames[1]; // 24
|
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);
|
void Draw(double x, double y, int ticks, int stat, int shade, int palnum, bool to3dview, double const smoothratio = 65536, bool const looped = false);
|
||||||
|
|
Loading…
Reference in a new issue