From 454f9530087e93169e91b50410fd05ed36548405 Mon Sep 17 00:00:00 2001 From: sezero Date: Tue, 16 Feb 2010 09:01:53 +0000 Subject: [PATCH] gl_vidsdl.c (VID_Init): Changed default mode to windowed. Added -w as an alternative to -window command line switch. added new -f and -fullscreen command line switches. added comments about the problems being encountered when default mode is fullscreen. git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@13 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/gl_vidsdl.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/quakespasm/Quake/gl_vidsdl.c b/quakespasm/Quake/gl_vidsdl.c index 1da55370..27627ec5 100644 --- a/quakespasm/Quake/gl_vidsdl.c +++ b/quakespasm/Quake/gl_vidsdl.c @@ -1209,13 +1209,18 @@ void VID_Init (void) basenummodes = nummodes = 1; VID_InitFullDIB(); - if (COM_CheckParm("-window")) + // Config file is not read yet, so we don't know vid_fullscreen.value + // Changed this to default to -window as otherwise it occasionally forces + // two switches of video mode (window->fullscreen->window) which is bad S.A + // It's still not perfect but, hell, this ancient code can be a pain + if (!COM_CheckParm("-fullscreen") && !COM_CheckParm ("-f")) { windowed = true; vid_default = MODE_WINDOWED; } else { + Cvar_Set ("vid_fullscreen", "1"); if (nummodes == 1) Sys_Error ("No RGB fullscreen modes available"); @@ -1395,11 +1400,17 @@ void VID_Init (void) //johnfitz -- command line vid settings should override config file settings. //so we have to lock the vid mode from now until after all config files are read. if (COM_CheckParm("-width") || COM_CheckParm("-height") || - COM_CheckParm("-bpp") || COM_CheckParm("-window")) + COM_CheckParm("-bpp") || + COM_CheckParm("-window") || COM_CheckParm("-w") || + COM_CheckParm("-fullscreen") || COM_CheckParm("-f")) { vid_locked = true; } //johnfitz + + // The problem here is (say) previous video mode is 1024x768 windowed + // And we call "fitzquake -w". This disables setting of 1024x768, and when video lock + // is removed, we get 800x600. } /*