Move a test inside function, rather than repeated all over the place.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2003-02-25 06:04:42 +00:00
parent a9c61bb6bf
commit 1201f615ee
3 changed files with 13 additions and 18 deletions

View file

@ -73,7 +73,6 @@ 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);
}

View file

@ -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);
}
return;
} else {
if (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;

View file

@ -83,6 +83,7 @@ static int input_grabbed = 0;
void
IN_UpdateGrab (cvar_t *var) // called from context_*.c
{
if (var) {
if (var->int_val) {
if (!input_grabbed) {
input_grabbed = IN_LL_Grab_Input ();
@ -92,6 +93,7 @@ IN_UpdateGrab (cvar_t *var) // called from context_*.c
input_grabbed = IN_LL_Ungrab_Input ();
}
}
}
}
void