diff --git a/source/core/inputstate.cpp b/source/core/inputstate.cpp index aa55b505d..a18c01317 100644 --- a/source/core/inputstate.cpp +++ b/source/core/inputstate.cpp @@ -50,6 +50,7 @@ ESyncBits ActionsToSend = 0; static int dpad_lock = 0; bool sendPause; bool crouch_toggle; +double inputScale; // Mouse speeds CVAR(Float, m_pitch, 1.f, CVAR_GLOBALCONFIG | CVAR_ARCHIVE) diff --git a/source/core/inputstate.h b/source/core/inputstate.h index 4782fb79f..6aa203d6e 100644 --- a/source/core/inputstate.h +++ b/source/core/inputstate.h @@ -105,6 +105,7 @@ void SetupGameButtons(); void ApplyGlobalInput(InputPacket& input, ControlInfo* const hidInput, bool const crouchable = true, bool const disableToggle = false); extern ESyncBits ActionsToSend; extern bool gamesetinput; +extern double inputScale; inline bool SyncInput() { diff --git a/source/core/mainloop.cpp b/source/core/mainloop.cpp index 8d551b24f..30a664ef9 100644 --- a/source/core/mainloop.cpp +++ b/source/core/mainloop.cpp @@ -134,7 +134,7 @@ void G_BuildTiccmd(ticcmd_t* cmd) cmd->ucmd = {}; I_GetEvent(); auto input = CONTROL_GetInput(); - gi->GetInput(&input, I_GetInputFrac(SyncInput()), &cmd->ucmd); + gi->GetInput(&input, inputScale, &cmd->ucmd); cmd->consistency = consistency[myconnectindex][(maketic / ticdup) % BACKUPTICS]; } @@ -589,7 +589,7 @@ void TryRunTics (void) { I_GetEvent(); auto input = CONTROL_GetInput(); - gi->GetInput(&input, I_GetInputFrac(SyncInput())); + gi->GetInput(&input, inputScale); } return; } diff --git a/source/games/blood/src/controls.cpp b/source/games/blood/src/controls.cpp index 1b404fd80..917e92732 100644 --- a/source/games/blood/src/controls.cpp +++ b/source/games/blood/src/controls.cpp @@ -62,8 +62,6 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju pPlayer->Angles.applyYaw(input.avel, &pPlayer->input.actions, scaleAdjust); pPlayer->Angles.applyPitch(input.horz, &pPlayer->input.actions, scaleAdjust); } - - pPlayer->Angles.applyScaledAdjustments(scaleAdjust); } if (packet) diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index f3b2a3c24..f1fa392bc 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -598,6 +598,10 @@ 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/input.cpp b/source/games/duke/src/input.cpp index 781da0e5c..fb8f6a7d0 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -838,8 +838,6 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju p->Angles.applyYaw(p->adjustavel(input.avel), &p->sync.actions, scaleAdjust); p->Angles.applyPitch(input.horz, &p->sync.actions, scaleAdjust); } - - p->Angles.applyScaledAdjustments(scaleAdjust); } if (packet) diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index f4c81dfcb..cc7a869b1 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -221,6 +221,10 @@ 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/input.cpp b/source/games/exhumed/src/input.cpp index 4bd7bd85e..82e0a6c01 100644 --- a/source/games/exhumed/src/input.cpp +++ b/source/games/exhumed/src/input.cpp @@ -95,7 +95,6 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju } } - pPlayer->Angles.applyScaledAdjustments(scaleAdjust); UpdatePlayerSpriteAngle(pPlayer); } diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index 02d435f56..237bde369 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -195,11 +195,19 @@ void DrawView(double interpfrac, bool sceneonly) DoInterpolations(interpfrac); - auto pPlayerActor = PlayerList[nLocalPlayer].pActor; + auto pPlayer = &PlayerList[nLocalPlayer]; + auto pPlayerActor = pPlayer->pActor; auto nPlayerOldCstat = pPlayerActor->spr.cstat; - auto pDop = PlayerList[nLocalPlayer].pDoppleSprite; + 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 2f9a9ad90..51e35dc7a 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -1237,6 +1237,10 @@ 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); diff --git a/source/games/sw/src/input.cpp b/source/games/sw/src/input.cpp index 1696ef979..29e03f271 100644 --- a/source/games/sw/src/input.cpp +++ b/source/games/sw/src/input.cpp @@ -199,8 +199,6 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju { DoPlayerTurnTurret(pp, input.avel); } - - pp->Angles.applyScaledAdjustments(scaleAdjust); } if (packet)