mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -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.
|
||||
// Relative mode implicitly hides the cursor.
|
||||
SDL_SetRelativeMouseMode(!show);
|
||||
SDL_GetRelativeMouseState(NULL, NULL);
|
||||
}
|
||||
|
||||
//
|
||||
@ -177,7 +176,6 @@ static void UpdateGrab(void)
|
||||
if (!grab && currently_grabbed)
|
||||
{
|
||||
SetShowCursor(true);
|
||||
SDL_GetRelativeMouseState(NULL, NULL);
|
||||
}
|
||||
|
||||
currently_grabbed = grab;
|
||||
@ -196,15 +194,12 @@ void I_ShowMouseCursor(boolean on)
|
||||
state = on;
|
||||
}
|
||||
|
||||
if (on)
|
||||
{
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
SDL_GetRelativeMouseState(NULL, NULL);
|
||||
}
|
||||
SDL_ShowCursor(on);
|
||||
}
|
||||
|
||||
void I_ResetRelativeMouseState(void)
|
||||
{
|
||||
SDL_GetRelativeMouseState(NULL, NULL);
|
||||
}
|
||||
|
||||
// [FG] window event handling from Chocolate Doom 3.0
|
||||
|
@ -108,6 +108,7 @@ void *I_GetSDLRenderer(void);
|
||||
void I_InitWindowIcon(void);
|
||||
|
||||
void I_ShowMouseCursor(boolean on);
|
||||
void I_ResetRelativeMouseState(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -6770,6 +6770,7 @@ static void M_ClearMenus(void)
|
||||
// sendpause = true;
|
||||
|
||||
G_ClearInput();
|
||||
I_ResetRelativeMouseState();
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user