Turn menu_animation.c into gfx_animation.c

This commit is contained in:
twinaphex 2020-02-16 14:01:34 +01:00
parent 084bad5aaa
commit fc9edda0ef
22 changed files with 503 additions and 505 deletions

View File

@ -52,7 +52,7 @@
"ozone_display.h": "c",
"verbosity.h": "c",
"retroarch.h": "c",
"menu_animation.h": "c",
"gfx_animation.h": "c",
"netplay.h": "c",
"scaler.h": "c",
"deque": "c",

View File

@ -834,7 +834,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
menu/cbs/menu_cbs_down.o \
menu/cbs/menu_cbs_contentlist_switch.o \
menu/menu_displaylist.o \
menu/menu_animation.o \
menu/gfx_animation.o \
menu/drivers/menu_generic.o \
menu/menu_thumbnail_path.o \
menu/menu_thumbnail.o

View File

@ -392,7 +392,7 @@
#ifdef HAVE_MENU
#include "menu/menu_driver.h"
#include "menu/menu_animation.h"
#include "menu/gfx_animation.h"
#ifdef HAVE_LIBNX
#define DEFAULT_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME true

View File

@ -1279,7 +1279,7 @@ MENU
#include "../menu/cbs/menu_cbs_down.c"
#include "../menu/cbs/menu_cbs_contentlist_switch.c"
#include "../menu/menu_displaylist.c"
#include "../menu/menu_animation.c"
#include "../menu/gfx_animation.c"
#include "../menu/menu_thumbnail_path.c"
#include "../menu/menu_thumbnail.c"

View File

