(iOS/Apple) Dehardcode some code

This commit is contained in:
Twinaphex 2014-10-04 16:34:52 +02:00
parent 3d68429aca
commit c07aa7ec0a
2 changed files with 8 additions and 18 deletions

View File

@ -124,8 +124,6 @@ const struct apple_key_name_map_entry apple_key_name_map[] =
};
#if defined(IOS)
extern void apple_gamecontroller_poll_all(void);
#define HIDKEY(X) X
#elif defined(OSX)
@ -312,10 +310,9 @@ int32_t apple_input_find_any_key(void)
if (!apple)
return 0;
#ifdef IOS
apple_gamecontroller_poll_all();
#endif
if (apple->joypad)
apple->joypad->poll();
input_init_keyboard_lut(rarch_key_map_apple_hid);
for (i = 0; apple_key_name_map[i].hid_id; i++)
@ -333,9 +330,8 @@ int32_t apple_input_find_any_button(uint32_t port)
if (!apple)
return -1;
#ifdef IOS
apple_gamecontroller_poll_all();
#endif
if (apple->joypad)
apple->joypad->poll();
buttons = apple->buttons[port];
if (port == 0)
@ -354,9 +350,8 @@ int32_t apple_input_find_any_axis(uint32_t port)
int i;
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
#ifdef IOS
apple_gamecontroller_poll_all();
#endif
if (apple && apple->joypad)
apple->joypad->poll();
for (i = 0; i < 4; i++)
{
@ -416,10 +411,6 @@ static void apple_input_poll(void *data)
if (!apple)
return;
#ifdef IOS
apple_gamecontroller_poll_all();
#endif
for (i = 0; i < apple->touch_count; i++)
{
input_translate_coord_viewport(apple->touches[i].screen_x,

View File

@ -18,11 +18,9 @@
#include "input_common.h"
#include "../general.h"
#ifdef IOS
#include "../apple/iOS/bluetooth/btdynamic.c"
#include "../apple/iOS/bluetooth/btpad.c"
#include "../apple/iOS/bluetooth/btpad_queue.c"
#endif
#include "wiimote.c"
#include "apple_joypad_ps3.c"
@ -208,6 +206,7 @@ static int16_t apple_joypad_axis(unsigned port, uint32_t joyaxis)
static void apple_joypad_poll(void)
{
apple_gamecontroller_poll_all();
}
static bool apple_joypad_rumble(unsigned pad,