Get rid of a bunch of HAVE_MFI ifdefs

This commit is contained in:
twinaphex 2015-11-16 06:23:07 +01:00
parent 1c304779a9
commit 3e81b4deef

View File

@ -143,10 +143,8 @@ int32_t cocoa_input_find_any_key(void)
if (apple->joypad)
apple->joypad->poll();
#ifdef HAVE_MFI
if (apple->sec_joypad)
apple->sec_joypad->poll();
#endif
for (i = 0; apple_key_name_map[i].hid_id; i++)
if (apple->key_state[apple_key_name_map[i].hid_id])
@ -179,17 +177,14 @@ int32_t cocoa_input_find_any_button(uint32_t port)
if (apple->joypad)
apple->joypad->poll();
#ifdef HAVE_MFI
if (apple->sec_joypad)
apple->sec_joypad->poll();
#endif
ret = cocoa_input_find_any_button_ret(apple, apple->buttons[port], port);
if (ret != -1)
return ret;
#ifdef HAVE_MFI
if (apple && apple->sec_joypad && apple->sec_joypad->get_buttons)
{
apple->sec_joypad->poll();
@ -198,7 +193,6 @@ int32_t cocoa_input_find_any_button(uint32_t port)
if (ret != -1)
return ret;
}
#endif
return -1;
}
@ -212,10 +206,8 @@ int32_t cocoa_input_find_any_axis(uint32_t port)
if (apple && apple->joypad)
apple->joypad->poll();
#ifdef HAVE_MFI
if (apple && apple->sec_joypad)
apple->sec_joypad->poll();
#endif
for (i = 0; i < 6; i++)
{
@ -274,11 +266,8 @@ static void cocoa_input_poll(void *data)
if (apple->joypad)
apple->joypad->poll();
#ifdef HAVE_MFI
if (apple->sec_joypad)
apple->sec_joypad->poll();
#endif
apple->mouse_x_last = apple->mouse_rel_x;
apple->mouse_y_last = apple->mouse_rel_y;
@ -437,10 +426,8 @@ static void cocoa_input_free(void *data)
if (apple->joypad)
apple->joypad->destroy();
#ifdef HAVE_MFI
if (apple->sec_joypad)
apple->sec_joypad->destroy();
#endif
free(apple);
}
@ -480,7 +467,6 @@ static void cocoa_input_grab_mouse(void *data, bool state)
(void)state;
}
#ifdef HAVE_MFI
static const input_device_driver_t *cocoa_input_get_sec_joypad_driver(void *data)
{
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
@ -489,7 +475,6 @@ static const input_device_driver_t *cocoa_input_get_sec_joypad_driver(void *data
return apple->sec_joypad;
return NULL;
}
#endif
static const input_device_driver_t *cocoa_input_get_joypad_driver(void *data)
{
@ -531,11 +516,7 @@ input_driver_t input_cocoa = {
NULL,
cocoa_input_set_rumble,
cocoa_input_get_joypad_driver,
#ifdef HAVE_MFI
cocoa_input_get_sec_joypad_driver,
#else
NULL,
#endif
cocoa_input_keyboard_mapping_is_blocked,
cocoa_input_keyboard_mapping_set_block,
};