From 6ca6d5639baa7e88a1a891d2b0c9c004f3b9c857 Mon Sep 17 00:00:00 2001 From: Mitch Richters Date: Sun, 31 Oct 2021 11:06:13 +1100 Subject: [PATCH] - SW: Fix horizon of camera screens originating from changes in 09a05f354c70a3820e1efe2d8b52da4b490daba6. --- source/games/sw/src/jsector.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/source/games/sw/src/jsector.cpp b/source/games/sw/src/jsector.cpp index 1fc9fbcbb..53b510b6a 100644 --- a/source/games/sw/src/jsector.cpp +++ b/source/games/sw/src/jsector.cpp @@ -595,7 +595,6 @@ void JS_DrawCameras(PLAYERp pp, int tx, int ty, int tz, double smoothratio) SPRITEp sp = nullptr; - int camhoriz; short w; int dx, dy, dz, tdx, tdy, tdz, midx, midy; @@ -691,14 +690,8 @@ void JS_DrawCameras(PLAYERp pp, int tx, int ty, int tz, double smoothratio) // tag5 } - // See if there is a horizon value. 0 defaults to - // 100! - if (SP_TAG7(sp) != 0) - { - camhoriz = clamp(SP_TAG7(sp), gi->playerHorizMin(), gi->playerHorizMax()); - } - else - camhoriz = 0; // Default + // Set the horizon value. + auto camhoriz = q16horiz(clamp(IntToFixed(SP_TAG7(sp) - 100), gi->playerHorizMin(), gi->playerHorizMax())); // If player is dead still then update at MoveSkip4 // rate. @@ -720,7 +713,7 @@ void JS_DrawCameras(PLAYERp pp, int tx, int ty, int tz, double smoothratio) } else { - drawroomstotile(sp->x, sp->y, sp->z, buildang(SP_TAG5(sp)), buildhoriz(camhoriz), sp->sectnum, mirror[cnt].campic, smoothratio); + drawroomstotile(sp->x, sp->y, sp->z, buildang(SP_TAG5(sp)), camhoriz, sp->sectnum, mirror[cnt].campic, smoothratio); } } }