(iOS/Apple) Dehardcode some code
This commit is contained in:
parent
3d68429aca
commit
c07aa7ec0a
|
@ -124,8 +124,6 @@ const struct apple_key_name_map_entry apple_key_name_map[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(IOS)
|
#if defined(IOS)
|
||||||
extern void apple_gamecontroller_poll_all(void);
|
|
||||||
|
|
||||||
#define HIDKEY(X) X
|
#define HIDKEY(X) X
|
||||||
#elif defined(OSX)
|
#elif defined(OSX)
|
||||||
|
|
||||||
|
@ -313,9 +311,8 @@ int32_t apple_input_find_any_key(void)
|
||||||
if (!apple)
|
if (!apple)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifdef IOS
|
if (apple->joypad)
|
||||||
apple_gamecontroller_poll_all();
|
apple->joypad->poll();
|
||||||
#endif
|
|
||||||
input_init_keyboard_lut(rarch_key_map_apple_hid);
|
input_init_keyboard_lut(rarch_key_map_apple_hid);
|
||||||
|
|
||||||
for (i = 0; apple_key_name_map[i].hid_id; i++)
|
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)
|
if (!apple)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#ifdef IOS
|
if (apple->joypad)
|
||||||
apple_gamecontroller_poll_all();
|
apple->joypad->poll();
|
||||||
#endif
|
|
||||||
|
|
||||||
buttons = apple->buttons[port];
|
buttons = apple->buttons[port];
|
||||||
if (port == 0)
|
if (port == 0)
|
||||||
|
@ -354,9 +350,8 @@ int32_t apple_input_find_any_axis(uint32_t port)
|
||||||
int i;
|
int i;
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
||||||
|
|
||||||
#ifdef IOS
|
if (apple && apple->joypad)
|
||||||
apple_gamecontroller_poll_all();
|
apple->joypad->poll();
|
||||||
#endif
|
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
|
@ -416,10 +411,6 @@ static void apple_input_poll(void *data)
|
||||||
if (!apple)
|
if (!apple)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef IOS
|
|
||||||
apple_gamecontroller_poll_all();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (i = 0; i < apple->touch_count; i++)
|
for (i = 0; i < apple->touch_count; i++)
|
||||||
{
|
{
|
||||||
input_translate_coord_viewport(apple->touches[i].screen_x,
|
input_translate_coord_viewport(apple->touches[i].screen_x,
|
||||||
|
|
|
@ -18,11 +18,9 @@
|
||||||
#include "input_common.h"
|
#include "input_common.h"
|
||||||
#include "../general.h"
|
#include "../general.h"
|
||||||
|
|
||||||
#ifdef IOS
|
|
||||||
#include "../apple/iOS/bluetooth/btdynamic.c"
|
#include "../apple/iOS/bluetooth/btdynamic.c"
|
||||||
#include "../apple/iOS/bluetooth/btpad.c"
|
#include "../apple/iOS/bluetooth/btpad.c"
|
||||||
#include "../apple/iOS/bluetooth/btpad_queue.c"
|
#include "../apple/iOS/bluetooth/btpad_queue.c"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wiimote.c"
|
#include "wiimote.c"
|
||||||
#include "apple_joypad_ps3.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)
|
static void apple_joypad_poll(void)
|
||||||
{
|
{
|
||||||
|
apple_gamecontroller_poll_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool apple_joypad_rumble(unsigned pad,
|
static bool apple_joypad_rumble(unsigned pad,
|
||||||
|
|
Loading…
Reference in New Issue