Optimize fastforwarding runtime check - menu widgets function
was being called every frame unnecessarily
This commit is contained in:
parent
60932b18ad
commit
1de946a1b7
35
retroarch.c
35
retroarch.c
|
@ -22901,6 +22901,25 @@ static bool menu_display_libretro(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void update_fastforwarding_state(void)
|
||||||
|
{
|
||||||
|
/* Display the fast forward state to the user, if needed. */
|
||||||
|
if (runloop_fastmotion)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
|
if (!menu_widgets_set_fast_forward(true))
|
||||||
|
#endif
|
||||||
|
runloop_msg_queue_push(
|
||||||
|
msg_hash_to_str(MSG_FAST_FORWARD), 1, 1, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||||
|
}
|
||||||
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
|
else
|
||||||
|
{
|
||||||
|
menu_widgets_set_fast_forward(false);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static enum runloop_state runloop_check_state(
|
static enum runloop_state runloop_check_state(
|
||||||
settings_t *settings,
|
settings_t *settings,
|
||||||
bool input_nonblock_state,
|
bool input_nonblock_state,
|
||||||
|
@ -23515,6 +23534,7 @@ static enum runloop_state runloop_check_state(
|
||||||
runloop_fastmotion = true;
|
runloop_fastmotion = true;
|
||||||
}
|
}
|
||||||
driver_set_nonblock_state();
|
driver_set_nonblock_state();
|
||||||
|
update_fastforwarding_state();
|
||||||
}
|
}
|
||||||
else if (old_hold_button_state != new_hold_button_state)
|
else if (old_hold_button_state != new_hold_button_state)
|
||||||
{
|
{
|
||||||
|
@ -23530,22 +23550,9 @@ static enum runloop_state runloop_check_state(
|
||||||
fastforward_after_frames = 1;
|
fastforward_after_frames = 1;
|
||||||
}
|
}
|
||||||
driver_set_nonblock_state();
|
driver_set_nonblock_state();
|
||||||
|
update_fastforwarding_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display the fast forward state to the user, if needed. */
|
|
||||||
if (runloop_fastmotion)
|
|
||||||
{
|
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
|
||||||
if (!menu_widgets_set_fast_forward(true))
|
|
||||||
#endif
|
|
||||||
runloop_msg_queue_push(
|
|
||||||
msg_hash_to_str(MSG_FAST_FORWARD), 1, 1, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
|
||||||
}
|
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
|
||||||
else
|
|
||||||
menu_widgets_set_fast_forward(false);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
old_button_state = new_button_state;
|
old_button_state = new_button_state;
|
||||||
old_hold_button_state = new_hold_button_state;
|
old_hold_button_state = new_hold_button_state;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue