Revert parts of menu_widgets that were causing breakage, but leave

all the hooks in so we can add them back piece by piece again
This commit is contained in:
twinaphex 2019-02-08 07:26:43 +01:00
parent a22540310c
commit 7022786f34
49 changed files with 187 additions and 2547 deletions

View File

@ -1406,7 +1406,7 @@ static void audio_driver_mixer_play_stream_internal(unsigned i, unsigned type)
audio_mixer_streams[i].state = (enum audio_mixer_state)type; audio_mixer_streams[i].state = (enum audio_mixer_state)type;
} }
static void audio_driver_load_menu_bgm_callback(retro_task_t *task, void *task_data, void *user_data, const char *error) static void audio_driver_load_menu_bgm_callback(void *task_data, void *user_data, const char *error)
{ {
bool contentless = false; bool contentless = false;
bool is_inited = false; bool is_inited = false;

View File

@ -28,7 +28,6 @@
#include <retro_math.h> #include <retro_math.h>
#include <net/net_http.h> #include <net/net_http.h>
#include <libretro.h> #include <libretro.h>
#include <queues/task_queue.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "../config.h" #include "../config.h"
@ -1590,7 +1589,7 @@ static void cheevos_make_unlock_url(const cheevo_t *cheevo,
#endif #endif
} }
static void cheevos_unlocked(retro_task_t *task, void *task_data, void *user_data, static void cheevos_unlocked(void *task_data, void *user_data,
const char *error) const char *error)
{ {
cheevo_t *cheevo = (cheevo_t *)user_data; cheevo_t *cheevo = (cheevo_t *)user_data;

View File

@ -59,9 +59,6 @@
#include "menu/menu_content.h" #include "menu/menu_content.h"
#include "menu/menu_shader.h" #include "menu/menu_shader.h"
#include "menu/widgets/menu_dialog.h" #include "menu/widgets/menu_dialog.h"
#ifdef HAVE_MENU_WIDGETS
#include "menu/widgets/menu_widgets.h"
#endif
#endif #endif
#ifdef HAVE_NETWORKING #ifdef HAVE_NETWORKING
@ -1000,10 +997,7 @@ static void command_event_set_volume(float gain)
msg_hash_to_str(MSG_AUDIO_VOLUME), msg_hash_to_str(MSG_AUDIO_VOLUME),
new_volume); new_volume);
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS) runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
if (!video_driver_has_widgets() || !menu_widgets_volume_update_and_show())
#endif
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
RARCH_LOG("%s\n", msg); RARCH_LOG("%s\n", msg);
@ -2131,10 +2125,7 @@ TODO: Add a setting for these tweaks */
return false; return false;
} }
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS) runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
if (!video_driver_has_widgets() || !menu_widgets_volume_update_and_show())
#endif
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
RARCH_LOG("%s\n", msg); RARCH_LOG("%s\n", msg);
} }
@ -2504,12 +2495,9 @@ TODO: Add a setting for these tweaks */
RARCH_LOG("%s\n", msg_hash_to_str(MSG_PAUSED)); RARCH_LOG("%s\n", msg_hash_to_str(MSG_PAUSED));
command_event(CMD_EVENT_AUDIO_STOP, NULL); command_event(CMD_EVENT_AUDIO_STOP, NULL);
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS) runloop_msg_queue_push(msg_hash_to_str(MSG_PAUSED), 1,
if (!video_driver_has_widgets() || !menu_widgets_set_paused(is_paused)) 1, true,
#endif NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
runloop_msg_queue_push(msg_hash_to_str(MSG_PAUSED), 1,
1, true,
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
if (!is_idle) if (!is_idle)
video_driver_cached_frame(); video_driver_cached_frame();
@ -2523,11 +2511,6 @@ TODO: Add a setting for these tweaks */
} }
else else
{ {
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
if (video_driver_has_widgets())
menu_widgets_set_paused(is_paused);
#endif
RARCH_LOG("%s\n", msg_hash_to_str(MSG_UNPAUSED)); RARCH_LOG("%s\n", msg_hash_to_str(MSG_UNPAUSED));
command_event(CMD_EVENT_AUDIO_START, NULL); command_event(CMD_EVENT_AUDIO_START, NULL);
} }

View File

