Merge pull request #8287 from natinusala/master
More menu widgets changes
This commit is contained in:
commit
9b84a0f701
|
@ -167,8 +167,6 @@ typedef struct materialui_handle
|
||||||
float textures_arrow_alpha;
|
float textures_arrow_alpha;
|
||||||
float categories_x_pos;
|
float categories_x_pos;
|
||||||
|
|
||||||
uint64_t frame_count;
|
|
||||||
|
|
||||||
char *box_message;
|
char *box_message;
|
||||||
|
|
||||||
char menu_title[255];
|
char menu_title[255];
|
||||||
|
@ -936,7 +934,6 @@ static void materialui_render_menu_list(
|
||||||
float sum = 0;
|
float sum = 0;
|
||||||
size_t entries_end = 0;
|
size_t entries_end = 0;
|
||||||
file_list_t *list = NULL;
|
file_list_t *list = NULL;
|
||||||
uint64_t frame_count = mui->frame_count;
|
|
||||||
unsigned header_height =
|
unsigned header_height =
|
||||||
menu_display_get_header_height();
|
menu_display_get_header_height();
|
||||||
|
|
||||||
|
@ -987,7 +984,7 @@ static void materialui_render_menu_list(
|
||||||
y,
|
y,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
frame_count / 20,
|
menu_animation_get_ticker_idx(),
|
||||||
font_hover_color,
|
font_hover_color,
|
||||||
entry_selected,
|
entry_selected,
|
||||||
rich_label,
|
rich_label,
|
||||||
|
@ -1179,8 +1176,6 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
|
||||||
|
|
||||||
usable_width = width - (mui->margin * 2);
|
usable_width = width - (mui->margin * 2);
|
||||||
|
|
||||||
mui->frame_count++;
|
|
||||||
|
|
||||||
msg[0] = title_buf[0] = title_msg[0] = '\0';
|
msg[0] = title_buf[0] = title_msg[0] = '\0';
|
||||||
|
|
||||||
switch (video_info->materialui_color_theme)
|
switch (video_info->materialui_color_theme)
|
||||||
|
@ -1532,7 +1527,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
|
||||||
|
|
||||||
ticker.s = title_buf;
|
ticker.s = title_buf;
|
||||||
ticker.len = ticker_limit;
|
ticker.len = ticker_limit;
|
||||||
ticker.idx = mui->frame_count / 100;
|
ticker.idx = menu_animation_get_ticker_slow_idx();
|
||||||
ticker.str = mui->menu_title;
|
ticker.str = mui->menu_title;
|
||||||
ticker.selected = true;
|
ticker.selected = true;
|
||||||
|
|
||||||
|
@ -1554,7 +1549,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
|
||||||
|
|
||||||
ticker.s = title_buf_msg_tmp;
|
ticker.s = title_buf_msg_tmp;
|
||||||
ticker.len = ticker_limit;
|
ticker.len = ticker_limit;
|
||||||
ticker.idx = mui->frame_count / 20;
|
ticker.idx = menu_animation_get_ticker_idx();
|
||||||
ticker.str = title_buf_msg;
|
ticker.str = title_buf_msg;
|
||||||
ticker.selected = true;
|
ticker.selected = true;
|
||||||
|
|
||||||
|
@ -1810,7 +1805,7 @@ static void materialui_navigation_set(void *data, bool scroll)
|
||||||
if (!mui || !scroll)
|
if (!mui || !scroll)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
entry.duration = 10;
|
entry.duration = 166;
|
||||||
entry.target_value = scroll_pos;
|
entry.target_value = scroll_pos;
|
||||||
entry.subject = &mui->scroll_y;
|
entry.subject = &mui->scroll_y;
|
||||||
entry.easing_enum = EASING_IN_OUT_QUAD;
|
entry.easing_enum = EASING_IN_OUT_QUAD;
|
||||||
|
|
|
@ -482,7 +482,6 @@ static void ozone_context_reset(void *data, bool is_threaded)
|
||||||
ozone_context_reset_horizontal_list(ozone);
|
ozone_context_reset_horizontal_list(ozone);
|
||||||
|
|
||||||
/* State reset */
|
/* State reset */
|
||||||
ozone->frame_count = 0;
|
|
||||||
ozone->fade_direction = false;
|
ozone->fade_direction = false;
|
||||||
ozone->cursor_in_sidebar = false;
|
ozone->cursor_in_sidebar = false;
|
||||||
ozone->cursor_in_sidebar_old = false;
|
ozone->cursor_in_sidebar_old = false;
|
||||||
|
@ -862,7 +861,7 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||||
/* Title */
|
/* Title */
|
||||||
ticker.s = title;
|
ticker.s = title;
|
||||||
ticker.len = (video_info->width - 128 - 47 - 130) / ozone->title_font_glyph_width;
|
ticker.len = (video_info->width - 128 - 47 - 130) / ozone->title_font_glyph_width;
|
||||||
ticker.idx = ozone->frame_count / 20;
|
ticker.idx = menu_animation_get_ticker_idx();
|
||||||
ticker.str = ozone->title;
|
ticker.str = ozone->title;
|
||||||
ticker.selected = true;
|
ticker.selected = true;
|
||||||
|
|
||||||
|
@ -1101,8 +1100,6 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
|
||||||
last_use_preferred_system_color_theme = settings->bools.menu_use_preferred_system_color_theme;
|
last_use_preferred_system_color_theme = settings->bools.menu_use_preferred_system_color_theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
ozone->frame_count++;
|
|
||||||
|
|
||||||
menu_display_set_viewport(video_info->width, video_info->height);
|
menu_display_set_viewport(video_info->width, video_info->height);
|
||||||
|
|
||||||
/* Clear text */
|
/* Clear text */
|
||||||
|
|
|
@ -27,9 +27,9 @@ typedef struct ozone_handle ozone_handle_t;
|
||||||
#include "../../menu_driver.h"
|
#include "../../menu_driver.h"
|
||||||
#include "../../../retroarch.h"
|
#include "../../../retroarch.h"
|
||||||
|
|
||||||
#define ANIMATION_PUSH_ENTRY_DURATION 10
|
#define ANIMATION_PUSH_ENTRY_DURATION 166
|
||||||
#define ANIMATION_CURSOR_DURATION 8
|
#define ANIMATION_CURSOR_DURATION 133
|
||||||
#define ANIMATION_CURSOR_PULSE 30
|
#define ANIMATION_CURSOR_PULSE 500
|
||||||
|
|
||||||
#define FONT_SIZE_FOOTER 18
|
#define FONT_SIZE_FOOTER 18
|
||||||
#define FONT_SIZE_TITLE 36
|
#define FONT_SIZE_TITLE 36
|
||||||
|
@ -64,8 +64,6 @@ typedef struct ozone_handle ozone_handle_t;
|
||||||
|
|
||||||
struct ozone_handle
|
struct ozone_handle
|
||||||
{
|
{
|
||||||
uint64_t frame_count;
|
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
font_data_t *footer;
|
font_data_t *footer;
|
||||||
|
|
|
@ -107,9 +107,6 @@ void ozone_draw_text(
|
||||||
uint32_t color,
|
uint32_t color,
|
||||||
bool draw_outside)
|
bool draw_outside)
|
||||||
{
|
{
|
||||||
if ((color & 0x000000FF) == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
menu_display_draw_text(font, str, x, y,
|
menu_display_draw_text(font, str, x, y,
|
||||||
width, height, color, text_align, 1.0f,
|
width, height, color, text_align, 1.0f,
|
||||||
false,
|
false,
|
||||||
|
|
|
@ -442,7 +442,7 @@ border_iterate:
|
||||||
/* Prepare text */
|
/* Prepare text */
|
||||||
entry_rich_label = menu_entry_get_rich_label(&entry);
|
entry_rich_label = menu_entry_get_rich_label(&entry);
|
||||||
|
|
||||||
ticker.idx = ozone->frame_count / 20;
|
ticker.idx = menu_animation_get_ticker_idx();
|
||||||
ticker.s = rich_label;
|
ticker.s = rich_label;
|
||||||
ticker.str = entry_rich_label;
|
ticker.str = entry_rich_label;
|
||||||
ticker.selected = entry_selected && !ozone->cursor_in_sidebar;
|
ticker.selected = entry_selected && !ozone->cursor_in_sidebar;
|
||||||
|
@ -518,7 +518,7 @@ border_iterate:
|
||||||
y + ozone->dimensions.entry_height + 1 + 5 + FONT_SIZE_ENTRIES_SUBLABEL + scroll_y, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_sublabel, COLOR_TEXT_ALPHA(ozone->theme->text_sublabel_rgba, alpha_uint32), false);
|
y + ozone->dimensions.entry_height + 1 + 5 + FONT_SIZE_ENTRIES_SUBLABEL + scroll_y, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_sublabel, COLOR_TEXT_ALPHA(ozone->theme->text_sublabel_rgba, alpha_uint32), false);
|
||||||
|
|
||||||
/* Value */
|
/* Value */
|
||||||
ticker.idx = ozone->frame_count / 20;
|
ticker.idx = menu_animation_get_ticker_idx();
|
||||||
ticker.s = entry_value_ticker;
|
ticker.s = entry_value_ticker;
|
||||||
ticker.str = entry_value;
|
ticker.str = entry_value;
|
||||||
ticker.selected = entry_selected && !ozone->cursor_in_sidebar;
|
ticker.selected = entry_selected && !ozone->cursor_in_sidebar;
|
||||||
|
|
|
@ -226,7 +226,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||||
|
|
||||||
|
|
||||||
/* Text */
|
/* Text */
|
||||||
ticker.idx = ozone->frame_count / 20;
|
ticker.idx = menu_animation_get_ticker_idx();
|
||||||
ticker.len = (entry_width - ozone->dimensions.sidebar_entry_icon_size - 35) / ozone->sidebar_font_glyph_width;
|
ticker.len = (entry_width - ozone->dimensions.sidebar_entry_icon_size - 35) / ozone->sidebar_font_glyph_width;
|
||||||
ticker.s = console_title;
|
ticker.s = console_title;
|
||||||
ticker.selected = selected;
|
ticker.selected = selected;
|
||||||
|
|
|
@ -411,7 +411,6 @@ typedef struct
|
||||||
bool mouse_show;
|
bool mouse_show;
|
||||||
unsigned last_width;
|
unsigned last_width;
|
||||||
unsigned last_height;
|
unsigned last_height;
|
||||||
unsigned frame_count;
|
|
||||||
bool bg_thickness;
|
bool bg_thickness;
|
||||||
bool border_thickness;
|
bool border_thickness;
|
||||||
float scroll_y;
|
float scroll_y;
|
||||||
|
@ -1457,8 +1456,6 @@ static void rgui_frame(void *data, video_frame_info_t *video_info)
|
||||||
prepare_rgui_colors(rgui, settings);
|
prepare_rgui_colors(rgui, settings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rgui->frame_count++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rgui_render(void *data, bool is_idle)
|
static void rgui_render(void *data, bool is_idle)
|
||||||
|
@ -1473,7 +1470,6 @@ static void rgui_render(void *data, bool is_idle)
|
||||||
bool msg_force = false;
|
bool msg_force = false;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
rgui_t *rgui = (rgui_t*)data;
|
rgui_t *rgui = (rgui_t*)data;
|
||||||
uint64_t frame_count = rgui->frame_count;
|
|
||||||
|
|
||||||
static bool display_kb = false;
|
static bool display_kb = false;
|
||||||
bool current_display_cb = false;
|
bool current_display_cb = false;
|
||||||
|
@ -1589,7 +1585,7 @@ static void rgui_render(void *data, bool is_idle)
|
||||||
|
|
||||||
/* We use a single ticker for all text animations,
|
/* We use a single ticker for all text animations,
|
||||||
* with the following configuration: */
|
* with the following configuration: */
|
||||||
ticker.idx = frame_count / RGUI_TERM_START_X(fb_width);
|
ticker.idx = menu_animation_get_ticker_idx();
|
||||||
ticker.type_enum = settings->uints.menu_ticker_type;
|
ticker.type_enum = settings->uints.menu_ticker_type;
|
||||||
ticker.spacer = ticker_spacer;
|
ticker.spacer = ticker_spacer;
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
#define STRIPES_RIBBON_VERTICES 2*STRIPES_RIBBON_COLS*STRIPES_RIBBON_ROWS-2*STRIPES_RIBBON_COLS
|
#define STRIPES_RIBBON_VERTICES 2*STRIPES_RIBBON_COLS*STRIPES_RIBBON_ROWS-2*STRIPES_RIBBON_COLS
|
||||||
|
|
||||||
#ifndef STRIPES_DELAY
|
#ifndef STRIPES_DELAY
|
||||||
#define STRIPES_DELAY 10
|
#define STRIPES_DELAY 166
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BATTERY_LEVEL_CHECK_INTERVAL (30 * 1000000)
|
#define BATTERY_LEVEL_CHECK_INTERVAL (30 * 1000000)
|
||||||
|
@ -249,8 +249,6 @@ typedef struct stripes_handle
|
||||||
float categories_active_alpha;
|
float categories_active_alpha;
|
||||||
float categories_active_width;
|
float categories_active_width;
|
||||||
|
|
||||||
uint64_t frame_count;
|
|
||||||
|
|
||||||
char title_name[255];
|
char title_name[255];
|
||||||
char *box_message;
|
char *box_message;
|
||||||
char *thumbnail_system;
|
char *thumbnail_system;
|
||||||
|
@ -2323,7 +2321,6 @@ static int stripes_draw_item(
|
||||||
float *color,
|
float *color,
|
||||||
const char *thumb_ident,
|
const char *thumb_ident,
|
||||||
const char *left_thumb_ident,
|
const char *left_thumb_ident,
|
||||||
uint64_t frame_count,
|
|
||||||
size_t i,
|
size_t i,
|
||||||
size_t current,
|
size_t current,
|
||||||
unsigned width,
|
unsigned width,
|
||||||
|
@ -2455,7 +2452,7 @@ static int stripes_draw_item(
|
||||||
|
|
||||||
ticker.s = tmp;
|
ticker.s = tmp;
|
||||||
ticker.len = ticker_limit;
|
ticker.len = ticker_limit;
|
||||||
ticker.idx = frame_count / 20;
|
ticker.idx = menu_animation_get_ticker_idx();
|
||||||
ticker.str = ticker_str;
|
ticker.str = ticker_str;
|
||||||
ticker.selected = (i == current);
|
ticker.selected = (i == current);
|
||||||
|
|
||||||
|
@ -2491,7 +2488,7 @@ static int stripes_draw_item(
|
||||||
|
|
||||||
ticker.s = tmp;
|
ticker.s = tmp;
|
||||||
ticker.len = 35 * stripes_scale_mod[7];
|
ticker.len = 35 * stripes_scale_mod[7];
|
||||||
ticker.idx = frame_count / 20;
|
ticker.idx = menu_animation_get_ticker_idx();
|
||||||
ticker.selected = (i == current);
|
ticker.selected = (i == current);
|
||||||
|
|
||||||
if (!string_is_empty(entry->value))
|
if (!string_is_empty(entry->value))
|
||||||
|
@ -2592,7 +2589,6 @@ static void stripes_draw_items(
|
||||||
menu_display_ctx_rotate_draw_t rotate_draw;
|
menu_display_ctx_rotate_draw_t rotate_draw;
|
||||||
stripes_node_t *core_node = NULL;
|
stripes_node_t *core_node = NULL;
|
||||||
size_t end = 0;
|
size_t end = 0;
|
||||||
uint64_t frame_count = stripes ? stripes->frame_count : 0;
|
|
||||||
const char *thumb_ident = stripes_thumbnails_ident('R');
|
const char *thumb_ident = stripes_thumbnails_ident('R');
|
||||||
const char *left_thumb_ident= stripes_thumbnails_ident('L');
|
const char *left_thumb_ident= stripes_thumbnails_ident('L');
|
||||||
|
|
||||||
|
@ -2645,7 +2641,6 @@ static void stripes_draw_items(
|
||||||
&mymat,
|
&mymat,
|
||||||
stripes, core_node,
|
stripes, core_node,
|
||||||
list, color, thumb_ident, left_thumb_ident,
|
list, color, thumb_ident, left_thumb_ident,
|
||||||
frame_count,
|
|
||||||
i, current,
|
i, current,
|
||||||
width, height);
|
width, height);
|
||||||
menu_entry_free(&entry);
|
menu_entry_free(&entry);
|
||||||
|
@ -2828,8 +2823,6 @@ static void stripes_frame(void *data, video_frame_info_t *video_info)
|
||||||
scale_factor = (settings->uints.menu_xmb_scale_factor * (float)width) / (1920.0 * 100);
|
scale_factor = (settings->uints.menu_xmb_scale_factor * (float)width) / (1920.0 * 100);
|
||||||
pseudo_font_length = stripes->icon_spacing_horizontal * 4 - stripes->icon_size / 4;
|
pseudo_font_length = stripes->icon_spacing_horizontal * 4 - stripes->icon_size / 4;
|
||||||
|
|
||||||
stripes->frame_count++;
|
|
||||||
|
|
||||||
msg[0] = '\0';
|
msg[0] = '\0';
|
||||||
title_msg[0] = '\0';
|
title_msg[0] = '\0';
|
||||||
title_truncated[0] = '\0';
|
title_truncated[0] = '\0';
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
#define XMB_RIBBON_VERTICES 2*XMB_RIBBON_COLS*XMB_RIBBON_ROWS-2*XMB_RIBBON_COLS
|
#define XMB_RIBBON_VERTICES 2*XMB_RIBBON_COLS*XMB_RIBBON_ROWS-2*XMB_RIBBON_COLS
|
||||||
|
|
||||||
#ifndef XMB_DELAY
|
#ifndef XMB_DELAY
|
||||||
#define XMB_DELAY 10
|
#define XMB_DELAY 166
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BATTERY_LEVEL_CHECK_INTERVAL (30 * 1000000)
|
#define BATTERY_LEVEL_CHECK_INTERVAL (30 * 1000000)
|
||||||
|
@ -304,8 +304,6 @@ typedef struct xmb_handle
|
||||||
float categories_active_zoom;
|
float categories_active_zoom;
|
||||||
float categories_active_alpha;
|
float categories_active_alpha;
|
||||||
|
|
||||||
uint64_t frame_count;
|
|
||||||
|
|
||||||
char title_name[255];
|
char title_name[255];
|
||||||
char *box_message;
|
char *box_message;
|
||||||
char *thumbnail_system;
|
char *thumbnail_system;
|
||||||
|
@ -2796,7 +2794,6 @@ static int xmb_draw_item(
|
||||||
float *color,
|
float *color,
|
||||||
const char *thumb_ident,
|
const char *thumb_ident,
|
||||||
const char *left_thumb_ident,
|
const char *left_thumb_ident,
|
||||||
uint64_t frame_count,
|
|
||||||
size_t i,
|
size_t i,
|
||||||
size_t current,
|
size_t current,
|
||||||
unsigned width,
|
unsigned width,
|
||||||
|
@ -2931,7 +2928,7 @@ static int xmb_draw_item(
|
||||||
|
|
||||||
ticker.s = tmp;
|
ticker.s = tmp;
|
||||||
ticker.len = ticker_limit;
|
ticker.len = ticker_limit;
|
||||||
ticker.idx = frame_count / 20;
|
ticker.idx = menu_animation_get_ticker_idx();
|
||||||
ticker.str = ticker_str;
|
ticker.str = ticker_str;
|
||||||
ticker.selected = (i == current);
|
ticker.selected = (i == current);
|
||||||
|
|
||||||
|
@ -2967,7 +2964,7 @@ static int xmb_draw_item(
|
||||||
|
|
||||||
ticker.s = tmp;
|
ticker.s = tmp;
|
||||||
ticker.len = 35 * scale_mod[7];
|
ticker.len = 35 * scale_mod[7];
|
||||||
ticker.idx = frame_count / 20;
|
ticker.idx = menu_animation_get_ticker_idx();
|
||||||
ticker.selected = (i == current);
|
ticker.selected = (i == current);
|
||||||
|
|
||||||
if (!string_is_empty(entry->value))
|
if (!string_is_empty(entry->value))
|
||||||
|
@ -3078,7 +3075,6 @@ static void xmb_draw_items(
|
||||||
menu_display_ctx_rotate_draw_t rotate_draw;
|
menu_display_ctx_rotate_draw_t rotate_draw;
|
||||||
xmb_node_t *core_node = NULL;
|
xmb_node_t *core_node = NULL;
|
||||||
size_t end = 0;
|
size_t end = 0;
|
||||||
uint64_t frame_count = xmb->frame_count;
|
|
||||||
const char *thumb_ident = xmb_thumbnails_ident('R');
|
const char *thumb_ident = xmb_thumbnails_ident('R');
|
||||||
const char *left_thumb_ident= xmb_thumbnails_ident('L');
|
const char *left_thumb_ident= xmb_thumbnails_ident('L');
|
||||||
|
|
||||||
|
@ -3131,7 +3127,6 @@ static void xmb_draw_items(
|
||||||
&mymat,
|
&mymat,
|
||||||
xmb, core_node,
|
xmb, core_node,
|
||||||
list, color, thumb_ident, left_thumb_ident,
|
list, color, thumb_ident, left_thumb_ident,
|
||||||
frame_count,
|
|
||||||
i, current,
|
i, current,
|
||||||
width, height);
|
width, height);
|
||||||
menu_entry_free(&entry);
|
menu_entry_free(&entry);
|
||||||
|
@ -3398,8 +3393,6 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||||
scale_factor = (settings->uints.menu_xmb_scale_factor * (float)width) / (1920.0 * 100);
|
scale_factor = (settings->uints.menu_xmb_scale_factor * (float)width) / (1920.0 * 100);
|
||||||
pseudo_font_length = xmb->icon_spacing_horizontal * 4 - xmb->icon_size / 4;
|
pseudo_font_length = xmb->icon_spacing_horizontal * 4 - xmb->icon_size / 4;
|
||||||
|
|
||||||
xmb->frame_count++;
|
|
||||||
|
|
||||||
msg[0] = '\0';
|
msg[0] = '\0';
|
||||||
title_msg[0] = '\0';
|
title_msg[0] = '\0';
|
||||||
title_truncated[0] = '\0';
|
title_truncated[0] = '\0';
|
||||||
|
|
|
@ -69,7 +69,6 @@ HXUIOBJ m_back;
|
||||||
HXUIOBJ root_menu;
|
HXUIOBJ root_menu;
|
||||||
HXUIOBJ current_menu;
|
HXUIOBJ current_menu;
|
||||||
static msg_queue_t *xui_msg_queue = NULL;
|
static msg_queue_t *xui_msg_queue = NULL;
|
||||||
static uint64_t xui_frame_count = 0;
|
|
||||||
|
|
||||||
class CRetroArch : public CXuiModule
|
class CRetroArch : public CXuiModule
|
||||||
{
|
{
|
||||||
|
@ -366,8 +365,6 @@ static void xui_free(void *data)
|
||||||
(void)data;
|
(void)data;
|
||||||
app.Uninit();
|
app.Uninit();
|
||||||
|
|
||||||
xui_frame_count = 0;
|
|
||||||
|
|
||||||
if (xui_msg_queue)
|
if (xui_msg_queue)
|
||||||
msg_queue_free(xui_msg_queue);
|
msg_queue_free(xui_msg_queue);
|
||||||
}
|
}
|
||||||
|
@ -422,8 +419,6 @@ static void xui_frame(void *data, video_frame_info_t *video_info)
|
||||||
if (!d3d)
|
if (!d3d)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
xui_frame_count++;
|
|
||||||
|
|
||||||
menu_display_set_viewport(video_info->width, video_info->height);
|
menu_display_set_viewport(video_info->width, video_info->height);
|
||||||
|
|
||||||
app.RunFrame();
|
app.RunFrame();
|
||||||
|
@ -544,7 +539,6 @@ static void xui_render(void *data, bool is_idle)
|
||||||
const char *dir = NULL;
|
const char *dir = NULL;
|
||||||
const char *label = NULL;
|
const char *label = NULL;
|
||||||
unsigned menu_type = 0;
|
unsigned menu_type = 0;
|
||||||
uint64_t frame_count = xui_frame_count;
|
|
||||||
bool msg_force = menu_display_get_msg_force();
|
bool msg_force = menu_display_get_msg_force();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
@ -577,7 +571,7 @@ static void xui_render(void *data, bool is_idle)
|
||||||
|
|
||||||
ticker.s = title;
|
ticker.s = title;
|
||||||
ticker.len = RXUI_TERM_WIDTH(fb_width) - 3;
|
ticker.len = RXUI_TERM_WIDTH(fb_width) - 3;
|
||||||
ticker.idx = (unsigned int)frame_count / 15;
|
ticker.idx = menu_animation_get_ticker_idx();
|
||||||
ticker.str = title;
|
ticker.str = title;
|
||||||
ticker.selected = true;
|
ticker.selected = true;
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,6 @@
|
||||||
#include "../configuration.h"
|
#include "../configuration.h"
|
||||||
#include "../performance_counters.h"
|
#include "../performance_counters.h"
|
||||||
|
|
||||||
#define IDEAL_DELTA_TIME (1.0 / 60.0 * 1000000.0)
|
|
||||||
|
|
||||||
struct tween
|
struct tween
|
||||||
{
|
{
|
||||||
float duration;
|
float duration;
|
||||||
|
@ -62,9 +60,14 @@ struct menu_animation
|
||||||
|
|
||||||
typedef struct menu_animation menu_animation_t;
|
typedef struct menu_animation menu_animation_t;
|
||||||
|
|
||||||
|
#define TICKER_SPEED 333
|
||||||
|
#define TICKER_SLOW_SPEED 1600
|
||||||
|
|
||||||
static menu_animation_t anim;
|
static menu_animation_t anim;
|
||||||
static retro_time_t cur_time = 0;
|
static retro_time_t cur_time = 0;
|
||||||
static retro_time_t old_time = 0;
|
static retro_time_t old_time = 0;
|
||||||
|
static uint64_t ticker_idx = 0; /* updated every TICKER_SPEED ms */
|
||||||
|
static uint64_t ticker_slow_idx = 0; /* updated every TICKER_SLOW_SPEED ms */
|
||||||
static float delta_time = 0.0f;
|
static float delta_time = 0.0f;
|
||||||
static bool animation_is_active = false;
|
static bool animation_is_active = false;
|
||||||
static bool ticker_is_active = false;
|
static bool ticker_is_active = false;
|
||||||
|
@ -554,9 +557,48 @@ bool menu_animation_push(menu_animation_ctx_entry_t *entry)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool menu_animation_update(float anim_delta_time)
|
static void menu_animation_update_time(bool timedate_enable)
|
||||||
|
{
|
||||||
|
static retro_time_t
|
||||||
|
last_clock_update = 0;
|
||||||
|
static retro_time_t
|
||||||
|
last_ticker_update = 0;
|
||||||
|
static retro_time_t
|
||||||
|
last_ticker_slow_update = 0;
|
||||||
|
|
||||||
|
cur_time = cpu_features_get_time_usec() / 1000;
|
||||||
|
delta_time = old_time == 0 ? 0 : cur_time - old_time;
|
||||||
|
|
||||||
|
old_time = cur_time;
|
||||||
|
|
||||||
|
if (((cur_time - last_clock_update) > 1000)
|
||||||
|
&& timedate_enable)
|
||||||
|
{
|
||||||
|
animation_is_active = true;
|
||||||
|
last_clock_update = cur_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ticker_is_active
|
||||||
|
&& cur_time - last_ticker_update >= TICKER_SPEED)
|
||||||
|
{
|
||||||
|
ticker_idx++;
|
||||||
|
last_ticker_update = cur_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ticker_is_active
|
||||||
|
&& cur_time - last_ticker_slow_update >= TICKER_SLOW_SPEED)
|
||||||
|
{
|
||||||
|
ticker_slow_idx++;
|
||||||
|
last_ticker_slow_update = cur_time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool menu_animation_update(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
menu_animation_update_time(settings->bools.menu_timedate_enable);
|
||||||
|
|
||||||
anim.in_update = true;
|
anim.in_update = true;
|
||||||
anim.pending_deletes = false;
|
anim.pending_deletes = false;
|
||||||
|
@ -564,7 +606,7 @@ bool menu_animation_update(float anim_delta_time)
|
||||||
for(i = 0; i < da_count(anim.list); i++)
|
for(i = 0; i < da_count(anim.list); i++)
|
||||||
{
|
{
|
||||||
struct tween *tween = da_getptr(anim.list, i);
|
struct tween *tween = da_getptr(anim.list, i);
|
||||||
tween->running_since += anim_delta_time;
|
tween->running_since += delta_time;
|
||||||
|
|
||||||
*tween->subject = tween->easing(
|
*tween->subject = tween->easing(
|
||||||
tween->running_since,
|
tween->running_since,
|
||||||
|
@ -715,29 +757,6 @@ bool menu_animation_ticker(const menu_animation_ctx_ticker_t *ticker)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_animation_update_time(bool timedate_enable)
|
|
||||||
{
|
|
||||||
static retro_time_t
|
|
||||||
last_clock_update = 0;
|
|
||||||
|
|
||||||
cur_time = cpu_features_get_time_usec();
|
|
||||||
delta_time = cur_time - old_time;
|
|
||||||
|
|
||||||
if (delta_time >= IDEAL_DELTA_TIME* 4)
|
|
||||||
delta_time = IDEAL_DELTA_TIME * 4;
|
|
||||||
if (delta_time <= IDEAL_DELTA_TIME / 4)
|
|
||||||
delta_time = IDEAL_DELTA_TIME / 4;
|
|
||||||
|
|
||||||
old_time = cur_time;
|
|
||||||
|
|
||||||
if (((cur_time - last_clock_update) > 1000000)
|
|
||||||
&& timedate_enable)
|
|
||||||
{
|
|
||||||
animation_is_active = true;
|
|
||||||
last_clock_update = cur_time;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool menu_animation_is_active(void)
|
bool menu_animation_is_active(void)
|
||||||
{
|
{
|
||||||
return animation_is_active || ticker_is_active;
|
return animation_is_active || ticker_is_active;
|
||||||
|
@ -802,10 +821,9 @@ void menu_animation_kill_by_subject(menu_animation_ctx_subject_t *subject)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_animation_get_time(menu_animation_ctx_delta_t *delta)
|
float menu_animation_get_delta_time(void)
|
||||||
{
|
{
|
||||||
delta->current = delta_time;
|
return delta_time;
|
||||||
delta->ideal = delta_time / IDEAL_DELTA_TIME;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data)
|
bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data)
|
||||||
|
@ -872,3 +890,13 @@ void menu_timer_kill(menu_timer_t *timer)
|
||||||
menu_animation_ctx_tag tag = (uintptr_t) timer;
|
menu_animation_ctx_tag tag = (uintptr_t) timer;
|
||||||
menu_animation_kill_by_tag(&tag);
|
menu_animation_kill_by_tag(&tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t menu_animation_get_ticker_idx(void)
|
||||||
|
{
|
||||||
|
return ticker_idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t menu_animation_get_ticker_slow_idx(void)
|
||||||
|
{
|
||||||
|
return ticker_slow_idx;
|
||||||
|
}
|
|
@ -94,12 +94,6 @@ enum menu_animation_ticker_type
|
||||||
TICKER_TYPE_LAST
|
TICKER_TYPE_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct menu_animation_ctx_delta
|
|
||||||
{
|
|
||||||
float current;
|
|
||||||
float ideal;
|
|
||||||
} menu_animation_ctx_delta_t;
|
|
||||||
|
|
||||||
typedef uintptr_t menu_animation_ctx_tag;
|
typedef uintptr_t menu_animation_ctx_tag;
|
||||||
|
|
||||||
typedef struct menu_animation_ctx_subject
|
typedef struct menu_animation_ctx_subject
|
||||||
|
@ -153,13 +147,11 @@ void menu_animation_init(void);
|
||||||
|
|
||||||
void menu_animation_free(void);
|
void menu_animation_free(void);
|
||||||
|
|
||||||
bool menu_animation_update(float delta_time);
|
bool menu_animation_update(void);
|
||||||
|
|
||||||
void menu_animation_get_time(menu_animation_ctx_delta_t *delta);
|
|
||||||
|
|
||||||
bool menu_animation_ticker(const menu_animation_ctx_ticker_t *ticker);
|
bool menu_animation_ticker(const menu_animation_ctx_ticker_t *ticker);
|
||||||
|
|
||||||
void menu_animation_update_time(bool timedate_enable);
|
float menu_animation_get_delta_time(void);
|
||||||
|
|
||||||
bool menu_animation_is_active(void);
|
bool menu_animation_is_active(void);
|
||||||
|
|
||||||
|
@ -173,6 +165,10 @@ void menu_animation_push_delayed(unsigned delay, menu_animation_ctx_entry_t *ent
|
||||||
|
|
||||||
bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data);
|
bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data);
|
||||||
|
|
||||||
|
uint64_t menu_animation_get_ticker_idx(void);
|
||||||
|
|
||||||
|
uint64_t menu_animation_get_ticker_slow_idx(void);
|
||||||
|
|
||||||
RETRO_END_DECLS
|
RETRO_END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1588,10 +1588,13 @@ void menu_display_draw_text(
|
||||||
{
|
{
|
||||||
struct font_params params;
|
struct font_params params;
|
||||||
|
|
||||||
|
if ((color & 0x000000FF) == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Don't draw outside of the screen */
|
/* Don't draw outside of the screen */
|
||||||
if ( ((x < -64 || x > width + 64)
|
if (!draw_outside &&
|
||||||
|
((x < -64 || x > width + 64)
|
||||||
|| (y < -64 || y > height + 64))
|
|| (y < -64 || y > height + 64))
|
||||||
&& !draw_outside
|
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1952,9 +1955,6 @@ bool menu_driver_render(bool is_idle, bool rarch_is_inited,
|
||||||
|
|
||||||
if (BIT64_GET(menu_driver_data->state, MENU_STATE_BLIT))
|
if (BIT64_GET(menu_driver_data->state, MENU_STATE_BLIT))
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
menu_animation_update_time(settings->bools.menu_timedate_enable);
|
|
||||||
|
|
||||||
if (menu_driver_ctx->render)
|
if (menu_driver_ctx->render)
|
||||||
menu_driver_ctx->render(menu_userdata, is_idle);
|
menu_driver_ctx->render(menu_userdata, is_idle);
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,7 +162,6 @@ void menu_event_kb_set(bool down, enum retro_key key)
|
||||||
*/
|
*/
|
||||||
unsigned menu_event(input_bits_t *p_input, input_bits_t *p_trigger_input)
|
unsigned menu_event(input_bits_t *p_input, input_bits_t *p_trigger_input)
|
||||||
{
|
{
|
||||||
menu_animation_ctx_delta_t delta;
|
|
||||||
/* Used for key repeat */
|
/* Used for key repeat */
|
||||||
static float delay_timer = 0.0f;
|
static float delay_timer = 0.0f;
|
||||||
static float delay_count = 0.0f;
|
static float delay_count = 0.0f;
|
||||||
|
@ -198,7 +197,7 @@ unsigned menu_event(input_bits_t *p_input, input_bits_t *p_trigger_input)
|
||||||
* for old_input_state. */
|
* for old_input_state. */
|
||||||
|
|
||||||
first_held = true;
|
first_held = true;
|
||||||
delay_timer = initial_held ? 12 : 6;
|
delay_timer = initial_held ? 200 : 100;
|
||||||
delay_count = 0;
|
delay_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,8 +234,7 @@ unsigned menu_event(input_bits_t *p_input, input_bits_t *p_trigger_input)
|
||||||
menu_driver_ctl(MENU_NAVIGATION_CTL_SET_SCROLL_ACCEL,
|
menu_driver_ctl(MENU_NAVIGATION_CTL_SET_SCROLL_ACCEL,
|
||||||
&new_scroll_accel);
|
&new_scroll_accel);
|
||||||
|
|
||||||
menu_animation_get_time(&delta);
|
delay_count += menu_animation_get_delta_time();
|
||||||
delay_count += delta.ideal;
|
|
||||||
|
|
||||||
if (menu_input_dialog_get_display_kb())
|
if (menu_input_dialog_get_display_kb())
|
||||||
{
|
{
|
||||||
|
|
|
@ -2732,7 +2732,6 @@ static enum runloop_state runloop_check_state(
|
||||||
bool rarch_is_initialized = rarch_ctl(RARCH_CTL_IS_INITED, NULL);
|
bool rarch_is_initialized = rarch_ctl(RARCH_CTL_IS_INITED, NULL);
|
||||||
bool fs_toggle_triggered = false;
|
bool fs_toggle_triggered = false;
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
menu_animation_ctx_delta_t delta;
|
|
||||||
bool menu_driver_binding_state = menu_driver_is_binding_state();
|
bool menu_driver_binding_state = menu_driver_is_binding_state();
|
||||||
bool menu_is_alive = menu_driver_is_alive();
|
bool menu_is_alive = menu_driver_is_alive();
|
||||||
unsigned menu_toggle_gamepad_combo = settings->uints.input_menu_toggle_gamepad_combo;
|
unsigned menu_toggle_gamepad_combo = settings->uints.input_menu_toggle_gamepad_combo;
|
||||||
|
@ -2920,8 +2919,7 @@ static enum runloop_state runloop_check_state(
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_MENU)
|
#if defined(HAVE_MENU)
|
||||||
menu_animation_get_time(&delta);
|
menu_animation_update();
|
||||||
menu_animation_update(delta.ideal);
|
|
||||||
|
|
||||||
if (menu_is_alive)
|
if (menu_is_alive)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue