Minor code cleanup & remove some unneeded resolution info from logs.

This commit is contained in:
spherallic 2022-02-06 16:13:45 +01:00
parent 599644e885
commit 35f2937fd1
2 changed files with 13 additions and 25 deletions

View file

@ -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

View file

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