@ -23,7 +23,7 @@
#endif
#include "../menu_driver.h"
#include "../menu_animation.h"
#include "../gfx_animation.h"
#include "../menu_cbs.h"
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
#include "../menu_shader.h"
@ -647,7 +647,7 @@ static void general_disp_set_label_perf_counters(
menu_action_setting_disp_set_label_perf_counters_common(
counters, offset, s, len);
menu_animation_ctl(MENU_ANIMATION_CTL_SET_ACTIVE, NULL);
gfx_animation_ctl(MENU_ANIMATION_CTL_SET_ACTIVE, NULL);
}
static void menu_action_setting_disp_set_label_perf_counters(

View File

@ -42,7 +42,7 @@
#include "menu_generic.h"
#include "../menu_driver.h"
#include "../menu_animation.h"
#include "../gfx_animation.h"
#include "../menu_input.h"
#include "../menu_thumbnail_path.h"
#include "../menu_thumbnail.h"
@ -1336,8 +1336,8 @@ typedef struct materialui_handle
* > Simplifies configuration and
* improves performance */
bool use_smooth_ticker;
menu_animation_ctx_ticker_t ticker;
menu_animation_ctx_ticker_smooth_t ticker_smooth;
gfx_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_smooth_t ticker_smooth;
unsigned ticker_x_offset;
unsigned ticker_str_width;
@ -2323,7 +2323,7 @@ static void materialui_render(void *data,
if (mui->need_compute)
{
menu_animation_ctx_tag tag = (uintptr_t)&mui->scroll_y;
gfx_animation_ctx_tag tag = (uintptr_t)&mui->scroll_y;
if (mui->font_data.list.font && mui->font_data.hint.font)
materialui_compute_entries_box(mui, width, height, header_height);
@ -2336,7 +2336,7 @@ static void materialui_render(void *data,
* mui->need_compute is acted upon. */
/* Kill any existing scroll animation */
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
/* Reset scroll acceleration */
menu_input_set_pointer_y_accel(0.0f);
@ -2810,7 +2810,7 @@ static void materialui_render_menu_entry_default(
mui->ticker_smooth.dst_str = value_buf;
mui->ticker_smooth.dst_str_len = sizeof(value_buf);
if (menu_animation_ticker_smooth(&mui->ticker_smooth))
if (gfx_animation_ticker_smooth(&mui->ticker_smooth))
{
/* If ticker is active, then value text is effectively
* entry_value_width_max pixels wide... */
@ -2844,7 +2844,7 @@ static void materialui_render_menu_entry_default(
mui->ticker.len = entry_value_len;
mui->ticker.str = entry_value;
menu_animation_ticker(&mui->ticker);
gfx_animation_ticker(&mui->ticker);
/* Get effective width of value string
* > Approximate value - only the smooth ticker
@ -2927,7 +2927,7 @@ static void materialui_render_menu_entry_default(
mui->ticker_smooth.dst_str = label_buf;
mui->ticker_smooth.dst_str_len = sizeof(label_buf);
menu_animation_ticker_smooth(&mui->ticker_smooth);
gfx_animation_ticker_smooth(&mui->ticker_smooth);
}
else
{
@ -2936,7 +2936,7 @@ static void materialui_render_menu_entry_default(
mui->ticker.len = (size_t)(label_width / mui->font_data.list.glyph_width);
mui->ticker.str = entry_label;
menu_animation_ticker(&mui->ticker);
gfx_animation_ticker(&mui->ticker);
}
/* Draw label string */
@ -3090,7 +3090,7 @@ static void materialui_render_menu_entry_playlist_list(
mui->ticker_smooth.dst_str = label_buf;
mui->ticker_smooth.dst_str_len = sizeof(label_buf);
menu_animation_ticker_smooth(&mui->ticker_smooth);
gfx_animation_ticker_smooth(&mui->ticker_smooth);
}
else
{
@ -3099,7 +3099,7 @@ static void materialui_render_menu_entry_playlist_list(
mui->ticker.len = (size_t)(usable_width / mui->font_data.list.glyph_width);
mui->ticker.str = entry_label;
menu_animation_ticker(&mui->ticker);
gfx_animation_ticker(&mui->ticker);
}
/* Draw label string */
@ -3258,7 +3258,7 @@ static void materialui_render_menu_entry_playlist_dual_icon(
mui->ticker_smooth.dst_str_len = sizeof(label_buf);
/* If ticker is inactive, centre the text */
if (!menu_animation_ticker_smooth(&mui->ticker_smooth))
if (!gfx_animation_ticker_smooth(&mui->ticker_smooth))
label_x = (float)(usable_width - mui->ticker_str_width) / 2.0f;
}
else
@ -3269,7 +3269,7 @@ static void materialui_render_menu_entry_playlist_dual_icon(
mui->ticker.str = entry_label;
/* If ticker is inactive, centre the text */
if (!menu_animation_ticker(&mui->ticker))
if (!gfx_animation_ticker(&mui->ticker))
{
int str_width = (int)(utf8len(label_buf) *
mui->font_data.list.glyph_width);
@ -3655,7 +3655,7 @@ static void materialui_render_entry_touch_feedback(
* fade out */
else if (mui->touch_feedback_alpha > 0.0f)
{
mui->touch_feedback_alpha -= (menu_animation_get_delta_time() * 1000.0f) / (float)MENU_INPUT_PRESS_TIME_SHORT;
mui->touch_feedback_alpha -= (gfx_animation_get_delta_time() * 1000.0f) / (float)MENU_INPUT_PRESS_TIME_SHORT;
mui->touch_feedback_alpha = (mui->touch_feedback_alpha < 0.0f) ? 0.0f : mui->touch_feedback_alpha;
}
@ -3898,7 +3898,7 @@ static void materialui_render_header(
mui->ticker_smooth.dst_str = core_title_buf;
mui->ticker_smooth.dst_str_len = sizeof(core_title_buf);
menu_animation_ticker_smooth(&mui->ticker_smooth);
gfx_animation_ticker_smooth(&mui->ticker_smooth);
}
else
{
@ -3907,7 +3907,7 @@ static void materialui_render_header(
mui->ticker.str = core_title;
mui->ticker.selected = true;
menu_animation_ticker(&mui->ticker);
gfx_animation_ticker(&mui->ticker);
}
menu_display_draw_text(mui->font_data.hint.font, core_title_buf,
@ -4007,7 +4007,7 @@ static void materialui_render_header(
/* If ticker is not active and landscape
* optimisation is enabled, centre the title text */
if (!menu_animation_ticker_smooth(&mui->ticker_smooth))
if (!gfx_animation_ticker_smooth(&mui->ticker_smooth))
{
if (use_landscape_layout)
{
@ -4031,7 +4031,7 @@ static void materialui_render_header(
/* If ticker is not active and landscape
* optimisation is enabled, centre the title text */
if (!menu_animation_ticker(&mui->ticker))
if (!gfx_animation_ticker(&mui->ticker))
{
if (use_landscape_layout)
{
@ -4311,15 +4311,15 @@ static bool materialui_get_selected_thumbnails(
static void materialui_hide_fullscreen_thumbnails(
materialui_handle_t *mui, bool animate)
{
menu_animation_ctx_tag alpha_tag = (uintptr_t)&mui->fullscreen_thumbnail_alpha;
gfx_animation_ctx_tag alpha_tag = (uintptr_t)&mui->fullscreen_thumbnail_alpha;
/* Kill any existing fade in/out animations */
menu_animation_kill_by_tag(&alpha_tag);
gfx_animation_kill_by_tag(&alpha_tag);
/* Check whether animations are enabled */
if (animate && (mui->fullscreen_thumbnail_alpha > 0.0f))
{
menu_animation_ctx_entry_t animation_entry;
gfx_animation_ctx_entry_t animation_entry;
/* Configure fade out animation */
animation_entry.easing_enum = EASING_OUT_QUAD;
@ -4331,7 +4331,7 @@ static void materialui_hide_fullscreen_thumbnails(
animation_entry.userdata = NULL;
/* Push animation */
menu_animation_push(&animation_entry);
gfx_animation_push(&animation_entry);
}
/* No animation - just set thumbnail alpha to zero */
else
@ -4346,13 +4346,13 @@ static void materialui_hide_fullscreen_thumbnails(
static void materialui_show_fullscreen_thumbnails(
materialui_handle_t *mui, size_t selection)
{
menu_entry_t selected_entry;
gfx_animation_ctx_entry_t animation_entry;
menu_thumbnail_t *primary_thumbnail = NULL;
menu_thumbnail_t *secondary_thumbnail = NULL;
menu_animation_ctx_tag scroll_tag = (uintptr_t)&mui->scroll_y;
menu_animation_ctx_tag alpha_tag = (uintptr_t)&mui->fullscreen_thumbnail_alpha;
gfx_animation_ctx_tag scroll_tag = (uintptr_t)&mui->scroll_y;
gfx_animation_ctx_tag alpha_tag = (uintptr_t)&mui->fullscreen_thumbnail_alpha;
const char *thumbnail_label = NULL;
menu_animation_ctx_entry_t animation_entry;
menu_entry_t selected_entry;
/* Before showing fullscreen thumbnails, must
* ensure that any existing fullscreen thumbnail
@ -4389,7 +4389,7 @@ static void materialui_show_fullscreen_thumbnails(
* thumbnails are shown
* > Kill any existing scroll animations and
* reset scroll acceleration */
menu_animation_kill_by_tag(&scroll_tag);
gfx_animation_kill_by_tag(&scroll_tag);
menu_input_set_pointer_y_accel(0.0f);
/* Cache selected entry label
@ -4424,7 +4424,7 @@ static void materialui_show_fullscreen_thumbnails(
animation_entry.userdata = NULL;
/* Push animation */
menu_animation_push(&animation_entry);
gfx_animation_push(&animation_entry);
/* Enable fullscreen thumbnails */
mui->fullscreen_thumbnail_selection = selection;
@ -4866,13 +4866,13 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
if (mui->use_smooth_ticker)
{
mui->ticker_smooth.idx = menu_animation_get_ticker_pixel_idx();
mui->ticker_smooth.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
mui->ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
mui->ticker_smooth.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
}
else
{
mui->ticker.idx = menu_animation_get_ticker_idx();
mui->ticker.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
mui->ticker.idx = gfx_animation_get_ticker_idx();
mui->ticker.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
}
/* Handle any transparency adjustments required
@ -5677,13 +5677,13 @@ static void *materialui_init(void **userdata, bool video_is_threaded)
mui->fullscreen_thumbnail_alpha = 0.0f;
mui->fullscreen_thumbnail_label[0] = '\0';
menu_animation_set_update_time_cb(materialui_menu_animation_update_time);
gfx_animation_set_update_time_cb(materialui_menu_animation_update_time);
return menu;
error:
if (menu)
free(menu);
menu_animation_unset_update_time_cb();
gfx_animation_unset_update_time_cb();
return NULL;
}
@ -5702,7 +5702,7 @@ static void materialui_free(void *data)
if (mui->thumbnail_path_data)
free(mui->thumbnail_path_data);
menu_animation_unset_update_time_cb();
gfx_animation_unset_update_time_cb();
}
static void materialui_context_bg_destroy(materialui_handle_t *mui)
@ -5789,11 +5789,11 @@ static bool materialui_load_image(void *userdata, void *data, enum menu_image_ty
static void materialui_animate_scroll(
materialui_handle_t *mui, float scroll_pos, float duration)
{
menu_animation_ctx_tag animation_tag = (uintptr_t)&mui->scroll_y;
menu_animation_ctx_entry_t animation_entry;
gfx_animation_ctx_tag animation_tag = (uintptr_t)&mui->scroll_y;
gfx_animation_ctx_entry_t animation_entry;
/* Kill any existing scroll animation */
menu_animation_kill_by_tag(&animation_tag);
gfx_animation_kill_by_tag(&animation_tag);
/* mui->scroll_y will be modified by the animation
* > Set scroll acceleration to zero to minimise
@ -5810,7 +5810,7 @@ static void materialui_animate_scroll(
animation_entry.userdata = NULL;
/* Push animation */
menu_animation_push(&animation_entry);
gfx_animation_push(&animation_entry);
}
/* The navigation pointer has been updated (for example by pressing up or down
@ -5931,11 +5931,11 @@ static void materialui_populate_nav_bar(
static void materialui_init_transition_animation(
materialui_handle_t *mui, settings_t *settings)
{
menu_animation_ctx_entry_t alpha_entry;
menu_animation_ctx_entry_t x_offset_entry;
gfx_animation_ctx_entry_t alpha_entry;
gfx_animation_ctx_entry_t x_offset_entry;
size_t stack_size = materialui_list_get_size(mui, MENU_LIST_PLAIN);
menu_animation_ctx_tag alpha_tag = (uintptr_t)&mui->transition_alpha;
menu_animation_ctx_tag x_offset_tag = (uintptr_t)&mui->transition_x_offset;
gfx_animation_ctx_tag alpha_tag = (uintptr_t)&mui->transition_alpha;
gfx_animation_ctx_tag x_offset_tag = (uintptr_t)&mui->transition_x_offset;
unsigned transition_animation = settings->uints.menu_materialui_transition_animation;
/* If animations are disabled, reset alpha/x offset
@ -5954,7 +5954,7 @@ static void materialui_init_transition_animation(
/* > Kill any existing animations and set
* initial alpha value */
menu_animation_kill_by_tag(&alpha_tag);
gfx_animation_kill_by_tag(&alpha_tag);
mui->transition_alpha = 0.0f;
/* > Configure animation */
@ -5967,13 +5967,13 @@ static void materialui_init_transition_animation(
alpha_entry.userdata = NULL;
/* > Push animation */
menu_animation_push(&alpha_entry);
gfx_animation_push(&alpha_entry);
/* Slide animation (x offset) */
/* > Kill any existing animations and set
* initial x offset value */
menu_animation_kill_by_tag(&x_offset_tag);
gfx_animation_kill_by_tag(&x_offset_tag);
mui->transition_x_offset = 0.0f;
/* >> Menu tab 'reset' action - using navigation
@ -6035,7 +6035,7 @@ static void materialui_init_transition_animation(
x_offset_entry.userdata = NULL;
/* > Push animation */
menu_animation_push(&x_offset_entry);
gfx_animation_push(&x_offset_entry);
}
}
@ -6832,7 +6832,7 @@ static int materialui_pointer_down(void *userdata,
if (mui->scrollbar.active && !mui->show_fullscreen_thumbnails)
{
unsigned header_height = menu_display_get_header_height();
menu_animation_ctx_tag tag = (uintptr_t)&mui->scroll_y;
gfx_animation_ctx_tag tag = (uintptr_t)&mui->scroll_y;
unsigned width;
unsigned height;
int drag_margin_horz;
@ -6887,7 +6887,7 @@ static int materialui_pointer_down(void *userdata,
/* > Kill any existing scroll animations
* and reset scroll acceleration */
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
menu_input_set_pointer_y_accel(0.0f);
/* > Enable dragging */

View File

@ -38,7 +38,7 @@
#include "../menu_generic.h"
#include "../../menu_driver.h"
#include "../../menu_animation.h"
#include "../../gfx_animation.h"
#include "../../menu_input.h"
#include "../../playlist.h"
#include "../../runtime_file.h"
@ -311,7 +311,7 @@ static void *ozone_init(void **userdata, bool video_is_threaded)
);
last_use_preferred_system_color_theme = settings->bools.menu_use_preferred_system_color_theme;
menu_animation_set_update_time_cb(ozone_menu_animation_update_time);
gfx_animation_set_update_time_cb(ozone_menu_animation_update_time);
return menu;
@ -336,7 +336,7 @@ error:
if (menu)
free(menu);
menu_animation_unset_update_time_cb();
gfx_animation_unset_update_time_cb();
return NULL;
}
@ -377,7 +377,7 @@ static void ozone_free(void *data)
if (ozone->thumbnail_path_data)
free(ozone->thumbnail_path_data);
}
menu_animation_unset_update_time_cb();
gfx_animation_unset_update_time_cb();
}
unsigned ozone_count_lines(const char *str)
@ -773,7 +773,7 @@ static void ozone_context_destroy(void *data)
{
unsigned i;
ozone_handle_t *ozone = (ozone_handle_t*) data;
menu_animation_ctx_tag tag;
gfx_animation_ctx_tag tag;
if (!ozone)
return;
@ -813,7 +813,7 @@ static void ozone_context_destroy(void *data)
ozone->fonts.sidebar = NULL;
tag = (uintptr_t) &ozone_default_theme;
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
/* Horizontal list */
ozone_context_destroy_horizontal_list(ozone);
@ -1077,8 +1077,8 @@ static size_t ozone_list_get_selection(void *data)
static void ozone_list_clear(file_list_t *list)
{
menu_animation_ctx_tag tag = (uintptr_t)list;
menu_animation_kill_by_tag(&tag);
gfx_animation_ctx_tag tag = (uintptr_t)list;
gfx_animation_kill_by_tag(&tag);
ozone_free_list_nodes(list, false);
}
@ -1135,14 +1135,14 @@ static void ozone_render(void *data,
menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &i);
}
menu_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL);
gfx_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL);
}
static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_info)
{
char title[255];
menu_animation_ctx_ticker_t ticker;
menu_animation_ctx_ticker_smooth_t ticker_smooth;
gfx_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_smooth_t ticker_smooth;
static const char* const ticker_spacer = OZONE_TICKER_SPACER;
unsigned ticker_x_offset = 0;
settings_t *settings = config_get_ptr();
@ -1156,17 +1156,17 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
/* Initial ticker configuration */
if (use_smooth_ticker)
{
ticker_smooth.idx = menu_animation_get_ticker_pixel_idx();
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker_smooth.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
ticker_smooth.spacer = ticker_spacer;
ticker_smooth.x_offset = &ticker_x_offset;
ticker_smooth.dst_str_width = NULL;
}
else
{
ticker.idx = menu_animation_get_ticker_idx();
ticker.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker.idx = gfx_animation_get_ticker_idx();
ticker.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
ticker.spacer = ticker_spacer;
}
@ -1183,7 +1183,7 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
ticker_smooth.dst_str = title;
ticker_smooth.dst_str_len = sizeof(title);
menu_animation_ticker_smooth(&ticker_smooth);
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
@ -1192,7 +1192,7 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
ticker.str = ozone->show_fullscreen_thumbnails ? ozone->fullscreen_thumbnail_label : ozone->title;
ticker.selected = true;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
ozone_draw_text(video_info, ozone, title, ticker_x_offset + 128 * scale_factor, ozone->dimensions.header_height / 2 + ozone->title_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.title, ozone->theme->text_rgba, false);
@ -1547,7 +1547,7 @@ static void ozone_selection_changed(ozone_handle_t *ozone, bool allow_animation)
menu_entry_t entry;
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_animation_ctx_tag tag = (uintptr_t) selection_buf;
gfx_animation_ctx_tag tag = (uintptr_t) selection_buf;
size_t selection = menu_navigation_get_selection();
size_t new_selection = menu_navigation_get_selection();
@ -1573,7 +1573,7 @@ static void ozone_selection_changed(ozone_handle_t *ozone, bool allow_animation)
ozone->cursor_in_sidebar_old = ozone->cursor_in_sidebar;
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
ozone_update_scroll(ozone, allow_animation, node);
/* Update thumbnail */
@ -1661,10 +1661,11 @@ static void ozone_messagebox_fadeout_cb(void *userdata)
static void ozone_frame(void *data, video_frame_info_t *video_info)
{
gfx_animation_ctx_entry_t entry;
ozone_handle_t* ozone = (ozone_handle_t*) data;
settings_t *settings = config_get_ptr();
unsigned color_theme = video_info->ozone_color_theme;
menu_animation_ctx_tag messagebox_tag = (uintptr_t)ozone->pending_message;
gfx_animation_ctx_tag messagebox_tag = (uintptr_t)ozone->pending_message;
bool draw_osk = menu_input_dialog_get_display_kb();
static bool draw_osk_old = false;
@ -1678,7 +1679,6 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
}
#endif
menu_animation_ctx_entry_t entry;
if (!ozone)
return;
@ -1807,7 +1807,7 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
{
ozone->messagebox_state_old = ozone->messagebox_state;
menu_animation_kill_by_tag(&messagebox_tag);
gfx_animation_kill_by_tag(&messagebox_tag);
ozone->animations.messagebox_alpha = 0.0f;
entry.cb = NULL;
@ -1818,7 +1818,7 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
entry.target_value = 1.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
/* Fade out animation */
else if (ozone->messagebox_state_old != ozone->messagebox_state && !ozone->messagebox_state)
@ -1826,7 +1826,7 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
ozone->messagebox_state_old = ozone->messagebox_state;
ozone->messagebox_state = false;
menu_animation_kill_by_tag(&messagebox_tag);
gfx_animation_kill_by_tag(&messagebox_tag);
ozone->animations.messagebox_alpha = 1.0f;
entry.cb = ozone_messagebox_fadeout_cb;
@ -1837,7 +1837,7 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
entry.target_value = 0.0f;
entry.userdata = ozone;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
ozone_draw_backdrop(video_info, float_min(ozone->animations.messagebox_alpha, 0.75f));
@ -1904,8 +1904,8 @@ static void ozone_animation_end(void *userdata)
static void ozone_list_open(ozone_handle_t *ozone)
{
menu_animation_ctx_tag sidebar_tag = (uintptr_t)&ozone->sidebar_offset;
struct menu_animation_ctx_entry entry;
gfx_animation_ctx_tag sidebar_tag = (uintptr_t)&ozone->sidebar_offset;
struct gfx_animation_ctx_entry entry;
ozone->draw_old_list = true;
@ -1920,7 +1920,7 @@ static void ozone_list_open(ozone_handle_t *ozone)
entry.target_value = 1.0f;
entry.userdata = ozone;
menu_animation_push(&entry);
gfx_animation_push(&entry);
/* Sidebar animation */
ozone_sidebar_update_collapse(ozone, true);
@ -1937,11 +1937,11 @@ static void ozone_list_open(ozone_handle_t *ozone)
entry.target_value = 0.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
else if (ozone->depth > 1)
{
struct menu_animation_ctx_entry entry;
struct gfx_animation_ctx_entry entry;
entry.cb = ozone_collapse_end;
entry.duration = ANIMATION_PUSH_ENTRY_DURATION;
@ -1951,7 +1951,7 @@ static void ozone_list_open(ozone_handle_t *ozone)
entry.target_value = -ozone->dimensions.sidebar_width;
entry.userdata = (void*) ozone;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
}
@ -2144,9 +2144,9 @@ static void ozone_list_deep_copy(const file_list_t *src, file_list_t *dst,
size_t first, size_t last)
{
size_t i, j = 0;
menu_animation_ctx_tag tag = (uintptr_t)dst;
gfx_animation_ctx_tag tag = (uintptr_t)dst;
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
ozone_free_list_nodes(dst, true);
@ -2346,15 +2346,15 @@ static bool ozone_get_load_content_animation_data(void *userdata, menu_texture_i
void ozone_hide_fullscreen_thumbnails(ozone_handle_t *ozone, bool animate)
{
menu_animation_ctx_tag alpha_tag = (uintptr_t)&ozone->animations.fullscreen_thumbnail_alpha;
gfx_animation_ctx_tag alpha_tag = (uintptr_t)&ozone->animations.fullscreen_thumbnail_alpha;
/* Kill any existing fade in/out animations */
menu_animation_kill_by_tag(&alpha_tag);
gfx_animation_kill_by_tag(&alpha_tag);
/* Check whether animations are enabled */
if (animate && (ozone->animations.fullscreen_thumbnail_alpha > 0.0f))
{
menu_animation_ctx_entry_t animation_entry;
gfx_animation_ctx_entry_t animation_entry;
/* Configure fade out animation */
animation_entry.easing_enum = EASING_OUT_QUAD;
@ -2366,7 +2366,7 @@ void ozone_hide_fullscreen_thumbnails(ozone_handle_t *ozone, bool animate)
animation_entry.userdata = NULL;
/* Push animation */
menu_animation_push(&animation_entry);
gfx_animation_push(&animation_entry);
}
/* No animation - just set thumbnail alpha to zero */
else
@ -2378,10 +2378,10 @@ void ozone_hide_fullscreen_thumbnails(ozone_handle_t *ozone, bool animate)
void ozone_show_fullscreen_thumbnails(ozone_handle_t *ozone)
{
const char *thumbnail_label = NULL;
menu_animation_ctx_tag alpha_tag = (uintptr_t)&ozone->animations.fullscreen_thumbnail_alpha;
menu_animation_ctx_entry_t animation_entry;
menu_entry_t selected_entry;
gfx_animation_ctx_entry_t animation_entry;
const char *thumbnail_label = NULL;
gfx_animation_ctx_tag alpha_tag = (uintptr_t)&ozone->animations.fullscreen_thumbnail_alpha;
/* Before showing fullscreen thumbnails, must
* ensure that any existing fullscreen thumbnail
@ -2458,7 +2458,7 @@ void ozone_show_fullscreen_thumbnails(ozone_handle_t *ozone)
animation_entry.userdata = NULL;
/* Push animation */
menu_animation_push(&animation_entry);
gfx_animation_push(&animation_entry);
/* Enable fullscreen thumbnails */
ozone->fullscreen_thumbnail_selection = (size_t)ozone->selection;
@ -2514,11 +2514,11 @@ static int ozone_pointer_up(void *userdata,
static enum menu_action ozone_parse_menu_entry_action(
ozone_handle_t *ozone, enum menu_action action)
{
int new_selection;
enum menu_action new_action = action;
file_list_t *selection_buf = NULL;
unsigned horizontal_list_size = 0;
int new_selection;
menu_animation_ctx_tag tag;
gfx_animation_ctx_tag tag;
/* If fullscreen thumbnail view is active, any
* valid menu action will disable it... */

View File

@ -28,7 +28,7 @@
#include <features/features_cpu.h>
#include "../../menu_input.h"
#include "../../menu_animation.h"
#include "../../gfx_animation.h"
#include "../../widgets/menu_osk.h"
@ -36,7 +36,7 @@ static void ozone_cursor_animation_cb(void *userdata);
static void ozone_animate_cursor(ozone_handle_t *ozone, float *dst, float *target)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
int i;
entry.easing_enum = EASING_OUT_QUAD;
@ -57,7 +57,7 @@ static void ozone_animate_cursor(ozone_handle_t *ozone, float *dst, float *targe
entry.subject = &dst[i];
entry.target_value = target[i];
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
}
@ -84,14 +84,14 @@ static void ozone_cursor_animation_cb(void *userdata)
void ozone_restart_cursor_animation(ozone_handle_t *ozone)
{
menu_animation_ctx_tag tag = (uintptr_t) &ozone_default_theme;
gfx_animation_ctx_tag tag = (uintptr_t) &ozone_default_theme;
if (!ozone->has_all_assets)
return;
ozone->theme_dynamic.cursor_state = 1;
memcpy(ozone->theme_dynamic.cursor_border, ozone->theme->cursor_border_0, sizeof(ozone->theme_dynamic.cursor_border));
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
ozone_animate_cursor(ozone, ozone->theme_dynamic.cursor_border, ozone->theme->cursor_border_1);
}

View File

@ -26,7 +26,7 @@
#include <encodings/utf.h>
#include "../../menu_driver.h"
#include "../../menu_animation.h"
#include "../../gfx_animation.h"
#include "../../../configuration.h"
@ -131,8 +131,8 @@ static void ozone_draw_entry_value(ozone_handle_t *ozone,
void ozone_update_scroll(ozone_handle_t *ozone, bool allow_animation, ozone_node_t *node)
{
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_animation_ctx_tag tag = (uintptr_t) selection_buf;
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_tag tag = (uintptr_t) selection_buf;
gfx_animation_ctx_entry_t entry;
float new_scroll = 0, entries_middle;
float bottom_boundary, current_selection_middle_onscreen;
unsigned video_info_height;
@ -170,7 +170,7 @@ void ozone_update_scroll(ozone_handle_t *ozone, bool allow_animation, ozone_node
entry.target_value = 1.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
/* Scroll animation */
entry.cb = NULL;
@ -181,7 +181,7 @@ void ozone_update_scroll(ozone_handle_t *ozone, bool allow_animation, ozone_node
entry.target_value = new_scroll;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
else
{
@ -295,15 +295,15 @@ static void ozone_thumbnail_bar_hide_end(void *userdata)
void ozone_entries_update_thumbnail_bar(ozone_handle_t *ozone, bool is_playlist, bool allow_animation)
{
struct menu_animation_ctx_entry entry;
menu_animation_ctx_tag tag = (uintptr_t) &ozone->show_thumbnail_bar;
struct gfx_animation_ctx_entry entry;
gfx_animation_ctx_tag tag = (uintptr_t) &ozone->show_thumbnail_bar;
entry.duration = ANIMATION_CURSOR_DURATION;
entry.easing_enum = EASING_OUT_QUAD;
entry.tag = tag;
entry.subject = &ozone->animations.thumbnail_bar_position;
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
/* Show it */
if (is_playlist && !ozone->cursor_in_sidebar && !ozone->show_thumbnail_bar && ozone->depth == 1)
@ -316,7 +316,7 @@ void ozone_entries_update_thumbnail_bar(ozone_handle_t *ozone, bool is_playlist,
entry.userdata = NULL;
entry.target_value = ozone->dimensions.thumbnail_bar_width;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
else
{
@ -333,7 +333,7 @@ void ozone_entries_update_thumbnail_bar(ozone_handle_t *ozone, bool is_playlist,
entry.userdata = ozone;
entry.target_value = 0.0f;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
else
{
@ -482,8 +482,8 @@ border_iterate:
{
menu_texture_item tex;
menu_entry_t entry;
menu_animation_ctx_ticker_t ticker;
menu_animation_ctx_ticker_smooth_t ticker_smooth;
gfx_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_smooth_t ticker_smooth;
static const char* const ticker_spacer = OZONE_TICKER_SPACER;
unsigned ticker_x_offset = 0;
unsigned ticker_str_width = 0;
@ -503,19 +503,19 @@ border_iterate:
/* Initial ticker configuration */
if (use_smooth_ticker)
{
ticker_smooth.idx = menu_animation_get_ticker_pixel_idx();
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.font = ozone->fonts.entries_label;
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker_smooth.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
ticker_smooth.spacer = ticker_spacer;
ticker_smooth.x_offset = &ticker_x_offset;
ticker_smooth.dst_str_width = &ticker_str_width;
}
else
{
ticker.idx = menu_animation_get_ticker_idx();
ticker.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker.spacer = ticker_spacer;
ticker.idx = gfx_animation_get_ticker_idx();
ticker.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
ticker.spacer = ticker_spacer;
}
entry_selected = selection == i;
@ -546,7 +546,7 @@ border_iterate:
ticker_smooth.dst_str = rich_label;
ticker_smooth.dst_str_len = sizeof(rich_label);
menu_animation_ticker_smooth(&ticker_smooth);
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
@ -555,7 +555,7 @@ border_iterate:
ticker.selected = entry_selected && !ozone->cursor_in_sidebar;
ticker.len = (entry_width - entry_padding - (10 * scale_factor) - ozone->dimensions.entry_icon_padding) / ozone->entry_font_glyph_width;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
if (ozone->empty_playlist)
@ -648,7 +648,7 @@ border_iterate:
/* Value text is right aligned, so have to offset x
* by the 'padding' width at the end of the ticker string... */
if (menu_animation_ticker_smooth(&ticker_smooth))
if (gfx_animation_ticker_smooth(&ticker_smooth))
value_x_offset = (ticker_x_offset + ticker_str_width) - ticker_smooth.field_width;
}
else
@ -659,7 +659,7 @@ border_iterate:
ticker.len = (entry_width - ozone->dimensions.entry_icon_size - ozone->dimensions.entry_icon_padding * 2 -
((unsigned)utf8len(entry_rich_label) * ozone->entry_font_glyph_width)) / ozone->entry_font_glyph_width;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
ozone_draw_entry_value(ozone, video_info, entry_value_ticker,
@ -831,8 +831,8 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i
else if (!ozone->selection_core_is_viewer)
{
char ticker_buf[255];
menu_animation_ctx_ticker_t ticker;
menu_animation_ctx_ticker_smooth_t ticker_smooth;
gfx_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_smooth_t ticker_smooth;
static const char* const ticker_spacer = OZONE_TICKER_SPACER;
unsigned ticker_x_offset = 0;
settings_t *settings = config_get_ptr();
@ -847,9 +847,10 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i
/* Initial ticker configuration */
if (use_smooth_ticker)
{
ticker_smooth.idx = menu_animation_get_ticker_pixel_idx();
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = (enum gfx_animation_ticker_type)
settings->uints.menu_ticker_type;
ticker_smooth.spacer = ticker_spacer;
ticker_smooth.x_offset = &ticker_x_offset;
ticker_smooth.dst_str_width = NULL;
@ -862,8 +863,8 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i
}
else
{
ticker.idx = menu_animation_get_ticker_idx();
ticker.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker.idx = gfx_animation_get_ticker_idx();
ticker.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
ticker.spacer = ticker_spacer;
ticker.selected = true;
@ -891,12 +892,12 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i
if (use_smooth_ticker)
{
ticker_smooth.src_str = ozone->selection_core_name;
menu_animation_ticker_smooth(&ticker_smooth);
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
ticker.str = ozone->selection_core_name;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
ozone_content_metadata_line(video_info, ozone,
@ -913,12 +914,12 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i
if (use_smooth_ticker)
{
ticker_smooth.src_str = ozone->selection_playtime;
menu_animation_ticker_smooth(&ticker_smooth);
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
ticker.str = ozone->selection_playtime;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
ozone_content_metadata_line(video_info, ozone,
@ -931,12 +932,12 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i
if (use_smooth_ticker)
{
ticker_smooth.src_str = ozone->selection_lastplayed;
menu_animation_ticker_smooth(&ticker_smooth);
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
ticker.str = ozone->selection_lastplayed;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
ozone_content_metadata_line(video_info, ozone,

View File

@ -27,7 +27,7 @@
#include <file/file_path.h>
#include <formats/image.h>
#include "../../menu_animation.h"
#include "../../gfx_animation.h"
#include "../../../configuration.h"
@ -109,8 +109,8 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
int entry_width;
unsigned i, sidebar_height, selection_y, selection_old_y, horizontal_list_size;
char console_title[255];
menu_animation_ctx_ticker_t ticker;
menu_animation_ctx_ticker_smooth_t ticker_smooth;
gfx_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_smooth_t ticker_smooth;
static const char* const ticker_spacer = OZONE_TICKER_SPACER;
unsigned ticker_x_offset = 0;
settings_t *settings = config_get_ptr();
@ -121,19 +121,19 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
/* Initial ticker configuration */
if (use_smooth_ticker)
{
ticker_smooth.idx = menu_animation_get_ticker_pixel_idx();
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.font = ozone->fonts.sidebar;
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker_smooth.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
ticker_smooth.spacer = ticker_spacer;
ticker_smooth.x_offset = &ticker_x_offset;
ticker_smooth.dst_str_width = NULL;
}
else
{
ticker.idx = menu_animation_get_ticker_idx();
ticker.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker.spacer = ticker_spacer;
ticker.idx = gfx_animation_get_ticker_idx();
ticker.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
ticker.spacer = ticker_spacer;
}
selection_y = 0;
@ -259,7 +259,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
ticker_smooth.dst_str = console_title;
ticker_smooth.dst_str_len = sizeof(console_title);
menu_animation_ticker_smooth(&ticker_smooth);
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
@ -268,7 +268,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
ticker.selected = selected;
ticker.str = node->console_name;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
ozone_draw_text(video_info, ozone, console_title, ticker_x_offset + ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.sidebar_entry_icon_padding * 2 + ozone->dimensions.sidebar_entry_icon_size,
@ -290,7 +290,7 @@ console_iterate:
void ozone_go_to_sidebar(ozone_handle_t *ozone, uintptr_t tag)
{
struct menu_animation_ctx_entry entry;
struct gfx_animation_ctx_entry entry;
ozone->selection_old = ozone->selection;
ozone->cursor_in_sidebar_old = ozone->cursor_in_sidebar;
@ -307,14 +307,14 @@ void ozone_go_to_sidebar(ozone_handle_t *ozone, uintptr_t tag)
entry.target_value = 1.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
ozone_sidebar_update_collapse(ozone, true);
}
void ozone_leave_sidebar(ozone_handle_t *ozone, uintptr_t tag)
{
struct menu_animation_ctx_entry entry;
struct gfx_animation_ctx_entry entry;
if (ozone->empty_playlist)
return;
@ -336,7 +336,7 @@ void ozone_leave_sidebar(ozone_handle_t *ozone, uintptr_t tag)
entry.target_value = 1.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
ozone_sidebar_update_collapse(ozone, true);
}
@ -365,18 +365,17 @@ static void ozone_sidebar_collapse_end(void *userdata)
void ozone_sidebar_update_collapse(ozone_handle_t *ozone, bool allow_animation)
{
/* Collapse sidebar if needed */
settings_t *settings = config_get_ptr();
bool is_playlist = ozone_is_playlist(ozone, false);
menu_animation_ctx_tag tag = (uintptr_t) &ozone->sidebar_collapsed;
struct menu_animation_ctx_entry entry;
struct gfx_animation_ctx_entry entry;
settings_t *settings = config_get_ptr();
bool is_playlist = ozone_is_playlist(ozone, false);
gfx_animation_ctx_tag tag = (uintptr_t) &ozone->sidebar_collapsed;
entry.easing_enum = EASING_OUT_QUAD;
entry.tag = tag;
entry.userdata = ozone;
entry.duration = ANIMATION_CURSOR_DURATION;
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
/* Collapse it */
if (settings->bools.ozone_collapse_sidebar || (is_playlist && !ozone->cursor_in_sidebar))
@ -389,13 +388,13 @@ void ozone_sidebar_update_collapse(ozone_handle_t *ozone, bool allow_animation)
entry.subject = &ozone->animations.sidebar_text_alpha;
entry.target_value = 0.0f;
menu_animation_push(&entry);
gfx_animation_push(&entry);
/* Collapse */
entry.subject = &ozone->dimensions.sidebar_width;
entry.target_value = ozone->dimensions.sidebar_width_collapsed;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
else
{
@ -417,13 +416,13 @@ void ozone_sidebar_update_collapse(ozone_handle_t *ozone, bool allow_animation)
entry.subject = &ozone->animations.sidebar_text_alpha;
entry.target_value = 1.0f;
menu_animation_push(&entry);
gfx_animation_push(&entry);
/* Collapse */
entry.subject = &ozone->dimensions.sidebar_width;
entry.target_value = ozone->dimensions.sidebar_width_normal;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
else
{
@ -466,10 +465,8 @@ static float ozone_sidebar_get_scroll_y(ozone_handle_t *ozone, unsigned video_he
void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
{
unsigned video_info_height;
struct menu_animation_ctx_entry entry;
menu_animation_ctx_tag tag;
struct gfx_animation_ctx_entry entry;
gfx_animation_ctx_tag tag;
video_driver_get_size(NULL, &video_info_height);
@ -482,7 +479,7 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
ozone->cursor_in_sidebar_old = ozone->cursor_in_sidebar;
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
}
/* Cursor animation */
@ -496,7 +493,7 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
entry.target_value = 1.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
/* Scroll animation */
entry.cb = NULL;
@ -507,7 +504,7 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
entry.target_value = ozone_sidebar_get_scroll_y(ozone, video_info_height);
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
if (new_selection > ozone->system_tab_end)
{
@ -522,18 +519,18 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
void ozone_refresh_sidebars(ozone_handle_t *ozone, unsigned video_height)
{
settings_t *settings = config_get_ptr();
menu_animation_ctx_tag collapsed_tag = (uintptr_t)&ozone->sidebar_collapsed;
menu_animation_ctx_tag offset_tag = (uintptr_t)&ozone->sidebar_offset;
menu_animation_ctx_tag thumbnail_tag = (uintptr_t)&ozone->show_thumbnail_bar;
menu_animation_ctx_tag scroll_tag = (uintptr_t)ozone;
gfx_animation_ctx_tag collapsed_tag = (uintptr_t)&ozone->sidebar_collapsed;
gfx_animation_ctx_tag offset_tag = (uintptr_t)&ozone->sidebar_offset;
gfx_animation_ctx_tag thumbnail_tag = (uintptr_t)&ozone->show_thumbnail_bar;
gfx_animation_ctx_tag scroll_tag = (uintptr_t)ozone;
bool is_playlist = ozone_is_playlist(ozone, false);
/* Kill any existing animations */
menu_animation_kill_by_tag(&collapsed_tag);
menu_animation_kill_by_tag(&offset_tag);
menu_animation_kill_by_tag(&thumbnail_tag);
gfx_animation_kill_by_tag(&collapsed_tag);
gfx_animation_kill_by_tag(&offset_tag);
gfx_animation_kill_by_tag(&thumbnail_tag);
if (ozone->depth == 1)
menu_animation_kill_by_tag(&scroll_tag);
gfx_animation_kill_by_tag(&scroll_tag);
/* Set sidebar width */
if (settings->bools.ozone_collapse_sidebar || (is_playlist && !ozone->cursor_in_sidebar))

View File

@ -49,7 +49,7 @@
#include "menu_generic.h"
#include "../menu_driver.h"
#include "../menu_animation.h"
#include "../gfx_animation.h"
#include "../widgets/menu_osk.h"
@ -1369,7 +1369,7 @@ static void rgui_render_particle_effect(rgui_t *rgui)
settings->floats.menu_rgui_particle_effect_speed : 1.0f;
/* > Account for non-standard frame times
* (high/low refresh rates, or frame drops) */
global_speed_factor *= menu_animation_get_delta_time() / particle_effect_period;
global_speed_factor *= gfx_animation_get_delta_time() / particle_effect_period;
/* Note: It would be more elegant to have 'update' and 'draw'
* as separate functions, since 'update' is the part that
@ -2917,7 +2917,8 @@ int rgui_osk_ptr_at_pos(void *data, int x, int y,
static void rgui_render_osk(
rgui_t *rgui,
menu_animation_ctx_ticker_t *ticker, menu_animation_ctx_ticker_smooth_t *ticker_smooth,
gfx_animation_ctx_ticker_t *ticker,
gfx_animation_ctx_ticker_smooth_t *ticker_smooth,
bool use_smooth_ticker)
{
size_t fb_pitch;
@ -3056,7 +3057,7 @@ static void rgui_render_osk(
ticker_smooth->dst_str_len = sizeof(input_label_buf);
ticker_smooth->x_offset = &ticker_x_offset;
menu_animation_ticker_smooth(ticker_smooth);
gfx_animation_ticker_smooth(ticker_smooth);
}
else
{
@ -3065,7 +3066,7 @@ static void rgui_render_osk(
ticker->str = input_label;
ticker->selected = true;
menu_animation_ticker(ticker);
gfx_animation_ticker(ticker);
}
input_label_length = (unsigned)(utf8len(input_label_buf) * FONT_WIDTH_STRIDE);
@ -3200,8 +3201,8 @@ static void rgui_render(void *data,
unsigned width, unsigned height,
bool is_idle)
{
menu_animation_ctx_ticker_t ticker;
menu_animation_ctx_ticker_smooth_t ticker_smooth;
gfx_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_smooth_t ticker_smooth;
static const char* const ticker_spacer = RGUI_TICKER_SPACER;
bool use_smooth_ticker;
unsigned x, y;
@ -3282,7 +3283,7 @@ static void rgui_render(void *data,
rgui->bg_modified = false;
menu_display_set_framebuffer_dirty_flag();
menu_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL);
gfx_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL);
rgui->force_redraw = false;
@ -3356,17 +3357,18 @@ static void rgui_render(void *data,
use_smooth_ticker = settings->bools.menu_ticker_smooth;
if (use_smooth_ticker)
{
ticker_smooth.idx = menu_animation_get_ticker_pixel_idx();
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.font = NULL;
ticker_smooth.glyph_width = FONT_WIDTH_STRIDE;
ticker_smooth.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker_smooth.type_enum = (enum gfx_animation_ticker_type)
settings->uints.menu_ticker_type;
ticker_smooth.spacer = ticker_spacer;
ticker_smooth.dst_str_width = NULL;
}
else
{
ticker.idx = menu_animation_get_ticker_idx();
ticker.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker.idx = gfx_animation_get_ticker_idx();
ticker.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
ticker.spacer = ticker_spacer;
}
@ -3405,7 +3407,7 @@ static void rgui_render(void *data,
ticker_smooth.x_offset = &ticker_x_offset;
/* If title is scrolling, then width == field_width */
if (menu_animation_ticker_smooth(&ticker_smooth))
if (gfx_animation_ticker_smooth(&ticker_smooth))
title_width = ticker_smooth.field_width;
else
title_width = (unsigned)(utf8len(thumbnail_title_buf) * FONT_WIDTH_STRIDE);
@ -3417,7 +3419,7 @@ static void rgui_render(void *data,
ticker.str = thumbnail_title;
ticker.selected = true;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
title_width = (unsigned)(utf8len(thumbnail_title_buf) * FONT_WIDTH_STRIDE);
}
@ -3555,7 +3557,7 @@ static void rgui_render(void *data,
ticker_smooth.x_offset = &ticker_x_offset;
/* If title is scrolling, then title_len == title_max_len */
if (menu_animation_ticker_smooth(&ticker_smooth))
if (gfx_animation_ticker_smooth(&ticker_smooth))
title_len = title_max_len;
else
title_len = utf8len(title_buf);
@ -3567,7 +3569,7 @@ static void rgui_render(void *data,
ticker.str = rgui->menu_title;
ticker.selected = true;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
title_len = utf8len(title_buf);
}
@ -3692,7 +3694,7 @@ static void rgui_render(void *data,
ticker_smooth.dst_str_len = sizeof(entry_title_buf);
ticker_smooth.x_offset = &ticker_x_offset;
menu_animation_ticker_smooth(&ticker_smooth);
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
@ -3701,7 +3703,7 @@ static void rgui_render(void *data,
ticker.str = entry_label;
ticker.selected = entry_selected;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
/* Print entry title */
@ -3721,7 +3723,7 @@ static void rgui_render(void *data,
ticker_smooth.dst_str_len = sizeof(type_str_buf);
ticker_smooth.x_offset = &ticker_x_offset;
menu_animation_ticker_smooth(&ticker_smooth);
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
@ -3729,7 +3731,7 @@ static void rgui_render(void *data,
ticker.len = entry_value_len;
ticker.str = entry_value;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
/* Print entry value */
@ -3774,7 +3776,7 @@ static void rgui_render(void *data,
ticker_smooth.dst_str_len = sizeof(sublabel_buf);
ticker_smooth.x_offset = &ticker_x_offset;
menu_animation_ticker_smooth(&ticker_smooth);
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
@ -3783,7 +3785,7 @@ static void rgui_render(void *data,
ticker.str = rgui->menu_sublabel;
ticker.selected = true;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
blit_line(
@ -3810,7 +3812,7 @@ static void rgui_render(void *data,
ticker_smooth.dst_str_len = sizeof(core_title_buf);
ticker_smooth.x_offset = &ticker_x_offset;
menu_animation_ticker_smooth(&ticker_smooth);
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
@ -3819,7 +3821,7 @@ static void rgui_render(void *data,
ticker.str = core_title;
ticker.selected = true;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
blit_line(
@ -4356,7 +4358,7 @@ static void *rgui_init(void **userdata, bool video_is_threaded)
* not handle struct initialisation correctly...) */
memset(&rgui->pointer, 0, sizeof(menu_input_pointer_t));
menu_animation_set_update_time_cb(rgui_menu_animation_update_time);
gfx_animation_set_update_time_cb(rgui_menu_animation_update_time);
return menu;
@ -4368,7 +4370,7 @@ error:
rgui_thumbnail_free(&mini_left_thumbnail);
if (menu)
free(menu);
menu_animation_unset_update_time_cb();
gfx_animation_unset_update_time_cb();
return NULL;
}
@ -4394,7 +4396,7 @@ static void rgui_free(void *data)
rgui_upscale_buf.data = NULL;
}
menu_animation_unset_update_time_cb();
gfx_animation_unset_update_time_cb();
}
static void rgui_set_texture(void)

View File

@ -42,7 +42,7 @@
#include "menu_generic.h"
#include "../menu_driver.h"
#include "../menu_animation.h"
#include "../gfx_animation.h"
#include "../menu_entries.h"
#include "../menu_input.h"
@ -1159,7 +1159,7 @@ static void stripes_selection_pointer_changed(
stripes_handle_t *stripes, bool allow_animations)
{
unsigned i, end, height;
menu_animation_ctx_tag tag;
gfx_animation_ctx_tag tag;
menu_entry_t entry;
size_t num = 0;
int threshold = 0;
@ -1184,7 +1184,7 @@ static void stripes_selection_pointer_changed(
tag = (uintptr_t)selection_buf;
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &num);
for (i = 0; i < end; i++)
@ -1211,7 +1211,7 @@ static void stripes_selection_pointer_changed(
}
else
{
menu_animation_ctx_entry_t anim_entry;
gfx_animation_ctx_entry_t anim_entry;
anim_entry.duration = STRIPES_DELAY;
anim_entry.target_value = ia;
@ -1220,21 +1220,21 @@ static void stripes_selection_pointer_changed(
anim_entry.tag = tag;
anim_entry.cb = NULL;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.subject = &node->label_alpha;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.target_value = iz;
anim_entry.subject = &node->zoom;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.target_value = iy;
anim_entry.subject = &node->y;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
}
}
}
@ -1275,7 +1275,7 @@ static void stripes_list_open_old(stripes_handle_t *stripes,
}
else
{
menu_animation_ctx_entry_t anim_entry;
gfx_animation_ctx_entry_t anim_entry;
anim_entry.duration = STRIPES_DELAY;
anim_entry.target_value = ia;
@ -1284,17 +1284,17 @@ static void stripes_list_open_old(stripes_handle_t *stripes,
anim_entry.tag = (uintptr_t)list;
anim_entry.cb = NULL;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.target_value = 0;
anim_entry.subject = &node->label_alpha;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.target_value = stripes->icon_size * dir * -2;
anim_entry.subject = &node->x;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
}
}
}
@ -1346,7 +1346,7 @@ static void stripes_list_open_new(stripes_handle_t *stripes,
}
else
{
menu_animation_ctx_entry_t anim_entry;
gfx_animation_ctx_entry_t anim_entry;
anim_entry.duration = STRIPES_DELAY;
anim_entry.target_value = ia;
@ -1355,16 +1355,16 @@ static void stripes_list_open_new(stripes_handle_t *stripes,
anim_entry.tag = (uintptr_t)list;
anim_entry.cb = NULL;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.subject = &node->label_alpha;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.target_value = 0;
anim_entry.subject = &node->x;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
}
}
@ -1425,7 +1425,7 @@ static stripes_node_t* stripes_get_userdata_from_horizontal_list(
static void stripes_push_animations(stripes_node_t *node,
uintptr_t tag, float ia, float ix)
{
menu_animation_ctx_entry_t anim_entry;
gfx_animation_ctx_entry_t anim_entry;
anim_entry.duration = STRIPES_DELAY;
anim_entry.target_value = ia;
@ -1434,16 +1434,16 @@ static void stripes_push_animations(stripes_node_t *node,
anim_entry.tag = tag;
anim_entry.cb = NULL;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.subject = &node->label_alpha;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.target_value = ix;
anim_entry.subject = &node->x;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
}
static void stripes_list_switch_old(stripes_handle_t *stripes,
@ -1625,7 +1625,7 @@ static void stripes_list_switch_horizontal_list(stripes_handle_t *stripes)
for (j = 0; j <= list_size; j++)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
float ia = stripes->categories_passive_alpha;
float iz = stripes->categories_passive_zoom;
float iw = stripes->categories_passive_width;
@ -1663,33 +1663,33 @@ static void stripes_list_switch_horizontal_list(stripes_handle_t *stripes)
entry.tag = -1;
entry.cb = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
entry.target_value = iz;
entry.subject = &node->zoom;
menu_animation_push(&entry);
gfx_animation_push(&entry);
entry.target_value = iy;
entry.subject = &node->y;
menu_animation_push(&entry);
gfx_animation_push(&entry);
entry.target_value = ix;
entry.subject = &node->x;
menu_animation_push(&entry);
gfx_animation_push(&entry);
entry.target_value = iw;
entry.subject = &node->width;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
}
static void stripes_list_switch(stripes_handle_t *stripes)
{
menu_animation_ctx_entry_t anim_entry;
gfx_animation_ctx_entry_t anim_entry;
int dir = -1;
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
size_t selection = menu_navigation_get_selection();
@ -1712,7 +1712,7 @@ static void stripes_list_switch(stripes_handle_t *stripes)
anim_entry.cb = NULL;
if (anim_entry.subject)
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
dir = -1;
if (stripes->categories_selection_ptr > stripes->categories_selection_ptr_old)
@ -1764,7 +1764,7 @@ static void stripes_list_open_horizontal_list(stripes_handle_t *stripes)
for (j = 0; j <= list_size; j++)
{
menu_animation_ctx_entry_t anim_entry;
gfx_animation_ctx_entry_t anim_entry;
float ia = 0;
stripes_node_t *node = stripes_get_node(stripes, j);
@ -1785,7 +1785,7 @@ static void stripes_list_open_horizontal_list(stripes_handle_t *stripes)
anim_entry.cb = NULL;
if (anim_entry.subject)
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
}
}
@ -2027,7 +2027,7 @@ static int stripes_environ(enum menu_environ_cb type, void *data, void *userdata
static void stripes_list_open(stripes_handle_t *stripes)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
int dir = 0;
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
@ -2058,20 +2058,20 @@ static void stripes_list_open(stripes_handle_t *stripes)
switch (stripes->depth)
{
case 1:
menu_animation_push(&entry);
gfx_animation_push(&entry);
entry.target_value = 0;
entry.subject = &stripes->textures_arrow_alpha;
menu_animation_push(&entry);
gfx_animation_push(&entry);
break;
case 2:
menu_animation_push(&entry);
gfx_animation_push(&entry);
entry.target_value = 1;
entry.subject = &stripes->textures_arrow_alpha;
menu_animation_push(&entry);
gfx_animation_push(&entry);
break;
}
@ -2333,7 +2333,7 @@ static int stripes_draw_item(
)
{
float icon_x, icon_y, label_offset;
menu_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_t ticker;
char tmp[255];
const char *ticker_str = NULL;
unsigned entry_type = 0;
@ -2456,12 +2456,12 @@ static int stripes_draw_item(
ticker.s = tmp;
ticker.len = ticker_limit;
ticker.idx = menu_animation_get_ticker_idx();
ticker.idx = gfx_animation_get_ticker_idx();
ticker.str = ticker_str;
ticker.selected = (i == current);
if (ticker.str)
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
label_offset = stripes->margins_label_top;
if (i == current && width > 320 && height > 240
@ -2492,13 +2492,13 @@ static int stripes_draw_item(
ticker.s = tmp;
ticker.len = 35 * stripes_scale_mod[7];
ticker.idx = menu_animation_get_ticker_idx();
ticker.idx = gfx_animation_get_ticker_idx();
ticker.selected = (i == current);
if (!string_is_empty(entry->value))
{
ticker.str = entry->value;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
if (do_draw_text)
@ -2697,7 +2697,7 @@ static void stripes_render(void *data,
menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &i);
}
menu_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL);
gfx_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL);
}
static bool stripes_shader_pipeline_active(video_frame_info_t *video_info)
@ -3808,9 +3808,9 @@ static void stripes_list_insert(void *userdata,
static void stripes_list_clear(file_list_t *list)
{
menu_animation_ctx_tag tag = (uintptr_t)list;
gfx_animation_ctx_tag tag = (uintptr_t)list;
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
stripes_free_list_nodes(list, false);
}
@ -3824,9 +3824,9 @@ static void stripes_list_deep_copy(const file_list_t *src, file_list_t *dst,
size_t first, size_t last)
{
size_t i, j = 0;
menu_animation_ctx_tag tag = (uintptr_t)dst;
gfx_animation_ctx_tag tag = (uintptr_t)dst;
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
stripes_free_list_nodes(dst, true);
@ -4039,7 +4039,7 @@ static void stripes_context_destroy(void *data)
static void stripes_toggle(void *userdata, bool menu_on)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
bool tmp = false;
stripes_handle_t *stripes = (stripes_handle_t*)userdata;
@ -4062,7 +4062,7 @@ static void stripes_toggle(void *userdata, bool menu_on)
entry.tag = -1;
entry.cb = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
tmp = !menu_entries_ctl(MENU_ENTRIES_CTL_NEEDS_REFRESH, NULL);

View File

@ -42,7 +42,7 @@
#include "menu_generic.h"
#include "../menu_driver.h"
#include "../menu_animation.h"
#include "../gfx_animation.h"
#include "../menu_entries.h"
#include "../menu_input.h"
#include "../menu_thumbnail_path.h"
@ -1205,7 +1205,7 @@ static void xmb_selection_pointer_changed(
xmb_handle_t *xmb, bool allow_animations)
{
unsigned i, end, height;
menu_animation_ctx_tag tag;
gfx_animation_ctx_tag tag;
menu_entry_t entry;
size_t num = 0;
int threshold = 0;
@ -1233,7 +1233,7 @@ static void xmb_selection_pointer_changed(
tag = (uintptr_t)selection_buf;
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &num);
for (i = 0; i < end; i++)
@ -1324,7 +1324,7 @@ static void xmb_selection_pointer_changed(
settings_t *settings = config_get_ptr();
/* Move up/down animation */
menu_animation_ctx_entry_t anim_entry;
gfx_animation_ctx_entry_t anim_entry;
anim_entry.target_value = ia;
anim_entry.subject = &node->alpha;
@ -1343,21 +1343,21 @@ static void xmb_selection_pointer_changed(
break;
}
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.subject = &node->label_alpha;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.target_value = iz;
anim_entry.subject = &node->zoom;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.target_value = iy;
anim_entry.subject = &node->y;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
}
}
}
@ -1398,7 +1398,7 @@ static void xmb_list_open_old(xmb_handle_t *xmb,
}
else
{
menu_animation_ctx_entry_t anim_entry;
gfx_animation_ctx_entry_t anim_entry;
anim_entry.duration = XMB_DELAY;
anim_entry.target_value = ia;
@ -1407,17 +1407,17 @@ static void xmb_list_open_old(xmb_handle_t *xmb,
anim_entry.tag = (uintptr_t)list;
anim_entry.cb = NULL;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.target_value = 0;
anim_entry.subject = &node->label_alpha;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.target_value = xmb->icon_size * dir * -2;
anim_entry.subject = &node->x;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
}
}
}
@ -1476,7 +1476,7 @@ static void xmb_list_open_new(xmb_handle_t *xmb,
}
else
{
menu_animation_ctx_entry_t anim_entry;
gfx_animation_ctx_entry_t anim_entry;
anim_entry.duration = XMB_DELAY;
anim_entry.target_value = ia;
@ -1485,16 +1485,16 @@ static void xmb_list_open_new(xmb_handle_t *xmb,
anim_entry.tag = (uintptr_t)list;
anim_entry.cb = NULL;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.subject = &node->label_alpha;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.target_value = 0;
anim_entry.subject = &node->x;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
}
}
@ -1565,7 +1565,7 @@ static xmb_node_t* xmb_get_userdata_from_horizontal_list(
static void xmb_push_animations(xmb_node_t *node,
uintptr_t tag, float ia, float ix)
{
menu_animation_ctx_entry_t anim_entry;
gfx_animation_ctx_entry_t anim_entry;
anim_entry.duration = XMB_DELAY;
anim_entry.target_value = ia;
@ -1574,16 +1574,16 @@ static void xmb_push_animations(xmb_node_t *node,
anim_entry.tag = tag;
anim_entry.cb = NULL;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.subject = &node->label_alpha;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
anim_entry.target_value = ix;
anim_entry.subject = &node->x;
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
}
static void xmb_list_switch_old(xmb_handle_t *xmb,
@ -1762,7 +1762,7 @@ static void xmb_list_switch_horizontal_list(xmb_handle_t *xmb)
for (j = 0; j <= list_size; j++)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
settings_t *settings = config_get_ptr();
float ia = xmb->categories_passive_alpha;
float iz = xmb->categories_passive_zoom;
@ -1801,18 +1801,18 @@ static void xmb_list_switch_horizontal_list(xmb_handle_t *xmb)
break;
}
menu_animation_push(&entry);
gfx_animation_push(&entry);
entry.target_value = iz;
entry.subject = &node->zoom;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
}
static void xmb_list_switch(xmb_handle_t *xmb)
{
menu_animation_ctx_entry_t anim_entry;
gfx_animation_ctx_entry_t anim_entry;
int dir = -1;
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
size_t selection = menu_navigation_get_selection();
@ -1835,7 +1835,7 @@ static void xmb_list_switch(xmb_handle_t *xmb)
anim_entry.cb = NULL;
if (anim_entry.subject)
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
dir = -1;
if (xmb->categories_selection_ptr > xmb->categories_selection_ptr_old)
@ -1870,7 +1870,7 @@ static void xmb_list_open_horizontal_list(xmb_handle_t *xmb)
for (j = 0; j <= list_size; j++)
{
menu_animation_ctx_entry_t anim_entry;
gfx_animation_ctx_entry_t anim_entry;
float ia = 0;
xmb_node_t *node = xmb_get_node(xmb, j);
@ -1891,7 +1891,7 @@ static void xmb_list_open_horizontal_list(xmb_handle_t *xmb)
anim_entry.cb = NULL;
if (anim_entry.subject)
menu_animation_push(&anim_entry);
gfx_animation_push(&anim_entry);
}
}
@ -2150,7 +2150,7 @@ static int xmb_environ(enum menu_environ_cb type, void *data, void *userdata)
static void xmb_list_open(xmb_handle_t *xmb)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
settings_t *settings = config_get_ptr();
int dir = 0;
@ -2205,12 +2205,12 @@ static void xmb_list_open(xmb_handle_t *xmb)
{
case 1:
case 2:
menu_animation_push(&entry);
gfx_animation_push(&entry);
entry.target_value = xmb->depth - 1;
entry.subject = &xmb->textures_arrow_alpha;
menu_animation_push(&entry);
gfx_animation_push(&entry);
break;
}
@ -2848,8 +2848,8 @@ static int xmb_draw_item(
)
{
float icon_x, icon_y, label_offset;
menu_animation_ctx_ticker_t ticker;
menu_animation_ctx_ticker_smooth_t ticker_smooth;
gfx_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_smooth_t ticker_smooth;
char tmp[255];
unsigned ticker_x_offset = 0;
const char *ticker_str = NULL;
@ -2867,18 +2867,18 @@ static int xmb_draw_item(
/* Initial ticker configuration */
if (use_smooth_ticker)
{
ticker_smooth.idx = menu_animation_get_ticker_pixel_idx();
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.font = xmb->font;
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker_smooth.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
ticker_smooth.spacer = NULL;
ticker_smooth.x_offset = &ticker_x_offset;
ticker_smooth.dst_str_width = NULL;
}
else
{
ticker.idx = menu_animation_get_ticker_idx();
ticker.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker.idx = gfx_animation_get_ticker_idx();
ticker.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
ticker.spacer = NULL;
}
@ -3011,7 +3011,7 @@ static int xmb_draw_item(
ticker_smooth.dst_str_len = sizeof(tmp);
if (ticker_smooth.src_str)
menu_animation_ticker_smooth(&ticker_smooth);
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
@ -3021,7 +3021,7 @@ static int xmb_draw_item(
ticker.selected = (i == current);
if (ticker.str)
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
label_offset = xmb->margins_label_top;
@ -3034,8 +3034,8 @@ static int xmb_draw_item(
char entry_sublabel[MENU_SUBLABEL_MAX_LENGTH];
char entry_sublabel_top_fade[MENU_SUBLABEL_MAX_LENGTH >> 2];
char entry_sublabel_bottom_fade[MENU_SUBLABEL_MAX_LENGTH >> 2];
menu_animation_ctx_line_ticker_t line_ticker;
menu_animation_ctx_line_ticker_smooth_t line_ticker_smooth;
gfx_animation_ctx_line_ticker_t line_ticker;
gfx_animation_ctx_line_ticker_smooth_t line_ticker_smooth;
float ticker_y_offset = 0.0f;
float ticker_top_fade_y_offset = 0.0f;
float ticker_bottom_fade_y_offset = 0.0f;
@ -3053,8 +3053,8 @@ static int xmb_draw_item(
if (use_smooth_ticker)
{
line_ticker_smooth.fade_enabled = true;
line_ticker_smooth.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
line_ticker_smooth.idx = menu_animation_get_ticker_pixel_idx();
line_ticker_smooth.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
line_ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
line_ticker_smooth.font = xmb->font2;
line_ticker_smooth.font_scale = 1.0f;
@ -3082,12 +3082,12 @@ static int xmb_draw_item(
line_ticker_smooth.bottom_fade_y_offset = &ticker_bottom_fade_y_offset;
line_ticker_smooth.bottom_fade_alpha = &ticker_bottom_fade_alpha;
menu_animation_line_ticker_smooth(&line_ticker_smooth);
gfx_animation_line_ticker_smooth(&line_ticker_smooth);
}
else
{
line_ticker.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
line_ticker.idx = menu_animation_get_ticker_idx();
line_ticker.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
line_ticker.idx = gfx_animation_get_ticker_idx();
line_ticker.line_len = (size_t)(line_ticker_width);
/* Note: max_lines should be calculated at runtime,
@ -3100,7 +3100,7 @@ static int xmb_draw_item(
line_ticker.len = sizeof(entry_sublabel);
line_ticker.str = entry->sublabel;
menu_animation_line_ticker(&line_ticker);
gfx_animation_line_ticker(&line_ticker);
}
label_offset = - xmb->margins_label_top;
@ -3149,7 +3149,7 @@ static int xmb_draw_item(
ticker_smooth.dst_str_len = sizeof(tmp);
if (!string_is_empty(entry->value))
menu_animation_ticker_smooth(&ticker_smooth);
gfx_animation_ticker_smooth(&ticker_smooth);
}
else
{
@ -3159,7 +3159,7 @@ static int xmb_draw_item(
ticker.str = entry->value;
if (!string_is_empty(entry->value))
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
if (do_draw_text)
@ -3455,7 +3455,7 @@ static void xmb_render(void *data,
menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &i);
}
menu_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL);
gfx_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL);
}
static bool xmb_shader_pipeline_active(video_frame_info_t *video_info)
@ -3616,15 +3616,15 @@ static void xmb_draw_dark_layer(
static void xmb_hide_fullscreen_thumbnails(
xmb_handle_t *xmb, bool animate)
{
menu_animation_ctx_tag alpha_tag = (uintptr_t)&xmb->fullscreen_thumbnail_alpha;
gfx_animation_ctx_tag alpha_tag = (uintptr_t)&xmb->fullscreen_thumbnail_alpha;
/* Kill any existing fade in/out animations */
menu_animation_kill_by_tag(&alpha_tag);
gfx_animation_kill_by_tag(&alpha_tag);
/* Check whether animations are enabled */
if (animate && (xmb->fullscreen_thumbnail_alpha > 0.0f))
{
menu_animation_ctx_entry_t animation_entry;
gfx_animation_ctx_entry_t animation_entry;
/* Configure fade out animation */
animation_entry.easing_enum = EASING_OUT_QUAD;
@ -3636,7 +3636,7 @@ static void xmb_hide_fullscreen_thumbnails(
animation_entry.userdata = NULL;
/* Push animation */
menu_animation_push(&animation_entry);
gfx_animation_push(&animation_entry);
}
/* No animation - just set thumbnail alpha to zero */
else
@ -3653,8 +3653,8 @@ static void xmb_show_fullscreen_thumbnails(
{
const char *core_name = NULL;
const char *thumbnail_label = NULL;
menu_animation_ctx_tag alpha_tag = (uintptr_t)&xmb->fullscreen_thumbnail_alpha;
menu_animation_ctx_entry_t animation_entry;
gfx_animation_ctx_tag alpha_tag = (uintptr_t)&xmb->fullscreen_thumbnail_alpha;
gfx_animation_ctx_entry_t animation_entry;
menu_entry_t selected_entry;
/* Before showing fullscreen thumbnails, must
@ -3739,7 +3739,7 @@ static void xmb_show_fullscreen_thumbnails(
animation_entry.userdata = NULL;
/* Push animation */
menu_animation_push(&animation_entry);
gfx_animation_push(&animation_entry);
/* Enable fullscreen thumbnails */
xmb->fullscreen_thumbnail_selection = selection;
@ -3991,15 +3991,15 @@ static void xmb_draw_fullscreen_thumbnails(
int title_x = 0;
unsigned ticker_x_offset = 0;
unsigned ticker_str_width = 0;
menu_animation_ctx_ticker_smooth_t ticker_smooth;
gfx_animation_ctx_ticker_smooth_t ticker_smooth;
char title_buf[255];
title_buf[0] = '\0';
ticker_smooth.idx = menu_animation_get_ticker_pixel_idx();
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.font = xmb->font;
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = (enum menu_animation_ticker_type)settings->uints.menu_ticker_type;
ticker_smooth.type_enum = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
ticker_smooth.spacer = NULL;
ticker_smooth.x_offset = &ticker_x_offset;
ticker_smooth.dst_str_width = &ticker_str_width;
@ -4010,7 +4010,7 @@ static void xmb_draw_fullscreen_thumbnails(
ticker_smooth.dst_str_len = sizeof(title_buf);
/* If ticker is not active, centre the title text */
if (!menu_animation_ticker_smooth(&ticker_smooth))
if (!gfx_animation_ticker_smooth(&ticker_smooth))
title_x = (view_width - (int)ticker_str_width) >> 1;
title_x += (int)ticker_x_offset;
@ -5789,9 +5789,9 @@ static void xmb_list_insert(void *userdata,
static void xmb_list_clear(file_list_t *list)
{
menu_animation_ctx_tag tag = (uintptr_t)list;
gfx_animation_ctx_tag tag = (uintptr_t)list;
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
xmb_free_list_nodes(list, false);
}
@ -5805,9 +5805,9 @@ static void xmb_list_deep_copy(const file_list_t *src, file_list_t *dst,
size_t first, size_t last)
{
size_t i, j = 0;
menu_animation_ctx_tag tag = (uintptr_t)dst;
gfx_animation_ctx_tag tag = (uintptr_t)dst;
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
xmb_free_list_nodes(dst, true);
@ -6018,7 +6018,7 @@ static void xmb_context_destroy(void *data)
static void xmb_toggle(void *userdata, bool menu_on)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
bool tmp = false;
xmb_handle_t *xmb = (xmb_handle_t*)userdata;
@ -6046,7 +6046,7 @@ static void xmb_toggle(void *userdata, bool menu_on)
entry.tag = -1;
entry.cb = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
tmp = !menu_entries_ctl(MENU_ENTRIES_CTL_NEEDS_REFRESH, NULL);

View File

@ -34,7 +34,7 @@
#include "menu_generic.h"
#include "../menu_driver.h"
#include "../menu_animation.h"
#include "../gfx_animation.h"
#include "../menu_entries.h"
#include "../menu_input.h"
#include "../menu_setting.h"
@ -542,13 +542,13 @@ static void xui_render(void *data,
return;
menu_display_unset_framebuffer_dirty_flag();
menu_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL);
gfx_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL);
xui_render_background();
if (XuiHandleIsValid(m_menutitle))
{
menu_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_t ticker;
menu_entries_get_title(title, sizeof(title));
mbstowcs(strw_buffer, title, sizeof(strw_buffer) / sizeof(wchar_t));
XuiTextElementSetText(m_menutitle, strw_buffer);
@ -559,11 +559,11 @@ static void xui_render(void *data,
ticker.s = title;
ticker.len = RXUI_TERM_WIDTH(fb_width) - 3;
ticker.idx = menu_animation_get_ticker_idx();
ticker.idx = gfx_animation_get_ticker_idx();
ticker.str = title;
ticker.selected = true;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
}
if (XuiHandleIsValid(m_menutitle))

View File

@ -32,7 +32,7 @@
#include <array/dynarray.h>
#undef DG_DYNARR_IMPLEMENTATION
#include "menu_animation.h"
#include "gfx_animation.h"
#include "../performance_counters.h"
typedef float (*easing_cb) (float, float, float, float);
@ -53,7 +53,7 @@ struct tween
DA_TYPEDEF(struct tween, tween_array_t)
struct menu_animation
struct gfx_animation
{
tween_array_t list;
tween_array_t pending;
@ -62,7 +62,7 @@ struct menu_animation
bool in_update;
};
typedef struct menu_animation menu_animation_t;
typedef struct gfx_animation gfx_animation_t;
#define TICKER_SPEED 333333
#define TICKER_SLOW_SPEED 1666666
@ -74,7 +74,7 @@ static const float ticker_pixel_period = (1.0f / 60.0f) * 1000.0f;
static const char ticker_spacer_default[] = TICKER_SPACER_DEFAULT;
static menu_animation_t anim = {{0}};
static gfx_animation_t anim = {{0}};
static retro_time_t cur_time = 0;
static retro_time_t old_time = 0;
static uint64_t ticker_idx = 0; /* updated every TICKER_SPEED us */
@ -85,11 +85,11 @@ static bool animation_is_active = false;
static bool ticker_is_active = false;
/* Forward declarations */
static void menu_animation_update_time_default(
static void gfx_animation_update_time_default(
float *dst,
unsigned video_width, unsigned video_height);
static update_time_cb update_time_callback = menu_animation_update_time_default;
static update_time_cb update_time_callback = gfx_animation_update_time_default;
/* from https://github.com/kikito/tween.lua/blob/master/tween.lua */
@ -319,7 +319,7 @@ static float easing_out_in_bounce(float t, float b, float c, float d)
return easing_in_bounce((t * 2) - d, b + c / 2, c / 2, d);
}
static void menu_animation_ticker_generic(uint64_t idx,
static void gfx_animation_ticker_generic(uint64_t idx,
size_t max_width, size_t *offset, size_t *width)
{
int ticker_period = (int)(2 * (*width - max_width) + 4);
@ -344,7 +344,7 @@ static void menu_animation_ticker_generic(uint64_t idx,
*width = max_width;
}
static void menu_animation_ticker_loop(uint64_t idx,
static void gfx_animation_ticker_loop(uint64_t idx,
size_t max_width, size_t str_width, size_t spacer_width,
size_t *offset1, size_t *width1,
size_t *offset2, size_t *width2,
@ -455,8 +455,8 @@ static void ticker_smooth_scan_string_fw(
}
}
/* 'Fixed width' font version of menu_animation_ticker_smooth_generic() */
static void menu_animation_ticker_smooth_generic_fw(uint64_t idx,
/* 'Fixed width' font version of gfx_animation_ticker_smooth_generic() */
static void gfx_animation_ticker_smooth_generic_fw(uint64_t idx,
unsigned str_width, size_t num_chars,
unsigned glyph_width, unsigned field_width,
unsigned *char_offset, unsigned *num_chars_to_copy, unsigned *x_offset)
@ -478,8 +478,8 @@ static void menu_animation_ticker_smooth_generic_fw(uint64_t idx,
char_offset, num_chars_to_copy, x_offset);
}
/* 'Fixed width' font version of menu_animation_ticker_smooth_loop() */
static void menu_animation_ticker_smooth_loop_fw(uint64_t idx,
/* 'Fixed width' font version of gfx_animation_ticker_smooth_loop() */
static void gfx_animation_ticker_smooth_loop_fw(uint64_t idx,
unsigned str_width, size_t num_chars,
unsigned spacer_width, size_t num_spacer_chars,
unsigned glyph_width, unsigned field_width,
@ -525,7 +525,7 @@ static void menu_animation_ticker_smooth_loop_fw(uint64_t idx,
/* Update remaining width
* Note: We can avoid all the display_width shenanigans
* here (c.f. menu_animation_ticker_smooth_loop()) because
* here (c.f. gfx_animation_ticker_smooth_loop()) because
* the font width is constant - i.e. we don't have to wrangle
* out the width of the last 'non-copied' character since it
* is known a priori, so we can just subtract the string width
@ -648,7 +648,7 @@ static void ticker_smooth_scan_characters(
}
}
static void menu_animation_ticker_smooth_generic(uint64_t idx,
static void gfx_animation_ticker_smooth_generic(uint64_t idx,
const unsigned *char_widths, size_t num_chars, unsigned str_width, unsigned field_width,
unsigned *char_offset, unsigned *num_chars_to_copy, unsigned *x_offset, unsigned *dst_str_width)
{
@ -671,7 +671,7 @@ static void menu_animation_ticker_smooth_generic(uint64_t idx,
char_offset, num_chars_to_copy, x_offset, dst_str_width, NULL);
}
static void menu_animation_ticker_smooth_loop(uint64_t idx,
static void gfx_animation_ticker_smooth_loop(uint64_t idx,
const unsigned *char_widths, size_t num_chars,
const unsigned *spacer_widths, size_t num_spacer_chars,
unsigned str_width, unsigned spacer_width, unsigned field_width,
@ -799,7 +799,7 @@ static size_t get_line_display_ticks(size_t line_len)
return (size_t)(line_duration / (float)TICKER_SPEED);
}
static void menu_animation_line_ticker_generic(uint64_t idx,
static void gfx_animation_line_ticker_generic(uint64_t idx,
size_t line_len, size_t max_lines, size_t num_lines,
size_t *line_offset)
{
@ -829,7 +829,7 @@ static void menu_animation_line_ticker_generic(uint64_t idx,
*line_offset = (excess_lines * 2) - phase;
}
static void menu_animation_line_ticker_loop(uint64_t idx,
static void gfx_animation_line_ticker_loop(uint64_t idx,
size_t line_len, size_t num_lines,
size_t *line_offset)
{
@ -894,7 +894,7 @@ static void set_line_smooth_fade_parameters_default(
*bottom_fade_alpha = 0.0f;
}
static void menu_animation_line_ticker_smooth_generic(uint64_t idx,
static void gfx_animation_line_ticker_smooth_generic(uint64_t idx,
bool fade_enabled, size_t line_len, size_t line_height,
size_t max_display_lines, size_t num_lines,
size_t *num_display_lines, size_t *line_offset, float *y_offset,
@ -980,7 +980,7 @@ static void menu_animation_line_ticker_smooth_generic(uint64_t idx,
bottom_fade_line_offset, bottom_fade_y_offset, bottom_fade_alpha);
}
static void menu_animation_line_ticker_smooth_loop(uint64_t idx,
static void gfx_animation_line_ticker_smooth_loop(uint64_t idx,
bool fade_enabled, size_t line_len, size_t line_height,
size_t max_display_lines, size_t num_lines,
size_t *num_display_lines, size_t *line_offset, float *y_offset,
@ -1027,17 +1027,17 @@ static void menu_delayed_animation_cb(void *userdata)
{
menu_delayed_animation_t *delayed_animation = (menu_delayed_animation_t*) userdata;
menu_animation_push(&delayed_animation->entry);
gfx_animation_push(&delayed_animation->entry);
free(delayed_animation);
}
void menu_animation_push_delayed(unsigned delay, menu_animation_ctx_entry_t *entry)
void gfx_animation_push_delayed(unsigned delay, gfx_animation_ctx_entry_t *entry)
{
menu_timer_ctx_entry_t timer_entry;
menu_delayed_animation_t *delayed_animation = (menu_delayed_animation_t*) malloc(sizeof(menu_delayed_animation_t));
memcpy(&delayed_animation->entry, entry, sizeof(menu_animation_ctx_entry_t));
memcpy(&delayed_animation->entry, entry, sizeof(gfx_animation_ctx_entry_t));
timer_entry.cb = menu_delayed_animation_cb;
timer_entry.duration = delay;
@ -1046,7 +1046,7 @@ void menu_animation_push_delayed(unsigned delay, menu_animation_ctx_entry_t *ent
menu_timer_start(&delayed_animation->timer, &timer_entry);
}
bool menu_animation_push(menu_animation_ctx_entry_t *entry)
bool gfx_animation_push(gfx_animation_ctx_entry_t *entry)
{
struct tween t;
@ -1193,7 +1193,7 @@ bool menu_animation_push(menu_animation_ctx_entry_t *entry)
return true;
}
static void menu_animation_update_time_default(
static void gfx_animation_update_time_default(
float *dst,
unsigned video_width, unsigned video_height)
{
@ -1201,17 +1201,17 @@ static void menu_animation_update_time_default(
*(dst) *= ((float)video_width / 1920.0f);
}
void menu_animation_set_update_time_cb(update_time_cb cb)
void gfx_animation_set_update_time_cb(update_time_cb cb)
{
update_time_callback = cb;
}
void menu_animation_unset_update_time_cb(void)
void gfx_animation_unset_update_time_cb(void)
{
update_time_callback = menu_animation_update_time_default;
update_time_callback = gfx_animation_update_time_default;
}
static void menu_animation_update_time(
static void gfx_animation_update_time(
bool timedate_enable,
unsigned video_width, unsigned video_height,
float menu_ticker_speed)
@ -1303,7 +1303,7 @@ static void menu_animation_update_time(
}
}
bool menu_animation_update(
bool gfx_animation_update(
bool menu_timedate_enable,
float menu_ticker_speed,
unsigned video_width,
@ -1311,7 +1311,7 @@ bool menu_animation_update(
{
unsigned i;
menu_animation_update_time(
gfx_animation_update_time(
menu_timedate_enable,
video_width, video_height,
menu_ticker_speed);
@ -1413,7 +1413,7 @@ static void build_ticker_loop_string(
}
}
bool menu_animation_ticker(menu_animation_ctx_ticker_t *ticker)
bool gfx_animation_ticker(gfx_animation_ctx_ticker_t *ticker)
{
size_t str_len = utf8len(ticker->str);
@ -1447,7 +1447,7 @@ bool menu_animation_ticker(menu_animation_ctx_ticker_t *ticker)
size_t offset1, offset2, offset3;
size_t width1, width2, width3;
menu_animation_ticker_loop(
gfx_animation_ticker_loop(
ticker->idx,
ticker->len,
str_len, utf8len(ticker->spacer),
@ -1469,7 +1469,7 @@ bool menu_animation_ticker(menu_animation_ctx_ticker_t *ticker)
{
size_t offset = 0;
menu_animation_ticker_generic(
gfx_animation_ticker_generic(
ticker->idx,
ticker->len,
&offset,
@ -1490,8 +1490,8 @@ bool menu_animation_ticker(menu_animation_ctx_ticker_t *ticker)
return true;
}
/* 'Fixed width' font version of menu_animation_ticker_smooth() */
bool menu_animation_ticker_smooth_fw(menu_animation_ctx_ticker_smooth_t *ticker)
/* 'Fixed width' font version of gfx_animation_ticker_smooth() */
bool gfx_animation_ticker_smooth_fw(gfx_animation_ctx_ticker_smooth_t *ticker)
{
size_t spacer_len = 0;
unsigned glyph_width = ticker->glyph_width;
@ -1501,7 +1501,7 @@ bool menu_animation_ticker_smooth_fw(menu_animation_ctx_ticker_smooth_t *ticker)
bool is_active = false;
/* Sanity check has already been performed by
* menu_animation_ticker_smooth() - no need to
* gfx_animation_ticker_smooth() - no need to
* repeat */
/* Get length + width of src string */
@ -1576,7 +1576,7 @@ bool menu_animation_ticker_smooth_fw(menu_animation_ctx_ticker_smooth_t *ticker)
unsigned char_offset3 = 0;
unsigned num_chars3 = 0;
menu_animation_ticker_smooth_loop_fw(
gfx_animation_ticker_smooth_loop_fw(
ticker->idx,
src_str_width, src_str_len, spacer_width, spacer_len,
glyph_width, ticker->field_width,
@ -1605,7 +1605,7 @@ bool menu_animation_ticker_smooth_fw(menu_animation_ctx_ticker_smooth_t *ticker)
ticker->dst_str[0] = '\0';
menu_animation_ticker_smooth_generic_fw(
gfx_animation_ticker_smooth_generic_fw(
ticker->idx,
src_str_width, src_str_len, glyph_width, ticker->field_width,
&char_offset, &num_chars, ticker->x_offset);
@ -1640,7 +1640,7 @@ end:
return is_active;
}
bool menu_animation_ticker_smooth(menu_animation_ctx_ticker_smooth_t *ticker)
bool gfx_animation_ticker_smooth(gfx_animation_ctx_ticker_smooth_t *ticker)
{
size_t i;
size_t src_str_len = 0;
@ -1663,7 +1663,7 @@ bool menu_animation_ticker_smooth(menu_animation_ctx_ticker_smooth_t *ticker)
/* If we are using a fixed width font (ticker->font == NULL),
* switch to optimised code path */
if (!ticker->font)
return menu_animation_ticker_smooth_fw(ticker);
return gfx_animation_ticker_smooth_fw(ticker);
/* Find the display width of each character in
* the src string + total width */
@ -1796,7 +1796,7 @@ bool menu_animation_ticker_smooth(menu_animation_ctx_ticker_smooth_t *ticker)
unsigned char_offset3 = 0;
unsigned num_chars3 = 0;
menu_animation_ticker_smooth_loop(
gfx_animation_ticker_smooth_loop(
ticker->idx,
src_char_widths, src_str_len,
spacer_char_widths, spacer_len,
@ -1823,7 +1823,7 @@ bool menu_animation_ticker_smooth(menu_animation_ctx_ticker_smooth_t *ticker)
ticker->dst_str[0] = '\0';
menu_animation_ticker_smooth_generic(
gfx_animation_ticker_smooth_generic(
ticker->idx,
src_char_widths, src_str_len,
src_str_width, ticker->field_width,
@ -1893,7 +1893,7 @@ static void build_line_ticker_string(
}
}
bool menu_animation_line_ticker(menu_animation_ctx_line_ticker_t *line_ticker)
bool gfx_animation_line_ticker(gfx_animation_ctx_line_ticker_t *line_ticker)
{
char *wrapped_str = NULL;
struct string_list *lines = NULL;
@ -1943,7 +1943,7 @@ bool menu_animation_line_ticker(menu_animation_ctx_line_ticker_t *line_ticker)
{
case TICKER_TYPE_LOOP:
{
menu_animation_line_ticker_loop(
gfx_animation_line_ticker_loop(
line_ticker->idx,
line_ticker->line_len,
lines->size,
@ -1954,7 +1954,7 @@ bool menu_animation_line_ticker(menu_animation_ctx_line_ticker_t *line_ticker)
case TICKER_TYPE_BOUNCE:
default:
{
menu_animation_line_ticker_generic(
gfx_animation_line_ticker_generic(
line_ticker->idx,
line_ticker->line_len,
line_ticker->max_lines,
@ -1995,7 +1995,7 @@ end:
return is_active;
}
bool menu_animation_line_ticker_smooth(menu_animation_ctx_line_ticker_smooth_t *line_ticker)
bool gfx_animation_line_ticker_smooth(gfx_animation_ctx_line_ticker_smooth_t *line_ticker)
{
char *wrapped_str = NULL;
struct string_list *lines = NULL;
@ -2101,7 +2101,7 @@ bool menu_animation_line_ticker_smooth(menu_animation_ctx_line_ticker_smooth_t *
switch (line_ticker->type_enum)
{
case TICKER_TYPE_LOOP:
menu_animation_line_ticker_smooth_loop(
gfx_animation_line_ticker_smooth_loop(
line_ticker->idx,
line_ticker->fade_enabled,
line_len, (size_t)glyph_height,
@ -2114,7 +2114,7 @@ bool menu_animation_line_ticker_smooth(menu_animation_ctx_line_ticker_smooth_t *
break;
case TICKER_TYPE_BOUNCE:
default:
menu_animation_line_ticker_smooth_generic(
gfx_animation_line_ticker_smooth_generic(
line_ticker->idx,
line_ticker->fade_enabled,
line_len, (size_t)glyph_height,
@ -2186,12 +2186,12 @@ end:
return is_active;
}
bool menu_animation_is_active(void)
bool gfx_animation_is_active(void)
{
return animation_is_active || ticker_is_active;
}
bool menu_animation_kill_by_tag(menu_animation_ctx_tag *tag)
bool gfx_animation_kill_by_tag(gfx_animation_ctx_tag *tag)
{
unsigned i;
@ -2219,7 +2219,7 @@ bool menu_animation_kill_by_tag(menu_animation_ctx_tag *tag)
return true;
}
void menu_animation_kill_by_subject(menu_animation_ctx_subject_t *subject)
void gfx_animation_kill_by_subject(gfx_animation_ctx_subject_t *subject)
{
unsigned i, j, killed = 0;
float **sub = (float**)subject->data;
@ -2252,12 +2252,12 @@ void menu_animation_kill_by_subject(menu_animation_ctx_subject_t *subject)
}
}
float menu_animation_get_delta_time(void)
float gfx_animation_get_delta_time(void)
{
return delta_time;
}
bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data)
bool gfx_animation_ctl(enum gfx_animation_ctl_state state, void *data)
{
switch (state)
{
@ -2278,7 +2278,7 @@ bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data)
da_free(anim.list);
da_free(anim.pending);
memset(&anim, 0, sizeof(menu_animation_t));
memset(&anim, 0, sizeof(gfx_animation_t));
}
cur_time = 0;
old_time = 0;
@ -2302,8 +2302,8 @@ bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data)
void menu_timer_start(menu_timer_t *timer, menu_timer_ctx_entry_t *timer_entry)
{
menu_animation_ctx_entry_t entry;
menu_animation_ctx_tag tag = (uintptr_t) timer;
gfx_animation_ctx_entry_t entry;
gfx_animation_ctx_tag tag = (uintptr_t) timer;
menu_timer_kill(timer);
@ -2317,26 +2317,26 @@ void menu_timer_start(menu_timer_t *timer, menu_timer_ctx_entry_t *timer_entry)
entry.cb = timer_entry->cb;
entry.userdata = timer_entry->userdata;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
void menu_timer_kill(menu_timer_t *timer)
{
menu_animation_ctx_tag tag = (uintptr_t) timer;
menu_animation_kill_by_tag(&tag);
gfx_animation_ctx_tag tag = (uintptr_t) timer;
gfx_animation_kill_by_tag(&tag);
}
uint64_t menu_animation_get_ticker_idx(void)
uint64_t gfx_animation_get_ticker_idx(void)
{
return ticker_idx;
}
uint64_t menu_animation_get_ticker_slow_idx(void)
uint64_t gfx_animation_get_ticker_slow_idx(void)
{
return ticker_slow_idx;
}
uint64_t menu_animation_get_ticker_pixel_idx(void)
uint64_t gfx_animation_get_ticker_pixel_idx(void)
{
return ticker_pixel_idx;
}

View File

@ -14,8 +14,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MENU_ANIMATION_H
#define _MENU_ANIMATION_H
#ifndef _GFX_ANIMATION_H
#define _GFX_ANIMATION_H
#include <stdint.h>
#include <stdlib.h>
@ -34,7 +34,7 @@ typedef void (*tween_cb) (void*);
typedef void (*update_time_cb) (float *dst,
unsigned width, unsigned height);
enum menu_animation_ctl_state
enum gfx_animation_ctl_state
{
MENU_ANIMATION_CTL_NONE = 0,
MENU_ANIMATION_CTL_DEINIT,
@ -42,7 +42,7 @@ enum menu_animation_ctl_state
MENU_ANIMATION_CTL_SET_ACTIVE
};
enum menu_animation_easing_type
enum gfx_animation_easing_type
{
/* Linear */
EASING_LINEAR = 0,
@ -93,51 +93,51 @@ enum menu_animation_easing_type
/* TODO:
* Add a reverse loop ticker for languages
* that read right to left */
enum menu_animation_ticker_type
enum gfx_animation_ticker_type
{
TICKER_TYPE_BOUNCE = 0,
TICKER_TYPE_LOOP,
TICKER_TYPE_LAST
};
typedef uintptr_t menu_animation_ctx_tag;
typedef uintptr_t gfx_animation_ctx_tag;
typedef struct menu_animation_ctx_subject
typedef struct gfx_animation_ctx_subject
{
size_t count;
const void *data;
} menu_animation_ctx_subject_t;
} gfx_animation_ctx_subject_t;
typedef struct menu_animation_ctx_entry
typedef struct gfx_animation_ctx_entry
{
enum menu_animation_easing_type easing_enum;
enum gfx_animation_easing_type easing_enum;
uintptr_t tag;
float duration;
float target_value;
float *subject;
tween_cb cb;
void *userdata;
} menu_animation_ctx_entry_t;
} gfx_animation_ctx_entry_t;
typedef struct menu_animation_ctx_ticker
typedef struct gfx_animation_ctx_ticker
{
bool selected;
size_t len;
uint64_t idx;
enum menu_animation_ticker_type type_enum;
enum gfx_animation_ticker_type type_enum;
char *s;
const char *str;
const char *spacer;
} menu_animation_ctx_ticker_t;
} gfx_animation_ctx_ticker_t;
typedef struct menu_animation_ctx_ticker_smooth
typedef struct gfx_animation_ctx_ticker_smooth
{
bool selected;
font_data_t *font;
float font_scale;
unsigned glyph_width; /* Fallback if font == NULL */
unsigned field_width;
enum menu_animation_ticker_type type_enum;
enum gfx_animation_ticker_type type_enum;
uint64_t idx;
const char *src_str;
const char *spacer;
@ -145,27 +145,27 @@ typedef struct menu_animation_ctx_ticker_smooth
size_t dst_str_len;
unsigned *dst_str_width; /* May be set to NULL (RGUI + XMB do not require this info) */
unsigned *x_offset;
} menu_animation_ctx_ticker_smooth_t;
} gfx_animation_ctx_ticker_smooth_t;
typedef struct menu_animation_ctx_line_ticker
typedef struct gfx_animation_ctx_line_ticker
{
size_t line_len;
size_t max_lines;
uint64_t idx;
enum menu_animation_ticker_type type_enum;
enum gfx_animation_ticker_type type_enum;
char *s;
size_t len;
const char *str;
} menu_animation_ctx_line_ticker_t;
} gfx_animation_ctx_line_ticker_t;
typedef struct menu_animation_ctx_line_ticker_smooth
typedef struct gfx_animation_ctx_line_ticker_smooth
{
bool fade_enabled;
font_data_t *font;
float font_scale;
unsigned field_width;
unsigned field_height;
enum menu_animation_ticker_type type_enum;
enum gfx_animation_ticker_type type_enum;
uint64_t idx;
const char *src_str;
char *dst_str;
@ -179,7 +179,7 @@ typedef struct menu_animation_ctx_line_ticker_smooth
size_t bottom_fade_str_len;
float *bottom_fade_y_offset;
float *bottom_fade_alpha;
} menu_animation_ctx_line_ticker_smooth_t;
} gfx_animation_ctx_line_ticker_smooth_t;
typedef float menu_timer_t;
@ -193,50 +193,50 @@ typedef struct menu_timer_ctx_entry
typedef struct menu_delayed_animation
{
menu_timer_t timer;
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
} menu_delayed_animation_t;
void menu_timer_start(menu_timer_t *timer, menu_timer_ctx_entry_t *timer_entry);
void menu_timer_kill(menu_timer_t *timer);
bool menu_animation_update(
bool gfx_animation_update(
bool menu_timedate_enable,
float menu_ticker_speed,
unsigned video_width,
unsigned video_height);
bool menu_animation_ticker(menu_animation_ctx_ticker_t *ticker);
bool gfx_animation_ticker(gfx_animation_ctx_ticker_t *ticker);
bool menu_animation_ticker_smooth(menu_animation_ctx_ticker_smooth_t *ticker);
bool gfx_animation_ticker_smooth(gfx_animation_ctx_ticker_smooth_t *ticker);
bool menu_animation_line_ticker(menu_animation_ctx_line_ticker_t *line_ticker);
bool gfx_animation_line_ticker(gfx_animation_ctx_line_ticker_t *line_ticker);
bool menu_animation_line_ticker_smooth(menu_animation_ctx_line_ticker_smooth_t *line_ticker);
bool gfx_animation_line_ticker_smooth(gfx_animation_ctx_line_ticker_smooth_t *line_ticker);
float menu_animation_get_delta_time(void);
float gfx_animation_get_delta_time(void);
bool menu_animation_is_active(void);
bool gfx_animation_is_active(void);
bool menu_animation_kill_by_tag(menu_animation_ctx_tag *tag);
bool gfx_animation_kill_by_tag(gfx_animation_ctx_tag *tag);
void menu_animation_kill_by_subject(menu_animation_ctx_subject_t *subject);
void gfx_animation_kill_by_subject(gfx_animation_ctx_subject_t *subject);
bool menu_animation_push(menu_animation_ctx_entry_t *entry);
bool gfx_animation_push(gfx_animation_ctx_entry_t *entry);
void menu_animation_push_delayed(unsigned delay, menu_animation_ctx_entry_t *entry);
void gfx_animation_push_delayed(unsigned delay, gfx_animation_ctx_entry_t *entry);
bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data);
bool gfx_animation_ctl(enum gfx_animation_ctl_state state, void *data);
uint64_t menu_animation_get_ticker_idx(void);
uint64_t gfx_animation_get_ticker_idx(void);
uint64_t menu_animation_get_ticker_slow_idx(void);
uint64_t gfx_animation_get_ticker_slow_idx(void);
uint64_t menu_animation_get_ticker_pixel_idx(void);
uint64_t gfx_animation_get_ticker_pixel_idx(void);
void menu_animation_set_update_time_cb(update_time_cb cb);
void gfx_animation_set_update_time_cb(update_time_cb cb);
void menu_animation_unset_update_time_cb(void);
void gfx_animation_unset_update_time_cb(void);
RETRO_END_DECLS

View File

@ -15,8 +15,7 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "gfx_display.h"
#include "menu_animation.h"
#include "gfx_animation.h"
#include "../configuration.h"
#include "../frontend/frontend.h"
@ -1142,7 +1141,7 @@ void menu_display_set_msg_force(bool state)
* */
bool menu_display_get_update_pending(void)
{
if (menu_animation_is_active() || menu_display_framebuf_dirty)
if (gfx_animation_is_active() || menu_display_framebuf_dirty)
return true;
return false;
}
@ -1375,7 +1374,7 @@ void menu_display_allocate_white_texture(void)
void gfx_display_free(void)
{
video_coord_array_free(&menu_disp_ca);
menu_animation_ctl(MENU_ANIMATION_CTL_DEINIT, NULL);
gfx_animation_ctl(MENU_ANIMATION_CTL_DEINIT, NULL);
menu_display_msg_force = false;
menu_display_header_height = 0;

View File

@ -67,7 +67,7 @@
#include "menu_setting.h"
#include "menu_cbs.h"
#include "menu_driver.h"
#include "menu_animation.h"
#include "gfx_animation.h"
#include "menu_input.h"
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
#include "menu_shader.h"
@ -6210,7 +6210,7 @@ setting_get_string_representation_st_float_video_refresh_rate_auto(
{
snprintf(s, len, "%.3f Hz (%.1f%% dev, %u samples)",
video_refresh_rate, 100.0 * deviation, sample_points);
menu_animation_ctl(MENU_ANIMATION_CTL_SET_ACTIVE, NULL);
gfx_animation_ctl(MENU_ANIMATION_CTL_SET_ACTIVE, NULL);
}
else
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), len);

View File

@ -29,7 +29,7 @@
#include <file/file_path.h>
#include <string/stdstring.h>
#include "menu_animation.h"
#include "gfx_animation.h"
#include "menu_driver.h"
#include "menu_thumbnail.h"
@ -108,9 +108,9 @@ float menu_thumbnail_get_fade_duration(void)
static void menu_thumbnail_handle_upload(
retro_task_t *task, void *task_data, void *user_data, const char *err)
{
gfx_animation_ctx_entry_t animation_entry;
struct texture_image *img = (struct texture_image*)task_data;
menu_thumbnail_tag_t *thumbnail_tag = (menu_thumbnail_tag_t*)user_data;
menu_animation_ctx_entry_t animation_entry;
/* Sanity check */
if (!thumbnail_tag)
@ -168,7 +168,7 @@ static void menu_thumbnail_handle_upload(
animation_entry.cb = NULL;
animation_entry.userdata = NULL;
menu_animation_push(&animation_entry);
gfx_animation_push(&animation_entry);
}
else
thumbnail_tag->thumbnail->alpha = 1.0f;
@ -359,13 +359,13 @@ void menu_thumbnail_reset(menu_thumbnail_t *thumbnail)
if (thumbnail->texture)
{
menu_animation_ctx_tag tag = (uintptr_t)&thumbnail->alpha;
gfx_animation_ctx_tag tag = (uintptr_t)&thumbnail->alpha;
/* Unload texture */
video_driver_texture_unload(&thumbnail->texture);
/* Ensure any 'fade in' animation is killed */
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
}
/* Reset all parameters */
@ -409,7 +409,7 @@ void menu_thumbnail_process_stream(
if (thumbnail->status == MENU_THUMBNAIL_STATUS_UNKNOWN)
{
/* Check if stream delay timer has elapsed */
thumbnail->delay_timer += menu_animation_get_delta_time();
thumbnail->delay_timer += gfx_animation_get_delta_time();
if (thumbnail->delay_timer > menu_thumbnail_stream_delay)
{
@ -485,7 +485,7 @@ void menu_thumbnail_process_streams(
if (process_right || process_left)
{
/* Check if stream delay timer has elapsed */
float delta_time = menu_animation_get_delta_time();
float delta_time = gfx_animation_get_delta_time();
bool request_right = false;
bool request_left = false;

View File

@ -39,7 +39,7 @@
#include "../../ui/ui_companion_driver.h"
#include "../menu_driver.h"
#include "../menu_animation.h"
#include "../gfx_animation.h"
#include "../../gfx/font_driver.h"
@ -187,7 +187,7 @@ static menu_texture_item msg_queue_icon_outline = 0;
static menu_texture_item msg_queue_icon_rect = 0;
static bool msg_queue_has_icons = false;
extern menu_animation_ctx_tag menu_widgets_generic_tag;
extern gfx_animation_ctx_tag menu_widgets_generic_tag;
/* there can only be one message animation at a time to avoid confusing users */
static bool widgets_moving = false;
@ -243,7 +243,7 @@ static menu_timer_t volume_timer = 0.0f;
static float volume_alpha = 0.0f;
static float volume_text_alpha = 0.0f;
static menu_animation_ctx_tag volume_tag = (uintptr_t) &volume_alpha;
static gfx_animation_ctx_tag volume_tag = (uintptr_t) &volume_alpha;
static bool volume_mute = false;
@ -487,7 +487,7 @@ void menu_widgets_msg_queue_push(
if (!task->alternative_look)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
entry.easing_enum = EASING_OUT_QUAD;
entry.tag = (uintptr_t) msg_widget;
@ -497,7 +497,7 @@ void menu_widgets_msg_queue_push(
entry.cb = msg_widget_msg_transition_animation_done;
entry.userdata = msg_widget;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
else
{
@ -531,7 +531,7 @@ static void menu_widgets_move_end(void *userdata)
{
menu_widget_msg_t *unfold = (menu_widget_msg_t*) userdata;
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
entry.cb = menu_widgets_unfold_end;
entry.duration = MSG_QUEUE_ANIMATION_DURATION;
@ -541,7 +541,7 @@ static void menu_widgets_move_end(void *userdata)
entry.target_value = 1.0f;
entry.userdata = unfold;
menu_animation_push(&entry);
gfx_animation_push(&entry);
unfold->unfolded = true;
unfold->unfolding = true;
@ -583,7 +583,7 @@ static void menu_widgets_msg_queue_move(void)
if (msg->offset_y != y)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
entry.cb = i == 0 ? menu_widgets_move_end : NULL;
entry.duration = MSG_QUEUE_ANIMATION_DURATION;
@ -593,7 +593,7 @@ static void menu_widgets_msg_queue_move(void)
entry.target_value = y;
entry.userdata = unfold;
menu_animation_push(&entry);
gfx_animation_push(&entry);
widgets_moving = true;
}
@ -603,7 +603,7 @@ static void menu_widgets_msg_queue_move(void)
static void menu_widgets_msg_queue_free(menu_widget_msg_t *msg, bool touch_list)
{
size_t i;
menu_animation_ctx_tag tag = (uintptr_t) msg;
gfx_animation_ctx_tag tag = (uintptr_t) msg;
if (msg->task_ptr)
{
@ -619,7 +619,7 @@ static void menu_widgets_msg_queue_free(menu_widget_msg_t *msg, bool touch_list)
/* Kill all animations */
menu_timer_kill(&msg->hourglass_timer);
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
/* Kill all timers */
if (msg->expiration_timer_started)
@ -659,7 +659,7 @@ static void menu_widgets_msg_queue_kill_end(void *userdata)
static void menu_widgets_msg_queue_kill(unsigned idx)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
menu_widget_msg_t *msg = (menu_widget_msg_t*)
file_list_get_userdata_at_offset(current_msgs, idx);
@ -681,14 +681,14 @@ static void menu_widgets_msg_queue_kill(unsigned idx)
entry.subject = &msg->offset_y;
entry.target_value = msg->offset_y - msg_queue_height/4;
menu_animation_push(&entry);
gfx_animation_push(&entry);
/* Fade out */
entry.cb = menu_widgets_msg_queue_kill_end;
entry.subject = &msg->alpha;
entry.target_value = 0.0f;
menu_animation_push(&entry);
gfx_animation_push(&entry);
/* Move all messages back to their correct position */
menu_widgets_msg_queue_move();
@ -808,7 +808,7 @@ static void menu_widgets_screenshot_dispose(void *userdata)
static void menu_widgets_screenshot_end(void *userdata)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
entry.cb = menu_widgets_screenshot_dispose;
entry.duration = MSG_QUEUE_ANIMATION_DURATION;
@ -818,7 +818,7 @@ static void menu_widgets_screenshot_end(void *userdata)
entry.target_value = -((float)screenshot_height);
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
static void menu_widgets_start_msg_expiration_timer(menu_widget_msg_t *msg_widget, unsigned duration)
@ -854,10 +854,9 @@ static void menu_widgets_hourglass_end(void *userdata)
static void menu_widgets_hourglass_tick(void *userdata)
{
menu_widget_msg_t *msg = (menu_widget_msg_t*) userdata;
menu_animation_ctx_tag tag = (uintptr_t) msg;
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
menu_widget_msg_t *msg = (menu_widget_msg_t*) userdata;
gfx_animation_ctx_tag tag = (uintptr_t) msg;
entry.easing_enum = EASING_OUT_QUAD;
entry.tag = tag;
@ -867,7 +866,7 @@ static void menu_widgets_hourglass_tick(void *userdata)
entry.cb = menu_widgets_hourglass_end;
entry.userdata = msg;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
/* Forward declaration */
@ -1492,7 +1491,7 @@ void menu_widgets_frame(void *data)
if (screenshot_loaded)
{
char shotname[256];
menu_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_t ticker;
menu_display_set_alpha(menu_widgets_backdrop_orig, DEFAULT_BACKDROP);
@ -1521,13 +1520,13 @@ void menu_widgets_frame(void *data)
1, false, 0, true
);
ticker.idx = menu_animation_get_ticker_idx();
ticker.idx = gfx_animation_get_ticker_idx();
ticker.len = screenshot_shotname_length;
ticker.s = shotname;
ticker.selected = true;
ticker.str = screenshot_shotname;
menu_animation_ticker(&ticker);
gfx_animation_ticker(&ticker);
menu_display_draw_text(font_regular,
shotname,
@ -2125,11 +2124,11 @@ static void menu_widgets_achievement_free(void *userdata)
void menu_widgets_free(void)
{
size_t i;
menu_animation_ctx_tag libretro_tag;
gfx_animation_ctx_tag libretro_tag;
/* Kill any pending animation */
menu_animation_kill_by_tag(&volume_tag);
menu_animation_kill_by_tag(&menu_widgets_generic_tag);
gfx_animation_kill_by_tag(&volume_tag);
gfx_animation_kill_by_tag(&menu_widgets_generic_tag);
/* Purge everything from the fifo */
if (msg_queue)
@ -2181,7 +2180,7 @@ void menu_widgets_free(void)
libretro_tag = (uintptr_t) &libretro_message_timer;
libretro_message_alpha = 0.0f;
menu_timer_kill(&libretro_message_timer);
menu_animation_kill_by_tag(&libretro_tag);
gfx_animation_kill_by_tag(&libretro_tag);
/* AI Service overlay */
/* ... */
@ -2196,7 +2195,7 @@ void menu_widgets_free(void)
static void menu_widgets_volume_timer_end(void *userdata)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
entry.cb = NULL;
entry.duration = MSG_QUEUE_ANIMATION_DURATION;
@ -2206,11 +2205,11 @@ static void menu_widgets_volume_timer_end(void *userdata)
entry.target_value = 0.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
entry.subject = &volume_text_alpha;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
void menu_widgets_volume_update_and_show(float new_volume)
@ -2218,7 +2217,7 @@ void menu_widgets_volume_update_and_show(float new_volume)
menu_timer_ctx_entry_t entry;
bool mute = *(audio_get_bool_ptr(AUDIO_ACTION_MUTE_ENABLE));
menu_animation_kill_by_tag(&volume_tag);
gfx_animation_kill_by_tag(&volume_tag);
volume_db = new_volume;
volume_percent = pow(10, new_volume/20);
@ -2283,7 +2282,7 @@ void menu_widgets_ai_service_overlay_unload()
static void menu_widgets_screenshot_fadeout(void *userdata)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
entry.cb = NULL;
entry.duration = SCREENSHOT_DURATION_OUT;
@ -2293,12 +2292,12 @@ static void menu_widgets_screenshot_fadeout(void *userdata)
entry.target_value = 0.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
static void menu_widgets_play_screenshot_flash(void)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
entry.cb = menu_widgets_screenshot_fadeout;
entry.duration = SCREENSHOT_DURATION_IN;
@ -2308,7 +2307,7 @@ static void menu_widgets_play_screenshot_flash(void)
entry.target_value = 1.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
void menu_widgets_screenshot_taken(const char *shotname, const char *filename)
@ -2334,7 +2333,7 @@ void menu_widgets_cleanup_load_content_animation(void)
void menu_widgets_start_load_content_animation(const char *content_name, bool remove_extension)
{
/* TODO: finish the animation based on design, correct all timings */
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
menu_timer_ctx_entry_t timer_entry;
int i;
@ -2377,13 +2376,13 @@ void menu_widgets_start_load_content_animation(const char *content_name, bool re
entry.subject = &load_content_animation_icon_size;
entry.target_value = load_content_animation_icon_size_target;
menu_animation_push(&entry);
gfx_animation_push(&entry);
/* Alpha */
entry.subject = &load_content_animation_icon_alpha;
entry.target_value = 1.0f;
menu_animation_push(&entry);
gfx_animation_push(&entry);
timing += entry.duration;
/* Stage two: backdrop + text */
@ -2391,7 +2390,7 @@ void menu_widgets_start_load_content_animation(const char *content_name, bool re
entry.subject = &load_content_animation_fade_alpha;
entry.target_value = 1.0f;
menu_animation_push_delayed(timing, &entry);
gfx_animation_push_delayed(timing, &entry);
timing += entry.duration;
/* Stage three: wait then color transition */
@ -2407,7 +2406,7 @@ void menu_widgets_start_load_content_animation(const char *content_name, bool re
entry.subject = &load_content_animation_icon_color[i];
entry.target_value = menu_widgets_pure_white[i];
menu_animation_push_delayed(timing, &entry);
gfx_animation_push_delayed(timing, &entry);
}
timing += entry.duration;
@ -2419,7 +2418,7 @@ void menu_widgets_start_load_content_animation(const char *content_name, bool re
entry.subject = &load_content_animation_final_fade_alpha;
entry.target_value = 1.0f;
menu_animation_push_delayed(timing, &entry);
gfx_animation_push_delayed(timing, &entry);
timing += entry.duration;
/* Setup end */
@ -2435,7 +2434,7 @@ void menu_widgets_start_load_content_animation(const char *content_name, bool re
static void menu_widgets_achievement_dismiss(void *userdata)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
/* Slide up animation */
entry.cb = menu_widgets_achievement_free;
@ -2446,12 +2445,12 @@ static void menu_widgets_achievement_dismiss(void *userdata)
entry.target_value = (float)(-(int)(cheevo_height));
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
static void menu_widgets_achievement_fold(void *userdata)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
/* Fold */
entry.cb = menu_widgets_achievement_dismiss;
@ -2462,12 +2461,12 @@ static void menu_widgets_achievement_fold(void *userdata)
entry.target_value = 0.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
static void menu_widgets_achievement_unfold(void *userdata)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
menu_timer_ctx_entry_t timer;
/* Unfold */
@ -2479,7 +2478,7 @@ static void menu_widgets_achievement_unfold(void *userdata)
entry.target_value = 1.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
/* Wait before dismissing */
timer.cb = menu_widgets_achievement_fold;
@ -2491,7 +2490,7 @@ static void menu_widgets_achievement_unfold(void *userdata)
static void menu_widgets_start_achievement_notification(void)
{
menu_animation_ctx_entry_t entry;
gfx_animation_ctx_entry_t entry;
cheevo_height = widget_font_size * 4;
cheevo_width = MAX(
font_driver_get_message_width(font_regular, msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED), 0, 1),
@ -2510,7 +2509,7 @@ static void menu_widgets_start_achievement_notification(void)
entry.target_value = 0.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
static void menu_widgets_get_badge_texture(menu_texture_item *tex, const char *badge)
@ -2548,8 +2547,8 @@ void menu_widgets_push_achievement(const char *title, const char *badge)
static void menu_widgets_generic_message_fadeout(void *userdata)
{
menu_animation_ctx_entry_t entry;
menu_animation_ctx_tag tag = (uintptr_t) &generic_message_timer;
gfx_animation_ctx_entry_t entry;
gfx_animation_ctx_tag tag = (uintptr_t) &generic_message_timer;
/* Start fade out animation */
entry.cb = NULL;
@ -2560,13 +2559,13 @@ static void menu_widgets_generic_message_fadeout(void *userdata)
entry.target_value = 0.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
void menu_widgets_set_message(char *msg)
{
menu_timer_ctx_entry_t timer;
menu_animation_ctx_tag tag = (uintptr_t) &generic_message_timer;
gfx_animation_ctx_tag tag = (uintptr_t) &generic_message_timer;
strlcpy(generic_message, msg, GENERIC_MESSAGE_SIZE);
@ -2574,7 +2573,7 @@ void menu_widgets_set_message(char *msg)
/* Kill and restart the timer / animation */
menu_timer_kill(&generic_message_timer);
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
timer.cb = menu_widgets_generic_message_fadeout;
timer.duration = GENERIC_MESSAGE_DURATION;
@ -2585,8 +2584,8 @@ void menu_widgets_set_message(char *msg)
static void menu_widgets_libretro_message_fadeout(void *userdata)
{
menu_animation_ctx_entry_t entry;
menu_animation_ctx_tag tag = (uintptr_t) &libretro_message_timer;
gfx_animation_ctx_entry_t entry;
gfx_animation_ctx_tag tag = (uintptr_t) &libretro_message_timer;
/* Start fade out animation */
entry.cb = NULL;
@ -2597,13 +2596,13 @@ static void menu_widgets_libretro_message_fadeout(void *userdata)
entry.target_value = 0.0f;
entry.userdata = NULL;
menu_animation_push(&entry);
gfx_animation_push(&entry);
}
void menu_widgets_set_libretro_message(const char *msg, unsigned duration)
{
menu_timer_ctx_entry_t timer;
menu_animation_ctx_tag tag = (uintptr_t) &libretro_message_timer;
gfx_animation_ctx_tag tag = (uintptr_t) &libretro_message_timer;
strlcpy(libretro_message, msg, LIBRETRO_MESSAGE_SIZE);
@ -2611,7 +2610,7 @@ void menu_widgets_set_libretro_message(const char *msg, unsigned duration)
/* Kill and restart the timer / animation */
menu_timer_kill(&libretro_message_timer);
menu_animation_kill_by_tag(&tag);
gfx_animation_kill_by_tag(&tag);
timer.cb = menu_widgets_libretro_message_fadeout;
timer.duration = duration;

View File

@ -191,7 +191,7 @@
05A8C52B20DB72F000FF7857 /* menu_cbs_label.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = menu_cbs_label.c; sourceTree = "<group>"; };
05A8C52C20DB72F000FF7857 /* menu_cbs_title.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = menu_cbs_title.c; sourceTree = "<group>"; };
05A8C52D20DB72F000FF7857 /* menu_cbs_up.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = menu_cbs_up.c; sourceTree = "<group>"; };
05A8C52E20DB72F000FF7857 /* menu_animation.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = menu_animation.c; sourceTree = "<group>"; };
05A8C52E20DB72F000FF7857 /* gfx_animation.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = gfx_animation.c; sourceTree = "<group>"; };
05A8C52F20DB72F000FF7857 /* menu_displaylist.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = menu_displaylist.h; sourceTree = "<group>"; };
05A8C53020DB72F000FF7857 /* menu_content.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = menu_content.h; sourceTree = "<group>"; };
05A8C53220DB72F000FF7857 /* xmb.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = xmb.c; sourceTree = "<group>"; };
@ -210,7 +210,7 @@
05A8C54820DB72F000FF7857 /* menu_content.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = menu_content.c; sourceTree = "<group>"; };
05A8C54920DB72F000FF7857 /* menu_displaylist.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = menu_displaylist.c; sourceTree = "<group>"; };
05A8C54A20DB72F000FF7857 /* menu_shader.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = menu_shader.c; sourceTree = "<group>"; };
05A8C54B20DB72F000FF7857 /* menu_animation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = menu_animation.h; sourceTree = "<group>"; };
05A8C54B20DB72F000FF7857 /* gfx_animation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gfx_animation.h; sourceTree = "<group>"; };
05A8C54C20DB72F000FF7857 /* menu_cbs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = menu_cbs.h; sourceTree = "<group>"; };
05A8C54D20DB72F000FF7857 /* menu_driver.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = menu_driver.c; sourceTree = "<group>"; };
05A8C54F20DB72F000FF7857 /* menu_networking.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = menu_networking.c; sourceTree = "<group>"; };
@ -761,8 +761,8 @@
05A8C51C20DB72F000FF7857 /* cbs */,
05A8C53120DB72F000FF7857 /* drivers */,
05A8C56020DB72F000FF7857 /* drivers_display */,
05A8C52E20DB72F000FF7857 /* menu_animation.c */,
05A8C54B20DB72F000FF7857 /* menu_animation.h */,
05A8C52E20DB72F000FF7857 /* gfx_animation.c */,
05A8C54B20DB72F000FF7857 /* gfx_animation.h */,
05A8C54120DB72F000FF7857 /* menu_cbs.c */,
05A8C54C20DB72F000FF7857 /* menu_cbs.h */,
05A8C54820DB72F000FF7857 /* menu_content.c */,

View File

@ -133,7 +133,7 @@
#ifdef HAVE_MENU
#include "menu/menu_driver.h"
#include "menu/menu_animation.h"
#include "menu/gfx_animation.h"
#include "menu/menu_input.h"
#include "menu/widgets/menu_dialog.h"
#include "menu/widgets/menu_input_bind_dialog.h"
@ -2637,7 +2637,7 @@ extern void libnx_apply_overclock(void);
#ifdef HAVE_MENU_WIDGETS
static bool menu_widgets_inited = false;
menu_animation_ctx_tag menu_widgets_generic_tag = (uintptr_t) &menu_widgets_inited;
gfx_animation_ctx_tag menu_widgets_generic_tag = (uintptr_t) &menu_widgets_inited;
/* Status icons */
static bool menu_widgets_paused = false;
@ -14832,7 +14832,7 @@ static unsigned menu_event(
menu_driver_ctl(MENU_NAVIGATION_CTL_SET_SCROLL_ACCEL,
&new_scroll_accel);
delay_count += menu_animation_get_delta_time();
delay_count += gfx_animation_get_delta_time();
if (display_kb)
{
@ -27279,7 +27279,7 @@ static enum runloop_state runloop_check_state(void)
}
#if defined(HAVE_MENU)
menu_animation_update(
gfx_animation_update(
settings->bools.menu_timedate_enable,
settings->floats.menu_ticker_speed,
video_driver_width, video_driver_height);