diff --git a/Makefile.common b/Makefile.common index 7f6b5ff3db..71e79ff8b1 100644 --- a/Makefile.common +++ b/Makefile.common @@ -338,8 +338,9 @@ endif endif ifeq ($(HAVE_MENU_COMMON), 1) - OBJ += menu/menu_input.o \ - menu/menu.o \ + OBJ += menu/menu.o \ + menu/menu_hash.o \ + menu/menu_input.o \ menu/menu_entry.o \ menu/menu_entries.o \ menu/menu_navigation.o \ diff --git a/griffin/griffin.c b/griffin/griffin.c index 6031481f33..613b5c8d77 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -710,8 +710,9 @@ PLAYLISTS MENU ============================================================ */ #ifdef HAVE_MENU -#include "../menu/menu_input.c" #include "../menu/menu.c" +#include "../menu/menu_hash.c" +#include "../menu/menu_input.c" #include "../menu/menu_entry.c" #include "../menu/menu_entries.c" #include "../menu/menu_setting.c" diff --git a/menu/menu_hash.c b/menu/menu_hash.c new file mode 100644 index 0000000000..6a66703da3 --- /dev/null +++ b/menu/menu_hash.c @@ -0,0 +1,30 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2015 - Daniel De Matteis + * + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include + +#include "menu_hash.h" + +const char *menu_hash_to_str(uint32_t hash) +{ + switch (hash) + { + case MENU_VALUE_MAIN_MENU: + return "Main Menu"; + } + + return "null"; +} diff --git a/menu/menu_hash.h b/menu/menu_hash.h index 9cf44ebede..1d93d3b78e 100644 --- a/menu/menu_hash.h +++ b/menu/menu_hash.h @@ -360,6 +360,8 @@ extern "C" { #define MENU_LABEL_EXIT_EMULATOR 0x86d5d467U #define MENU_LABEL_COLLECTION 0x5fea5991U +const char *menu_hash_to_str(uint32_t hash); + #ifdef __cplusplus } #endif diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 6c7ca0a15a..32135cc3f5 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -3502,10 +3502,11 @@ static bool setting_append_list_main_menu_options( { rarch_setting_group_info_t group_info = {0}; rarch_setting_group_info_t subgroup_info = {0}; - settings_t *settings = config_get_ptr(); - global_t *global = global_get_ptr(); + settings_t *settings = config_get_ptr(); + global_t *global = global_get_ptr(); + const char *main_menu = menu_hash_to_str(MENU_VALUE_MAIN_MENU); - START_GROUP(group_info, "Main Menu", parent_group); + START_GROUP(group_info,main_menu, parent_group); START_SUB_GROUP(list, list_info, "State", group_info.name, subgroup_info, parent_group); #if defined(HAVE_DYNAMIC) || defined(HAVE_LIBRETRO_MANAGEMENT) @@ -7110,6 +7111,7 @@ rarch_setting_t *menu_setting_new(unsigned mask) rarch_setting_t* resized_list = NULL; rarch_setting_info_t *list_info = (rarch_setting_info_t*) calloc(1, sizeof(*list_info)); + const char *root = menu_hash_to_str(MENU_VALUE_MAIN_MENU); if (!list_info) return NULL; @@ -7121,55 +7123,55 @@ rarch_setting_t *menu_setting_new(unsigned mask) if (mask & SL_FLAG_MAIN_MENU) { - if (!setting_append_list_main_menu_options(&list, list_info, "Main Menu", mask)) + if (!setting_append_list_main_menu_options(&list, list_info, root, mask)) goto error; } if (mask & SL_FLAG_DRIVER_OPTIONS) { - if (!setting_append_list_driver_options(&list, list_info, "Main Menu")) + if (!setting_append_list_driver_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_CORE_OPTIONS) { - if (!setting_append_list_core_options(&list, list_info, "Main Menu")) + if (!setting_append_list_core_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_CONFIGURATION_OPTIONS) { - if (!setting_append_list_configuration_options(&list, list_info, "Main Menu")) + if (!setting_append_list_configuration_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_LOGGING_OPTIONS) { - if (!setting_append_list_logging_options(&list, list_info, "Main Menu")) + if (!setting_append_list_logging_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_SAVING_OPTIONS) { - if (!setting_append_list_saving_options(&list, list_info, "Main Menu")) + if (!setting_append_list_saving_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_REWIND_OPTIONS) { - if (!setting_append_list_rewind_options(&list, list_info, "Main Menu")) + if (!setting_append_list_rewind_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_VIDEO_OPTIONS) { - if (!setting_append_list_video_options(&list, list_info, "Main Menu")) + if (!setting_append_list_video_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_AUDIO_OPTIONS) { - if (!setting_append_list_audio_options(&list, list_info, "Main Menu")) + if (!setting_append_list_audio_options(&list, list_info, root)) goto error; } @@ -7178,110 +7180,110 @@ rarch_setting_t *menu_setting_new(unsigned mask) unsigned user; settings_t *settings = config_get_ptr(); - if (!setting_append_list_input_options(&list, list_info, "Main Menu")) + if (!setting_append_list_input_options(&list, list_info, root)) goto error; for (user = 0; user < settings->input.max_users; user++) - setting_append_list_input_player_options(&list, list_info, "Main Menu", user); + setting_append_list_input_player_options(&list, list_info, root, user); } if (mask & SL_FLAG_INPUT_HOTKEY_OPTIONS) { - if (!setting_append_list_input_hotkey_options(&list, list_info, "Main Menu")) + if (!setting_append_list_input_hotkey_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_RECORDING_OPTIONS) { - if (!setting_append_list_recording_options(&list, list_info, "Main Menu")) + if (!setting_append_list_recording_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_FRAME_THROTTLE_OPTIONS) { - if (!setting_append_list_frame_throttling_options(&list, list_info, "Main Menu")) + if (!setting_append_list_frame_throttling_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_FONT_OPTIONS) { - if (!setting_append_list_font_options(&list, list_info, "Main Menu")) + if (!setting_append_list_font_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_OVERLAY_OPTIONS) { - if (!setting_append_list_overlay_options(&list, list_info, "Main Menu")) + if (!setting_append_list_overlay_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_OSK_OVERLAY_OPTIONS) { - if (!setting_append_list_osk_overlay_options(&list, list_info, "Main Menu")) + if (!setting_append_list_osk_overlay_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_MENU_OPTIONS) { - if (!setting_append_list_menu_options(&list, list_info, "Main Menu")) + if (!setting_append_list_menu_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_UI_OPTIONS) { - if (!setting_append_list_ui_options(&list, list_info, "Main Menu")) + if (!setting_append_list_ui_options(&list, list_info, root)) goto error; } #if 0 if (mask & SL_FLAG_PATCH_OPTIONS) { - if (!setting_append_list_patch_options(&list, list_info, "Main Menu")) + if (!setting_append_list_patch_options(&list, list_info, root)) goto error; } #endif if (mask & SL_FLAG_PLAYLIST_OPTIONS) { - if (!setting_append_list_playlist_options(&list, list_info, "Main Menu")) + if (!setting_append_list_playlist_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_CORE_UPDATER_OPTIONS) { - if (!setting_append_list_core_updater_options(&list, list_info, "Main Menu")) + if (!setting_append_list_core_updater_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_NETPLAY_OPTIONS) { - if (!setting_append_list_netplay_options(&list, list_info, "Main Menu")) + if (!setting_append_list_netplay_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_ARCHIVE_OPTIONS) { - if (!setting_append_list_archive_options(&list, list_info, "Main Menu")) + if (!setting_append_list_archive_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_USER_OPTIONS) { - if (!setting_append_list_user_options(&list, list_info, "Main Menu")) + if (!setting_append_list_user_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_DIRECTORY_OPTIONS) { - if (!setting_append_list_directory_options(&list, list_info, "Main Menu")) + if (!setting_append_list_directory_options(&list, list_info, root)) goto error; } if (mask & SL_FLAG_PRIVACY_OPTIONS) { - if (!setting_append_list_privacy_options(&list, list_info, "Main Menu")) + if (!setting_append_list_privacy_options(&list, list_info, root)) goto error; }