mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
menu_animation_update_time - cleanups
This commit is contained in:
parent
3a1abbed4c
commit
98227a886b
@ -36,6 +36,8 @@
|
|||||||
#include "menu_driver.h"
|
#include "menu_driver.h"
|
||||||
#include "../performance_counters.h"
|
#include "../performance_counters.h"
|
||||||
|
|
||||||
|
typedef float (*easing_cb) (float, float, float, float);
|
||||||
|
|
||||||
struct tween
|
struct tween
|
||||||
{
|
{
|
||||||
float duration;
|
float duration;
|
||||||
@ -1185,6 +1187,35 @@ bool menu_animation_push(menu_animation_ctx_entry_t *entry)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void menu_animation_update_time_rgui(
|
||||||
|
float *dst,
|
||||||
|
unsigned video_width, unsigned height)
|
||||||
|
{
|
||||||
|
*(dst) *= 0.25f;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void menu_animation_update_time_ozone(
|
||||||
|
float *dst,
|
||||||
|
unsigned video_width, unsigned video_height)
|
||||||
|
{
|
||||||
|
*(dst) *= menu_display_get_dpi_scale(video_width, video_height) * 0.5f;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void menu_animation_update_time_materialui(
|
||||||
|
float *dst,
|
||||||
|
unsigned video_width, unsigned video_height)
|
||||||
|
{
|
||||||
|
*(dst) *= menu_display_get_dpi_scale(video_width, video_height) * 0.8f;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void menu_animation_update_time_default(
|
||||||
|
float *dst,
|
||||||
|
unsigned video_width, unsigned video_height)
|
||||||
|
{
|
||||||
|
if (video_width > 0)
|
||||||
|
*(dst) *= ((float)video_width / 1920.0f);
|
||||||
|
}
|
||||||
|
|
||||||
static void menu_animation_update_time(
|
static void menu_animation_update_time(
|
||||||
unsigned type,
|
unsigned type,
|
||||||
bool timedate_enable,
|
bool timedate_enable,
|
||||||
@ -1265,18 +1296,19 @@ static void menu_animation_update_time(
|
|||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case MENU_DRIVER_ID_RGUI:
|
case MENU_DRIVER_ID_RGUI:
|
||||||
ticker_pixel_increment *= 0.25f;
|
menu_animation_update_time_rgui(&ticker_pixel_increment, video_width, video_height);
|
||||||
break;
|
break;
|
||||||
case MENU_DRIVER_ID_OZONE:
|
case MENU_DRIVER_ID_OZONE:
|
||||||
ticker_pixel_increment *= (menu_display_get_dpi_scale(video_width, video_height) * 0.5f);
|
menu_animation_update_time_ozone(&ticker_pixel_increment, video_width, video_height);
|
||||||
break;
|
break;
|
||||||
case MENU_DRIVER_ID_GLUI:
|
case MENU_DRIVER_ID_GLUI:
|
||||||
ticker_pixel_increment *= (menu_display_get_dpi_scale(video_width, video_height) * 0.8f);
|
menu_animation_update_time_materialui(
|
||||||
|
&ticker_pixel_increment, video_width, video_height);
|
||||||
break;
|
break;
|
||||||
case MENU_DRIVER_ID_XMB:
|
case MENU_DRIVER_ID_XMB:
|
||||||
default:
|
default:
|
||||||
if (video_width > 0)
|
menu_animation_update_time_default(
|
||||||
ticker_pixel_increment *= ((float)video_width / 1920.0f);
|
&ticker_pixel_increment, video_width, video_height);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ RETRO_BEGIN_DECLS
|
|||||||
|
|
||||||
#define TICKER_SPACER_DEFAULT " | "
|
#define TICKER_SPACER_DEFAULT " | "
|
||||||
|
|
||||||
typedef float (*easing_cb) (float, float, float, float);
|
|
||||||
typedef void (*tween_cb) (void*);
|
typedef void (*tween_cb) (void*);
|
||||||
|
|
||||||
enum menu_animation_ctl_state
|
enum menu_animation_ctl_state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user