mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 12:41:21 +00:00
Minor input grabbing cleanup.
This commit is contained in:
parent
b33c895d56
commit
98a83e2322
2 changed files with 5 additions and 6 deletions
|
@ -569,13 +569,13 @@ IN_KeyboardInit(Key_Event_fp_t fp)
|
|||
|
||||
/* SDL stuff. Moved here from IN_BackendInit because
|
||||
this must be done after video is initialized. */
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||
have_grab = GLimp_InputIsGrabbed();
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
if (have_grab)
|
||||
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||
#else
|
||||
SDL_EnableUNICODE(0);
|
||||
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
have_grab = (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -708,8 +708,7 @@ qboolean GLimp_InputIsGrabbed()
|
|||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
return SDL_GetWindowGrab(window) ? true : false;
|
||||
#else
|
||||
SDL_GrabMode m = SDL_WM_GrabInput(SDL_GRAB_QUERY);
|
||||
return m == SDL_GRAB_ON;
|
||||
return (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue