From 61ec3490e8a6c30822b751370c9a156bb506fbc3 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 7 Sep 2022 19:35:40 +1000 Subject: [PATCH] - SW: Remove extern'd `smoothratio` variable. --- source/games/sw/src/draw.cpp | 6 +++--- source/games/sw/src/game.cpp | 11 +---------- source/games/sw/src/game.h | 1 - 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index bef3fc4a7..47e6cd34b 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -1062,11 +1062,11 @@ void PrintSpriteInfo(PLAYER* pp) } -void DrawCrosshair(PLAYER* pp) +static void DrawCrosshair(PLAYER* pp, const double inputfrac) { if (!(CameraTestMode)) { - ::DrawCrosshair(2326, pp->actor->user.Health, -pp->angle.look_anghalf(smoothratio * (1. / MaxSmoothRatio)), (pp->Flags & PF_VIEW_FROM_OUTSIDE) ? 5 : 0, 2, shadeToLight(10)); + ::DrawCrosshair(2326, pp->actor->user.Health, -pp->angle.look_anghalf(inputfrac), (pp->Flags & PF_VIEW_FROM_OUTSIDE) ? 5 : 0, 2, shadeToLight(10)); } } @@ -1526,7 +1526,7 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly) #endif UpdateStatusBar(); - DrawCrosshair(pp); + DrawCrosshair(pp, smoothratio * (1. / MaxSmoothRatio)); DoPlayerDiveMeter(pp); // Do the underwater breathing bar // Boss Health Meter, if Boss present diff --git a/source/games/sw/src/game.cpp b/source/games/sw/src/game.cpp index a7238d574..40529fd1e 100644 --- a/source/games/sw/src/game.cpp +++ b/source/games/sw/src/game.cpp @@ -709,18 +709,9 @@ void GameInterface::Ticker(void) void GameInterface::Render() { - if (paused) - { - smoothratio = MaxSmoothRatio; - } - else - { - smoothratio = !cl_interpolate || cl_capfps ? MaxSmoothRatio : I_GetTimeFrac() * MaxSmoothRatio; - } - drawtime.Reset(); drawtime.Clock(); - drawscreen(Player + screenpeek, smoothratio, false); + drawscreen(Player + screenpeek, (paused || !cl_interpolate || cl_capfps ? 1. : I_GetTimeFrac()) * MaxSmoothRatio, false); drawtime.Unclock(); } diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 695cf4780..f9f35d9b7 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1891,7 +1891,6 @@ extern int *lastpacket2clock; // /////////////////////////// -extern double smoothratio; extern int MoveSkip4, MoveSkip2, MoveSkip8; extern int MinEnemySkill; extern short screenpeek;