mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 21:01:04 +00:00
Only SetWindowGrab if !disable_mouse; toggle cursor visibility
This commit is contained in:
parent
46d1a866d8
commit
ed410575d6
1 changed files with 6 additions and 4 deletions
|
@ -360,6 +360,7 @@ static INT32 Impl_SDL_Scancode_To_Keycode(SDL_Scancode code)
|
||||||
|
|
||||||
static void SDLdoUngrabMouse(void)
|
static void SDLdoUngrabMouse(void)
|
||||||
{
|
{
|
||||||
|
SDL_ShowCursor(SDL_ENABLE);
|
||||||
SDL_SetWindowGrab(window, SDL_FALSE);
|
SDL_SetWindowGrab(window, SDL_FALSE);
|
||||||
wrapmouseok = SDL_FALSE;
|
wrapmouseok = SDL_FALSE;
|
||||||
SDL_SetRelativeMouseMode(SDL_FALSE);
|
SDL_SetRelativeMouseMode(SDL_FALSE);
|
||||||
|
@ -369,6 +370,7 @@ void SDLforceUngrabMouse(void)
|
||||||
{
|
{
|
||||||
if (SDL_WasInit(SDL_INIT_VIDEO)==SDL_INIT_VIDEO && window != NULL)
|
if (SDL_WasInit(SDL_INIT_VIDEO)==SDL_INIT_VIDEO && window != NULL)
|
||||||
{
|
{
|
||||||
|
SDL_ShowCursor(SDL_ENABLE);
|
||||||
SDL_SetWindowGrab(window, SDL_FALSE);
|
SDL_SetWindowGrab(window, SDL_FALSE);
|
||||||
wrapmouseok = SDL_FALSE;
|
wrapmouseok = SDL_FALSE;
|
||||||
SDL_SetRelativeMouseMode(SDL_FALSE);
|
SDL_SetRelativeMouseMode(SDL_FALSE);
|
||||||
|
@ -1553,18 +1555,18 @@ void I_StartupGraphics(void)
|
||||||
realheight = (Uint16)vid.height;
|
realheight = (Uint16)vid.height;
|
||||||
|
|
||||||
VID_Command_Info_f();
|
VID_Command_Info_f();
|
||||||
if (!disable_mouse) SDL_ShowCursor(SDL_DISABLE);
|
|
||||||
SDLdoUngrabMouse();
|
SDLdoUngrabMouse();
|
||||||
|
|
||||||
SDL_RaiseWindow(window);
|
SDL_RaiseWindow(window);
|
||||||
|
|
||||||
if (mousegrabok && !M_CheckParm("-nomouse"))
|
if (mousegrabok && !disable_mouse)
|
||||||
{
|
{
|
||||||
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
SDL_SetRelativeMouseMode(SDL_TRUE);
|
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||||
|
wrapmouseok = SDL_TRUE;
|
||||||
|
SDL_SetWindowGrab(window, SDL_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_SetWindowGrab(window, SDL_TRUE);
|
|
||||||
|
|
||||||
graphics_started = true;
|
graphics_started = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue