Try to fix build for targets that don't have HAvE_OVERLAY defined

This commit is contained in:
twinaphex 2018-05-02 13:52:27 +02:00
parent 4785893847
commit eac899f573
2 changed files with 20 additions and 7 deletions

View File

@ -34,6 +34,10 @@
#include "input_remote.h"
#endif
#ifdef HAVE_OVERLAY
#include "input_overlay.h"
#endif
#include "input_mapper.h"
#include "input_driver.h"
@ -715,8 +719,11 @@ int16_t input_state(unsigned port, unsigned device,
{
res = current_input->input_state(
current_input_data, joypad_info, libretro_input_binds, port, device, idx, id);
#ifdef HAVE_OVERLAY
if (input_overlay_is_alive(overlay_ptr) && port == 0)
res |= input_overlay_key_pressed(overlay_ptr, id);
#endif
}
else
res = 0;

View File

@ -41,6 +41,10 @@
#include "input_mapper.h"
#ifdef HAVE_OVERLAY
#include "input_overlay.h"
#endif
#include "../configuration.h"
#include "../msg_hash.h"
#include "../verbosity.h"
@ -89,11 +93,9 @@ void input_mapper_poll(input_mapper_t *handle)
unsigned max_users =
*(input_driver_get_uint(INPUT_ACTION_MAX_USERS));
bool key_event[RARCH_CUSTOM_BIND_LIST_END] = { false };
bool poll_overlay = false;
if (input_overlay_is_alive(overlay_ptr))
poll_overlay = true;
#ifdef HAVE_OVERLAY
bool poll_overlay = input_overlay_is_alive(overlay_ptr) ? true : false;
#endif
#ifdef HAVE_MENU
if (menu_driver_is_alive())
@ -162,13 +164,17 @@ void input_mapper_poll(input_mapper_t *handle)
for (j = 0; j < RARCH_FIRST_CUSTOM_BIND; j++)
{
bool remap_valid;
unsigned remap_button;
unsigned current_button_value = BIT256_GET(current_input, j);
#ifdef HAVE_OVERLAY
if (poll_overlay && i == 0)
current_button_value |= input_overlay_key_pressed(overlay_ptr, j);
#endif
unsigned remap_button =
remap_button =
settings->uints.input_remap_ids[i][j];
bool remap_valid = (current_button_value == 1) &&
remap_valid = (current_button_value == 1) &&
(j != remap_button) && (remap_button != RARCH_UNMAPPED);
if (remap_valid)