Skip to content
Snippets Groups Projects
Commit b7e8d7d0 authored by Ronald Kinard's avatar Ronald Kinard
Browse files

Fix -nomouse

parent a721528c
No related branches found
No related tags found
No related merge requests found
...@@ -818,6 +818,8 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt) ...@@ -818,6 +818,8 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt)
event_t event; event_t event;
int wwidth, wheight; int wwidth, wheight;
if (USE_MOUSEINPUT)
{
SDL_GetWindowSize(window, &wwidth, &wheight); SDL_GetWindowSize(window, &wwidth, &wheight);
if ((SDL_GetMouseFocus() != window && SDL_GetKeyboardFocus() != window)) if ((SDL_GetMouseFocus() != window && SDL_GetKeyboardFocus() != window))
...@@ -832,8 +834,8 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt) ...@@ -832,8 +834,8 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt)
} }
else else
{ {
event.data2 = (evt.xrel) * (wwidth / realwidth); event.data2 = (int)round((evt.xrel) * ((float)wwidth / (float)realwidth));
event.data3 = -evt.yrel * (wheight / realheight); event.data3 = (int)round(-evt.yrel * ((float)wheight / (float)realheight));
} }
event.type = ev_mouse; event.type = ev_mouse;
...@@ -844,6 +846,7 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt) ...@@ -844,6 +846,7 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt)
HalfWarpMouse(wwidth, wheight); HalfWarpMouse(wwidth, wheight);
} }
} }
}
static void Impl_HandleMouseButtonEvent(SDL_MouseButtonEvent evt, Uint32 type) static void Impl_HandleMouseButtonEvent(SDL_MouseButtonEvent evt, Uint32 type)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment