Interp: do not update view interpolation state during sped-up tics

- If you called R_ResetViewInterpolation once but G_Ticker
  got called more than once, then the effect of
  R_ResetViewInterpolation would be cancelled
- This should be a comprehensive solution to the titlemap
  camera bug
- Multiple tests:
  - -skipintro
  - -warp, then exit to title
  - map command, then exit to title
  - Wait for attract demo, then skip and exit to title
This commit is contained in:
James R 2024-03-18 04:15:49 -07:00
parent 9e549d5607
commit 95216563a6
2 changed files with 14 additions and 8 deletions

View file

@ -66,6 +66,7 @@
#include "music.h"
#include "k_bans.h"
#include "sanitize.h"
#include "r_fps.h"
// cl loading screen
#include "v_video.h"
@ -6045,6 +6046,8 @@ boolean TryRunTics(tic_t realtics)
if (ticking)
{
boolean tickInterp = true;
// run the count * tics
while (neededtic > gametic)
{
@ -6073,7 +6076,17 @@ boolean TryRunTics(tic_t realtics)
P_PostLoadLevel();
}
G_Ticker((gametic % NEWTICRATERATIO) == 0);
boolean run = (gametic % NEWTICRATERATIO) == 0;
if (run && tickInterp)
{
// Update old view state BEFORE ticking so resetting
// the old interpolation state from game logic works.
R_UpdateViewInterpolation();
tickInterp = false; // do not update again in sped-up tics
}
G_Ticker(run);
}
if (Playing() && netgame && (gametic % TICRATE == 0))

View file

@ -852,13 +852,6 @@ void P_Ticker(boolean run)
}
}
if (run)
{
// Update old view state BEFORE ticking so resetting
// the old interpolation state from game logic works.
R_UpdateViewInterpolation();
}
if (objectplacing)
{
if (OP_FreezeObjectplace())