mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
skip duplicate mousemode changes
This commit is contained in:
parent
7a5285cff0
commit
482f5066b8
|
@ -68,16 +68,22 @@ void CInput::MouseRelative(float *x, float *y)
|
|||
|
||||
void CInput::MouseModeAbsolute()
|
||||
{
|
||||
m_InputGrabbed = 0;
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
SDL_SetRelativeMouseMode(SDL_FALSE);
|
||||
if(m_InputGrabbed)
|
||||
{
|
||||
m_InputGrabbed = 0;
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
SDL_SetRelativeMouseMode(SDL_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void CInput::MouseModeRelative()
|
||||
{
|
||||
m_InputGrabbed = 1;
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||
if(!m_InputGrabbed)
|
||||
{
|
||||
m_InputGrabbed = 1;
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
int CInput::MouseDoubleClick()
|
||||
|
|
Loading…
Reference in a new issue