From: bones_was_here Date: Wed, 10 Apr 2024 15:35:45 +0000 (+1000) Subject: vid: don't overwrite vid_width and vid_height when using vid_desktopfullscreen X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6ffb7e700763040f04cfdeffccf59b808491ce06;p=xonotic%2Fdarkplaces.git vid: don't overwrite vid_width and vid_height when using vid_desktopfullscreen This allows the player's windowed mode preferences to be saved by default. Signed-off-by: bones_was_here --- diff --git a/vid_shared.c b/vid_shared.c index b119a3ac..ef064928 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -1443,9 +1443,13 @@ static int VID_Mode(int fullscreen, int width, int height, int bpp, float refres Con_Printf("Video Mode: %s %dx%dx%dx%.2fhz%s on display %i\n", mode.fullscreen ? "fullscreen" : "window", mode.width, mode.height, mode.bitsperpixel, mode.refreshrate, mode.stereobuffer ? " stereo" : "", vid.displayindex); - Cvar_SetValueQuick(&vid_fullscreen, vid.mode.fullscreen); - Cvar_SetValueQuick(&vid_width, vid.mode.width); - Cvar_SetValueQuick(&vid_height, vid.mode.height); + // desktopfullscreen doesn't need fallback mode saved so let cvars store windowed mode dimensions + if (!vid_desktopfullscreen.integer) // maybe checking SDL_WINDOW_FULLSCREEN_DESKTOP is better? + { + Cvar_SetValueQuick(&vid_fullscreen, vid.mode.fullscreen); + Cvar_SetValueQuick(&vid_width, vid.mode.width); + Cvar_SetValueQuick(&vid_height, vid.mode.height); + } Cvar_SetValueQuick(&vid_bitsperpixel, vid.mode.bitsperpixel); Cvar_SetValueQuick(&vid_samples, vid.mode.samples); if(vid_userefreshrate.integer)