From 35f2937fd114d16cf3e5374fa80c1dcca1220fb4 Mon Sep 17 00:00:00 2001 From: spherallic Date: Sun, 6 Feb 2022 16:13:45 +0100 Subject: [PATCH] Minor code cleanup & remove some unneeded resolution info from logs. --- src/screen.c | 34 +++++++++++----------------------- src/sdl/i_video.c | 4 ++-- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/screen.c b/src/screen.c index 96e436193..f21ea2a93 100644 --- a/src/screen.c +++ b/src/screen.c @@ -368,16 +368,13 @@ void SCR_CheckDefaultMode(void) } else { - if (cv_fullscreen.value == 0) - { - CONS_Printf(M_GetText("Default windowed resolution: %d x %d (%d bits)\n"), cv_scr_width_w.value, cv_scr_height_w.value, cv_scr_depth.value); - setmodeneeded = VID_GetModeForSize(cv_scr_width_w.value, cv_scr_height_w.value) + 1; // see note above - } - else - { - CONS_Printf(M_GetText("Default resolution: %d x %d (%d bits)\n"), cv_scr_width.value, cv_scr_height.value, cv_scr_depth.value); + CONS_Printf(M_GetText("Default resolution: %d x %d\n"), cv_scr_width.value, cv_scr_height.value); + CONS_Printf(M_GetText("Windowed resolution: %d x %d\n"), cv_scr_width_w.value, cv_scr_height_w.value); + CONS_Printf(M_GetText("Default bit depth: %d bits\n"), cv_scr_depth.value); + if (cv_fullscreen.value) setmodeneeded = VID_GetModeForSize(cv_scr_width.value, cv_scr_height.value) + 1; // see note above - } + else + setmodeneeded = VID_GetModeForSize(cv_scr_width_w.value, cv_scr_height_w.value) + 1; // see note above } if (cv_renderer.value != (signed)rendermode) @@ -395,17 +392,8 @@ void SCR_CheckDefaultMode(void) // sets the modenum as the new default video mode to be saved in the config file void SCR_SetDefaultMode(void) { - // remember the default screen size - if (cv_fullscreen.value == 0) - { - CV_SetValue(&cv_scr_width_w, vid.width); - CV_SetValue(&cv_scr_height_w, vid.height); - } - else - { - CV_SetValue(&cv_scr_width, vid.width); - CV_SetValue(&cv_scr_height, vid.height); - } + CV_SetValue(cv_fullscreen.value ? &cv_scr_width : &cv_scr_width_w, vid.width); + CV_SetValue(cv_fullscreen.value ? &cv_scr_height : &cv_scr_height_w, vid.height); } // Change fullscreen on/off according to cv_fullscreen @@ -420,10 +408,10 @@ void SCR_ChangeFullscreen(void) if (graphics_started) { VID_PrepareModeList(); - if (cv_fullscreen.value == 0) - setmodeneeded = VID_GetModeForSize(cv_scr_width_w.value, cv_scr_height_w.value) + 1; - else + if (cv_fullscreen.value) setmodeneeded = VID_GetModeForSize(cv_scr_width.value, cv_scr_height.value) + 1; + else + setmodeneeded = VID_GetModeForSize(cv_scr_width_w.value, cv_scr_height_w.value) + 1; } return; #endif diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index ed766ff23..1642695d0 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1795,7 +1795,7 @@ void I_StartupGraphics(void) borderlesswindow = M_CheckParm("-borderless"); //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2); - VID_Command_ModeList_f(); + //VID_Command_ModeList_f(); #ifdef HWRENDER if (rendermode == render_opengl) @@ -1843,7 +1843,7 @@ void I_StartupGraphics(void) realwidth = (Uint16)vid.width; realheight = (Uint16)vid.height; - VID_Command_Info_f(); + //VID_Command_Info_f(); SDLdoUngrabMouse(); SDL_RaiseWindow(window);