mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Don't use return value of menu_entries_get_title
This commit is contained in:
parent
f07e990c0c
commit
ffe1ee4636
@ -1048,13 +1048,16 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
|
|||||||
|
|
||||||
static void ozone_draw_footer(ozone_handle_t *ozone, video_frame_info_t *video_info, settings_t *settings)
|
static void ozone_draw_footer(ozone_handle_t *ozone, video_frame_info_t *video_info, settings_t *settings)
|
||||||
{
|
{
|
||||||
char core_title[255];
|
|
||||||
/* Separator */
|
/* Separator */
|
||||||
menu_display_draw_quad(video_info, 23, video_info->height - ozone->dimensions.footer_height, video_info->width - 60, 1, video_info->width, video_info->height, ozone->theme->header_footer_separator);
|
menu_display_draw_quad(video_info, 23, video_info->height - ozone->dimensions.footer_height, video_info->width - 60, 1, video_info->width, video_info->height, ozone->theme->header_footer_separator);
|
||||||
|
|
||||||
/* Core title or Switch icon */
|
/* Core title or Switch icon */
|
||||||
if (settings->bools.menu_core_enable && menu_entries_get_core_title(core_title, sizeof(core_title)) == 0)
|
if (settings->bools.menu_core_enable)
|
||||||
|
{
|
||||||
|
char core_title[255];
|
||||||
|
menu_entries_get_core_title(core_title, sizeof(core_title));
|
||||||
ozone_draw_text(video_info, ozone, core_title, 59, video_info->height - ozone->dimensions.footer_height / 2 + FONT_SIZE_FOOTER * 3/8, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
|
ozone_draw_text(video_info, ozone, core_title, 59, video_info->height - ozone->dimensions.footer_height / 2 + FONT_SIZE_FOOTER * 3/8, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ozone_draw_icon(video_info, 69, 30, ozone->theme->textures[OZONE_THEME_TEXTURE_SWITCH], 59, video_info->height - ozone->dimensions.footer_height / 2 - 15, video_info->width,video_info->height, 0, 1, NULL);
|
ozone_draw_icon(video_info, 69, 30, ozone->theme->textures[OZONE_THEME_TEXTURE_SWITCH], 59, video_info->height - ozone->dimensions.footer_height / 2 - 15, video_info->width,video_info->height, 0, 1, NULL);
|
||||||
|
|
||||||
|
@ -3541,21 +3541,20 @@ static void rgui_render(void *data, bool is_idle)
|
|||||||
char core_title_buf[64];
|
char core_title_buf[64];
|
||||||
core_title[0] = core_title_buf[0] = '\0';
|
core_title[0] = core_title_buf[0] = '\0';
|
||||||
|
|
||||||
if (menu_entries_get_core_title(core_title, sizeof(core_title)) == 0)
|
menu_entries_get_core_title(core_title, sizeof(core_title));
|
||||||
{
|
|
||||||
ticker.s = core_title_buf;
|
|
||||||
ticker.len = core_name_len;
|
|
||||||
ticker.str = core_title;
|
|
||||||
ticker.selected = true;
|
|
||||||
|
|
||||||
menu_animation_ticker(&ticker);
|
ticker.s = core_title_buf;
|
||||||
|
ticker.len = core_name_len;
|
||||||
|
ticker.str = core_title;
|
||||||
|
ticker.selected = true;
|
||||||
|
|
||||||
blit_line(
|
menu_animation_ticker(&ticker);
|
||||||
RGUI_TERM_START_X(fb_width) + FONT_WIDTH_STRIDE,
|
|
||||||
(RGUI_TERM_HEIGHT(fb_height) * FONT_HEIGHT_STRIDE) +
|
blit_line(
|
||||||
RGUI_TERM_START_Y(fb_height) + 2, core_title_buf,
|
RGUI_TERM_START_X(fb_width) + FONT_WIDTH_STRIDE,
|
||||||
rgui->colors.hover_color, rgui->colors.shadow_color);
|
(RGUI_TERM_HEIGHT(fb_height) * FONT_HEIGHT_STRIDE) +
|
||||||
}
|
RGUI_TERM_START_Y(fb_height) + 2, core_title_buf,
|
||||||
|
rgui->colors.hover_color, rgui->colors.shadow_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print clock (if required) */
|
/* Print clock (if required) */
|
||||||
|
@ -3370,11 +3370,13 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
|||||||
1, 1, TEXT_ALIGN_LEFT,
|
1, 1, TEXT_ALIGN_LEFT,
|
||||||
width, height, xmb->font);
|
width, height, xmb->font);
|
||||||
|
|
||||||
if (settings->bools.menu_core_enable &&
|
if (settings->bools.menu_core_enable)
|
||||||
menu_entries_get_core_title(title_msg, sizeof(title_msg)) == 0)
|
{
|
||||||
|
menu_entries_get_core_title(title_msg, sizeof(title_msg));
|
||||||
xmb_draw_text(video_info, xmb, title_msg, xmb->margins_title_left,
|
xmb_draw_text(video_info, xmb, title_msg, xmb->margins_title_left,
|
||||||
height - xmb->margins_title_bottom, 1, 1, TEXT_ALIGN_LEFT,
|
height - xmb->margins_title_bottom, 1, 1, TEXT_ALIGN_LEFT,
|
||||||
width, height, xmb->font);
|
width, height, xmb->font);
|
||||||
|
}
|
||||||
|
|
||||||
rotate_draw.matrix = &mymat;
|
rotate_draw.matrix = &mymat;
|
||||||
rotate_draw.rotation = 0;
|
rotate_draw.rotation = 0;
|
||||||
|
@ -166,12 +166,9 @@ HRESULT CRetroArchMain::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
|||||||
{
|
{
|
||||||
char str[PATH_MAX_LENGTH] = {0};
|
char str[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
if (
|
menu_entries_get_core_title(str, sizeof(str));
|
||||||
menu_entries_get_core_title(str, sizeof(str)) == 0)
|
mbstowcs(strw_buffer, str, sizeof(strw_buffer) / sizeof(wchar_t));
|
||||||
{
|
XuiTextElementSetText(m_menutitlebottom, strw_buffer);
|
||||||
mbstowcs(strw_buffer, str, sizeof(strw_buffer) / sizeof(wchar_t));
|
|
||||||
XuiTextElementSetText(m_menutitlebottom, strw_buffer);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -578,12 +575,9 @@ static void xui_render(void *data, bool is_idle)
|
|||||||
|
|
||||||
if (XuiHandleIsValid(m_menutitle))
|
if (XuiHandleIsValid(m_menutitle))
|
||||||
{
|
{
|
||||||
if (
|
menu_entries_get_core_title(title, sizeof(title));
|
||||||
menu_entries_get_core_title(title, sizeof(title)) == 0)
|
mbstowcs(strw_buffer, title, sizeof(strw_buffer) / sizeof(wchar_t));
|
||||||
{
|
XuiTextElementSetText(m_menutitlebottom, strw_buffer);
|
||||||
mbstowcs(strw_buffer, title, sizeof(strw_buffer) / sizeof(wchar_t));
|
|
||||||
XuiTextElementSetText(m_menutitlebottom, strw_buffer);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
end = menu_entries_get_size();
|
end = menu_entries_get_size();
|
||||||
|
@ -915,37 +915,32 @@ int menu_entries_get_title(char *s, size_t len)
|
|||||||
int menu_entries_get_core_title(char *s, size_t len)
|
int menu_entries_get_core_title(char *s, size_t len)
|
||||||
{
|
{
|
||||||
struct retro_system_info *system = runloop_get_libretro_system_info();
|
struct retro_system_info *system = runloop_get_libretro_system_info();
|
||||||
const char *core_name = system ? system->library_name : NULL;
|
const char *core_name = system ? system->library_name : msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);
|
||||||
const char *core_version = system ? system->library_version : NULL;
|
const char *core_version = system ? system->library_version : "";
|
||||||
#if _MSC_VER == 1200
|
#if _MSC_VER == 1200
|
||||||
const char *extra_version = " msvc6";
|
const char *extra_version = " msvc6";
|
||||||
#elif _MSC_VER == 1300
|
#elif _MSC_VER == 1300
|
||||||
const char *extra_version = " msvc2002";
|
const char *extra_version = " msvc2002";
|
||||||
#elif _MSC_VER == 1310
|
#elif _MSC_VER == 1310
|
||||||
const char *extra_version = " msvc2003";
|
const char *extra_version = " msvc2003";
|
||||||
#elif _MSC_VER == 1400
|
#elif _MSC_VER == 1400
|
||||||
const char *extra_version = " msvc2005";
|
const char *extra_version = " msvc2005";
|
||||||
#elif _MSC_VER == 1500
|
#elif _MSC_VER == 1500
|
||||||
const char *extra_version = " msvc2008";
|
const char *extra_version = " msvc2008";
|
||||||
#elif _MSC_VER == 1600
|
#elif _MSC_VER == 1600
|
||||||
const char *extra_version = " msvc2010";
|
const char *extra_version = " msvc2010";
|
||||||
#elif _MSC_VER == 1700
|
#elif _MSC_VER == 1700
|
||||||
const char *extra_version = " msvc2012";
|
const char *extra_version = " msvc2012";
|
||||||
#elif _MSC_VER == 1800
|
#elif _MSC_VER == 1800
|
||||||
const char *extra_version = " msvc2013";
|
const char *extra_version = " msvc2013";
|
||||||
#elif _MSC_VER == 1900
|
#elif _MSC_VER == 1900
|
||||||
const char *extra_version = " msvc2015";
|
const char *extra_version = " msvc2015";
|
||||||
#elif _MSC_VER >= 1910 && _MSC_VER < 2000
|
#elif _MSC_VER >= 1910 && _MSC_VER < 2000
|
||||||
const char *extra_version = " msvc2017";
|
const char *extra_version = " msvc2017";
|
||||||
#else
|
#else
|
||||||
const char *extra_version = "";
|
const char *extra_version = "";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (string_is_empty(core_name))
|
|
||||||
core_name = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);
|
|
||||||
if (!core_version)
|
|
||||||
core_version = "";
|
|
||||||
|
|
||||||
snprintf(s, len, "%s%s - %s %s", PACKAGE_VERSION, extra_version,
|
snprintf(s, len, "%s%s - %s %s", PACKAGE_VERSION, extra_version,
|
||||||
core_name, core_version);
|
core_name, core_version);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user