Add EXPERIMENTAL_MOUSE_SCREEN to menu_input.c

This commit is contained in:
twinaphex 2015-10-08 10:07:30 +02:00
parent 666c6849b7
commit e572cb19f5

View File

@ -784,6 +784,10 @@ int menu_input_bind_iterate(char *s, size_t len)
return 0;
}
#if 0
#define EXPERIMENTAL_MOUSE_SCREEN
#endif
static int menu_input_mouse(unsigned *action)
{
unsigned fb_width, fb_height;
@ -834,6 +838,12 @@ static int menu_input_mouse(unsigned *action)
0, RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELUP);
menu_input->mouse.hwheeldown = input_driver_state(binds, 0, RETRO_DEVICE_MOUSE,
0, RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELDOWN);
#ifdef EXPERIMENTAL_MOUSE_SCREEN
menu_input->mouse.screen_x = input_driver_state(binds, 0, RARCH_DEVICE_MOUSE_SCREEN,
0, RETRO_DEVICE_ID_MOUSE_X);
menu_input->mouse.screen_y = input_driver_state(binds, 0, RARCH_DEVICE_MOUSE_SCREEN,
0, RETRO_DEVICE_ID_MOUSE_Y);
#else
menu_input->mouse.dx = input_driver_state(binds, 0, RETRO_DEVICE_MOUSE,
0, RETRO_DEVICE_ID_MOUSE_X);
menu_input->mouse.dy = input_driver_state(binds, 0, RETRO_DEVICE_MOUSE,
@ -841,6 +851,8 @@ static int menu_input_mouse(unsigned *action)
menu_input->mouse.screen_x += menu_input->mouse.dx;
menu_input->mouse.screen_y += menu_input->mouse.dy;
#endif
menu_input->mouse.x = ((int)menu_input->mouse.screen_x * (int)fb_width) / (int)vp.width;
menu_input->mouse.y = ((int)menu_input->mouse.screen_y * (int)fb_height) / (int)vp.height;
@ -855,8 +867,10 @@ static int menu_input_mouse(unsigned *action)
menu_input->mouse.y = fb_height - 5;
if (
#ifndef EXPERIMENTAL_MOUSE_SCREEN
(menu_input->mouse.dx != 0) ||
(menu_input->mouse.dy !=0) ||
#endif
menu_input->mouse.left ||
menu_input->mouse.wheelup ||
menu_input->mouse.wheeldown ||