From 15b101870db478616171db23327ad8239f6bfc1e Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 7 Dec 2022 10:31:17 +1100 Subject: [PATCH] - Completely remove current scaled angle change setup. * During this transition, temporarily enforce synchronised input at all times. --- source/core/gameinput.h | 37 ++----------------------------- source/core/inputstate.h | 2 +- source/core/mainloop.cpp | 3 +++ source/games/blood/src/view.cpp | 4 ---- source/games/duke/src/render.cpp | 4 ---- source/games/exhumed/src/view.cpp | 7 ------ source/games/sw/src/draw.cpp | 4 ---- 7 files changed, 6 insertions(+), 55 deletions(-) diff --git a/source/core/gameinput.h b/source/core/gameinput.h index 1a32c95d2..ad8b3cade 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -73,30 +73,6 @@ struct PlayerAngles void addRoll(const DAngle value) { updateAngle(ROLL, pActor->spr.Angles.Roll + value); } void setRoll(const DAngle value, const bool backup = false) { updateAngle(ROLL, value, backup); } - // Applicator of pending angle changes. - void applyScaledAdjustments(const double scaleAdjust) - { - for (unsigned i = 0; i < MAXANGLES; i++) - { - if (Targets[i].Sgn()) - { - // Calculate scaled amount of target and add to the accumlation buffer. - DAngle addition = Targets[i] * scaleAdjust; - AppliedAmounts[i] += addition; - - // Test whether we're now reached/exceeded our target. - if (abs(AppliedAmounts[i]) >= abs(Targets[i])) - { - addition -= AppliedAmounts[i] - Targets[i]; - Targets[i] = AppliedAmounts[i] = nullAngle; - } - - // Apply the scaled addition to the angle. - pActor->spr.Angles[i] += addition; - } - } - } - private: // DRotator indices. enum : unsigned @@ -108,22 +84,13 @@ private: }; // Private data which should never be accessed publically. - DRotator Targets, AppliedAmounts; DCoreActor* pActor; // Internal angle updater to reduce boilerplate from the public setters. void updateAngle(const unsigned angIndex, const DAngle value, const bool backup = false) { - if (!SyncInput() && !backup) - { - Targets[angIndex] = deltaangle(pActor->spr.Angles[angIndex], value); - AppliedAmounts[angIndex] = nullAngle; - } - else - { - pActor->spr.Angles[angIndex] = value; - if (backup) pActor->PrevAngles[angIndex] = pActor->spr.Angles[angIndex]; - } + pActor->spr.Angles[angIndex] = value; + if (backup) pActor->PrevAngles[angIndex] = pActor->spr.Angles[angIndex]; } }; diff --git a/source/core/inputstate.h b/source/core/inputstate.h index 6aa203d6e..dad92afe0 100644 --- a/source/core/inputstate.h +++ b/source/core/inputstate.h @@ -109,7 +109,7 @@ extern double inputScale; inline bool SyncInput() { - return gamesetinput || cl_syncinput || cl_capfps; + return true; //gamesetinput || cl_syncinput || cl_capfps; } inline float backendinputscale() diff --git a/source/core/mainloop.cpp b/source/core/mainloop.cpp index 2f4946820..419a2e20b 100644 --- a/source/core/mainloop.cpp +++ b/source/core/mainloop.cpp @@ -540,6 +540,9 @@ void TryRunTics (void) realtics = entertic - oldentertics; oldentertics = entertic; + // update the scale factor for unsynchronised input here. + inputScale = I_GetInputFrac(SyncInput()); + // get available tics NetUpdate (); diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index f1fa392bc..f3b2a3c24 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -598,10 +598,6 @@ void viewDrawScreen(bool sceneonly) { PLAYER* pPlayer = &gPlayer[gViewIndex]; - // process scaled actor adjustments prior to drawing. - if ((inputScale = I_GetInputFrac(SyncInput())) != 1.) - pPlayer->Angles.applyScaledAdjustments(inputScale); - if (testgotpic(2342, true)) { FireProcess(); diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index 4fd5a1677..7a4162a53 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -221,10 +221,6 @@ void displayrooms(int snum, double interpfrac, bool sceneonly) player_struct* p = &ps[snum]; - // process scaled actor adjustments prior to drawing. - if ((inputScale = I_GetInputFrac(SyncInput())) != 1.) - p->Angles.applyScaledAdjustments(inputScale); - if (automapMode == am_full || !p->insector()) return; diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index 237bde369..fd6a85766 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -201,13 +201,6 @@ void DrawView(double interpfrac, bool sceneonly) auto pDop = pPlayer->pDoppleSprite; auto nDoppleOldCstat = pDop->spr.cstat; - // process scaled actor adjustments prior to drawing. - if ((inputScale = I_GetInputFrac(SyncInput())) != 1.) - { - pPlayer->Angles.applyScaledAdjustments(inputScale); - UpdatePlayerSpriteAngle(pPlayer); - } - if (nSnakeCam >= 0 && !sceneonly) { DExhumedActor* pActor = SnakeList[nSnakeCam].pSprites[0]; diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index 51e35dc7a..2f9a9ad90 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -1237,10 +1237,6 @@ void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly) if (cl_sointerpolation) so_dointerpolations(interpfrac); } - // process scaled actor adjustments prior to drawing. - if ((inputScale = I_GetInputFrac(SyncInput())) != 1.) - pp->Angles.applyScaledAdjustments(inputScale); - // Get initial player position, interpolating if required. DVector3 tpos = camerapp->actor->getRenderPos(interpfrac); DRotator tangles = camerapp->Angles.getRenderAngles(interpfrac);