@ -182,7 +182,7 @@ static void handle_discord_error(int errcode, const char* message)
RARCH_LOG("[discord] error (%d: %s)\n", errcode, message); RARCH_LOG("[discord] error (%d: %s)\n", errcode, message);
} }
static void handle_discord_join_cb(retro_task_t *task, void *task_data, void *user_data, const char *err) static void handle_discord_join_cb(void *task_data, void *user_data, const char *err)
{ {
struct netplay_room *room; struct netplay_room *room;
char join_hostname[PATH_MAX_LENGTH]; char join_hostname[PATH_MAX_LENGTH];

View File

@ -26,9 +26,6 @@
#ifdef HAVE_MENU #ifdef HAVE_MENU
#include "menu/menu_driver.h" #include "menu/menu_driver.h"
#ifdef HAVE_MENU_WIDGETS
#include "menu/widgets/menu_widgets.h"
#endif
#endif #endif
#include "dynamic.h" #include "dynamic.h"
@ -388,13 +385,6 @@ void drivers_init(int flags)
core_info_init_current_core(); core_info_init_current_core();
#ifdef HAVE_MENU #ifdef HAVE_MENU
#ifdef HAVE_MENU_WIDGETS
if (video_driver_has_widgets())
{
menu_widgets_init(video_is_threaded);
menu_widgets_context_reset(video_is_threaded);
}
#endif
if (flags & DRIVER_VIDEO_MASK) if (flags & DRIVER_VIDEO_MASK)
{ {
@ -496,15 +486,6 @@ bool driver_ctl(enum driver_ctl_state state, void *data)
switch (state) switch (state)
{ {
case RARCH_DRIVER_CTL_DEINIT: case RARCH_DRIVER_CTL_DEINIT:
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
/* Tear down menu widgets no matter what
* in case the handle is lost in the threaded
* video driver in the meantime
* (breaking video_driver_has_widgets) */
menu_widgets_context_destroy();
menu_widgets_free();
#endif
video_driver_destroy(); video_driver_destroy();
audio_driver_destroy(); audio_driver_destroy();
input_driver_destroy(); input_driver_destroy();

View File

@ -33,7 +33,6 @@
#include "../audio/audio_driver.h" #include "../audio/audio_driver.h"
#include "../menu/menu_shader.h" #include "../menu/menu_shader.h"
#include "../menu/menu_animation.h"
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "../config.h" #include "../config.h"
@ -48,9 +47,6 @@
#ifdef HAVE_MENU #ifdef HAVE_MENU
#include "../menu/menu_driver.h" #include "../menu/menu_driver.h"
#include "../menu/menu_setting.h" #include "../menu/menu_setting.h"
#ifdef HAVE_MENU_WIDGETS
#include "../menu/widgets/menu_widgets.h"
#endif
#endif #endif
#include "video_thread_wrapper.h" #include "video_thread_wrapper.h"
@ -2653,10 +2649,7 @@ void video_driver_frame(const void *data, unsigned width,
/* Display the FPS, with a higher priority. */ /* Display the FPS, with a higher priority. */
if (video_info.fps_show || video_info.framecount_show) if (video_info.fps_show || video_info.framecount_show)
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS) runloop_msg_queue_push(video_info.fps_text, 2, 1, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
if (!video_driver_has_widgets() || !menu_widgets_set_fps_text(video_info.fps_text))
#endif
runloop_msg_queue_push(video_info.fps_text, 2, 1, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
/* trigger set resolution*/ /* trigger set resolution*/
if (video_info.crt_switch_resolution) if (video_info.crt_switch_resolution)
@ -3582,4 +3575,4 @@ bool video_driver_has_widgets(void)
return current_video && current_video->menu_widgets_enabled return current_video && current_video->menu_widgets_enabled
&& current_video->menu_widgets_enabled(video_driver_data); && current_video->menu_widgets_enabled(video_driver_data);
} }
#endif #endif

View File

@ -34,8 +34,6 @@
#include "../gfx/video_driver.h" #include "../gfx/video_driver.h"
#include "input_overlay.h" #include "input_overlay.h"
#include <queues/task_queue.h>
#define OVERLAY_GET_KEY(state, key) (((state)->keys[(key) / 32] >> ((key) % 32)) & 1) #define OVERLAY_GET_KEY(state, key) (((state)->keys[(key) / 32] >> ((key) % 32)) & 1)
#define OVERLAY_SET_KEY(state, key) (state)->keys[(key) / 32] |= 1 << ((key) % 32) #define OVERLAY_SET_KEY(state, key) (state)->keys[(key) / 32] |= 1 << ((key) % 32)
@ -597,7 +595,7 @@ void input_overlay_free(input_overlay_t *ol)
} }
/* task_data = overlay_task_data_t* */ /* task_data = overlay_task_data_t* */
void input_overlay_loaded(retro_task_t *task, void *task_data, void *user_data, const char *err) void input_overlay_loaded(void *task_data, void *user_data, const char *err)
{ {
size_t i; size_t i;
overlay_task_data_t *data = (overlay_task_data_t*)task_data; overlay_task_data_t *data = (overlay_task_data_t*)task_data;

View File

@ -23,7 +23,6 @@
#include <retro_common_api.h> #include <retro_common_api.h>
#include <retro_miscellaneous.h> #include <retro_miscellaneous.h>
#include <formats/image.h> #include <formats/image.h>
#include <queues/task_queue.h>
#include "input_driver.h" #include "input_driver.h"
@ -257,7 +256,7 @@ bool input_overlay_key_pressed(input_overlay_t *ol, unsigned key);
bool input_overlay_is_alive(input_overlay_t *ol); bool input_overlay_is_alive(input_overlay_t *ol);
void input_overlay_loaded(retro_task_t *task, void *task_data, void *user_data, const char *err); void input_overlay_loaded(void *task_data, void *user_data, const char *err);
void input_overlay_set_visibility(int overlay_idx,enum overlay_visibility vis); void input_overlay_set_visibility(int overlay_idx,enum overlay_visibility vis);

View File

@ -43,16 +43,15 @@ enum task_type
}; };
typedef struct retro_task retro_task_t; typedef struct retro_task retro_task_t;
typedef void (*retro_task_callback_t)(retro_task_t *task, typedef void (*retro_task_callback_t)(void *task_data,
void *task_data, void *user_data, void *user_data, const char *error);
const char *error);
typedef void (*retro_task_handler_t)(retro_task_t *task); typedef void (*retro_task_handler_t)(retro_task_t *task);
typedef bool (*retro_task_finder_t)(retro_task_t *task, typedef bool (*retro_task_finder_t)(retro_task_t *task,
void *userdata); void *userdata);
typedef void (*retro_task_queue_msg_t)(retro_task_t *task, const char *msg, typedef void (*retro_task_queue_msg_t)(const char *msg,
unsigned prio, unsigned duration, bool flush); unsigned prio, unsigned duration, bool flush);
typedef bool (*retro_task_retriever_t)(retro_task_t *task, void *data); typedef bool (*retro_task_retriever_t)(retro_task_t *task, void *data);
@ -239,7 +238,7 @@ void task_queue_deinit(void);
* This must only be called from the main thread. */ * This must only be called from the main thread. */
void task_queue_init(bool threaded, retro_task_queue_msg_t msg_push); void task_queue_init(bool threaded, retro_task_queue_msg_t msg_push);
/* Allocs and inits a new retro_task_t */ /* Allocates and inits a new retro_task_t */
retro_task_t *task_init(void); retro_task_t *task_init(void);
RETRO_END_DECLS RETRO_END_DECLS

View File

@ -62,7 +62,7 @@ static task_queue_t tasks_finished = {NULL, NULL};
static struct retro_task_impl *impl_current = NULL; static struct retro_task_impl *impl_current = NULL;
static bool task_threaded_enable = false; static bool task_threaded_enable = false;
static uint32_t task_count = 0; static uint32_t task_count = 0;
static void task_queue_msg_push(retro_task_t *task, static void task_queue_msg_push(retro_task_t *task,
unsigned prio, unsigned duration, unsigned prio, unsigned duration,
@ -78,7 +78,7 @@ static void task_queue_msg_push(retro_task_t *task,
va_end(ap); va_end(ap);
if (impl_current->msg_push) if (impl_current->msg_push)
impl_current->msg_push(task, buf, prio, duration, flush); impl_current->msg_push(buf, prio, duration, flush);
} }
static void task_queue_push_progress(retro_task_t *task) static void task_queue_push_progress(retro_task_t *task)
@ -140,7 +140,7 @@ static void retro_task_internal_gather(void)
task_queue_push_progress(task); task_queue_push_progress(task);
if (task->callback) if (task->callback)
task->callback(task, task->task_data, task->user_data, task->error); task->callback(task->task_data, task->user_data, task->error);
if (task->cleanup) if (task->cleanup)
task->cleanup(task); task->cleanup(task);
@ -823,17 +823,17 @@ char* task_get_title(retro_task_t *task)
return title; return title;
} }
static uint32_t task_get_next_ident() static uint32_t task_get_next_ident(void)
{ {
return task_count++; return task_count++;
} }
retro_task_t *task_init() retro_task_t *task_init(void)
{ {
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task)); retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
task->ident = task_get_next_ident(); task->ident = task_get_next_ident();
task->frontend_userdata = NULL; task->frontend_userdata = NULL;
return task; return task;
} }

View File

@ -1082,7 +1082,7 @@ static bool menu_content_find_first_core(menu_content_ctx_defer_info_t *def_info
} }
#ifdef HAVE_LIBRETRODB #ifdef HAVE_LIBRETRODB
void handle_dbscan_finished(retro_task_t *task, void *task_data, void *user_data, const char *err); void handle_dbscan_finished(void *task_data, void *user_data, const char *err);
#endif #endif
static void content_add_to_playlist(const char *path) static void content_add_to_playlist(const char *path)
@ -3259,7 +3259,7 @@ static int action_ok_undo_save_state(const char *path,
#ifdef HAVE_NETWORKING #ifdef HAVE_NETWORKING
#ifdef HAVE_ZLIB #ifdef HAVE_ZLIB
static void cb_decompressed(retro_task_t *task, void *task_data, void *user_data, const char *err) static void cb_decompressed(void *task_data, void *user_data, const char *err)
{ {
decompress_task_data_t *dec = (decompress_task_data_t*)task_data; decompress_task_data_t *dec = (decompress_task_data_t*)task_data;
@ -3392,7 +3392,7 @@ default_action_ok_list(action_ok_core_updater_list, MENU_ENUM_LABEL_CB_CORE_UPDA
default_action_ok_list(action_ok_thumbnails_updater_list, MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST) default_action_ok_list(action_ok_thumbnails_updater_list, MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST)
default_action_ok_list(action_ok_lakka_list, MENU_ENUM_LABEL_CB_LAKKA_LIST) default_action_ok_list(action_ok_lakka_list, MENU_ENUM_LABEL_CB_LAKKA_LIST)
static void cb_generic_dir_download(retro_task_t *task, void *task_data, static void cb_generic_dir_download(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
file_transfer_t *transf = (file_transfer_t*)user_data; file_transfer_t *transf = (file_transfer_t*)user_data;
@ -3406,7 +3406,7 @@ static void cb_generic_dir_download(retro_task_t *task, void *task_data,
} }
/* expects http_transfer_t*, file_transfer_t* */ /* expects http_transfer_t*, file_transfer_t* */
void cb_generic_download(retro_task_t *task, void *task_data, void cb_generic_download(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
char output_path[PATH_MAX_LENGTH]; char output_path[PATH_MAX_LENGTH];
@ -3541,14 +3541,11 @@ void cb_generic_download(retro_task_t *task, void *task_data,
if (path_is_compressed_file(output_path)) if (path_is_compressed_file(output_path))
{ {
void *frontend_userdata = task->frontend_userdata;
task->frontend_userdata = NULL;
if (!task_push_decompress(output_path, dir_path, if (!task_push_decompress(output_path, dir_path,
NULL, NULL, NULL, NULL, NULL, NULL,
cb_decompressed, (void*)(uintptr_t) cb_decompressed, (void*)(uintptr_t)
msg_hash_calculate(msg_hash_to_str(transf->enum_idx)), msg_hash_calculate(msg_hash_to_str(transf->enum_idx)),
frontend_userdata)) NULL))
{ {
err = msg_hash_to_str(MSG_DECOMPRESSION_FAILED); err = msg_hash_to_str(MSG_DECOMPRESSION_FAILED);
goto finish; goto finish;
@ -4278,7 +4275,7 @@ void netplay_refresh_rooms_menu(file_list_t *list)
#define INET6_ADDRSTRLEN 46 #define INET6_ADDRSTRLEN 46
#endif #endif
static void netplay_refresh_rooms_cb(retro_task_t *task, void *task_data, void *user_data, const char *err) static void netplay_refresh_rooms_cb(void *task_data, void *user_data, const char *err)
{ {
char *new_data = NULL; char *new_data = NULL;
const char *path = NULL; const char *path = NULL;
@ -4405,7 +4402,7 @@ finish:
} }
static void netplay_lan_scan_callback(retro_task_t *task, void *task_data, static void netplay_lan_scan_callback(void *task_data,
void *user_data, const char *error) void *user_data, const char *error)
{ {
struct netplay_host_list *netplay_hosts = NULL; struct netplay_host_list *netplay_hosts = NULL;

View File

@ -37,7 +37,7 @@
#endif #endif
#ifdef HAVE_LIBRETRODB #ifdef HAVE_LIBRETRODB
void handle_dbscan_finished(retro_task_t *task, void *task_data, void *user_data, const char *err) void handle_dbscan_finished(void *task_data, void *user_data, const char *err)
{ {
menu_ctx_environment_t menu_environ; menu_ctx_environment_t menu_environ;
menu_environ.type = MENU_ENVIRON_RESET_HORIZONTAL_LIST; menu_environ.type = MENU_ENVIRON_RESET_HORIZONTAL_LIST;

View File

@ -641,6 +641,7 @@ static void materialui_compute_entries_box(materialui_handle_t* mui, int width)
with acceleration */ with acceleration */
static void materialui_render(void *data, bool is_idle) static void materialui_render(void *data, bool is_idle)
{ {
menu_animation_ctx_delta_t delta;
unsigned bottom, width, height, header_height; unsigned bottom, width, height, header_height;
size_t i = 0; size_t i = 0;
materialui_handle_t *mui = (materialui_handle_t*)data; materialui_handle_t *mui = (materialui_handle_t*)data;
@ -659,6 +660,11 @@ static void materialui_render(void *data, bool is_idle)
mui->need_compute = false; mui->need_compute = false;
} }
delta.current = menu_animation_get_delta_time();
if (menu_animation_get_ideal_delta_time(&delta))
menu_animation_update(delta.ideal);
menu_display_set_width(width); menu_display_set_width(width);
menu_display_set_height(height); menu_display_set_height(height);
header_height = menu_display_get_header_height(); header_height = menu_display_get_header_height();
@ -1519,7 +1525,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
ticker.s = title_buf; ticker.s = title_buf;
ticker.len = ticker_limit; ticker.len = ticker_limit;
ticker.idx = menu_animation_get_ticker_time() / 5.0f; ticker.idx = mui->frame_count / 100;
ticker.str = title; ticker.str = title;
ticker.selected = true; ticker.selected = true;
@ -1541,7 +1547,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
ticker.s = title_buf_msg_tmp; ticker.s = title_buf_msg_tmp;
ticker.len = ticker_limit; ticker.len = ticker_limit;
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = mui->frame_count / 20;
ticker.str = title_buf_msg; ticker.str = title_buf_msg;
ticker.selected = true; ticker.selected = true;
@ -1795,7 +1801,7 @@ static void materialui_navigation_set(void *data, bool scroll)
if (!mui || !scroll) if (!mui || !scroll)
return; return;
entry.duration = 166; entry.duration = 10;
entry.target_value = scroll_pos; entry.target_value = scroll_pos;
entry.subject = &mui->scroll_y; entry.subject = &mui->scroll_y;
entry.easing_enum = EASING_IN_OUT_QUAD; entry.easing_enum = EASING_IN_OUT_QUAD;

View File

@ -29,8 +29,6 @@
#include "../../content.h" #include "../../content.h"
#include "../../retroarch.h" #include "../../retroarch.h"
#include "../../tasks/task_content.h"
static enum action_iterate_type action_iterate_type(const char *label) static enum action_iterate_type action_iterate_type(const char *label)
{ {
if (string_is_equal(label, "info_screen")) if (string_is_equal(label, "info_screen"))
@ -78,16 +76,6 @@ int generic_menu_iterate(menu_handle_t *menu, void *userdata, enum menu_action a
if (!menu) if (!menu)
return 0; return 0;
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
if (task_load_content_is_pending())
{
if (task_load_content_should_resume())
action = MENU_ACTION_OK;
else
return 0;
}
#endif
menu_entries_get_last_stack(NULL, &label, &file_type, &enum_idx, NULL); menu_entries_get_last_stack(NULL, &label, &file_type, &enum_idx, NULL);
menu->menu_state_msg[0] = '\0'; menu->menu_state_msg[0] = '\0';

View File

@ -932,6 +932,7 @@ static void ozone_compute_entries_position(ozone_handle_t *ozone)
static void ozone_render(void *data, bool is_idle) static void ozone_render(void *data, bool is_idle)
{ {
size_t i; size_t i;
menu_animation_ctx_delta_t delta;
unsigned end = (unsigned)menu_entries_get_size(); unsigned end = (unsigned)menu_entries_get_size();
ozone_handle_t *ozone = (ozone_handle_t*)data; ozone_handle_t *ozone = (ozone_handle_t*)data;
if (!data) if (!data)
@ -945,6 +946,11 @@ static void ozone_render(void *data, bool is_idle)
ozone->selection = menu_navigation_get_selection(); ozone->selection = menu_navigation_get_selection();
delta.current = menu_animation_get_delta_time();
if (menu_animation_get_ideal_delta_time(&delta))
menu_animation_update(delta.ideal);
/* TODO Handle pointer & mouse */ /* TODO Handle pointer & mouse */
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i); menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i);
@ -971,7 +977,7 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
/* Title */ /* Title */
ticker.s = title; ticker.s = title;
ticker.len = (video_info->width - 128 - 47 - 130) / ozone->title_font_glyph_width; ticker.len = (video_info->width - 128 - 47 - 130) / ozone->title_font_glyph_width;
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = ozone->frame_count / 20;
ticker.str = ozone->title; ticker.str = ozone->title;
ticker.selected = true; ticker.selected = true;
@ -1848,28 +1854,6 @@ static int ozone_list_bind_init(menu_file_list_cbs_t *cbs,
return -1; return -1;
} }
#ifdef HAVE_MENU_WIDGETS
static bool ozone_get_load_content_animation_data(void *userdata, menu_texture_item *icon, char **playlist_name)
{
ozone_handle_t *ozone = (ozone_handle_t*) userdata;
if (ozone->categories_selection_ptr > ozone->system_tab_end)
{
ozone_node_t *node = file_list_get_userdata_at_offset(ozone->horizontal_list, ozone->categories_selection_ptr - ozone->system_tab_end-1);
*icon = node->icon;
*playlist_name = node->console_name;
}
else
{
*icon = ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_QUICKMENU];
*playlist_name = "RetroArch";
}
return true;
}
#endif
menu_ctx_driver_t menu_ctx_ozone = { menu_ctx_driver_t menu_ctx_ozone = {
NULL, /* set_texture */ NULL, /* set_texture */
ozone_messagebox, ozone_messagebox,
@ -1913,8 +1897,5 @@ menu_ctx_driver_t menu_ctx_ozone = {
NULL, /* update_savestate_thumbnail_path */ NULL, /* update_savestate_thumbnail_path */
NULL, /* update_savestate_thumbnail_image */ NULL, /* update_savestate_thumbnail_image */
NULL, NULL,
NULL, NULL
#ifdef HAVE_MENU_WIDGETS
ozone_get_load_content_animation_data
#endif
}; };

View File

@ -33,9 +33,9 @@ typedef struct ozone_handle ozone_handle_t;
#define FONT_SIZE_ENTRIES_SUBLABEL 18 #define FONT_SIZE_ENTRIES_SUBLABEL 18
#define FONT_SIZE_SIDEBAR 24 #define FONT_SIZE_SIDEBAR 24
#define ANIMATION_PUSH_ENTRY_DURATION 166 #define ANIMATION_PUSH_ENTRY_DURATION 10
#define ANIMATION_CURSOR_DURATION 133 #define ANIMATION_CURSOR_DURATION 8
#define ANIMATION_CURSOR_PULSE 500 #define ANIMATION_CURSOR_PULSE 30
#define ENTRIES_START_Y 127 #define ENTRIES_START_Y 127

View File

@ -107,6 +107,9 @@ void ozone_draw_text(
uint32_t color, uint32_t color,
bool draw_outside) bool draw_outside)
{ {
if ((color & 0x000000FF) == 0)
return;
menu_display_draw_text(font, str, x, y, menu_display_draw_text(font, str, x, y,
width, height, color, text_align, 1.0f, width, height, color, text_align, 1.0f,
false, false,

View File

@ -227,11 +227,11 @@ border_iterate:
/* Prepare text */ /* Prepare text */
entry_rich_label = menu_entry_get_rich_label(&entry); entry_rich_label = menu_entry_get_rich_label(&entry);
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = ozone->frame_count / 20;
ticker.s = rich_label; ticker.s = rich_label;
ticker.str = entry_rich_label; ticker.str = entry_rich_label;
ticker.selected = entry_selected && !ozone->cursor_in_sidebar; ticker.selected = entry_selected && !ozone->cursor_in_sidebar;
ticker.len = (entry_width - 60 - text_offset) / ozone->entry_font_glyph_width; ticker.len = (entry_width - 60 - text_offset) / ozone->entry_font_glyph_width;
menu_animation_ticker(&ticker); menu_animation_ticker(&ticker);
@ -295,11 +295,11 @@ border_iterate:
ozone_draw_text(video_info, ozone, sublabel_str, x_offset + 470, y + FONT_SIZE_ENTRIES_SUBLABEL + 80 - 20 - 3 + scroll_y, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_sublabel, COLOR_TEXT_ALPHA(ozone->theme->text_sublabel_rgba, alpha_uint32), false); ozone_draw_text(video_info, ozone, sublabel_str, x_offset + 470, y + FONT_SIZE_ENTRIES_SUBLABEL + 80 - 20 - 3 + scroll_y, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_sublabel, COLOR_TEXT_ALPHA(ozone->theme->text_sublabel_rgba, alpha_uint32), false);
/* Value */ /* Value */
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = ozone->frame_count / 20;
ticker.s = entry_value_ticker; ticker.s = entry_value_ticker;
ticker.str = entry_value; ticker.str = entry_value;
ticker.selected = entry_selected && !ozone->cursor_in_sidebar; ticker.selected = entry_selected && !ozone->cursor_in_sidebar;
ticker.len = (entry_width - 60 - ((int)utf8len(entry_rich_label) * ozone->entry_font_glyph_width)) / ozone->entry_font_glyph_width; ticker.len = (entry_width - 60 - ((int)utf8len(entry_rich_label) * ozone->entry_font_glyph_width)) / ozone->entry_font_glyph_width;
menu_animation_ticker(&ticker); menu_animation_ticker(&ticker);

View File

@ -206,10 +206,10 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
goto console_iterate; goto console_iterate;
/* Icon */ /* Icon */
ozone_draw_icon(video_info, 46, 46, node->icon, ozone->sidebar_offset + 41 + 10 - 3, y - 5 - 3 + ozone->animations.scroll_y_sidebar, video_info->width, video_info->height, 0, 1, (selected ? ozone->theme->text_selected : ozone->theme->entries_icon)); ozone_draw_icon(video_info, 40, 40, node->icon, ozone->sidebar_offset + 41 + 10 - 3, y - 5 - 3 + ozone->animations.scroll_y_sidebar, video_info->width, video_info->height, 0, 1, (selected ? ozone->theme->text_selected : ozone->theme->entries_icon));
/* Text */ /* Text */
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = ozone->frame_count / 20;
ticker.len = 19; ticker.len = 19;
ticker.s = console_title; ticker.s = console_title;
ticker.selected = selected; ticker.selected = selected;

View File

@ -20,10 +20,6 @@
#include "ozone.h" #include "ozone.h"
#include "ozone_texture.h" #include "ozone_texture.h"
#ifdef HAVE_MENU_WIDGETS
#include "../../widgets/menu_widgets.h"
#endif
#include "../../../retroarch.h" #include "../../../retroarch.h"
static float ozone_pure_white[16] = { static float ozone_pure_white[16] = {

View File

@ -1585,11 +1585,10 @@ static void rgui_render(void *data, bool is_idle)
/* Format thumbnail title */ /* Format thumbnail title */
ticker.s = thumbnail_title_buf; ticker.s = thumbnail_title_buf;
ticker.len = RGUI_TERM_WIDTH(fb_width) - 10; ticker.len = RGUI_TERM_WIDTH(fb_width) - 10;
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = frame_count / RGUI_TERM_START_X(fb_width);
ticker.str = rgui->thumbnail_content; ticker.str = rgui->thumbnail_content;
ticker.selected = true; ticker.selected = true;
if (menu_animation_ticker(&ticker)) menu_animation_ticker(&ticker);
rgui->force_redraw = true;
title_width = utf8len(thumbnail_title_buf) * FONT_WIDTH_STRIDE; title_width = utf8len(thumbnail_title_buf) * FONT_WIDTH_STRIDE;
title_x = RGUI_TERM_START_X(fb_width) + ((RGUI_TERM_WIDTH(fb_width) * FONT_WIDTH_STRIDE) - title_width) / 2; title_x = RGUI_TERM_START_X(fb_width) + ((RGUI_TERM_WIDTH(fb_width) * FONT_WIDTH_STRIDE) - title_width) / 2;
@ -1620,12 +1619,11 @@ static void rgui_render(void *data, bool is_idle)
ticker.s = title_buf; ticker.s = title_buf;
ticker.len = RGUI_TERM_WIDTH(fb_width) - 10; ticker.len = RGUI_TERM_WIDTH(fb_width) - 10;
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = frame_count / RGUI_TERM_START_X(fb_width);;
ticker.str = title; ticker.str = title;
ticker.selected = true; ticker.selected = true;
if (menu_animation_ticker(&ticker)) menu_animation_ticker(&ticker);
rgui->force_redraw = true;
string_to_upper(title_buf); string_to_upper(title_buf);
@ -1645,8 +1643,7 @@ static void rgui_render(void *data, bool is_idle)
ticker.str = core_title; ticker.str = core_title;
ticker.selected = true; ticker.selected = true;
if (menu_animation_ticker(&ticker)) menu_animation_ticker(&ticker);
rgui->force_redraw = true;
if (rgui_framebuf_data) if (rgui_framebuf_data)
blit_line( blit_line(
@ -1712,19 +1709,17 @@ static void rgui_render(void *data, bool is_idle)
ticker.s = entry_title_buf; ticker.s = entry_title_buf;
ticker.len = RGUI_TERM_WIDTH(fb_width) - (entry_spacing + 1 + 2); ticker.len = RGUI_TERM_WIDTH(fb_width) - (entry_spacing + 1 + 2);
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = frame_count / RGUI_TERM_START_X(fb_width);
ticker.str = entry_path; ticker.str = entry_path;
ticker.selected = entry_selected; ticker.selected = entry_selected;
if (menu_animation_ticker(&ticker)) menu_animation_ticker(&ticker);
rgui->force_redraw = true;
ticker.s = type_str_buf; ticker.s = type_str_buf;
ticker.len = entry_spacing; ticker.len = entry_spacing;
ticker.str = entry_value; ticker.str = entry_value;
if (menu_animation_ticker(&ticker)) menu_animation_ticker(&ticker);
rgui->force_redraw = true;
entry_title_buf_utf8len = utf8len(entry_title_buf); entry_title_buf_utf8len = utf8len(entry_title_buf);
entry_title_buf_len = strlen(entry_title_buf); entry_title_buf_len = strlen(entry_title_buf);

View File

@ -69,7 +69,7 @@
#define STRIPES_RIBBON_VERTICES 2*STRIPES_RIBBON_COLS*STRIPES_RIBBON_ROWS-2*STRIPES_RIBBON_COLS #define STRIPES_RIBBON_VERTICES 2*STRIPES_RIBBON_COLS*STRIPES_RIBBON_ROWS-2*STRIPES_RIBBON_COLS
#ifndef STRIPES_DELAY #ifndef STRIPES_DELAY
#define STRIPES_DELAY 166 #define STRIPES_DELAY 10
#endif #endif
#define BATTERY_LEVEL_CHECK_INTERVAL (30 * 1000000) #define BATTERY_LEVEL_CHECK_INTERVAL (30 * 1000000)
@ -2450,7 +2450,7 @@ static int stripes_draw_item(
ticker.s = tmp; ticker.s = tmp;
ticker.len = ticker_limit; ticker.len = ticker_limit;
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = frame_count / 20;
ticker.str = ticker_str; ticker.str = ticker_str;
ticker.selected = (i == current); ticker.selected = (i == current);
@ -2486,7 +2486,7 @@ static int stripes_draw_item(
ticker.s = tmp; ticker.s = tmp;
ticker.len = 35 * stripes_scale_mod[7]; ticker.len = 35 * stripes_scale_mod[7];
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = frame_count / 20;
ticker.selected = (i == current); ticker.selected = (i == current);
if (!string_is_empty(entry->value)) if (!string_is_empty(entry->value))
@ -2654,6 +2654,7 @@ static void stripes_draw_items(
static void stripes_render(void *data, bool is_idle) static void stripes_render(void *data, bool is_idle)
{ {
size_t i; size_t i;
menu_animation_ctx_delta_t delta;
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
stripes_handle_t *stripes = (stripes_handle_t*)data; stripes_handle_t *stripes = (stripes_handle_t*)data;
unsigned end = (unsigned)menu_entries_get_size(); unsigned end = (unsigned)menu_entries_get_size();
@ -2663,6 +2664,11 @@ static void stripes_render(void *data, bool is_idle)
if (!stripes) if (!stripes)
return; return;
delta.current = menu_animation_get_delta_time();
if (menu_animation_get_ideal_delta_time(&delta))
menu_animation_update(delta.ideal);
if (pointer_enable || mouse_enable) if (pointer_enable || mouse_enable)
{ {
size_t selection = menu_navigation_get_selection(); size_t selection = menu_navigation_get_selection();

View File

@ -71,7 +71,7 @@
#define XMB_RIBBON_VERTICES 2*XMB_RIBBON_COLS*XMB_RIBBON_ROWS-2*XMB_RIBBON_COLS #define XMB_RIBBON_VERTICES 2*XMB_RIBBON_COLS*XMB_RIBBON_ROWS-2*XMB_RIBBON_COLS
#ifndef XMB_DELAY #ifndef XMB_DELAY
#define XMB_DELAY 166 #define XMB_DELAY 10
#endif #endif
#define BATTERY_LEVEL_CHECK_INTERVAL (30 * 1000000) #define BATTERY_LEVEL_CHECK_INTERVAL (30 * 1000000)
@ -2923,7 +2923,7 @@ static int xmb_draw_item(
ticker.s = tmp; ticker.s = tmp;
ticker.len = ticker_limit; ticker.len = ticker_limit;
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = frame_count / 20;
ticker.str = ticker_str; ticker.str = ticker_str;
ticker.selected = (i == current); ticker.selected = (i == current);
@ -2959,7 +2959,7 @@ static int xmb_draw_item(
ticker.s = tmp; ticker.s = tmp;
ticker.len = 35 * scale_mod[7]; ticker.len = 35 * scale_mod[7];
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = frame_count / 20;
ticker.selected = (i == current); ticker.selected = (i == current);
if (!string_is_empty(entry->value)) if (!string_is_empty(entry->value))
@ -3140,6 +3140,7 @@ static void xmb_context_reset_internal(xmb_handle_t *xmb,
static void xmb_render(void *data, bool is_idle) static void xmb_render(void *data, bool is_idle)
{ {
size_t i; size_t i;
menu_animation_ctx_delta_t delta;
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
xmb_handle_t *xmb = (xmb_handle_t*)data; xmb_handle_t *xmb = (xmb_handle_t*)data;
unsigned end = (unsigned)menu_entries_get_size(); unsigned end = (unsigned)menu_entries_get_size();
@ -3162,6 +3163,11 @@ static void xmb_render(void *data, bool is_idle)
xmb->previous_scale_factor = scale_factor; xmb->previous_scale_factor = scale_factor;
delta.current = menu_animation_get_delta_time();
if (menu_animation_get_ideal_delta_time(&delta))
menu_animation_update(delta.ideal);
if (pointer_enable || mouse_enable) if (pointer_enable || mouse_enable)
{ {
unsigned height; unsigned height;
@ -5765,28 +5771,6 @@ static int xmb_pointer_tap(void *userdata,
return 0; return 0;
} }
#ifdef HAVE_MENU_WIDGETS
static bool xmb_get_load_content_animation_data(void *userdata, menu_texture_item *icon, char **playlist_name)
{
xmb_handle_t *xmb = (xmb_handle_t*) userdata;
if (xmb->categories_selection_ptr > xmb->system_tab_end)
{
xmb_node_t *node = file_list_get_userdata_at_offset(xmb->horizontal_list, xmb->categories_selection_ptr - xmb->system_tab_end-1);
*icon = node->icon;
*playlist_name = xmb->title_name;
}
else
{
*icon = xmb->textures.list[XMB_TEXTURE_QUICKMENU];
*playlist_name = "RetroArch";
}
return true;
}
#endif
menu_ctx_driver_t menu_ctx_xmb = { menu_ctx_driver_t menu_ctx_xmb = {
NULL, NULL,
xmb_messagebox, xmb_messagebox,
@ -5830,8 +5814,5 @@ menu_ctx_driver_t menu_ctx_xmb = {
xmb_update_savestate_thumbnail_path, xmb_update_savestate_thumbnail_path,
xmb_update_savestate_thumbnail_image, xmb_update_savestate_thumbnail_image,
NULL, NULL,
NULL, NULL
#ifdef HAVE_MENU_WIDGETS
xmb_get_load_content_animation_data
#endif
}; };

View File

@ -571,7 +571,7 @@ static void xui_render(void *data, bool is_idle)
ticker.s = title; ticker.s = title;
ticker.len = RXUI_TERM_WIDTH(fb_width) - 3; ticker.len = RXUI_TERM_WIDTH(fb_width) - 3;
ticker.idx = menu_animation_get_ticker_time(); ticker.idx = (unsigned int)frame_count / 15;
ticker.str = title; ticker.str = title;
ticker.selected = true; ticker.selected = true;

View File

@ -34,6 +34,8 @@
#include "../configuration.h" #include "../configuration.h"
#include "../performance_counters.h" #include "../performance_counters.h"
#define IDEAL_DELTA_TIME (1.0 / 60.0 * 1000000.0)
struct tween struct tween
{ {
float duration; float duration;
@ -64,7 +66,6 @@ static menu_animation_t anim;
static retro_time_t cur_time = 0; static retro_time_t cur_time = 0;
static retro_time_t old_time = 0; static retro_time_t old_time = 0;
static float delta_time = 0.0f; static float delta_time = 0.0f;
static float ticker_time = 0.0f;
static bool animation_is_active = false; static bool animation_is_active = false;
/* from https://github.com/kikito/tween.lua/blob/master/tween.lua */ /* from https://github.com/kikito/tween.lua/blob/master/tween.lua */
@ -495,12 +496,9 @@ bool menu_animation_push(menu_animation_ctx_entry_t *entry)
return true; return true;
} }
bool menu_animation_update(void) bool menu_animation_update(float anim_delta_time)
{ {
unsigned i; unsigned i;
settings_t *settings = config_get_ptr();
menu_animation_update_time(settings->bools.menu_timedate_enable);
anim.in_update = true; anim.in_update = true;
anim.pending_deletes = false; anim.pending_deletes = false;
@ -508,7 +506,7 @@ bool menu_animation_update(void)
for(i = 0; i < da_count(anim.list); i++) for(i = 0; i < da_count(anim.list); i++)
{ {
struct tween *tween = da_getptr(anim.list, i); struct tween *tween = da_getptr(anim.list, i);
tween->running_since += delta_time; tween->running_since += anim_delta_time;
*tween->subject = tween->easing( *tween->subject = tween->easing(
tween->running_since, tween->running_since,
@ -593,17 +591,30 @@ bool menu_animation_ticker(const menu_animation_ctx_ticker_t *ticker)
return true; return true;
} }
bool menu_animation_get_ideal_delta_time(menu_animation_ctx_delta_t *delta)
{
if (!delta)
return false;
delta->ideal = delta->current / IDEAL_DELTA_TIME;
return true;
}
void menu_animation_update_time(bool timedate_enable) void menu_animation_update_time(bool timedate_enable)
{ {
static retro_time_t static retro_time_t
last_clock_update = 0; last_clock_update = 0;
cur_time = cpu_features_get_time_usec() / 1000.0f; cur_time = cpu_features_get_time_usec();
delta_time = old_time == 0 ? 0 : cur_time - old_time; delta_time = cur_time - old_time;
old_time = cur_time;
ticker_time = (cur_time / 1000.0f) * 3.0f;
if (((cur_time - last_clock_update) > 1000) if (delta_time >= IDEAL_DELTA_TIME* 4)
delta_time = IDEAL_DELTA_TIME * 4;
if (delta_time <= IDEAL_DELTA_TIME / 4)
delta_time = IDEAL_DELTA_TIME / 4;
old_time = cur_time;
if (((cur_time - last_clock_update) > 1000000)
&& timedate_enable) && timedate_enable)
{ {
animation_is_active = true; animation_is_active = true;
@ -742,8 +753,3 @@ void menu_timer_kill(menu_timer_t *timer)
menu_animation_ctx_tag tag = (uintptr_t) timer; menu_animation_ctx_tag tag = (uintptr_t) timer;
menu_animation_kill_by_tag(&tag); menu_animation_kill_by_tag(&tag);
} }
float menu_animation_get_ticker_time(void)
{
return ticker_time;
}

View File

@ -84,6 +84,12 @@ enum menu_animation_easing_type
EASING_LAST EASING_LAST
}; };
typedef struct menu_animation_ctx_delta
{
float current;
float ideal;
} menu_animation_ctx_delta_t;
typedef uintptr_t menu_animation_ctx_tag; typedef uintptr_t menu_animation_ctx_tag;
typedef struct menu_animation_ctx_subject typedef struct menu_animation_ctx_subject
@ -135,7 +141,9 @@ void menu_animation_init(void);
void menu_animation_free(void); void menu_animation_free(void);
bool menu_animation_update(void); bool menu_animation_update(float delta_time);
bool menu_animation_get_ideal_delta_time(menu_animation_ctx_delta_t *delta);
bool menu_animation_ticker(const menu_animation_ctx_ticker_t *ticker); bool menu_animation_ticker(const menu_animation_ctx_ticker_t *ticker);
@ -155,8 +163,6 @@ float menu_animation_get_delta_time(void);
bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data); bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data);
float menu_animation_get_ticker_time(void);
RETRO_END_DECLS RETRO_END_DECLS
#endif #endif

View File

@ -288,7 +288,7 @@ void menu_cbs_init(void *data,
int menu_cbs_exit(void); int menu_cbs_exit(void);
void cb_generic_download(retro_task_t *task, void *task_data, void cb_generic_download(void *task_data,
void *user_data, const char *err); void *user_data, const char *err);
RETRO_END_DECLS RETRO_END_DECLS

View File

@ -4139,7 +4139,7 @@ static void menu_displaylist_parse_playlist_generic(
} }
#ifdef HAVE_NETWORKING #ifdef HAVE_NETWORKING
static void wifi_scan_callback(retro_task_t *task, void *task_data, static void wifi_scan_callback(void *task_data,
void *user_data, const char *error) void *user_data, const char *error)
{ {
unsigned i; unsigned i;

View File

@ -44,10 +44,6 @@
#include "../gfx/video_driver.h" #include "../gfx/video_driver.h"
#ifdef HAVE_MENU_WIDGETS
#include "widgets/menu_widgets.h"
#endif
#include "menu_animation.h" #include "menu_animation.h"
#include "menu_driver.h" #include "menu_driver.h"
#include "menu_cbs.h" #include "menu_cbs.h"
@ -1257,7 +1253,7 @@ static bool menu_driver_load_image(menu_ctx_load_image_t *load_image_info)
return false; return false;
} }
void menu_display_handle_thumbnail_upload(retro_task_t *task, void *task_data, void menu_display_handle_thumbnail_upload(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
menu_ctx_load_image_t load_image_info; menu_ctx_load_image_t load_image_info;
@ -1273,7 +1269,7 @@ void menu_display_handle_thumbnail_upload(retro_task_t *task, void *task_data,
free(user_data); free(user_data);
} }
void menu_display_handle_left_thumbnail_upload(retro_task_t *task, void *task_data, void menu_display_handle_left_thumbnail_upload(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
menu_ctx_load_image_t load_image_info; menu_ctx_load_image_t load_image_info;
@ -1289,7 +1285,7 @@ void menu_display_handle_left_thumbnail_upload(retro_task_t *task, void *task_da
free(user_data); free(user_data);
} }
void menu_display_handle_savestate_thumbnail_upload(retro_task_t *task, void *task_data, void menu_display_handle_savestate_thumbnail_upload(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
menu_ctx_load_image_t load_image_info; menu_ctx_load_image_t load_image_info;
@ -1308,7 +1304,7 @@ void menu_display_handle_savestate_thumbnail_upload(retro_task_t *task, void *ta
/* Function that gets called when we want to load in a /* Function that gets called when we want to load in a
* new menu wallpaper. * new menu wallpaper.
*/ */
void menu_display_handle_wallpaper_upload(retro_task_t *task, void *task_data, void menu_display_handle_wallpaper_upload(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
menu_ctx_load_image_t load_image_info; menu_ctx_load_image_t load_image_info;
@ -1579,10 +1575,6 @@ void menu_display_draw_text(
{ {
struct font_params params; struct font_params params;
/* Don't draw is alpha is 0 */
if ((color & 0x000000FF) == 0)
return;
/* Don't draw outside of the screen */ /* Don't draw outside of the screen */
if ( ((x < -64 || x > width + 64) if ( ((x < -64 || x > width + 64)
|| (y < -64 || y > height + 64)) || (y < -64 || y > height + 64))
@ -1704,7 +1696,7 @@ const char *config_get_menu_driver_options(void)
* when we need to extract the APK contents/zip file. This * when we need to extract the APK contents/zip file. This
* file contains assets which then get extracted to the * file contains assets which then get extracted to the
* user's asset directories. */ * user's asset directories. */
static void bundle_decompressed(retro_task_t *task, void *task_data, static void bundle_decompressed(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
@ -1910,14 +1902,6 @@ void menu_driver_frame(video_frame_info_t *video_info)
menu_driver_ctx->frame(menu_userdata, video_info); menu_driver_ctx->frame(menu_userdata, video_info);
} }
#ifdef HAVE_MENU_WIDGETS
bool menu_driver_get_load_content_animation_data(menu_texture_item *icon, char **playlist_name)
{
return menu_driver_ctx && menu_driver_ctx->get_load_content_animation_data
&& menu_driver_ctx->get_load_content_animation_data(menu_userdata, icon, playlist_name);
}
#endif
bool menu_driver_render(bool is_idle, bool rarch_is_inited, bool menu_driver_render(bool is_idle, bool rarch_is_inited,
bool rarch_is_dummy_core) bool rarch_is_dummy_core)
{ {
@ -1948,6 +1932,9 @@ bool menu_driver_render(bool is_idle, bool rarch_is_inited,
if (BIT64_GET(menu_driver_data->state, MENU_STATE_BLIT)) if (BIT64_GET(menu_driver_data->state, MENU_STATE_BLIT))
{ {
settings_t *settings = config_get_ptr();
menu_animation_update_time(settings->bools.menu_timedate_enable);
if (menu_driver_ctx->render) if (menu_driver_ctx->render)
menu_driver_ctx->render(menu_userdata, is_idle); menu_driver_ctx->render(menu_userdata, is_idle);
} }
@ -2304,9 +2291,6 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
case RARCH_MENU_CTL_OWNS_DRIVER: case RARCH_MENU_CTL_OWNS_DRIVER:
return menu_driver_data_own; return menu_driver_data_own;
case RARCH_MENU_CTL_DEINIT: case RARCH_MENU_CTL_DEINIT:
#ifdef HAVE_MENU_WIDGETS
menu_widgets_context_destroy();
#endif
if (menu_driver_ctx && menu_driver_ctx->context_destroy) if (menu_driver_ctx && menu_driver_ctx->context_destroy)
menu_driver_ctx->context_destroy(menu_userdata); menu_driver_ctx->context_destroy(menu_userdata);

View File

@ -27,7 +27,6 @@
#include <boolean.h> #include <boolean.h>
#include <retro_common_api.h> #include <retro_common_api.h>
#include <gfx/math/matrix_4x4.h> #include <gfx/math/matrix_4x4.h>
#include <queues/task_queue.h>
#include "menu_defines.h" #include "menu_defines.h"
#include "menu_input.h" #include "menu_input.h"
@ -388,9 +387,6 @@ typedef struct menu_ctx_driver
int (*pointer_up)(void *data, unsigned x, unsigned y, unsigned ptr, int (*pointer_up)(void *data, unsigned x, unsigned y, unsigned ptr,
menu_file_list_cbs_t *cbs, menu_file_list_cbs_t *cbs,
menu_entry_t *entry, unsigned action); menu_entry_t *entry, unsigned action);
#ifdef HAVE_MENU_WIDGETS
bool (*get_load_content_animation_data)(void *userdata, menu_texture_item *icon, char **playlist_name);
#endif
} menu_ctx_driver_t; } menu_ctx_driver_t;
typedef struct menu_ctx_displaylist typedef struct menu_ctx_displaylist
@ -496,8 +492,6 @@ void menu_driver_set_binding_state(bool on);
void menu_driver_frame(video_frame_info_t *video_info); void menu_driver_frame(video_frame_info_t *video_info);
bool menu_driver_get_load_content_animation_data(menu_texture_item *icon, char **playlist_name);
/* Is a background texture set for the current menu driver? Should /* Is a background texture set for the current menu driver? Should
* return true for RGUI, for instance. */ * return true for RGUI, for instance. */
bool menu_driver_is_texture_set(void); bool menu_driver_is_texture_set(void);
@ -628,16 +622,16 @@ bool menu_display_get_tex_coords(menu_display_ctx_coord_draw_t *draw);
void menu_display_timedate(menu_display_ctx_datetime_t *datetime); void menu_display_timedate(menu_display_ctx_datetime_t *datetime);
void menu_display_handle_wallpaper_upload(retro_task_t *task, void *task_data, void menu_display_handle_wallpaper_upload(void *task_data,
void *user_data, const char *err); void *user_data, const char *err);
void menu_display_handle_thumbnail_upload(retro_task_t *task, void *task_data, void menu_display_handle_thumbnail_upload(void *task_data,
void *user_data, const char *err); void *user_data, const char *err);
void menu_display_handle_left_thumbnail_upload(retro_task_t *task, void *task_data, void menu_display_handle_left_thumbnail_upload(void *task_data,
void *user_data, const char *err); void *user_data, const char *err);
void menu_display_handle_savestate_thumbnail_upload(retro_task_t *task, void *task_data, void menu_display_handle_savestate_thumbnail_upload(void *task_data,
void *user_data, const char *err); void *user_data, const char *err);
void menu_display_push_quad( void menu_display_push_quad(

View File

@ -162,6 +162,7 @@ void menu_event_kb_set(bool down, enum retro_key key)
*/ */
unsigned menu_event(input_bits_t *p_input, input_bits_t *p_trigger_input) unsigned menu_event(input_bits_t *p_input, input_bits_t *p_trigger_input)
{ {
menu_animation_ctx_delta_t delta;
/* Used for key repeat */ /* Used for key repeat */
static float delay_timer = 0.0f; static float delay_timer = 0.0f;
static float delay_count = 0.0f; static float delay_count = 0.0f;
@ -197,7 +198,7 @@ unsigned menu_event(input_bits_t *p_input, input_bits_t *p_trigger_input)
* for old_input_state. */ * for old_input_state. */
first_held = true; first_held = true;
delay_timer = initial_held ? 200 : 100; delay_timer = initial_held ? 12 : 6;
delay_count = 0; delay_count = 0;
} }
@ -234,7 +235,10 @@ unsigned menu_event(input_bits_t *p_input, input_bits_t *p_trigger_input)
menu_driver_ctl(MENU_NAVIGATION_CTL_SET_SCROLL_ACCEL, menu_driver_ctl(MENU_NAVIGATION_CTL_SET_SCROLL_ACCEL,
&new_scroll_accel); &new_scroll_accel);
delay_count += menu_animation_get_delta_time(); delta.current = menu_animation_get_delta_time();
if (menu_animation_get_ideal_delta_time(&delta))
delay_count += delta.ideal;
if (menu_input_dialog_get_display_kb()) if (menu_input_dialog_get_display_kb())
{ {

View File

@ -180,7 +180,7 @@ void print_buf_lines(file_list_t *list, char *buf,
* with a newline, just ignore the partial last line. */ * with a newline, just ignore the partial last line. */
} }
void cb_net_generic_subdir(retro_task_t *task, void *task_data, void *user_data, const char *err) void cb_net_generic_subdir(void *task_data, void *user_data, const char *err)
{ {
#ifdef HAVE_NETWORKING #ifdef HAVE_NETWORKING
char subdir_path[PATH_MAX_LENGTH]; char subdir_path[PATH_MAX_LENGTH];
@ -222,7 +222,7 @@ finish:
#endif #endif
} }
void cb_net_generic(retro_task_t *task, void *task_data, void *user_data, const char *err) void cb_net_generic(void *task_data, void *user_data, const char *err)
{ {
#ifdef HAVE_NETWORKING #ifdef HAVE_NETWORKING
bool refresh = false; bool refresh = false;

View File

@ -22,7 +22,6 @@
#include <retro_common_api.h> #include <retro_common_api.h>
#include <retro_environment.h> #include <retro_environment.h>
#include <queues/task_queue.h>
#include <lists/file_list.h> #include <lists/file_list.h>
@ -34,10 +33,10 @@ void print_buf_lines(file_list_t *list, char *buf,
const char *label, int buf_size, const char *label, int buf_size,
enum msg_file_type type, bool append, bool extended); enum msg_file_type type, bool append, bool extended);
void cb_net_generic_subdir(retro_task_t *task, void *task_data, void *user_data, void cb_net_generic_subdir(void *task_data, void *user_data,
const char *err); const char *err);
void cb_net_generic(retro_task_t *task, void *task_data, void *user_data, const char *err); void cb_net_generic(void *task_data, void *user_data, const char *err);
RETRO_END_DECLS RETRO_END_DECLS

File diff suppressed because it is too large Load Diff

View File

@ -21,59 +21,4 @@
#include <queues/task_queue.h> #include <queues/task_queue.h>
#include <queues/message_queue.h> #include <queues/message_queue.h>
#define DEFAULT_BACKDROP 0.75f
#define MSG_QUEUE_PENDING_MAX 32
#define MSG_QUEUE_ONSCREEN_MAX 4
#define MSG_QUEUE_ANIMATION_DURATION 330
#define VOLUME_DURATION 3000
#define SCREENSHOT_DURATION_IN 66
#define SCREENSHOT_DURATION_OUT SCREENSHOT_DURATION_IN*10
#define SCREENSHOT_NOTIFICATION_DURATION 4000
#define TASK_FINISHED_DURATION 3000
#define HOURGLASS_INTERVAL 5000
#define HOURGLASS_DURATION 1000
void menu_widgets_init(bool video_is_threaded);
void menu_widgets_free(void);
bool menu_widgets_ready(void);
bool menu_widgets_msg_queue_push(const char *msg,
unsigned duration,
char *title,
enum message_queue_icon icon, enum message_queue_category category,
unsigned prio, bool flush);
bool menu_widgets_volume_update_and_show(void);
bool menu_widgets_set_fps_text(char *fps_text);
void menu_widgets_iterate(void);
bool menu_widgets_set_paused(bool is_paused);
bool menu_widgets_set_fast_forward(bool is_fast_forward);
bool menu_widgets_set_rewind(bool is_rewind);
bool menu_widgets_task_msg_queue_push(retro_task_t *task,
const char *msg,
unsigned prio, unsigned duration,
bool flush);
void menu_widgets_take_screenshot(void);
void menu_widgets_screenshot_taken(const char *shotname, const char *filename);
void menu_widgets_start_load_content_animation(const char *content_name, bool remove_extension);
void menu_widgets_cleanup_load_content_animation(void);
void menu_widgets_context_reset(bool is_threaded);
void menu_widgets_context_destroy(void);
/* All the functions below should be called in
* the video driver - once they are all added, set
* enable_menu_widgets to true for that driver */
void menu_widgets_frame(video_frame_info_t *video_info);
#endif #endif

View File

@ -25,7 +25,6 @@
#include <retro_assert.h> #include <retro_assert.h>
#include <string/stdstring.h> #include <string/stdstring.h>
#include <net/net_http.h> #include <net/net_http.h>
#include <queues/task_queue.h>
#ifdef HAVE_DISCORD #ifdef HAVE_DISCORD
#include <discord/discord.h> #include <discord/discord.h>
@ -639,7 +638,7 @@ static int16_t netplay_input_state(netplay_t *netplay,
} }
} }
static void netplay_announce_cb(retro_task_t *task, void *task_data, void *user_data, const char *error) static void netplay_announce_cb(void *task_data, void *user_data, const char *error)
{ {
RARCH_LOG("[netplay] announcing netplay game... \n"); RARCH_LOG("[netplay] announcing netplay game... \n");

View File

@ -62,9 +62,6 @@
#include "menu/menu_driver.h" #include "menu/menu_driver.h"
#include "menu/menu_animation.h" #include "menu/menu_animation.h"
#include "menu/menu_input.h" #include "menu/menu_input.h"
#ifdef HAVE_MENU_WIDGETS
#include "menu/widgets/menu_widgets.h"
#endif
#include "menu/widgets/menu_dialog.h" #include "menu/widgets/menu_dialog.h"
#include "menu/widgets/menu_input_dialog.h" #include "menu/widgets/menu_input_dialog.h"
#endif #endif
@ -2440,14 +2437,11 @@ global_t *global_get_ptr(void)
return &g_extern; return &g_extern;
} }
void runloop_task_msg_queue_push(retro_task_t *task, const char *msg, void runloop_task_msg_queue_push(const char *msg,
unsigned prio, unsigned duration, unsigned prio, unsigned duration,
bool flush) bool flush)
{ {
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS) runloop_msg_queue_push(msg, prio, duration, flush, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
if (!video_driver_has_widgets() || !menu_widgets_task_msg_queue_push(task, msg, prio, duration, flush))
#endif
runloop_msg_queue_push(msg, prio, duration, flush, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
} }
void runloop_msg_queue_push(const char *msg, void runloop_msg_queue_push(const char *msg,
@ -2458,12 +2452,6 @@ void runloop_msg_queue_push(const char *msg,
{ {
runloop_ctx_msg_info_t msg_info; runloop_ctx_msg_info_t msg_info;
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
/* People have 60FPS in mind when they use runloop_msg_queue_push */
if (video_driver_has_widgets() && menu_widgets_msg_queue_push(msg, duration / 60 * 1000, title, icon, category, prio, flush))
return;
#endif
#ifdef HAVE_THREADS #ifdef HAVE_THREADS
runloop_msg_queue_lock(); runloop_msg_queue_lock();
#endif #endif
@ -2839,12 +2827,6 @@ static enum runloop_state runloop_check_state(
} }
#if defined(HAVE_MENU) #if defined(HAVE_MENU)
#ifdef HAVE_MENU_WIDGETS
menu_widgets_iterate();
#endif
menu_animation_update();
if (menu_is_alive) if (menu_is_alive)
{ {
enum menu_action action; enum menu_action action;
@ -3260,16 +3242,9 @@ static enum runloop_state runloop_check_state(
/* Display the fast forward state to the user, if needed. */ /* Display the fast forward state to the user, if needed. */
if (runloop_fastmotion) if (runloop_fastmotion)
{ {
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS) runloop_msg_queue_push(
if (!video_driver_has_widgets() || !menu_widgets_set_fast_forward(true)) msg_hash_to_str(MSG_FAST_FORWARD), 1, 1, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
#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;
@ -3354,27 +3329,13 @@ static enum runloop_state runloop_check_state(
{ {
char s[128]; char s[128];
unsigned t = 0; unsigned t = 0;
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
bool rewinding = state_manager_check_rewind(
BIT256_GET(current_input, RARCH_REWIND),
settings->uints.rewind_granularity,
runloop_paused, s, sizeof(s), &t);
#endif
s[0] = '\0'; s[0] = '\0';
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS) if (state_manager_check_rewind(BIT256_GET(current_input, RARCH_REWIND),
if (!video_driver_has_widgets()) settings->uints.rewind_granularity, runloop_is_paused, s, sizeof(s), &t))
#endif runloop_msg_queue_push(s, 0, t, true, NULL,
if (state_manager_check_rewind(BIT256_GET(current_input, RARCH_REWIND), MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
settings->uints.rewind_granularity, runloop_is_paused, s, sizeof(s), &t))
runloop_msg_queue_push(s, 0, t, true, NULL,
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
menu_widgets_set_rewind(rewinding);
#endif
} }
/* Checks if slowmotion toggle/hold was being pressed and/or held. */ /* Checks if slowmotion toggle/hold was being pressed and/or held. */
@ -3412,22 +3373,15 @@ static enum runloop_state runloop_check_state(
video_driver_cached_frame(); video_driver_cached_frame();
} }
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS) if (state_manager_frame_is_reversed())
if (!video_driver_has_widgets()) runloop_msg_queue_push(
{ msg_hash_to_str(MSG_SLOW_MOTION_REWIND), 1, 1, false, NULL,
#endif MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
if (state_manager_frame_is_reversed()) else
runloop_msg_queue_push( runloop_msg_queue_push(
msg_hash_to_str(MSG_SLOW_MOTION_REWIND), 1, 1, false, NULL, msg_hash_to_str(MSG_SLOW_MOTION), 1, 1, false,
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
else
runloop_msg_queue_push(
msg_hash_to_str(MSG_SLOW_MOTION), 1, 1, false,
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
}
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
} }
#endif
old_slowmotion_button_state = new_slowmotion_button_state; old_slowmotion_button_state = new_slowmotion_button_state;
old_slowmotion_hold_button_state = new_slowmotion_hold_button_state; old_slowmotion_hold_button_state = new_slowmotion_hold_button_state;

View File

@ -377,7 +377,7 @@ global_t *global_get_ptr(void);
**/ **/
int runloop_iterate(unsigned *sleep_ms); int runloop_iterate(unsigned *sleep_ms);
void runloop_task_msg_queue_push(retro_task_t *task, const char *msg, void runloop_task_msg_queue_push(const char *msg,
unsigned prio, unsigned duration, unsigned prio, unsigned duration,
bool flush); bool flush);

View File

@ -26,7 +26,6 @@
#include <compat/strl.h> #include <compat/strl.h>
#include <string/stdstring.h> #include <string/stdstring.h>
#include <retro_miscellaneous.h> #include <retro_miscellaneous.h>
#include <queues/task_queue.h>
#include "../audio/audio_driver.h" #include "../audio/audio_driver.h"
@ -75,7 +74,7 @@ static void task_audio_mixer_load_free(retro_task_t *task)
} }
if (mixer->cb) if (mixer->cb)
mixer->cb(task, NULL, NULL, NULL); mixer->cb(NULL, NULL, NULL);
} }
if (!string_is_empty(nbio->path)) if (!string_is_empty(nbio->path))
@ -105,7 +104,7 @@ static int cb_nbio_audio_mixer_load(void *data, size_t len)
return 0; return 0;
} }
static void task_audio_mixer_handle_upload_ogg(retro_task_t *task, void *task_data, static void task_audio_mixer_handle_upload_ogg(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
audio_mixer_stream_params_t params; audio_mixer_stream_params_t params;
@ -135,7 +134,7 @@ static void task_audio_mixer_handle_upload_ogg(retro_task_t *task, void *task_da
free(user_data); free(user_data);
} }
static void task_audio_mixer_handle_upload_ogg_and_play(retro_task_t *task, void *task_data, static void task_audio_mixer_handle_upload_ogg_and_play(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
audio_mixer_stream_params_t params; audio_mixer_stream_params_t params;
@ -166,7 +165,7 @@ static void task_audio_mixer_handle_upload_ogg_and_play(retro_task_t *task, void
free(user_data); free(user_data);
} }
static void task_audio_mixer_handle_upload_flac(retro_task_t *task, void *task_data, static void task_audio_mixer_handle_upload_flac(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
audio_mixer_stream_params_t params; audio_mixer_stream_params_t params;
@ -197,7 +196,7 @@ static void task_audio_mixer_handle_upload_flac(retro_task_t *task, void *task_d
free(user_data); free(user_data);
} }
static void task_audio_mixer_handle_upload_flac_and_play(retro_task_t *task, void *task_data, static void task_audio_mixer_handle_upload_flac_and_play(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
audio_mixer_stream_params_t params; audio_mixer_stream_params_t params;
@ -228,7 +227,7 @@ static void task_audio_mixer_handle_upload_flac_and_play(retro_task_t *task, voi
free(user_data); free(user_data);
} }
static void task_audio_mixer_handle_upload_mp3(retro_task_t *task, void *task_data, static void task_audio_mixer_handle_upload_mp3(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
audio_mixer_stream_params_t params; audio_mixer_stream_params_t params;
@ -259,7 +258,7 @@ static void task_audio_mixer_handle_upload_mp3(retro_task_t *task, void *task_da
free(user_data); free(user_data);
} }
static void task_audio_mixer_handle_upload_mp3_and_play(retro_task_t *task, void *task_data, static void task_audio_mixer_handle_upload_mp3_and_play(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
audio_mixer_stream_params_t params; audio_mixer_stream_params_t params;
@ -290,7 +289,7 @@ static void task_audio_mixer_handle_upload_mp3_and_play(retro_task_t *task, void
free(user_data); free(user_data);
} }
static void task_audio_mixer_handle_upload_mod(retro_task_t *task, void *task_data, static void task_audio_mixer_handle_upload_mod(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
audio_mixer_stream_params_t params; audio_mixer_stream_params_t params;
@ -321,7 +320,7 @@ static void task_audio_mixer_handle_upload_mod(retro_task_t *task, void *task_da
free(user_data); free(user_data);
} }
static void task_audio_mixer_handle_upload_mod_and_play(retro_task_t *task, void *task_data, static void task_audio_mixer_handle_upload_mod_and_play(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
audio_mixer_stream_params_t params; audio_mixer_stream_params_t params;
@ -352,7 +351,7 @@ static void task_audio_mixer_handle_upload_mod_and_play(retro_task_t *task, void
free(user_data); free(user_data);
} }
static void task_audio_mixer_handle_upload_wav(retro_task_t *task, void *task_data, static void task_audio_mixer_handle_upload_wav(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
audio_mixer_stream_params_t params; audio_mixer_stream_params_t params;
@ -383,7 +382,7 @@ static void task_audio_mixer_handle_upload_wav(retro_task_t *task, void *task_da
free(user_data); free(user_data);
} }
static void task_audio_mixer_handle_upload_wav_and_play(retro_task_t *task, void *task_data, static void task_audio_mixer_handle_upload_wav_and_play(void *task_data,
void *user_data, const char *err) void *user_data, const char *err)
{ {
audio_mixer_stream_params_t params; audio_mixer_stream_params_t params;

View File

@ -65,9 +65,6 @@
#ifdef HAVE_MENU #ifdef HAVE_MENU
#include "../menu/menu_driver.h" #include "../menu/menu_driver.h"
#ifdef HAVE_MENU_WIDGETS
#include "../menu/widgets/menu_widgets.h"
#endif
#endif #endif
#include "../menu/menu_shader.h" #include "../menu/menu_shader.h"
@ -166,11 +163,6 @@ static char pending_subsystem_extensions[PATH_MAX_LENGTH];
#endif #endif
static char *pending_subsystem_roms[RARCH_MAX_SUBSYSTEM_ROMS]; static char *pending_subsystem_roms[RARCH_MAX_SUBSYSTEM_ROMS];
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
static bool pending_load_content_pending = false;
static bool pending_load_content_resume = false;
#endif
static int64_t content_file_read(const char *path, void **buf, int64_t *length) static int64_t content_file_read(const char *path, void **buf, int64_t *length)
{ {
#ifdef HAVE_COMPRESSION #ifdef HAVE_COMPRESSION
@ -1256,27 +1248,6 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info)
} }
#ifdef HAVE_MENU #ifdef HAVE_MENU
#ifdef HAVE_MENU_WIDGETS
bool task_load_content_is_pending(void)
{
return pending_load_content_pending;
}
bool task_load_content_should_resume(void)
{
/* Avoid having one menu frame before running content
once the animation is finished */
if (pending_load_content_resume)
menu_widgets_cleanup_load_content_animation();
return pending_load_content_resume;
}
void task_load_content_resume(void)
{
pending_load_content_resume = true;
}
#endif
bool task_push_load_content_from_playlist_from_menu( bool task_push_load_content_from_playlist_from_menu(
const char *core_path, const char *core_path,
@ -1294,23 +1265,6 @@ bool task_push_load_content_from_playlist_from_menu(
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
rarch_system_info_t *sys_info = runloop_get_system_info(); rarch_system_info_t *sys_info = runloop_get_system_info();
#ifdef HAVE_MENU_WIDGETS
if (video_driver_has_widgets() && menu_widgets_ready() && !pending_load_content_resume)
{
pending_load_content_pending = true;
if (label)
menu_widgets_start_load_content_animation(label, false);
else
menu_widgets_start_load_content_animation(path_basename(fullpath), true);
return true;
}
pending_load_content_resume = false;
pending_load_content_pending = false;
#endif
content_ctx.check_firmware_before_loading = settings->bools.check_firmware_before_loading; content_ctx.check_firmware_before_loading = settings->bools.check_firmware_before_loading;
content_ctx.is_ips_pref = rarch_ctl(RARCH_CTL_IS_IPS_PREF, NULL); content_ctx.is_ips_pref = rarch_ctl(RARCH_CTL_IS_IPS_PREF, NULL);
content_ctx.is_bps_pref = rarch_ctl(RARCH_CTL_IS_BPS_PREF, NULL); content_ctx.is_bps_pref = rarch_ctl(RARCH_CTL_IS_BPS_PREF, NULL);
@ -1537,18 +1491,6 @@ bool task_push_load_content_with_new_core_from_menu(
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
#ifdef HAVE_MENU_WIDGETS
if (video_driver_has_widgets() && menu_widgets_ready() && !pending_load_content_resume)
{
pending_load_content_pending = true;
menu_widgets_start_load_content_animation(path_basename(fullpath), true);
return true;
}
pending_load_content_resume = false;
pending_load_content_pending = false;
#endif
content_ctx.check_firmware_before_loading = settings->bools.check_firmware_before_loading; content_ctx.check_firmware_before_loading = settings->bools.check_firmware_before_loading;
content_ctx.is_ips_pref = rarch_ctl(RARCH_CTL_IS_IPS_PREF, NULL); content_ctx.is_ips_pref = rarch_ctl(RARCH_CTL_IS_IPS_PREF, NULL);
content_ctx.is_bps_pref = rarch_ctl(RARCH_CTL_IS_BPS_PREF, NULL); content_ctx.is_bps_pref = rarch_ctl(RARCH_CTL_IS_BPS_PREF, NULL);
@ -1849,18 +1791,6 @@ bool task_push_load_content_with_current_core_from_companion_ui(
retro_task_callback_t cb, retro_task_callback_t cb,
void *user_data) void *user_data)
{ {
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
if (video_driver_has_widgets() && menu_widgets_ready() && !pending_load_content_resume)
{
pending_load_content_pending = true;
menu_widgets_start_load_content_animation(path_basename(fullpath), true);
return true;
}
pending_load_content_resume = false;
pending_load_content_pending = false;
#endif
/* Set content path */ /* Set content path */
path_set(RARCH_PATH_CONTENT, fullpath); path_set(RARCH_PATH_CONTENT, fullpath);
@ -1910,18 +1840,6 @@ bool task_push_load_subsystem_with_core_from_menu(
retro_task_callback_t cb, retro_task_callback_t cb,
void *user_data) void *user_data)
{ {
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
if (video_driver_has_widgets() && menu_widgets_ready() && !pending_load_content_resume)
{
pending_load_content_pending = true;
menu_widgets_start_load_content_animation(path_basename(fullpath), true);
return true;
}
pending_load_content_resume = false;
pending_load_content_pending = false;
#endif
pending_subsystem_init = true; pending_subsystem_init = true;
/* Load content */ /* Load content */

View File

@ -82,9 +82,6 @@ bool task_push_load_content_with_new_core_from_companion_ui(
void *user_data); void *user_data);
#ifdef HAVE_MENU #ifdef HAVE_MENU
bool task_load_content_is_pending(void);
bool task_load_content_should_resume(void);
void task_load_content_resume(void);
bool task_push_load_content_with_new_core_from_menu( bool task_push_load_content_with_new_core_from_menu(
const char *core_path, const char *core_path,

View File

@ -1313,7 +1313,7 @@ bool task_push_dbscan(
bool db_dir_show_hidden_files, bool db_dir_show_hidden_files,
retro_task_callback_t cb) retro_task_callback_t cb)
{ {
retro_task_t *t = task_init(); retro_task_t *t = (retro_task_t*)calloc(1, sizeof(*t));
db_handle_t *db = (db_handle_t*)calloc(1, sizeof(db_handle_t)); db_handle_t *db = (db_handle_t*)calloc(1, sizeof(db_handle_t));
if (!t || !db) if (!t || !db)

View File

@ -335,7 +335,7 @@ bool task_push_decompress(
s->archive.type = ARCHIVE_TRANSFER_INIT; s->archive.type = ARCHIVE_TRANSFER_INIT;
s->userdata = (struct archive_extract_userdata*)calloc(1, sizeof(*s->userdata)); s->userdata = (struct archive_extract_userdata*)calloc(1, sizeof(*s->userdata));
t = task_init(); t = (retro_task_t*)calloc(1, sizeof(*t));
if (!t) if (!t)
goto error; goto error;

View File

@ -39,7 +39,7 @@ enum frontend_powerstate get_last_powerstate(int *percent)
return state; return state;
} }
static void task_powerstate_cb(retro_task_t* task, void *task_data, static void task_powerstate_cb(void *task_data,
void *user_data, const char *error) void *user_data, const char *error)
{ {
powerstate_t *powerstate = (powerstate_t*)task_data; powerstate_t *powerstate = (powerstate_t*)task_data;

View File

@ -507,7 +507,7 @@ bool content_undo_load_state(void)
return ret; return ret;
} }
static void undo_save_state_cb(retro_task_t *task, void *task_data, static void undo_save_state_cb(void *task_data,
void *user_data, const char *error) void *user_data, const char *error)
{ {
/* Wipe the save file buffer as it's intended to be one use only */ /* Wipe the save file buffer as it's intended to be one use only */
@ -892,7 +892,7 @@ error:
* Load a state from disk to memory. * Load a state from disk to memory.
* *
**/ **/
static void content_load_state_cb(retro_task_t *task, void *task_data, static void content_load_state_cb(void *task_data,
void *user_data, const char *error) void *user_data, const char *error)
{ {
retro_ctx_serialize_info_t serial_info; retro_ctx_serialize_info_t serial_info;
@ -1041,7 +1041,7 @@ error:
* *
* Called after the save state is done. Takes a screenshot if needed. * Called after the save state is done. Takes a screenshot if needed.
**/ **/
static void save_state_cb(retro_task_t *task, void *task_data, static void save_state_cb(void *task_data,
void *user_data, const char *error) void *user_data, const char *error)
{ {
save_task_state_t *state = (save_task_state_t*)task_data; save_task_state_t *state = (save_task_state_t*)task_data;
@ -1105,7 +1105,7 @@ error:
* Load then save a state. * Load then save a state.
* *
**/ **/
static void content_load_and_save_state_cb(retro_task_t *task, void *task_data, static void content_load_and_save_state_cb(void *task_data,
void *user_data, const char *error) void *user_data, const char *error)
{ {
load_task_data_t *load_data = (load_task_data_t*)task_data; load_task_data_t *load_data = (load_task_data_t*)task_data;
@ -1114,7 +1114,7 @@ static void content_load_and_save_state_cb(retro_task_t *task, void *task_data,
size_t size = load_data->undo_size; size_t size = load_data->undo_size;
bool autosave = load_data->autosave; bool autosave = load_data->autosave;
content_load_state_cb(NULL, task_data, user_data, error); content_load_state_cb(task_data, user_data, error);
task_push_save_state(path, data, size, autosave); task_push_save_state(path, data, size, autosave);

View File

@ -43,10 +43,6 @@
#define IMG_EXT "bmp" #define IMG_EXT "bmp"
#endif #endif
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
#include "../../menu/widgets/menu_widgets.h"
#endif
#include "../defaults.h" #include "../defaults.h"
#include "../command.h" #include "../command.h"
#include "../configuration.h" #include "../configuration.h"
@ -129,11 +125,6 @@ static bool screenshot_dump_direct(screenshot_task_state_t *state)
bmp_type); bmp_type);
#endif #endif
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
if (!state->silence)
menu_widgets_screenshot_taken(state->shotname, state->filename);
#endif
return ret; return ret;
} }
@ -288,11 +279,6 @@ static bool screenshot_dump(
if (use_thread) if (use_thread)
{ {
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
if (video_driver_has_widgets())
task_free_title(task);
else
#endif
if (!savestate) if (!savestate)
task->title = strdup(msg_hash_to_str(MSG_TAKING_SCREENSHOT)); task->title = strdup(msg_hash_to_str(MSG_TAKING_SCREENSHOT));
@ -429,11 +415,6 @@ bool take_screenshot(const char *name_base, bool silence, bool has_valid_framebu
bool is_perfcnt_enable = false; bool is_perfcnt_enable = false;
bool ret = false; bool ret = false;
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
if (!silence)
menu_widgets_take_screenshot();
#endif
runloop_get_status(&is_paused, &is_idle, &is_slowmotion, &is_perfcnt_enable); runloop_get_status(&is_paused, &is_idle, &is_slowmotion, &is_perfcnt_enable);
ret = take_screenshot_choice(name_base, silence, is_paused, is_idle, ret = take_screenshot_choice(name_base, silence, is_paused, is_idle,

View File

@ -28,8 +28,7 @@ extern "C" {
#define THUMBNAILPACK_URL_HEADER "http://thumbnailpacks.libretro.com/" #define THUMBNAILPACK_URL_HEADER "http://thumbnailpacks.libretro.com/"
#define THUMBNAILPACK_EXTENSION ".zip" #define THUMBNAILPACK_EXTENSION ".zip"
static void extractThumbnailPackCB(retro_task_t *task, static void extractThumbnailPackCB(void *task_data, void *user_data, const char *err)
void *task_data, void *user_data, const char *err)
{ {
decompress_task_data_t *dec = (decompress_task_data_t*)task_data; decompress_task_data_t *dec = (decompress_task_data_t*)task_data;
MainWindow *mainwindow = (MainWindow*)user_data; MainWindow *mainwindow = (MainWindow*)user_data;

View File

@ -120,8 +120,7 @@ static const QPixmap getInvader()
} }
#ifdef HAVE_LIBRETRODB #ifdef HAVE_LIBRETRODB
static void scan_finished_handler(retro_task_t *task, static void scan_finished_handler(void *task_data, void *user_data, const char *err)
void *task_data, void *user_data, const char *err)
{ {
bool dontAsk = false; bool dontAsk = false;
bool answer = false; bool answer = false;

View File

@ -24,8 +24,7 @@ extern "C" {
#define TEMP_EXTENSION ".update_tmp" #define TEMP_EXTENSION ".update_tmp"
#define RETROARCH_NIGHTLY_UPDATE_PATH "../RetroArch_update.zip" #define RETROARCH_NIGHTLY_UPDATE_PATH "../RetroArch_update.zip"
static void extractUpdateCB(retro_task_t *task, static void extractUpdateCB(void *task_data, void *user_data, const char *err)
void *task_data, void *user_data, const char *err)
{ {
decompress_task_data_t *dec = (decompress_task_data_t*)task_data; decompress_task_data_t *dec = (decompress_task_data_t*)task_data;
MainWindow *mainwindow = (MainWindow*)user_data; MainWindow *mainwindow = (MainWindow*)user_data;