mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Don't use menu_display_get_ptr outside of menu_display.c anymore
This commit is contained in:
parent
057b498bb1
commit
ceff590094
@ -73,10 +73,10 @@ static void glui_blit_line(float x, float y, unsigned width, unsigned height,
|
||||
const char *message, uint32_t color, enum text_alignment text_align)
|
||||
{
|
||||
int font_size;
|
||||
void *fb_buf = NULL;
|
||||
glui_handle_t *glui = NULL;
|
||||
struct font_params params = {0};
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
menu_display_t *disp = menu_display_get_ptr();
|
||||
|
||||
if (!menu)
|
||||
return;
|
||||
@ -93,7 +93,9 @@ static void glui_blit_line(float x, float y, unsigned width, unsigned height,
|
||||
params.full_screen = true;
|
||||
params.text_align = text_align;
|
||||
|
||||
video_driver_set_osd_msg(message, ¶ms, disp->font.buf);
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_FONT_BUF, &fb_buf);
|
||||
|
||||
video_driver_set_osd_msg(message, ¶ms, fb_buf);
|
||||
}
|
||||
|
||||
static void glui_render_quad(gl_t *gl, int x, int y, int w, int h,
|
||||
@ -175,10 +177,9 @@ static void glui_render_messagebox(const char *message)
|
||||
int x, y, font_size;
|
||||
struct string_list *list = NULL;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
menu_display_t *disp = menu_display_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!menu || !disp || !menu->userdata)
|
||||
if (!menu || !menu->userdata)
|
||||
return;
|
||||
|
||||
list = (struct string_list*)string_split(message, "\n");
|
||||
@ -567,10 +568,10 @@ static void glui_font(menu_handle_t *menu)
|
||||
|
||||
static void glui_layout(menu_handle_t *menu, glui_handle_t *glui)
|
||||
{
|
||||
void *fb_buf;
|
||||
float scale_factor;
|
||||
int new_font_size;
|
||||
unsigned width, height, new_header_height;
|
||||
menu_display_t *disp = menu_display_get_ptr();
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
@ -594,10 +595,12 @@ static void glui_layout(menu_handle_t *menu, glui_handle_t *glui)
|
||||
|
||||
glui_font(menu);
|
||||
|
||||
if (disp && disp->font.buf) /* calculate a more realistic ticker_limit */
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_FONT_BUF, &fb_buf);
|
||||
|
||||
if (fb_buf) /* calculate a more realistic ticker_limit */
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
int m_width = driver->font_osd_driver->get_message_width(disp->font.buf, "a", 1, 1);
|
||||
int m_width = driver->font_osd_driver->get_message_width(fb_buf, "a", 1, 1);
|
||||
|
||||
if (m_width)
|
||||
glui->glyph_width = m_width;
|
||||
@ -748,11 +751,10 @@ static float glui_get_scroll(void)
|
||||
|
||||
static void glui_navigation_set(bool scroll)
|
||||
{
|
||||
menu_display_t *disp = menu_display_get_ptr();
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
float scroll_pos = glui_get_scroll();
|
||||
|
||||
if (!menu || !disp || !scroll)
|
||||
if (!menu || !scroll)
|
||||
return;
|
||||
|
||||
menu_animation_push(10, scroll_pos,
|
||||
|
@ -448,7 +448,7 @@ static void xmb_draw_text(menu_handle_t *menu,
|
||||
{
|
||||
uint8_t a8 = 0;
|
||||
struct font_params params = {0};
|
||||
menu_display_t *disp = menu_display_get_ptr();
|
||||
void *disp_buf = NULL;
|
||||
|
||||
if (alpha > xmb->alpha)
|
||||
alpha = xmb->alpha;
|
||||
@ -470,7 +470,9 @@ static void xmb_draw_text(menu_handle_t *menu,
|
||||
params.full_screen = true;
|
||||
params.text_align = text_align;
|
||||
|
||||
video_driver_set_osd_msg(str, ¶ms, disp->font.buf);
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_FONT_BUF, &disp_buf);
|
||||
|
||||
video_driver_set_osd_msg(str, ¶ms, disp_buf);
|
||||
}
|
||||
|
||||
static void xmb_render_messagebox_internal(const char *message)
|
||||
|
@ -193,14 +193,20 @@ bool menu_display_ctl(enum menu_display_ctl_state state, void *data)
|
||||
switch (state)
|
||||
{
|
||||
case MENU_DISPLAY_CTL_FONT_BUF:
|
||||
if (!data)
|
||||
return false;
|
||||
data = disp->font.buf;
|
||||
{
|
||||
void **ptr = (void**)data;
|
||||
if (!ptr)
|
||||
return false;
|
||||
*ptr = disp->font.buf;
|
||||
}
|
||||
return true;
|
||||
case MENU_DISPLAY_CTL_SET_FONT_BUF:
|
||||
if (!data)
|
||||
return false;
|
||||
disp->font.buf = data;
|
||||
{
|
||||
void **ptr = (void**)data;
|
||||
if (!ptr)
|
||||
return false;
|
||||
disp->font.buf = *ptr;
|
||||
}
|
||||
return true;
|
||||
case MENU_DISPLAY_CTL_FONT_FB:
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user