- 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.
This commit is contained in:
Christoph Oelckers 2017-03-30 18:51:24 +02:00
parent 3a1228bf95
commit 91ac6e30fe
1 changed files with 3 additions and 5 deletions

View File

@ -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]);