Refactor menu_widgets_iterate

This commit is contained in:
twinaphex 2020-02-16 23:38:24 +01:00
parent 5d5200d20b
commit 633277ddd0
3 changed files with 15 additions and 9 deletions

View File

@ -883,7 +883,8 @@ static void menu_widgets_layout(
void menu_widgets_iterate(
unsigned width, unsigned height,
const char *dir_assets, char *font_path)
const char *dir_assets, char *font_path,
bool is_threaded)
{
size_t i;
@ -903,16 +904,16 @@ void menu_widgets_iterate(
/* Note: We don't need a full context reset here
* > Just rescale layout, and reset frame time counter */
menu_widgets_layout(
video_driver_is_threaded(),
dir_assets, font_path);
menu_widgets_layout(is_threaded, dir_assets, font_path);
video_driver_monitor_reset();
}
/* Messages queue */
/* Consume one message if available */
if (fifo_read_avail(msg_queue) > 0 && !widgets_moving && current_msgs->size < MSG_QUEUE_ONSCREEN_MAX)
if ((fifo_read_avail(msg_queue) > 0)
&& !widgets_moving
&& (current_msgs->size < MSG_QUEUE_ONSCREEN_MAX))
{
menu_widget_msg_t *msg_widget;
@ -929,7 +930,8 @@ void menu_widgets_iterate(
0
);
file_list_set_userdata(current_msgs, current_msgs->size-1, msg_widget);
file_list_set_userdata(current_msgs,
current_msgs->size-1, msg_widget);
}
/* Regular messages are always above tasks */
else
@ -950,7 +952,9 @@ void menu_widgets_iterate(
/* Start expiration timer if not associated to a task */
if (!msg_widget->task_ptr)
{
menu_widgets_start_msg_expiration_timer(msg_widget, MSG_QUEUE_ANIMATION_DURATION*2 + msg_widget->duration);
menu_widgets_start_msg_expiration_timer(
msg_widget, MSG_QUEUE_ANIMATION_DURATION * 2
+ msg_widget->duration);
}
/* Else, start hourglass animation timer */
else

View File

@ -53,7 +53,8 @@ void menu_widgets_volume_update_and_show(float new_volume,
void menu_widgets_iterate(
unsigned width, unsigned height,
const char *dir_assets, char *font_path);
const char *dir_assets, char *font_path,
bool is_threaded);
void menu_widgets_screenshot_taken(const char *shotname, const char *filename);

View File

@ -27333,7 +27333,8 @@ static enum runloop_state runloop_check_state(void)
menu_widgets_iterate(
video_driver_width, video_driver_height,
settings->paths.directory_assets,
settings->paths.path_font);
settings->paths.path_font,
video_driver_is_threaded_internal());
runloop_msg_queue_unlock();
}
#endif