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
This commit is contained in:
sezero 2010-04-26 13:33:07 +00:00
parent fa0abdefdf
commit 6d761aafe8
2 changed files with 10 additions and 10 deletions

View file

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

View file

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