From 8f4cd93023f1fe9234d5e53d4f83df353d27fe43 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 27 Nov 2021 23:18:27 +1100 Subject: [PATCH] - WHaven: Uplift `gi->GetInput()` to work after merging. --- source/core/gameinput.h | 8 ++++---- source/games/whaven/src/input.cpp | 3 +-- source/games/whaven/src/wh.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/source/core/gameinput.h b/source/core/gameinput.h index aa1d5f208..7c2928958 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -79,11 +79,11 @@ struct PlayerHorizon void scaletozero(fixedhoriz& object, double const value, double const scaleAdjust, double const push = 0.) { if (object.asq16()) - { + { auto sgn = Sgn(object.asq16()); object -= getscaledhoriz(value, scaleAdjust, &object, push == 0 ? sgn * (1. / 3.) : push); if (sgn != Sgn(object.asq16())) object = q16horiz(0); - } + } } // Ticrate playsim adjustment processor. @@ -199,11 +199,11 @@ struct PlayerAngle void scaletozero(binangle& object, double const value, double const scaleAdjust, double const push = 0.) { if (object.asbam()) - { + { auto sgn = Sgn(object.signedbam()); object -= getscaledangle(value, scaleAdjust, &object, push == 0 ? sgn * (1. / 3.) : push); if (sgn != Sgn(object.signedbam())) object = bamang(0); - } + } } // Ticrate playsim adjustment processor. diff --git a/source/games/whaven/src/input.cpp b/source/games/whaven/src/input.cpp index 068fd019f..322e6a1b9 100644 --- a/source/games/whaven/src/input.cpp +++ b/source/games/whaven/src/input.cpp @@ -93,7 +93,7 @@ static void UpdatePlayerSpriteAngle(PLAYER& plr) plr.actor()->s().ang = plr.angle.ang.asbuild(); } -void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput) +void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdjust, InputPacket* packet) { if (paused || M_Active()) { @@ -112,7 +112,6 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput) if (plr.dead) localInput.actions &= SB_OPEN; } - double const scaleAdjust = InputScale(); InputPacket input{}; if (!plr.dead) diff --git a/source/games/whaven/src/wh.h b/source/games/whaven/src/wh.h index 3af0edf20..040cdc329 100644 --- a/source/games/whaven/src/wh.h +++ b/source/games/whaven/src/wh.h @@ -527,7 +527,7 @@ struct GameInterface : public ::GameInterface FString GetCoordString() override; //void ExitFromMenu() override; //void DrawPlayerSprite(const DVector2& origin, bool onteam) override; - void GetInput(InputPacket* packet, ControlInfo* const hidInput) override; + void GetInput(ControlInfo* const hidInput, double const scaleAdjust, InputPacket* packet) override; void UpdateSounds() override; void Startup() override; void DrawBackground() override;