Fix c89 build with clang.
This commit is contained in:
parent
c0ea6e7574
commit
6e95a62fdf
|
@ -1947,7 +1947,7 @@ void config_set_defaults(void)
|
||||||
for (i = 0; i < MAX_USERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
settings->uints.input_joypad_map[i] = i;
|
settings->uints.input_joypad_map[i] = i;
|
||||||
#ifdef SWITCH // Switch prefered default dpad mode
|
#ifdef SWITCH /* Switch prefered default dpad mode */
|
||||||
settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_LSTICK;
|
settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_LSTICK;
|
||||||
#else
|
#else
|
||||||
settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_NONE;
|
settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_NONE;
|
||||||
|
|
|
@ -295,17 +295,17 @@ static void ozone_free(void *data)
|
||||||
|
|
||||||
static void ozone_context_reset(void *data, bool is_threaded)
|
static void ozone_context_reset(void *data, bool is_threaded)
|
||||||
{
|
{
|
||||||
|
/* Fonts init */
|
||||||
|
unsigned i;
|
||||||
|
unsigned size;
|
||||||
|
char font_path[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
ozone_handle_t *ozone = (ozone_handle_t*) data;
|
ozone_handle_t *ozone = (ozone_handle_t*) data;
|
||||||
|
|
||||||
if (ozone)
|
if (ozone)
|
||||||
{
|
{
|
||||||
ozone->has_all_assets = true;
|
ozone->has_all_assets = true;
|
||||||
|
|
||||||
/* Fonts init */
|
|
||||||
unsigned i;
|
|
||||||
unsigned size;
|
|
||||||
char font_path[PATH_MAX_LENGTH];
|
|
||||||
|
|
||||||
fill_pathname_join(font_path, ozone->assets_path, "regular.ttf", sizeof(font_path));
|
fill_pathname_join(font_path, ozone->assets_path, "regular.ttf", sizeof(font_path));
|
||||||
ozone->fonts.footer = menu_display_font_file(font_path, FONT_SIZE_FOOTER, is_threaded);
|
ozone->fonts.footer = menu_display_font_file(font_path, FONT_SIZE_FOOTER, is_threaded);
|
||||||
ozone->fonts.entries_label = menu_display_font_file(font_path, FONT_SIZE_ENTRIES_LABEL, is_threaded);
|
ozone->fonts.entries_label = menu_display_font_file(font_path, FONT_SIZE_ENTRIES_LABEL, is_threaded);
|
||||||
|
@ -423,6 +423,7 @@ static void ozone_context_destroy(void *data)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
ozone_handle_t *ozone = (ozone_handle_t*) data;
|
ozone_handle_t *ozone = (ozone_handle_t*) data;
|
||||||
|
menu_animation_ctx_tag tag;
|
||||||
|
|
||||||
if (!ozone)
|
if (!ozone)
|
||||||
return;
|
return;
|
||||||
|
@ -458,7 +459,7 @@ static void ozone_context_destroy(void *data)
|
||||||
ozone->fonts.entries_sublabel = NULL;
|
ozone->fonts.entries_sublabel = NULL;
|
||||||
ozone->fonts.sidebar = NULL;
|
ozone->fonts.sidebar = NULL;
|
||||||
|
|
||||||
menu_animation_ctx_tag tag = (uintptr_t) &ozone_default_theme;
|
tag = (uintptr_t) &ozone_default_theme;
|
||||||
menu_animation_kill_by_tag(&tag);
|
menu_animation_kill_by_tag(&tag);
|
||||||
|
|
||||||
/* Horizontal list */
|
/* Horizontal list */
|
||||||
|
@ -798,6 +799,7 @@ static void ozone_compute_entries_position(ozone_handle_t *ozone)
|
||||||
/* Compute entries height and adjust scrolling if needed */
|
/* Compute entries height and adjust scrolling if needed */
|
||||||
unsigned video_info_height;
|
unsigned video_info_height;
|
||||||
unsigned video_info_width;
|
unsigned video_info_width;
|
||||||
|
unsigned lines;
|
||||||
size_t i, entries_end;
|
size_t i, entries_end;
|
||||||
file_list_t *selection_buf = NULL;
|
file_list_t *selection_buf = NULL;
|
||||||
|
|
||||||
|
@ -847,7 +849,7 @@ static void ozone_compute_entries_position(ozone_handle_t *ozone)
|
||||||
|
|
||||||
word_wrap(sublabel_str, sublabel_str, (video_info_width - 548) / ozone->sublabel_font_glyph_width, false);
|
word_wrap(sublabel_str, sublabel_str, (video_info_width - 548) / ozone->sublabel_font_glyph_width, false);
|
||||||
|
|
||||||
unsigned lines = ozone_count_lines(sublabel_str);
|
lines = ozone_count_lines(sublabel_str);
|
||||||
|
|
||||||
if (lines > 1)
|
if (lines > 1)
|
||||||
{
|
{
|
||||||
|
@ -1358,6 +1360,8 @@ static void ozone_populate_entries(void *data, const char *path, const char *lab
|
||||||
{
|
{
|
||||||
ozone_handle_t *ozone = (ozone_handle_t*) data;
|
ozone_handle_t *ozone = (ozone_handle_t*) data;
|
||||||
|
|
||||||
|
int new_depth;
|
||||||
|
|
||||||
if (!ozone)
|
if (!ozone)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1374,7 +1378,7 @@ static void ozone_populate_entries(void *data, const char *path, const char *lab
|
||||||
|
|
||||||
ozone->need_compute = true;
|
ozone->need_compute = true;
|
||||||
|
|
||||||
int new_depth = (int)ozone_list_get_size(ozone, MENU_LIST_PLAIN);
|
new_depth = (int)ozone_list_get_size(ozone, MENU_LIST_PLAIN);
|
||||||
|
|
||||||
ozone->fade_direction = new_depth <= ozone->depth;
|
ozone->fade_direction = new_depth <= ozone->depth;
|
||||||
ozone->depth = new_depth;
|
ozone->depth = new_depth;
|
||||||
|
|
|
@ -427,4 +427,4 @@ void ozone_draw_messagebox(ozone_handle_t *ozone,
|
||||||
|
|
||||||
end:
|
end:
|
||||||
string_list_free(list);
|
string_list_free(list);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,4 +59,4 @@ void ozone_draw_osk(ozone_handle_t *ozone,
|
||||||
|
|
||||||
void ozone_draw_messagebox(ozone_handle_t *ozone,
|
void ozone_draw_messagebox(ozone_handle_t *ozone,
|
||||||
video_frame_info_t *video_info,
|
video_frame_info_t *video_info,
|
||||||
const char *message);
|
const char *message);
|
||||||
|
|
|
@ -317,4 +317,4 @@ icons_iterate:
|
||||||
/* Text layer */
|
/* Text layer */
|
||||||
font_driver_flush(video_info->width, video_info->height, ozone->fonts.entries_label, video_info);
|
font_driver_flush(video_info->width, video_info->height, ozone->fonts.entries_label, video_info);
|
||||||
font_driver_flush(video_info->width, video_info->height, ozone->fonts.entries_sublabel, video_info);
|
font_driver_flush(video_info->width, video_info->height, ozone->fonts.entries_sublabel, video_info);
|
||||||
}
|
}
|
||||||
|
|
|
@ -295,11 +295,20 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
|
||||||
{
|
{
|
||||||
unsigned video_info_height;
|
unsigned video_info_height;
|
||||||
|
|
||||||
video_driver_get_size(NULL, &video_info_height);
|
|
||||||
|
|
||||||
struct menu_animation_ctx_entry entry;
|
struct menu_animation_ctx_entry entry;
|
||||||
|
|
||||||
menu_animation_ctx_tag tag = (uintptr_t)ozone;
|
menu_animation_ctx_tag tag;
|
||||||
|
|
||||||
|
float new_scroll;
|
||||||
|
float selected_position_y;
|
||||||
|
float current_selection_middle_onscreen;
|
||||||
|
float bottom_boundary;
|
||||||
|
float entries_middle;
|
||||||
|
float entries_height;
|
||||||
|
|
||||||
|
video_driver_get_size(NULL, &video_info_height);
|
||||||
|
|
||||||
|
tag = (uintptr_t)ozone;
|
||||||
|
|
||||||
if (ozone->categories_selection_ptr != new_selection)
|
if (ozone->categories_selection_ptr != new_selection)
|
||||||
{
|
{
|
||||||
|
@ -325,12 +334,12 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
|
||||||
menu_animation_push(&entry);
|
menu_animation_push(&entry);
|
||||||
|
|
||||||
/* Scroll animation */
|
/* Scroll animation */
|
||||||
float new_scroll = 0;
|
new_scroll = 0;
|
||||||
float selected_position_y = ozone_get_selected_sidebar_y_position(ozone);
|
selected_position_y = ozone_get_selected_sidebar_y_position(ozone);
|
||||||
float current_selection_middle_onscreen = ENTRIES_START_Y - 10 + ozone->animations.scroll_y_sidebar + selected_position_y + 65 / 2;
|
current_selection_middle_onscreen = ENTRIES_START_Y - 10 + ozone->animations.scroll_y_sidebar + selected_position_y + 65 / 2;
|
||||||
float bottom_boundary = video_info_height - 87 - 78;
|
bottom_boundary = video_info_height - 87 - 78;
|
||||||
float entries_middle = video_info_height/2;
|
entries_middle = video_info_height/2;
|
||||||
float entries_height = ozone_get_sidebar_height(ozone);
|
entries_height = ozone_get_sidebar_height(ozone);
|
||||||
|
|
||||||
if (current_selection_middle_onscreen != entries_middle)
|
if (current_selection_middle_onscreen != entries_middle)
|
||||||
new_scroll = ozone->animations.scroll_y_sidebar - (current_selection_middle_onscreen - entries_middle);
|
new_scroll = ozone->animations.scroll_y_sidebar - (current_selection_middle_onscreen - entries_middle);
|
||||||
|
@ -456,6 +465,8 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
||||||
unsigned i;
|
unsigned i;
|
||||||
const char *title;
|
const char *title;
|
||||||
char title_noext[255];
|
char title_noext[255];
|
||||||
|
char *chr;
|
||||||
|
bool hyphen_found;
|
||||||
|
|
||||||
size_t list_size = ozone_list_get_size(ozone, MENU_LIST_HORIZONTAL);
|
size_t list_size = ozone_list_get_size(ozone, MENU_LIST_HORIZONTAL);
|
||||||
|
|
||||||
|
@ -567,8 +578,8 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
||||||
/* Format : "Vendor - Console"
|
/* Format : "Vendor - Console"
|
||||||
Remove everything before the hyphen
|
Remove everything before the hyphen
|
||||||
and the subsequent space */
|
and the subsequent space */
|
||||||
char *chr = title_noext;
|
chr = title_noext;
|
||||||
bool hyphen_found = false;
|
hyphen_found = false;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
@ -651,4 +662,4 @@ bool ozone_is_playlist(ozone_handle_t *ozone)
|
||||||
}
|
}
|
||||||
|
|
||||||
return is_playlist && ozone->depth == 1;
|
return is_playlist && ozone->depth == 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,4 +52,4 @@ extern enum msg_hash_enums ozone_system_tabs_idx[OZONE_SYSTEM_TAB_LAST];
|
||||||
|
|
||||||
extern unsigned ozone_system_tabs_icons[OZONE_SYSTEM_TAB_LAST];
|
extern unsigned ozone_system_tabs_icons[OZONE_SYSTEM_TAB_LAST];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -168,4 +168,4 @@ extern ozone_theme_t *ozone_default_theme;
|
||||||
void ozone_set_color_theme(ozone_handle_t *ozone, unsigned color_theme);
|
void ozone_set_color_theme(ozone_handle_t *ozone, unsigned color_theme);
|
||||||
unsigned ozone_get_system_theme();
|
unsigned ozone_get_system_theme();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2713,4 +2713,4 @@ void menu_subsystem_populate(const struct retro_subsystem_info* subsystem, menu_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,4 +122,4 @@ static unsigned SWITCH_CPU_SPEEDS_VALUES[] = {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue