mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 04:00:42 +00:00
- Blood: Ensure new QAV timer doesn't process while game is paused.
This commit is contained in:
parent
1ee6fd76c4
commit
ebdc9c31f2
1 changed files with 24 additions and 16 deletions
|
@ -268,26 +268,34 @@ void qavProcessTicker(QAV* const pQAV, int* duration, int* lastTick)
|
||||||
|
|
||||||
void qavProcessTimer(PLAYER* const pPlayer, QAV* const pQAV, int* duration, double* smoothratio, bool const fixedduration)
|
void qavProcessTimer(PLAYER* const pPlayer, QAV* const pQAV, int* duration, double* smoothratio, bool const fixedduration)
|
||||||
{
|
{
|
||||||
// Process clock based on QAV's ticrate and last tick value.
|
// Process if not paused.
|
||||||
qavProcessTicker(pQAV, &pPlayer->qavTimer, &pPlayer->qavLastTick);
|
if (!paused)
|
||||||
|
{
|
||||||
|
// Process clock based on QAV's ticrate and last tick value.
|
||||||
|
qavProcessTicker(pQAV, &pPlayer->qavTimer, &pPlayer->qavLastTick);
|
||||||
|
|
||||||
if (pPlayer->weaponTimer == 0)
|
if (pPlayer->weaponTimer == 0)
|
||||||
{
|
{
|
||||||
// Check if we're playing an idle QAV as per the ticker's weapon timer.
|
// Check if we're playing an idle QAV as per the ticker's weapon timer.
|
||||||
*duration = fixedduration ? pQAV->duration - 1 : I_GetBuildTime() % pQAV->duration;
|
*duration = fixedduration ? pQAV->duration - 1 : I_GetBuildTime() % pQAV->duration;
|
||||||
*smoothratio = MaxSmoothRatio;
|
*smoothratio = MaxSmoothRatio;
|
||||||
}
|
}
|
||||||
else if (pPlayer->qavTimer == 0)
|
else if (pPlayer->qavTimer == 0)
|
||||||
{
|
{
|
||||||
// If qavTimer is 0, play the last frame uninterpolated. Sometimes the timer can be just ahead of weaponTimer.
|
// If qavTimer is 0, play the last frame uninterpolated. Sometimes the timer can be just ahead of weaponTimer.
|
||||||
*duration = pQAV->duration - 1;
|
*duration = pQAV->duration - 1;
|
||||||
*smoothratio = MaxSmoothRatio;
|
*smoothratio = MaxSmoothRatio;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Apply normal values.
|
||||||
|
*duration = pQAV->duration - pPlayer->qavTimer;
|
||||||
|
*smoothratio = I_GetTimeFrac(pQAV->ticrate) * MaxSmoothRatio;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Apply normal values.
|
*smoothratio = MaxSmoothRatio;
|
||||||
*duration = pQAV->duration - pPlayer->qavTimer;
|
|
||||||
*smoothratio = I_GetTimeFrac(pQAV->ticrate) * MaxSmoothRatio;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue