X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fevents.c;h=f6442956645825d6ac8e1e1cdcd970e01fe64397;hp=bd82a609734afb1c06ebf95f52862a82594ab54c;hb=aaa6bf53eceb4c7801966a017dcc8a57c2fdface;hpb=8e4eb47925648cd84d134dfe05ca7fb30727dc24 diff --git a/src/events.c b/src/events.c index bd82a609..f6442956 100644 --- a/src/events.c +++ b/src/events.c @@ -54,20 +54,13 @@ static void HandleEventActions(void); int FilterMouseMotionEvents(void *userdata, Event *event) { - if (event->type != EVENT_MOTIONNOTIFY) - return 1; - - int mouse_x = ((MotionEvent *)event)->x; - int mouse_y = ((MotionEvent *)event)->y; - - // mouse events do not contain logical screen size corrections at this stage - SDLCorrectMouseEventXY(&mouse_x, &mouse_y); - - mouse_x -= video.screen_xoffset; - mouse_y -= video.screen_yoffset; + if (event->type == EVENT_MOTIONNOTIFY) + { + int mouse_x = ((MotionEvent *)event)->x; + int mouse_y = ((MotionEvent *)event)->y; - gfx.mouse_x = mouse_x; - gfx.mouse_y = mouse_y; + UpdateRawMousePosition(mouse_x, mouse_y); + } return 1; } @@ -593,6 +586,8 @@ void HandleWindowEvent(WindowEvent *event) if (game_status == GAME_MODE_SETUP) RedrawSetupScreenAfterFullscreenToggle(); + UpdateMousePosition(); + SetWindowTitle(); } } @@ -2142,6 +2137,8 @@ void HandleKey(Key key, int key_status) if (game_status == GAME_MODE_SETUP) RedrawSetupScreenAfterFullscreenToggle(); + UpdateMousePosition(); + // set flag to ignore repeated "key pressed" events ignore_repeated_key = TRUE; @@ -2173,6 +2170,8 @@ void HandleKey(Key key, int key_status) if (game_status == GAME_MODE_SETUP) RedrawSetupScreenAfterFullscreenToggle(); + UpdateMousePosition(); + return; }