mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-13 21:31:32 +00:00
Fix -nomouse
This commit is contained in:
parent
a721528c50
commit
b7e8d7d044
1 changed files with 23 additions and 20 deletions
|
@ -818,6 +818,8 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt)
|
|||
event_t event;
|
||||
int wwidth, wheight;
|
||||
|
||||
if (USE_MOUSEINPUT)
|
||||
{
|
||||
SDL_GetWindowSize(window, &wwidth, &wheight);
|
||||
|
||||
if ((SDL_GetMouseFocus() != window && SDL_GetKeyboardFocus() != window))
|
||||
|
@ -832,8 +834,8 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt)
|
|||
}
|
||||
else
|
||||
{
|
||||
event.data2 = (evt.xrel) * (wwidth / realwidth);
|
||||
event.data3 = -evt.yrel * (wheight / realheight);
|
||||
event.data2 = (int)round((evt.xrel) * ((float)wwidth / (float)realwidth));
|
||||
event.data3 = (int)round(-evt.yrel * ((float)wheight / (float)realheight));
|
||||
}
|
||||
|
||||
event.type = ev_mouse;
|
||||
|
@ -844,6 +846,7 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt)
|
|||
HalfWarpMouse(wwidth, wheight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void Impl_HandleMouseButtonEvent(SDL_MouseButtonEvent evt, Uint32 type)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue