diff --git a/configuration.c b/configuration.c index f8d1714a25..d2712b5d75 100644 --- a/configuration.c +++ b/configuration.c @@ -1947,7 +1947,7 @@ void config_set_defaults(void) for (i = 0; i < MAX_USERS; 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; #else settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_NONE; diff --git a/menu/drivers/ozone/ozone.c b/menu/drivers/ozone/ozone.c index c3a8324c55..1ef225cfd5 100644 --- a/menu/drivers/ozone/ozone.c +++ b/menu/drivers/ozone/ozone.c @@ -295,17 +295,17 @@ static void ozone_free(void *data) 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; if (ozone) { 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)); 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); @@ -423,6 +423,7 @@ static void ozone_context_destroy(void *data) { unsigned i; ozone_handle_t *ozone = (ozone_handle_t*) data; + menu_animation_ctx_tag tag; if (!ozone) return; @@ -458,7 +459,7 @@ static void ozone_context_destroy(void *data) ozone->fonts.entries_sublabel = 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); /* Horizontal list */ @@ -798,6 +799,7 @@ static void ozone_compute_entries_position(ozone_handle_t *ozone) /* Compute entries height and adjust scrolling if needed */ unsigned video_info_height; unsigned video_info_width; + unsigned lines; size_t i, entries_end; 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); - unsigned lines = ozone_count_lines(sublabel_str); + lines = ozone_count_lines(sublabel_str); 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; + int new_depth; + if (!ozone) return; @@ -1374,7 +1378,7 @@ static void ozone_populate_entries(void *data, const char *path, const char *lab 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->depth = new_depth; diff --git a/menu/drivers/ozone/ozone_display.c b/menu/drivers/ozone/ozone_display.c index a435af7d14..a61482cc05 100644 --- a/menu/drivers/ozone/ozone_display.c +++ b/menu/drivers/ozone/ozone_display.c @@ -427,4 +427,4 @@ void ozone_draw_messagebox(ozone_handle_t *ozone, end: string_list_free(list); -} \ No newline at end of file +} diff --git a/menu/drivers/ozone/ozone_display.h b/menu/drivers/ozone/ozone_display.h index 4693a1d856..5e7b82bcbb 100644 --- a/menu/drivers/ozone/ozone_display.h +++ b/menu/drivers/ozone/ozone_display.h @@ -59,4 +59,4 @@ void ozone_draw_osk(ozone_handle_t *ozone, void ozone_draw_messagebox(ozone_handle_t *ozone, video_frame_info_t *video_info, - const char *message); \ No newline at end of file + const char *message); diff --git a/menu/drivers/ozone/ozone_entries.c b/menu/drivers/ozone/ozone_entries.c index bb166168d8..9e842347db 100644 --- a/menu/drivers/ozone/ozone_entries.c +++ b/menu/drivers/ozone/ozone_entries.c @@ -317,4 +317,4 @@ icons_iterate: /* 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_sublabel, video_info); -} \ No newline at end of file +} diff --git a/menu/drivers/ozone/ozone_sidebar.c b/menu/drivers/ozone/ozone_sidebar.c index aeb7c7163b..a6d51dfb40 100644 --- a/menu/drivers/ozone/ozone_sidebar.c +++ b/menu/drivers/ozone/ozone_sidebar.c @@ -295,11 +295,20 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection) { unsigned video_info_height; - video_driver_get_size(NULL, &video_info_height); - 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) { @@ -325,12 +334,12 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection) menu_animation_push(&entry); /* Scroll animation */ - float new_scroll = 0; - float 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; - float bottom_boundary = video_info_height - 87 - 78; - float entries_middle = video_info_height/2; - float entries_height = ozone_get_sidebar_height(ozone); + new_scroll = 0; + selected_position_y = ozone_get_selected_sidebar_y_position(ozone); + current_selection_middle_onscreen = ENTRIES_START_Y - 10 + ozone->animations.scroll_y_sidebar + selected_position_y + 65 / 2; + bottom_boundary = video_info_height - 87 - 78; + entries_middle = video_info_height/2; + entries_height = ozone_get_sidebar_height(ozone); if (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; const char *title; char title_noext[255]; + char *chr; + bool hyphen_found; 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" Remove everything before the hyphen and the subsequent space */ - char *chr = title_noext; - bool hyphen_found = false; + chr = title_noext; + hyphen_found = false; while (true) { @@ -651,4 +662,4 @@ bool ozone_is_playlist(ozone_handle_t *ozone) } return is_playlist && ozone->depth == 1; -} \ No newline at end of file +} diff --git a/menu/drivers/ozone/ozone_sidebar.h b/menu/drivers/ozone/ozone_sidebar.h index 08c5aba2b8..091ace05c0 100644 --- a/menu/drivers/ozone/ozone_sidebar.h +++ b/menu/drivers/ozone/ozone_sidebar.h @@ -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]; -#endif \ No newline at end of file +#endif diff --git a/menu/drivers/ozone/ozone_theme.h b/menu/drivers/ozone/ozone_theme.h index 09425e0dac..375657806b 100644 --- a/menu/drivers/ozone/ozone_theme.h +++ b/menu/drivers/ozone/ozone_theme.h @@ -168,4 +168,4 @@ extern ozone_theme_t *ozone_default_theme; void ozone_set_color_theme(ozone_handle_t *ozone, unsigned color_theme); unsigned ozone_get_system_theme(); -#endif \ No newline at end of file +#endif diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 8560e89234..f6d575538a 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -2713,4 +2713,4 @@ void menu_subsystem_populate(const struct retro_subsystem_info* subsystem, menu_ } } } -} \ No newline at end of file +} diff --git a/switch_performance_profiles.h b/switch_performance_profiles.h index 316e0bc122..15dde6eec7 100644 --- a/switch_performance_profiles.h +++ b/switch_performance_profiles.h @@ -122,4 +122,4 @@ static unsigned SWITCH_CPU_SPEEDS_VALUES[] = { #endif -#endif \ No newline at end of file +#endif