From acd33a0212207e497448980d6096c9e533ca00cf Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 5 Oct 2014 01:59:15 +0200 Subject: [PATCH] (runloop.c) Expand check_stateslots --- runloop.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/runloop.c b/runloop.c index 98f37d3ce8..d9cc632d02 100644 --- a/runloop.c +++ b/runloop.c @@ -218,36 +218,32 @@ static void check_fast_forward_button(bool fastforward_pressed, } } -static void state_slot(void) -{ - char msg[PATH_MAX]; - - if (g_extern.msg_queue) - msg_queue_clear(g_extern.msg_queue); - - snprintf(msg, sizeof(msg), "State slot: %d", - g_settings.state_slot); - - if (g_extern.msg_queue) - msg_queue_push(g_extern.msg_queue, msg, 1, 180); - - RARCH_LOG("%s\n", msg); -} - static void check_stateslots(bool pressed_increase, bool pressed_decrease) { /* Save state slots */ if (pressed_increase) - { g_settings.state_slot++; - state_slot(); - } if (pressed_decrease) { if (g_settings.state_slot > 0) g_settings.state_slot--; - state_slot(); + } + + if (pressed_increase || pressed_decrease) + { + char msg[PATH_MAX]; + + if (g_extern.msg_queue) + msg_queue_clear(g_extern.msg_queue); + + snprintf(msg, sizeof(msg), "State slot: %d", + g_settings.state_slot); + + if (g_extern.msg_queue) + msg_queue_push(g_extern.msg_queue, msg, 1, 180); + + RARCH_LOG("%s\n", msg); } }