[client] ds: refactor app and cursor state into app.c and core.c

This commit is contained in:
Geoffrey McRae
2021-01-29 05:13:26 +11:00
parent 33fed48277
commit 4e1c0cc0d0
7 changed files with 210 additions and 219 deletions

View File

@@ -297,10 +297,8 @@ static int sdlEventFilter(void * userdata, SDL_Event * event)
break;
app_updateCursorPos(event->motion.x, event->motion.y);
if (app_cursorIsGrabbed())
app_handleMouseGrabbed(event->motion.xrel, event->motion.yrel);
else
app_handleMouseNormal(event->motion.xrel, event->motion.yrel);
app_handleMouseRelitive(event->motion.xrel, event->motion.yrel,
event->motion.xrel, event->motion.yrel);
break;
case SDL_MOUSEBUTTONDOWN:
@@ -457,8 +455,7 @@ static void sdlWarpPointer(int x, int y, bool exiting)
static void sdlRealignPointer(void)
{
// no need to care about grab, realign only happens in normal mode
app_handleMouseNormal(0, 0);
app_handleMouseRelitive(0.0, 0.0, 0.0, 0.0);
}
static bool sdlIsValidPointerPos(int x, int y)