mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Add some MENU_DISPLAY_CTL_* enums
This commit is contained in:
parent
113791fb0f
commit
e3a7a67e43
@ -214,12 +214,13 @@ static bool init_font(menu_handle_t *menu, const uint8_t *font_bmp_buf)
|
|||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
uint8_t *font = (uint8_t *) calloc(1, FONT_OFFSET(256));
|
uint8_t *font = (uint8_t *) calloc(1, FONT_OFFSET(256));
|
||||||
|
bool fb_font_inited = true;
|
||||||
menu_display_t *disp = menu_display_get_ptr();
|
menu_display_t *disp = menu_display_get_ptr();
|
||||||
|
|
||||||
if (!font)
|
if (!font)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
disp->font.alloc_framebuf = true;
|
menu_display_ctl(MENU_DISPLAY_CTL_SET_FONT_FB_DATA_INIT, &fb_font_inited);
|
||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
{
|
{
|
||||||
@ -708,6 +709,7 @@ error:
|
|||||||
|
|
||||||
static void rgui_free(void *data)
|
static void rgui_free(void *data)
|
||||||
{
|
{
|
||||||
|
bool fb_font_inited = false;
|
||||||
menu_handle_t *menu = (menu_handle_t*)data;
|
menu_handle_t *menu = (menu_handle_t*)data;
|
||||||
menu_display_t *disp = menu_display_get_ptr();
|
menu_display_t *disp = menu_display_get_ptr();
|
||||||
|
|
||||||
@ -718,9 +720,14 @@ static void rgui_free(void *data)
|
|||||||
free(menu->userdata);
|
free(menu->userdata);
|
||||||
menu->userdata = NULL;
|
menu->userdata = NULL;
|
||||||
|
|
||||||
if (disp->font.alloc_framebuf)
|
menu_display_ctl(MENU_DISPLAY_CTL_FONT_FB_DATA_INIT, &fb_font_inited);
|
||||||
|
|
||||||
|
if (fb_font_inited)
|
||||||
free((uint8_t*)disp->font.framebuf);
|
free((uint8_t*)disp->font.framebuf);
|
||||||
disp->font.alloc_framebuf = false;
|
|
||||||
|
fb_font_inited = false;
|
||||||
|
|
||||||
|
menu_display_ctl(MENU_DISPLAY_CTL_SET_FONT_FB_DATA_INIT, &fb_font_inited);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rgui_set_texture(void)
|
static void rgui_set_texture(void)
|
||||||
|
@ -286,6 +286,22 @@ bool menu_display_ctl(enum menu_display_ctl_state state, void *data)
|
|||||||
frame_buf->pitch = *ptr;
|
frame_buf->pitch = *ptr;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
case MENU_DISPLAY_CTL_FONT_FB_DATA_INIT:
|
||||||
|
{
|
||||||
|
bool *ptr = (bool*)data;
|
||||||
|
if (!ptr)
|
||||||
|
return false;
|
||||||
|
*ptr = disp->font.alloc_framebuf;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
case MENU_DISPLAY_CTL_SET_FONT_FB_DATA_INIT:
|
||||||
|
{
|
||||||
|
bool *ptr = (bool*)data;
|
||||||
|
if (!ptr)
|
||||||
|
return false;
|
||||||
|
disp->font.alloc_framebuf = *ptr;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
case MENU_DISPLAY_CTL_UPDATE_PENDING:
|
case MENU_DISPLAY_CTL_UPDATE_PENDING:
|
||||||
if (menu_animation_ctl(MENU_ANIMATION_CTL_IS_ACTIVE, NULL) || (frame_buf && frame_buf->dirty))
|
if (menu_animation_ctl(MENU_ANIMATION_CTL_IS_ACTIVE, NULL) || (frame_buf && frame_buf->dirty))
|
||||||
return true;
|
return true;
|
||||||
|
@ -46,7 +46,9 @@ enum menu_display_ctl_state
|
|||||||
MENU_DISPLAY_CTL_SET_FB_DATA,
|
MENU_DISPLAY_CTL_SET_FB_DATA,
|
||||||
MENU_DISPLAY_CTL_FB_PITCH,
|
MENU_DISPLAY_CTL_FB_PITCH,
|
||||||
MENU_DISPLAY_CTL_SET_FB_PITCH,
|
MENU_DISPLAY_CTL_SET_FB_PITCH,
|
||||||
MENU_DISPLAY_CTL_LIBRETRO
|
MENU_DISPLAY_CTL_LIBRETRO,
|
||||||
|
MENU_DISPLAY_CTL_FONT_FB_DATA_INIT,
|
||||||
|
MENU_DISPLAY_CTL_SET_FONT_FB_DATA_INIT
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct menu_display
|
typedef struct menu_display
|
||||||
|
Loading…
x
Reference in New Issue
Block a user