mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
fix reset relative mouse state inconsistency
This commit is contained in:
parent
6d3c3930ff
commit
c42ec4e63e
@ -154,7 +154,6 @@ static void SetShowCursor(boolean show)
|
|||||||
// When the cursor is hidden, grab the input.
|
// When the cursor is hidden, grab the input.
|
||||||
// Relative mode implicitly hides the cursor.
|
// Relative mode implicitly hides the cursor.
|
||||||
SDL_SetRelativeMouseMode(!show);
|
SDL_SetRelativeMouseMode(!show);
|
||||||
SDL_GetRelativeMouseState(NULL, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -177,7 +176,6 @@ static void UpdateGrab(void)
|
|||||||
if (!grab && currently_grabbed)
|
if (!grab && currently_grabbed)
|
||||||
{
|
{
|
||||||
SetShowCursor(true);
|
SetShowCursor(true);
|
||||||
SDL_GetRelativeMouseState(NULL, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
currently_grabbed = grab;
|
currently_grabbed = grab;
|
||||||
@ -196,15 +194,12 @@ void I_ShowMouseCursor(boolean on)
|
|||||||
state = on;
|
state = on;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (on)
|
SDL_ShowCursor(on);
|
||||||
{
|
}
|
||||||
SDL_ShowCursor(SDL_ENABLE);
|
|
||||||
}
|
void I_ResetRelativeMouseState(void)
|
||||||
else
|
{
|
||||||
{
|
SDL_GetRelativeMouseState(NULL, NULL);
|
||||||
SDL_ShowCursor(SDL_DISABLE);
|
|
||||||
SDL_GetRelativeMouseState(NULL, NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// [FG] window event handling from Chocolate Doom 3.0
|
// [FG] window event handling from Chocolate Doom 3.0
|
||||||
|
@ -108,6 +108,7 @@ void *I_GetSDLRenderer(void);
|
|||||||
void I_InitWindowIcon(void);
|
void I_InitWindowIcon(void);
|
||||||
|
|
||||||
void I_ShowMouseCursor(boolean on);
|
void I_ShowMouseCursor(boolean on);
|
||||||
|
void I_ResetRelativeMouseState(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -6770,6 +6770,7 @@ static void M_ClearMenus(void)
|
|||||||
// sendpause = true;
|
// sendpause = true;
|
||||||
|
|
||||||
G_ClearInput();
|
G_ClearInput();
|
||||||
|
I_ResetRelativeMouseState();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user