Add RETRO_OVERLAY_NEXT bind.

This commit is contained in:
Themaister 2012-12-22 15:33:28 +01:00
parent 023443e1aa
commit 34bd32c1fd
7 changed files with 31 additions and 9 deletions

View File

@ -406,6 +406,7 @@ static const struct retro_keybind retro_keybinds_1[] = {
{ true, RARCH_ENABLE_HOTKEY, RETROK_UNKNOWN, NO_BTN, AXIS_NONE },
{ true, RARCH_VOLUME_UP, RETROK_KP_PLUS, NO_BTN, AXIS_NONE },
{ true, RARCH_VOLUME_DOWN, RETROK_KP_MINUS, NO_BTN, AXIS_NONE },
{ true, RARCH_OVERLAY_NEXT, RETROK_UNKNOWN, NO_BTN, AXIS_NONE },
};
// Player 2-5

View File

@ -99,6 +99,7 @@ enum // RetroArch specific bind IDs.
RARCH_ENABLE_HOTKEY,
RARCH_VOLUME_UP,
RARCH_VOLUME_DOWN,
RARCH_OVERLAY_NEXT,
#ifdef RARCH_CONSOLE
RARCH_CHEAT_INPUT,

View File

@ -539,6 +539,7 @@ static const struct str_to_bind_map str_to_bind[] = {
{ "enable_hotkey", RARCH_ENABLE_HOTKEY },
{ "volume_up", RARCH_VOLUME_UP },
{ "volume_down", RARCH_VOLUME_DOWN },
{ "overlay_next", RARCH_OVERLAY_NEXT },
};
unsigned input_str_to_bind(const char *str)

View File

@ -2310,8 +2310,8 @@ static void check_turbo(void)
#ifdef HAVE_XML
static void check_shader_dir(void)
{
static bool old_pressed_next = false;
static bool old_pressed_prev = false;
static bool old_pressed_next;
static bool old_pressed_prev;
if (!g_extern.shader_dir.list || !driver.video->set_shader)
return;
@ -2370,9 +2370,9 @@ static void check_cheats(void)
if (!g_extern.cheat)
return;
static bool old_pressed_prev = false;
static bool old_pressed_next = false;
static bool old_pressed_toggle = false;
static bool old_pressed_prev;
static bool old_pressed_next;
static bool old_pressed_toggle;
bool pressed_next = input_key_pressed_func(RARCH_CHEAT_INDEX_PLUS);
bool pressed_prev = input_key_pressed_func(RARCH_CHEAT_INDEX_MINUS);
@ -2394,7 +2394,7 @@ static void check_cheats(void)
#if defined(HAVE_SCREENSHOTS) && !defined(_XBOX)
static void check_screenshot(void)
{
static bool old_pressed = false;
static bool old_pressed;
bool pressed = input_key_pressed_func(RARCH_SCREENSHOT);
if (pressed && !old_pressed)
take_screenshot();
@ -2409,7 +2409,7 @@ static void check_dsp_config(void)
if (!g_extern.audio_data.dsp_plugin || !g_extern.audio_data.dsp_plugin->config)
return;
static bool old_pressed = false;
static bool old_pressed;
bool pressed = input_key_pressed_func(RARCH_DSP_CONFIG);
if (pressed && !old_pressed)
g_extern.audio_data.dsp_plugin->config(g_extern.audio_data.dsp_handle);
@ -2424,7 +2424,7 @@ static void check_mute(void)
if (!g_extern.audio_active)
return;
static bool old_pressed = false;
static bool old_pressed;
bool pressed = input_key_pressed_func(RARCH_MUTE);
if (pressed && !old_pressed)
{
@ -2475,7 +2475,7 @@ static void check_volume(void)
#ifdef HAVE_NETPLAY
static void check_netplay_flip(void)
{
static bool old_pressed = false;
static bool old_pressed;
bool pressed = input_key_pressed_func(RARCH_NETPLAY_FLIP);
if (pressed && !old_pressed)
netplay_flip_players(g_extern.netplay);
@ -2497,6 +2497,19 @@ static void check_block_hotkey(void)
driver.block_hotkey = !input_key_pressed_func(RARCH_ENABLE_HOTKEY);
}
static void check_overlay(void)
{
if (!driver.overlay)
return;
static bool old_pressed;
bool pressed = input_key_pressed_func(RARCH_OVERLAY_NEXT);
if (pressed && !old_pressed)
input_overlay_next(driver.overlay);
old_pressed = pressed;
}
static void do_state_checks(void)
{
check_block_hotkey();
@ -2510,6 +2523,7 @@ static void do_state_checks(void)
#endif
check_turbo();
check_overlay();
#ifdef HAVE_NETPLAY
if (!g_extern.netplay)

View File

@ -356,6 +356,9 @@
# Decreases audio volume.
# input_volume_down = kp_minus
# Toggles to next overlay. Wraps around.
# input_overlay_next =
#### Misc
# Enable rewinding. This will take a performance hit when playing, so it is disabled by default.

View File

@ -678,6 +678,7 @@ static const struct bind_map bind_maps[MAX_PLAYERS][RARCH_BIND_LIST_END_NULL] =
DECLARE_BIND(enable_hotkey, RARCH_ENABLE_HOTKEY),
DECLARE_BIND(volume_up, RARCH_VOLUME_UP),
DECLARE_BIND(volume_down, RARCH_VOLUME_DOWN),
DECLARE_BIND(overlay_next, RARCH_OVERLAY_NEXT),
},
{ DECL_PLAYER(2) },

View File

@ -122,6 +122,7 @@ static struct bind binds[] = {
MISC_BIND("Hotkey enable", enable_hotkey),
MISC_BIND("Volume up", volume_up),
MISC_BIND("Volume down", volume_down),
MISC_BIND("Next overlay", overlay_next),
};
#define MAX_BUTTONS 32