mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
Prevent mouse motion when returning from message prompts (#1722)
* Flush mouse motion when clearing relative state * Clear relative mouse state when clearing input variables * Prevent mouse motion when returning from message prompts
This commit is contained in:
parent
4f95da2225
commit
32be8190c8
@ -820,6 +820,7 @@ void G_ClearInput(void)
|
||||
ClearLocalView();
|
||||
G_ClearCarry();
|
||||
memset(&basecmd, 0, sizeof(basecmd));
|
||||
I_ResetRelativeMouseState();
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -220,6 +220,8 @@ void I_ShowMouseCursor(boolean toggle)
|
||||
|
||||
void I_ResetRelativeMouseState(void)
|
||||
{
|
||||
SDL_PumpEvents();
|
||||
SDL_FlushEvent(SDL_MOUSEMOTION);
|
||||
SDL_GetRelativeMouseState(NULL, NULL);
|
||||
}
|
||||
|
||||
@ -1782,8 +1784,6 @@ void I_InitGraphics(void)
|
||||
ResetLogicalSize();
|
||||
|
||||
// clear out events waiting at the start and center the mouse
|
||||
SDL_PumpEvents();
|
||||
SDL_FlushEvent(SDL_MOUSEMOTION);
|
||||
I_ResetRelativeMouseState();
|
||||
}
|
||||
|
||||
|
@ -1900,7 +1900,6 @@ void MN_ClearMenus(void)
|
||||
// sendpause = true;
|
||||
|
||||
G_ClearInput();
|
||||
I_ResetRelativeMouseState();
|
||||
}
|
||||
|
||||
void MN_Back(void)
|
||||
@ -2727,6 +2726,7 @@ boolean M_Responder(event_t *ev)
|
||||
messageRoutine(ch);
|
||||
}
|
||||
|
||||
G_ClearInput();
|
||||
menuactive = false;
|
||||
M_StartSound(sfx_swtchx);
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user