From 91ac6e30fe30b518a9d636bcd4fc5086a7df6958 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 30 Mar 2017 18:51:24 +0200 Subject: [PATCH] - fixed: The automap tried to access a variable before it was initialized. The fix is not ideal but the way this code is used it cannot be done any better. --- src/am_map.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/am_map.cpp b/src/am_map.cpp index 721bd3650..31961831e 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -790,7 +790,6 @@ static double mapystart=0; // y-value for the start of the map bitmap...used in static double mapxstart=0; //x-value for the bitmap. static bool stopped = true; -static int viewbottom; static void AM_calcMinMaxMtoF(); @@ -1063,7 +1062,7 @@ static void AM_findMinMaxBoundaries () static void AM_calcMinMaxMtoF() { double a = SCREENWIDTH / max_w; - double b = viewbottom / max_h; + double b = StatusBar->GetTopOfStatusbar() / max_h; min_scale_mtof = a < b ? a : b; max_scale_mtof = SCREENHEIGHT / (2*PLAYERRADIUS); @@ -1421,7 +1420,7 @@ void AM_NewResolution() else if (scale_mtof > max_scale_mtof) AM_maxOutWindowScale(); f_w = screen->GetWidth(); - f_h = viewbottom; + f_h = StatusBar->GetTopOfStatusbar(); AM_activateNewScale(); } @@ -3169,7 +3168,6 @@ void AM_Drawer (int bottom) bool allmap = (level.flags2 & LEVEL2_ALLMAP) != 0; bool allthings = allmap && players[consoleplayer].mo->FindInventory(NAME_PowerScanner, true) != nullptr; - viewbottom = bottom; if (am_portaloverlay) { sector_t *sec; @@ -3186,7 +3184,7 @@ void AM_Drawer (int bottom) // and view size adjustments. f_x = f_y = 0; f_w = screen->GetWidth (); - f_h = viewbottom; + f_h = bottom; f_p = screen->GetPitch (); AM_clearFB(AMColors[AMColors.Background]);