diff --git a/src/am_map.c b/src/am_map.c index 4a3899d2..9f82ff90 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -588,6 +588,29 @@ void AM_enableSmoothLines(void) AM_drawFline = map_smooth_lines ? AM_drawFline_Smooth : AM_drawFline_Vanilla; } +static void AM_initScreenSize(void) +{ + // killough 2/7/98: get rid of finit_ vars + // to allow runtime setting of width/height + // + // killough 11/98: ... finally add hires support :) + + f_w = video.width; + if (automapoverlay && scaledviewheight == SCREENHEIGHT) + f_h = video.height; + else + f_h = video.height - ((ST_HEIGHT * video.yscale) >> FRACBITS); +} + +void AM_ResetScreenSize(void) +{ + AM_saveScaleAndLoc(); + + AM_initScreenSize(); + + AM_restoreScaleAndLoc(); +} + // // AM_LevelInit() // @@ -603,19 +626,10 @@ static void AM_LevelInit(void) static int precalc_once; automapfirststart = true; - + f_x = f_y = 0; - // killough 2/7/98: get rid of finit_ vars - // to allow runtime setting of width/height - // - // killough 11/98: ... finally add hires support :) - - f_w = video.width; - if (automapoverlay && scaledviewheight == SCREENHEIGHT) - f_h = video.height; - else - f_h = video.height - ((ST_HEIGHT * video.yscale) >> FRACBITS); + AM_initScreenSize(); AM_enableSmoothLines(); @@ -898,11 +912,7 @@ boolean AM_Responder default: togglemsg("%s", s_AMSTR_OVERLAYOFF); break; } - if (automapoverlay && scaledviewheight == SCREENHEIGHT) - f_h = video.height; - else - f_h = video.height - ((ST_HEIGHT * video.yscale) >> FRACBITS); - + AM_initScreenSize(); AM_activateNewScale(); } else if (M_InputActivated(input_map_rotate)) diff --git a/src/am_map.h b/src/am_map.h index 4b1268f9..54df3590 100644 --- a/src/am_map.h +++ b/src/am_map.h @@ -54,6 +54,8 @@ extern void AM_initVariables(void); void AM_SetMapCenter(fixed_t x, fixed_t y); +void AM_ResetScreenSize(void); + typedef struct { int64_t x,y; diff --git a/src/i_video.c b/src/i_video.c index 40ca2467..1cde26e9 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -1047,6 +1047,9 @@ static void ResetResolution(int height) R_InitVisplanesRes(); setsizeneeded = true; // run R_ExecuteSetViewSize + if (automapactive) + AM_ResetScreenSize(); + I_InitDiskFlash(); I_Printf(VB_DEBUG, "ResetResolution: %dx%d", video.width, video.height); @@ -1530,9 +1533,6 @@ void I_ResetScreen(void) ResetResolution(CurrentResolutionMode()); ResetLogicalSize(); - if (automapactive) - AM_Start(); // Reset automap dimensions - ST_Start(); // Reset palette if (gamestate == GS_INTERMISSION) diff --git a/src/r_main.c b/src/r_main.c index 45ce5c9e..bea763b5 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -562,13 +562,6 @@ void R_ExecuteSetViewSize (void) // [crispy] forcefully initialize the status bar backing screen ST_refreshBackground(true); - // [FG] reinitialize Automap - if (automapactive) - AM_Start(); - - // [FG] spectre drawing mode - R_SetFuzzColumnMode(); - pspr_interp = false; } @@ -584,6 +577,9 @@ void R_Init (void) R_InitLightTables(); R_InitSkyMap(); R_InitTranslationTables(); + + // [FG] spectre drawing mode + R_SetFuzzColumnMode(); } //