This commit is contained in:
twinaphex 2016-11-20 14:46:11 +01:00
parent e9daa5e99c
commit d7ec915e1a

View File

@ -36,9 +36,6 @@
#include "../configuration.h" #include "../configuration.h"
static int mouse_old_x;
static int mouse_old_y;
enum menu_mouse_action enum menu_mouse_action
{ {
MENU_MOUSE_ACTION_NONE = 0, MENU_MOUSE_ACTION_NONE = 0,
@ -52,6 +49,9 @@ enum menu_mouse_action
MENU_MOUSE_ACTION_HORIZ_WHEEL_DOWN MENU_MOUSE_ACTION_HORIZ_WHEEL_DOWN
}; };
static int mouse_old_x = 0;
static int mouse_old_y = 0;
menu_input_t *menu_input_get_ptr(void) menu_input_t *menu_input_get_ptr(void)
{ {
static menu_input_t menu_input_state; static menu_input_t menu_input_state;
@ -87,16 +87,10 @@ bool menu_input_ctl(enum menu_input_ctl_state state, void *data)
pointer_dragging = false; pointer_dragging = false;
break; break;
case MENU_INPUT_CTL_MOUSE_PTR: case MENU_INPUT_CTL_MOUSE_PTR:
{ menu_input->mouse.ptr = (*(unsigned*)data);
unsigned *ptr = (unsigned*)data;
menu_input->mouse.ptr = *ptr;
}
break; break;
case MENU_INPUT_CTL_POINTER_PTR: case MENU_INPUT_CTL_POINTER_PTR:
{ menu_input->pointer.ptr = (*(unsigned*)data);
unsigned *ptr = (unsigned*)data;
menu_input->pointer.ptr = *ptr;
}
break; break;
case MENU_INPUT_CTL_POINTER_ACCEL_READ: case MENU_INPUT_CTL_POINTER_ACCEL_READ:
{ {
@ -105,10 +99,7 @@ bool menu_input_ctl(enum menu_input_ctl_state state, void *data)
} }
break; break;
case MENU_INPUT_CTL_POINTER_ACCEL_WRITE: case MENU_INPUT_CTL_POINTER_ACCEL_WRITE:
{ menu_input->pointer.accel = (*(float*)data);
float *ptr = (float*)data;
menu_input->pointer.accel = *ptr;
}
break; break;
case MENU_INPUT_CTL_IS_POINTER_DRAGGED: case MENU_INPUT_CTL_IS_POINTER_DRAGGED:
return pointer_dragging; return pointer_dragging;