From 6d761aafe80e7c3283c0c99694f4057950be62dc Mon Sep 17 00:00:00 2001 From: sezero Date: Mon, 26 Apr 2010 13:33:07 +0000 Subject: [PATCH] gl_vidsdl.c (VID_SetMode): If mode setting failed, error out before doing anything else unnecessary in between. gl_vidnt.c (VID_SetMode): Likewise. git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@147 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/gl_vidnt.c | 10 +++++----- quakespasm/Quake/gl_vidsdl.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/quakespasm/Quake/gl_vidnt.c b/quakespasm/Quake/gl_vidnt.c index 77321a31..63bcbc32 100644 --- a/quakespasm/Quake/gl_vidnt.c +++ b/quakespasm/Quake/gl_vidnt.c @@ -576,6 +576,11 @@ int VID_SetMode (int modenum) Sys_Error ("VID_SetMode: Bad mode type in modelist"); } + if (!stat) + { + Sys_Error ("Couldn't set video mode"); + } + //johnfitz -- re-initialize dinput becuase it's tied to the "mainwindow" object if (COM_CheckParm ("-dinput")) IN_InitDInput (); @@ -588,11 +593,6 @@ int VID_SetMode (int modenum) CDAudio_Resume (); scr_disabled_for_loading = temp; - if (!stat) - { - Sys_Error ("Couldn't set video mode"); - } - // now we try to make sure we get the focus on the mode switch, because // sometimes in some systems we don't. We grab the foreground, then // finish setting up, pump all our messages, and sleep for a little while diff --git a/quakespasm/Quake/gl_vidsdl.c b/quakespasm/Quake/gl_vidsdl.c index de67fe11..cdb59425 100644 --- a/quakespasm/Quake/gl_vidsdl.c +++ b/quakespasm/Quake/gl_vidsdl.c @@ -308,6 +308,11 @@ int VID_SetMode (int modenum) Sys_Error ("VID_SetMode: Bad mode type in modelist"); } + if (!stat) + { + Sys_Error ("Couldn't set video mode"); + } + //kristian -- set window caption sprintf(caption, "QuakeSpasm %1.2f.%d", (float)FITZQUAKE_VERSION, QUAKESPASM_VER_PATCH); SDL_WM_SetCaption((const char* )&caption, (const char*)&caption); @@ -324,11 +329,6 @@ int VID_SetMode (int modenum) CDAudio_Resume (); scr_disabled_for_loading = temp; - if (!stat) - { - Sys_Error ("Couldn't set video mode"); - } - vid_modenum = modenum; // fix the leftover Alt from any Alt-Tab or the like that switched us away