Buildfix/move input code around

This commit is contained in:
twinaphex 2015-11-24 01:18:00 +01:00
parent 6e86dd5491
commit 075a4891dc
4 changed files with 35 additions and 28 deletions

View File

@ -602,3 +602,29 @@ bool check_block_hotkey(bool enable_hotkey)
* hotkeys to be bound to same keys as RetroPad. */
return (use_hotkey_enable && enable_hotkey);
}
/**
* input_poll:
*
* Input polling callback function.
**/
void input_poll(void)
{
driver_t *driver = driver_get_ptr();
settings_t *settings = config_get_ptr();
const input_driver_t *input = driver ?
(const input_driver_t*)driver->input : NULL;
(void)settings;
input->poll(driver->input_data);
#ifdef HAVE_OVERLAY
input_poll_overlay(settings->input.overlay_opacity);
#endif
#ifdef HAVE_COMMAND
if (driver->command)
rarch_cmd_poll(driver->command);
#endif
}

View File

@ -123,9 +123,15 @@ retro_input_t input_keys_pressed(void);
bool check_block_hotkey(bool enable_hotkey);
/**
* input_poll:
*
* Input polling callback function.
**/
void input_poll(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -31,6 +31,7 @@
#include "retroarch.h"
#include "rewind.h"
#include "performance.h"
#include "input/input_common.h"
#include "input/input_remapping.h"
#include "audio/audio_driver.h"
#include "record/record_driver.h"
@ -179,32 +180,6 @@ static int16_t input_state(unsigned port, unsigned device,
return res;
}
/**
* input_poll:
*
* Input polling callback function.
**/
static void input_poll(void)
{
driver_t *driver = driver_get_ptr();
settings_t *settings = config_get_ptr();
const input_driver_t *input = driver ?
(const input_driver_t*)driver->input : NULL;
(void)settings;
input->poll(driver->input_data);
#ifdef HAVE_OVERLAY
input_poll_overlay(settings->input.overlay_opacity);
#endif
#ifdef HAVE_COMMAND
if (driver->command)
rarch_cmd_poll(driver->command);
#endif
}
/**
* retro_set_default_callbacks:
* @data : pointer to retro_callbacks object

View File

@ -2305,7 +2305,7 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
case MENU_FILE_PLAIN:
switch (menu_label_hash)
{
#ifdef HAVE_LBIRETRODB
#ifdef HAVE_LIBRETRODB
case MENU_LABEL_SCAN_FILE:
BIND_ACTION_OK(cbs, action_ok_scan_file);
break;