From 9972c6584217c735648edb282ec00d314c58d4d2 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 14 Nov 2022 20:55:29 +1100 Subject: [PATCH] - Duke: Back up all sprites as soon as possible. * The player's input is processed before the sprites were backed up, causing interpolation issues with the player's Z. --- source/games/duke/src/actors.cpp | 18 ------------------ source/games/duke/src/actors_d.cpp | 1 - source/games/duke/src/actors_r.cpp | 1 - source/games/duke/src/funct.h | 1 - source/games/duke/src/gameloop.cpp | 6 ++++++ 5 files changed, 6 insertions(+), 21 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index e8c9ec963..472aab2de 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -4370,24 +4370,6 @@ DDukeActor *LocateTheLocator(int n, sectortype* sect) // //--------------------------------------------------------------------------- -void recordoldspritepos() -{ - for (int statNum = 0; statNum < MAXSTATUS; statNum++) - { - DukeStatIterator it(statNum); - while (auto ac = it.Next()) - { - ac->backuploc(); - } - } -} - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - void movefta(void) { diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 2e6261b63..cfd040f3f 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -3270,7 +3270,6 @@ void think_d(void) { thinktime.Reset(); thinktime.Clock(); - recordoldspritepos(); movefta(); //ST 2 moveweapons_d(); //ST 4 diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 9e86a7c89..273f8852e 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -3739,7 +3739,6 @@ void think_r(void) { thinktime.Reset(); thinktime.Clock(); - recordoldspritepos(); movefta(); //ST 2 moveweapons_r(); //ST 4 diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index 322e4bc6b..c459839c6 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -226,7 +226,6 @@ int playercolor2lookup(int color); void PlayerColorChanged(void); bool movementBlocked(player_struct *p); void loadcons(); -void recordoldspritepos(); void DrawStatusBar(); inline int32_t krand(void) diff --git a/source/games/duke/src/gameloop.cpp b/source/games/duke/src/gameloop.cpp index a60b01ebe..cd87a7ae4 100644 --- a/source/games/duke/src/gameloop.cpp +++ b/source/games/duke/src/gameloop.cpp @@ -69,6 +69,12 @@ void GameInterface::Ticker() ud.cameraactor = nullptr; everyothertime++; + DukeSpriteIterator it; + while (auto ac = it.Next()) + { + ac->backuploc(); + } + global_random = krand(); fi.movetransports();//ST 9 movedummyplayers();//ST 13