mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(XMB) Move the ribbon display code to menu_display
This commit is contained in:
parent
5530f7fe63
commit
252414f4d7
@ -48,7 +48,7 @@
|
||||
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
#define XMB_RIBBON_ENABLE
|
||||
#define XMB_RIBBON_ROWS 16
|
||||
#define XMB_RIBBON_COLS 32
|
||||
@ -1833,44 +1833,7 @@ static void xmb_frame_horizontal_list(xmb_handle_t *xmb,
|
||||
#ifdef XMB_RIBBON_ENABLE
|
||||
static void xmb_draw_ribbon(xmb_handle_t *xmb, menu_display_ctx_draw_t *draw)
|
||||
{
|
||||
struct uniform_info uniform_param = {0};
|
||||
static float t = 0;
|
||||
video_shader_ctx_info_t shader_info;
|
||||
gfx_coord_array_t *ca = NULL;
|
||||
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_COORDS_ARRAY_GET, &ca);
|
||||
|
||||
if (menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO_RUNNING, NULL))
|
||||
draw->handle_alpha = 0.75;
|
||||
else
|
||||
draw->handle_alpha = 0.90;
|
||||
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_DRAW_GRADIENT, draw);
|
||||
|
||||
draw->x = 0;
|
||||
draw->y = 0;
|
||||
draw->coords = (struct gfx_coords*)(&ca->coords);
|
||||
draw->matrix_data = NULL;
|
||||
|
||||
shader_info.data = NULL;
|
||||
shader_info.idx = VIDEO_SHADER_MENU;
|
||||
|
||||
video_shader_driver_ctl(SHADER_CTL_USE, &shader_info);
|
||||
|
||||
t += 0.01;
|
||||
|
||||
uniform_param.enabled = true;
|
||||
uniform_param.lookup.enable = true;
|
||||
uniform_param.lookup.add_prefix = true;
|
||||
uniform_param.lookup.idx = VIDEO_SHADER_MENU;
|
||||
uniform_param.lookup.type = SHADER_PROGRAM_VERTEX;
|
||||
uniform_param.type = UNIFORM_1F;
|
||||
uniform_param.lookup.ident = "time";
|
||||
uniform_param.result.f.v0 = t;
|
||||
|
||||
video_shader_driver_ctl(SHADER_CTL_SET_PARAMETER, &uniform_param);
|
||||
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_DRAW, draw);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1880,7 +1843,8 @@ static void xmb_draw_bg(xmb_handle_t *xmb, menu_display_ctx_draw_t *draw)
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_SET_VIEWPORT, NULL);
|
||||
|
||||
#ifdef XMB_RIBBON_ENABLE
|
||||
xmb_draw_ribbon(xmb, draw);
|
||||
//xmb_draw_ribbon(xmb, draw);
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_DRAW_RIBBON, draw);
|
||||
#else
|
||||
draw->x = 0;
|
||||
draw->y = 0;
|
||||
|
@ -540,6 +540,49 @@ bool menu_display_ctl(enum menu_display_ctl_state state, void *data)
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_DRAW_BG, draw);
|
||||
}
|
||||
break;
|
||||
case MENU_DISPLAY_CTL_DRAW_RIBBON:
|
||||
{
|
||||
menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;
|
||||
struct uniform_info uniform_param = {0};
|
||||
static float t = 0;
|
||||
video_shader_ctx_info_t shader_info;
|
||||
gfx_coord_array_t *ca = NULL;
|
||||
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_COORDS_ARRAY_GET, &ca);
|
||||
|
||||
if (menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO_RUNNING, NULL))
|
||||
draw->handle_alpha = 0.75;
|
||||
else
|
||||
draw->handle_alpha = 0.90;
|
||||
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_DRAW_GRADIENT, draw);
|
||||
|
||||
draw->x = 0;
|
||||
draw->y = 0;
|
||||
draw->coords = (struct gfx_coords*)(&ca->coords);
|
||||
draw->matrix_data = NULL;
|
||||
|
||||
shader_info.data = NULL;
|
||||
shader_info.idx = VIDEO_SHADER_MENU;
|
||||
|
||||
video_shader_driver_ctl(SHADER_CTL_USE, &shader_info);
|
||||
|
||||
t += 0.01;
|
||||
|
||||
uniform_param.enabled = true;
|
||||
uniform_param.lookup.enable = true;
|
||||
uniform_param.lookup.add_prefix = true;
|
||||
uniform_param.lookup.idx = VIDEO_SHADER_MENU;
|
||||
uniform_param.lookup.type = SHADER_PROGRAM_VERTEX;
|
||||
uniform_param.type = UNIFORM_1F;
|
||||
uniform_param.lookup.ident = "time";
|
||||
uniform_param.result.f.v0 = t;
|
||||
|
||||
video_shader_driver_ctl(SHADER_CTL_SET_PARAMETER, &uniform_param);
|
||||
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_DRAW, draw);
|
||||
}
|
||||
break;
|
||||
case MENU_DISPLAY_CTL_ROTATE_Z:
|
||||
{
|
||||
math_matrix_4x4 matrix_rotated, matrix_scaled;
|
||||
|
@ -76,6 +76,7 @@ enum menu_display_ctl_state
|
||||
MENU_DISPLAY_CTL_DRAW,
|
||||
MENU_DISPLAY_CTL_DRAW_BG,
|
||||
MENU_DISPLAY_CTL_DRAW_GRADIENT,
|
||||
MENU_DISPLAY_CTL_DRAW_RIBBON,
|
||||
MENU_DISPLAY_CTL_ROTATE_Z,
|
||||
MENU_DISPLAY_CTL_TEX_COORDS_GET,
|
||||
MENU_DISPLAY_CTL_TIMEDATE,
|
||||
|
Loading…
x
Reference in New Issue
Block a user