mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 06:41:59 +00:00
- Blood: Directly use the incoming loopable
bool from gi->AddQAVInterpProps()
in the QAVInterpProps
struct.
* During the initial implementation, there were more flags than this single one. I don't foresee any further flags coming so lets go for cleaner code.
This commit is contained in:
parent
37f8fc8b0d
commit
6d06f063f6
1 changed files with 3 additions and 8 deletions
|
@ -40,17 +40,12 @@ extern void (*qavClientCallback[])(int, void *);
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
enum
|
||||
{
|
||||
kQAVIsLoopable = 1 << 0,
|
||||
};
|
||||
|
||||
using QAVPrevTileFinder = TILE_FRAME* (*)(FRAMEINFO* const thisFrame, FRAMEINFO* const prevFrame, const int& i);
|
||||
|
||||
struct QAVInterpProps
|
||||
{
|
||||
QAVPrevTileFinder PrevTileFinder;
|
||||
int flags;
|
||||
bool loopable;
|
||||
TMap<int, TArray<int>> IgnoreData;
|
||||
|
||||
bool CanInterpFrameTile(const int& nFrame, const int& i)
|
||||
|
@ -108,7 +103,7 @@ bool GameInterface::IsQAVInterpTypeValid(const FString& type)
|
|||
|
||||
void GameInterface::AddQAVInterpProps(const int& res_id, const FString& interptype, const bool& loopable, const TMap<int, TArray<int>>& ignoredata)
|
||||
{
|
||||
qavInterpProps.Insert(res_id, { qavGetInterpType(interptype), loopable ? kQAVIsLoopable : 0, ignoredata });
|
||||
qavInterpProps.Insert(res_id, { qavGetInterpType(interptype), loopable, ignoredata });
|
||||
}
|
||||
|
||||
void GameInterface::RemoveQAVInterpProps(const int& res_id)
|
||||
|
@ -164,7 +159,7 @@ void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, b
|
|||
auto const nFrame = clamp(ticks / ticksPerFrame, 0, nFrames - 1);
|
||||
FRAMEINFO* const thisFrame = &frames[nFrame];
|
||||
|
||||
auto const oFrame = clamp((nFrame == 0 && (interpdata && (interpdata->flags & kQAVIsLoopable)) ? nFrames : nFrame) - 1, 0, nFrames - 1);
|
||||
auto const oFrame = clamp((nFrame == 0 && interpdata && interpdata->loopable ? nFrames : nFrame) - 1, 0, nFrames - 1);
|
||||
FRAMEINFO* const prevFrame = &frames[oFrame];
|
||||
|
||||
bool const interpolate = interpdata && cl_hudinterpolation && cl_bloodqavinterp && (nFrames > 1) && (nFrame != oFrame) && (smoothratio != MaxSmoothRatio);
|
||||
|
|
Loading…
Reference in a new issue