From 182180c6b914ba719ef1328c36cd5f5ed5a5dc62 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Sun, 26 Oct 2014 00:37:20 +0200 Subject: [PATCH] (Apple input) Change mouse_delta[0]/mouse_delta[1] to mouse_x/mouse_y --- apple/OSX/platform.m | 4 ++-- input/apple_input.c | 8 ++++---- input/apple_input.h | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apple/OSX/platform.m b/apple/OSX/platform.m index 5548b450bb..bfd6005ef8 100644 --- a/apple/OSX/platform.m +++ b/apple/OSX/platform.m @@ -90,8 +90,8 @@ void apple_rarch_exited(void) { NSPoint pos; // Relative - apple->mouse_delta[0] += event.deltaX; - apple->mouse_delta[1] += event.deltaY; + apple->mouse_x += event.deltaX; + apple->mouse_y += event.deltaY; // Absolute pos = [[RAGameView get] convertPoint:[event locationInWindow] fromView:nil]; diff --git a/input/apple_input.c b/input/apple_input.c index 286f7c6628..5c8a9cef26 100644 --- a/input/apple_input.c +++ b/input/apple_input.c @@ -389,8 +389,8 @@ static void apple_input_poll(void *data) if (icade_enabled) BIT32_SET(apple->buttons[0], icade_buttons); - apple->mouse_delta[0] = 0; - apple->mouse_delta[1] = 0; + apple->mouse_x = 0; + apple->mouse_y = 0; } static int16_t apple_mouse_state(apple_input_data_t *apple, @@ -399,9 +399,9 @@ static int16_t apple_mouse_state(apple_input_data_t *apple, switch (id) { case RETRO_DEVICE_ID_MOUSE_X: - return apple->mouse_delta[0]; + return apple->mouse_x; case RETRO_DEVICE_ID_MOUSE_Y: - return apple->mouse_delta[1]; + return apple->mouse_y; case RETRO_DEVICE_ID_MOUSE_LEFT: return apple->mouse_buttons & 1; case RETRO_DEVICE_ID_MOUSE_RIGHT: diff --git a/input/apple_input.h b/input/apple_input.h index 5a02f561cb..b0774b8a3a 100644 --- a/input/apple_input.h +++ b/input/apple_input.h @@ -41,7 +41,8 @@ typedef struct uint32_t touch_count; uint32_t mouse_buttons; - int16_t mouse_delta[2]; + int16_t mouse_x; + int16_t mouse_y; uint32_t key_state[MAX_KEYS];