From a26a46d4deab6b7a8149acd5664968802991979c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Tue, 10 Mar 2015 18:44:55 +0100 Subject: [PATCH] (Apple) Fix mouse movements --- apple/OSX/platform.m | 12 ++++++++++-- input/drivers/apple_input.c | 3 --- menu/drivers/xmb.c | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apple/OSX/platform.m b/apple/OSX/platform.m index b8781706bb..cd8e971416 100644 --- a/apple/OSX/platform.m +++ b/apple/OSX/platform.m @@ -103,8 +103,8 @@ void apple_rarch_exited(void) { NSPoint pos; // Relative - apple->mouse_x += event.deltaX; - apple->mouse_y += event.deltaY; + apple->mouse_x = event.deltaX; + apple->mouse_y = event.deltaY; // Absolute pos = [[RAGameView get] convertPoint:[event locationInWindow] fromView:nil]; @@ -188,6 +188,14 @@ static char** waiting_argv; - (void) poll_iteration { NSEvent *event; + + apple_input_data_t *apple = (apple_input_data_t*)driver.input_data; + + if (!apple) + return; + + apple->mouse_x = 0; + apple->mouse_y = 0; do { diff --git a/input/drivers/apple_input.c b/input/drivers/apple_input.c index e0c47d078d..c777bb9ef1 100644 --- a/input/drivers/apple_input.c +++ b/input/drivers/apple_input.c @@ -260,9 +260,6 @@ static void apple_input_poll(void *data) if (apple->icade_enabled) BIT32_SET(apple->buttons[0], apple->icade_buttons); - - apple->mouse_x = 0; - apple->mouse_y = 0; } static int16_t apple_mouse_state(apple_input_data_t *apple, diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index fa9ab97549..0755baea19 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1194,6 +1194,7 @@ static void xmb_draw_cursor(gl_t *gl, xmb_handle_t *xmb, float x, float y) glBindTexture(GL_TEXTURE_2D, xmb->textures.list[XMB_TEXTURE_POINTER].id); + matrix_4x4_rotate_z(&mrot, 0); matrix_4x4_multiply(&mymat, &mrot, &gl->mvp_no_rot); glEnable(GL_BLEND);