mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Move a test inside function, rather than repeated all over the place.
This commit is contained in:
parent
a9c61bb6bf
commit
1201f615ee
3 changed files with 13 additions and 18 deletions
|
@ -73,8 +73,7 @@ VID_UpdateFullscreen (cvar_t *vid_fullscreen)
|
|||
|| (!vid_fullscreen->int_val && screen->flags & SDL_FULLSCREEN))
|
||||
if (!SDL_WM_ToggleFullScreen (screen))
|
||||
Con_Printf ("VID_UpdateFullscreen: error setting fullscreen\n");
|
||||
if (in_grab)
|
||||
IN_UpdateGrab (in_grab);
|
||||
IN_UpdateGrab (in_grab);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -391,23 +391,17 @@ X11_UpdateFullscreen (cvar_t *fullscreen)
|
|||
X11_ForceMove (window_x, window_y);
|
||||
window_saved = 0;
|
||||
}
|
||||
if (in_grab) {
|
||||
IN_UpdateGrab (in_grab);
|
||||
}
|
||||
IN_UpdateGrab (in_grab);
|
||||
return;
|
||||
} else {
|
||||
if (in_grab) {
|
||||
IN_UpdateGrab (in_grab);
|
||||
}
|
||||
IN_UpdateGrab (in_grab);
|
||||
|
||||
if (X11_GetWindowCoords (&window_x, &window_y))
|
||||
window_saved = 1;
|
||||
|
||||
X11_SetVidMode (scr_width, scr_height);
|
||||
|
||||
if (in_grab) { // FIXME: why are there two of these?
|
||||
IN_UpdateGrab (in_grab);
|
||||
}
|
||||
IN_UpdateGrab (in_grab); // FIXME: why are there two of these?
|
||||
|
||||
if (!vidmode_active) {
|
||||
window_saved = 0;
|
||||
|
|
|
@ -83,13 +83,15 @@ static int input_grabbed = 0;
|
|||
void
|
||||
IN_UpdateGrab (cvar_t *var) // called from context_*.c
|
||||
{
|
||||
if (var->int_val) {
|
||||
if (!input_grabbed) {
|
||||
input_grabbed = IN_LL_Grab_Input ();
|
||||
}
|
||||
} else {
|
||||
if (input_grabbed) {
|
||||
input_grabbed = IN_LL_Ungrab_Input ();
|
||||
if (var) {
|
||||
if (var->int_val) {
|
||||
if (!input_grabbed) {
|
||||
input_grabbed = IN_LL_Grab_Input ();
|
||||
}
|
||||
} else {
|
||||
if (input_grabbed) {
|
||||
input_grabbed = IN_LL_Ungrab_Input ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue