gl_vidsdl.c, vid.h: cleanup some modestate related stuff (requires a clean build)

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@819 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
svdijk 2013-02-24 13:42:23 +00:00
parent eb7bc0e1b7
commit d8196b6a00
2 changed files with 16 additions and 10 deletions

View file

@ -75,7 +75,7 @@ static void GL_Init (void);
static void GL_SetupState (void); //johnfitz static void GL_SetupState (void); //johnfitz
viddef_t vid; // global video state viddef_t vid; // global video state
modestate_t modestate = MS_WINDOWED; modestate_t modestate = MS_UNINIT;
qboolean scr_skipupdate; qboolean scr_skipupdate;
qboolean isIntelVideo = false; //johnfitz -- intel video workarounds from Baker qboolean isIntelVideo = false; //johnfitz -- intel video workarounds from Baker
@ -350,10 +350,13 @@ static void VID_Restart (void)
// //
// update mouse grab // update mouse grab
// //
if (modestate == MS_FULLSCREEN) if (key_dest == key_console || key_dest == key_menu)
IN_Activate(); {
else if (key_dest == key_console || key_dest == key_menu) if (modestate == MS_WINDOWED)
IN_Deactivate(true); IN_Deactivate(true);
else if (modestate == MS_FULLSCREEN)
IN_Activate();
}
} }
/* /*
@ -1029,10 +1032,13 @@ void VID_Toggle (void)
VID_SyncCvars(); VID_SyncCvars();
// update mouse grab // update mouse grab
if (modestate == MS_FULLSCREEN) if (key_dest == key_console || key_dest == key_menu)
IN_Activate(); {
else if (key_dest == key_console || key_dest == key_menu) if (modestate == MS_WINDOWED)
IN_Deactivate(true); IN_Deactivate(true);
else if (modestate == MS_FULLSCREEN)
IN_Activate();
}
} }
else else
{ {

View file

@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define VID_GRADES (1 << VID_CBITS) #define VID_GRADES (1 << VID_CBITS)
// moved here for global use -- kristian // moved here for global use -- kristian
typedef enum { MS_UNINIT = -1, MS_WINDOWED, MS_FULLSCREEN } modestate_t; typedef enum { MS_UNINIT, MS_WINDOWED, MS_FULLSCREEN } modestate_t;
extern modestate_t modestate; extern modestate_t modestate;