mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-21 19:11:06 +00:00
- Blood: Amend how QAVs process when game is paused.
* Repair of initial implementation in ebdc9c31f2
.
* Fixes #883.
This commit is contained in:
parent
016016b7ab
commit
2162e51424
1 changed files with 22 additions and 24 deletions
|
@ -309,9 +309,8 @@ void qavProcessTicker(QAV* const pQAV, int* duration, int* lastTick)
|
||||||
{
|
{
|
||||||
if (*duration > 0)
|
if (*duration > 0)
|
||||||
{
|
{
|
||||||
auto thisTick = I_GetTime(pQAV->ticrate);
|
const auto thisTick = I_GetTime(pQAV->ticrate);
|
||||||
auto numTicks = thisTick - (*lastTick);
|
if (const auto numTicks = thisTick - (*lastTick))
|
||||||
if (numTicks)
|
|
||||||
{
|
{
|
||||||
*lastTick = thisTick;
|
*lastTick = thisTick;
|
||||||
*duration -= pQAV->ticksPerFrame * numTicks;
|
*duration -= pQAV->ticksPerFrame * numTicks;
|
||||||
|
@ -328,35 +327,34 @@ void qavProcessTicker(QAV* const pQAV, int* duration, int* lastTick)
|
||||||
|
|
||||||
void qavProcessTimer(PLAYER* const pPlayer, QAV* const pQAV, int* duration, double* interpfrac, bool const fixedduration, bool const ignoreWeaponTimer)
|
void qavProcessTimer(PLAYER* const pPlayer, QAV* const pQAV, int* duration, double* interpfrac, bool const fixedduration, bool const ignoreWeaponTimer)
|
||||||
{
|
{
|
||||||
// Process if not paused.
|
// Process clock based on QAV's ticrate and last tick value.
|
||||||
if (!paused)
|
if (!paused)
|
||||||
{
|
{
|
||||||
// Process clock based on QAV's ticrate and last tick value.
|
|
||||||
qavProcessTicker(pQAV, &pPlayer->qavTimer, &pPlayer->qavLastTick);
|
qavProcessTicker(pQAV, &pPlayer->qavTimer, &pPlayer->qavLastTick);
|
||||||
|
|
||||||
if (pPlayer->weaponTimer == 0 && pPlayer->qavTimer == 0 && !ignoreWeaponTimer)
|
|
||||||
{
|
|
||||||
// Check if we're playing an idle QAV as per the ticker's weapon timer.
|
|
||||||
*duration = fixedduration ? pQAV->duration - 1 : I_GetBuildTime() % pQAV->duration;
|
|
||||||
*interpfrac = 1.;
|
|
||||||
}
|
|
||||||
else if (pPlayer->qavTimer == 0)
|
|
||||||
{
|
|
||||||
// If qavTimer is 0, play the last frame uninterpolated. Sometimes the timer can be just ahead of weaponTimer.
|
|
||||||
*duration = pQAV->duration - 1;
|
|
||||||
*interpfrac = 1.;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Apply normal values.
|
|
||||||
*duration = pQAV->duration - pPlayer->qavTimer;
|
|
||||||
*interpfrac = !cl_interpolate || cl_capfps ? 1. : I_GetTimeFrac(pQAV->ticrate);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
pPlayer->qavLastTick = I_GetTime(pQAV->ticrate);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pPlayer->weaponTimer == 0 && pPlayer->qavTimer == 0 && !ignoreWeaponTimer)
|
||||||
|
{
|
||||||
|
// Check if we're playing an idle QAV as per the ticker's weapon timer.
|
||||||
|
*duration = fixedduration ? pQAV->duration - 1 : I_GetBuildTime() % pQAV->duration;
|
||||||
*interpfrac = 1.;
|
*interpfrac = 1.;
|
||||||
}
|
}
|
||||||
|
else if (pPlayer->qavTimer == 0)
|
||||||
|
{
|
||||||
|
// If qavTimer is 0, play the last frame uninterpolated. Sometimes the timer can be just ahead of weaponTimer.
|
||||||
|
*duration = pQAV->duration - 1;
|
||||||
|
*interpfrac = 1.;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Apply normal values.
|
||||||
|
*duration = pQAV->duration - pPlayer->qavTimer;
|
||||||
|
*interpfrac = !cl_interpolate || cl_capfps || paused ? 1. : I_GetTimeFrac(pQAV->ticrate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue