Turn another function static

This commit is contained in:
twinaphex 2015-11-24 02:18:41 +01:00
parent 00a0ab3fac
commit f04f4c89c8
3 changed files with 36 additions and 35 deletions

View File

@ -544,6 +544,38 @@ static bool check_block_hotkey(bool enable_hotkey)
return (use_hotkey_enable && enable_hotkey);
}
static retro_input_t input_driver_keys_pressed(void)
{
int key;
retro_input_t ret = 0;
driver_t *driver = driver_get_ptr();
const input_driver_t *input = input_get_ptr(driver);
for (key = 0; key < RARCH_BIND_LIST_END; key++)
{
bool state = false;
if ((!driver->block_libretro_input && ((key < RARCH_FIRST_META_KEY)))
|| !driver->block_hotkey)
state = input->key_pressed(driver->input_data, key);
if (key >= RARCH_FIRST_META_KEY)
state |= input->meta_key_pressed(driver->input_data, key);
#ifdef HAVE_OVERLAY
state |= input_overlay_key_pressed(key);
#endif
#ifdef HAVE_COMMAND
if (driver->command)
state |= rarch_cmd_get(driver->command, key);
#endif
if (state)
ret |= (UINT64_C(1) << key);
}
return ret;
}
/**
* input_keys_pressed:
*

View File

@ -137,8 +137,9 @@ void find_input_driver(void)
}
}
static const input_driver_t *input_get_ptr(driver_t *driver)
const input_driver_t *input_get_ptr(void *data)
{
driver_t *driver = (driver_t*)data;
if (!driver)
return NULL;
return driver->input;
@ -165,38 +166,6 @@ bool input_driver_set_rumble_state(unsigned port,
return false;
}
retro_input_t input_driver_keys_pressed(void)
{
int key;
retro_input_t ret = 0;
driver_t *driver = driver_get_ptr();
const input_driver_t *input = input_get_ptr(driver);
for (key = 0; key < RARCH_BIND_LIST_END; key++)
{
bool state = false;
if ((!driver->block_libretro_input && ((key < RARCH_FIRST_META_KEY)))
|| !driver->block_hotkey)
state = input->key_pressed(driver->input_data, key);
if (key >= RARCH_FIRST_META_KEY)
state |= input->meta_key_pressed(driver->input_data, key);
#ifdef HAVE_OVERLAY
state |= input_overlay_key_pressed(key);
#endif
#ifdef HAVE_COMMAND
if (driver->command)
state |= rarch_cmd_get(driver->command, key);
#endif
if (state)
ret |= (UINT64_C(1) << key);
}
return ret;
}
int16_t input_driver_state(const struct retro_keybind **retro_keybinds,
unsigned port, unsigned device, unsigned index, unsigned id)
{

View File

@ -152,8 +152,6 @@ void find_input_driver(void);
bool input_driver_set_rumble_state(unsigned port,
enum retro_rumble_effect effect, uint16_t strength);
retro_input_t input_driver_keys_pressed(void);
int16_t input_driver_state(const struct retro_keybind **retro_keybinds,
unsigned port, unsigned device, unsigned index, unsigned id);
@ -175,6 +173,8 @@ bool input_driver_keyboard_mapping_is_blocked(void);
void input_driver_keyboard_mapping_set_block(bool value);
const input_driver_t *input_get_ptr(void *data);
#ifdef __cplusplus
}
#endif