mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
Rewrite populate_settings_bool
This commit is contained in:
parent
ae3d9bc0aa
commit
a414f4093f
221
configuration.c
221
configuration.c
@ -1279,137 +1279,148 @@ static void config_get_hex_base(config_file_t *conf, const char *key, unsigned *
|
||||
}
|
||||
#endif
|
||||
|
||||
#define SETTING_BOOL(key, configval) \
|
||||
{ \
|
||||
if (count == 0) \
|
||||
tmp = (struct config_bool_setting_ptr*)malloc(sizeof(struct config_bool_setting_ptr) * (count + 1)); \
|
||||
else \
|
||||
tmp = (struct config_bool_setting_ptr*)realloc(tmp, sizeof(struct config_bool_setting_ptr) * (count + 1)); \
|
||||
tmp[count].ident = key; \
|
||||
tmp[count].ptr = configval; \
|
||||
count++; \
|
||||
}
|
||||
|
||||
static int populate_settings_bool(settings_t *settings, struct config_bool_setting_ptr *out)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
struct config_bool_setting_ptr tmp[] = {
|
||||
{ "ui_companion_start_on_boot", &settings->ui.companion_start_on_boot},
|
||||
{ "ui_companion_enable", &settings->ui.companion_enable},
|
||||
{ "video_gpu_record", &settings->video.gpu_record},
|
||||
{ "input_remap_binds_enable", &settings->input.remap_binds_enable},
|
||||
{ "back_as_menu_toggle_enable", &settings->input.back_as_menu_toggle_enable},
|
||||
{ "netplay_client_swap_input", &settings->input.netplay_client_swap_input},
|
||||
{ "input_descriptor_label_show", &settings->input.input_descriptor_label_show},
|
||||
{ "input_descriptor_hide_unbound",&settings->input.input_descriptor_hide_unbound},
|
||||
{ "load_dummy_on_core_shutdown", &settings->load_dummy_on_core_shutdown},
|
||||
{ "builtin_mediaplayer_enable", &settings->multimedia.builtin_mediaplayer_enable},
|
||||
{ "builtin_imageviewer_enable", &settings->multimedia.builtin_imageviewer_enable},
|
||||
{ "fps_show", &settings->fps_show},
|
||||
{ "ui_menubar_enable", &settings->ui.menubar_enable},
|
||||
{ "suspend_screensaver_enable", &settings->ui.suspend_screensaver_enable},
|
||||
{ "rewind_enable", &settings->rewind_enable},
|
||||
{ "audio_sync", &settings->audio.sync},
|
||||
{ "video_shader_enable", &settings->video.shader_enable},
|
||||
{ "video_aspect_ratio_auto", &settings->video.aspect_ratio_auto},
|
||||
{ "video_allow_rotate", &settings->video.allow_rotate},
|
||||
{ "video_windowed_fullscreen", &settings->video.windowed_fullscreen},
|
||||
{ "video_crop_overscan", &settings->video.crop_overscan},
|
||||
{ "video_scale_integer", &settings->video.scale_integer},
|
||||
{ "video_smooth", &settings->video.smooth},
|
||||
{ "video_force_aspect", &settings->video.force_aspect},
|
||||
{ "video_threaded", &settings->video.threaded},
|
||||
{ "video_shared_context", &settings->video.shared_context},
|
||||
{ "custom_bgm_enable", &global->console.sound.system_bgm_enable},
|
||||
{ "auto_screenshot_filename", &settings->auto_screenshot_filename},
|
||||
{ "video_force_srgb_disable", &settings->video.force_srgb_disable},
|
||||
{ "video_fullscreen", &settings->video.fullscreen},
|
||||
{ "bundle_assets_extract_enable", &settings->bundle_assets_extract_enable},
|
||||
{ "video_vsync", &settings->video.vsync},
|
||||
{ "video_hard_sync", &settings->video.hard_sync},
|
||||
{ "video_black_frame_insertion", &settings->video.black_frame_insertion},
|
||||
{ "video_disable_composition", &settings->video.disable_composition},
|
||||
{ "pause_nonactive", &settings->pause_nonactive},
|
||||
{ "debug_panel_enable", &settings->debug_panel_enable},
|
||||
{ "video_gpu_screenshot", &settings->video.gpu_screenshot},
|
||||
{ "video_post_filter_record", &settings->video.post_filter_record },
|
||||
{ "keyboard_gamepad_enable", &settings->input.keyboard_gamepad_enable},
|
||||
{ "core_set_supports_no_game_enable", &settings->set_supports_no_game_enable},
|
||||
{ "audio_enable", &settings->audio.enable},
|
||||
{ "audio_mute_enable", &settings->audio.mute_enable},
|
||||
{ "location_allow", &settings->location.allow},
|
||||
{ "video_font_enable", &settings->video.font_enable},
|
||||
{ "core_updater_auto_extract_archive", &settings->network.buildbot_auto_extract_archive},
|
||||
{ "camera_allow", &settings->camera.allow},
|
||||
unsigned count = 0;
|
||||
global_t *global = global_get_ptr();
|
||||
struct config_bool_setting_ptr *tmp = NULL;
|
||||
|
||||
SETTING_BOOL("ui_companion_start_on_boot", &settings->ui.companion_start_on_boot);
|
||||
SETTING_BOOL("ui_companion_enable", &settings->ui.companion_enable);
|
||||
SETTING_BOOL("video_gpu_record", &settings->video.gpu_record);
|
||||
SETTING_BOOL("input_remap_binds_enable", &settings->input.remap_binds_enable);
|
||||
SETTING_BOOL("back_as_menu_toggle_enable", &settings->input.back_as_menu_toggle_enable);
|
||||
SETTING_BOOL("netplay_client_swap_input", &settings->input.netplay_client_swap_input);
|
||||
SETTING_BOOL("input_descriptor_label_show", &settings->input.input_descriptor_label_show);
|
||||
SETTING_BOOL("input_descriptor_hide_unbound", &settings->input.input_descriptor_hide_unbound);
|
||||
SETTING_BOOL("load_dummy_on_core_shutdown", &settings->load_dummy_on_core_shutdown);
|
||||
SETTING_BOOL("builtin_mediaplayer_enable", &settings->multimedia.builtin_mediaplayer_enable);
|
||||
SETTING_BOOL("builtin_imageviewer_enable", &settings->multimedia.builtin_imageviewer_enable);
|
||||
SETTING_BOOL("fps_show", &settings->fps_show);
|
||||
SETTING_BOOL("ui_menubar_enable", &settings->ui.menubar_enable);
|
||||
SETTING_BOOL("suspend_screensaver_enable", &settings->ui.suspend_screensaver_enable);
|
||||
SETTING_BOOL("rewind_enable", &settings->rewind_enable);
|
||||
SETTING_BOOL("audio_sync", &settings->audio.sync);
|
||||
SETTING_BOOL("video_shader_enable", &settings->video.shader_enable);
|
||||
SETTING_BOOL("video_aspect_ratio_auto", &settings->video.aspect_ratio_auto);
|
||||
SETTING_BOOL("video_allow_rotate", &settings->video.allow_rotate);
|
||||
SETTING_BOOL("video_windowed_fullscreen", &settings->video.windowed_fullscreen);
|
||||
SETTING_BOOL("video_crop_overscan", &settings->video.crop_overscan);
|
||||
SETTING_BOOL( "video_scale_integer", &settings->video.scale_integer);
|
||||
SETTING_BOOL("video_smooth", &settings->video.smooth);
|
||||
SETTING_BOOL("video_force_aspect", &settings->video.force_aspect);
|
||||
SETTING_BOOL("video_threaded", &settings->video.threaded);
|
||||
SETTING_BOOL("video_shared_context", &settings->video.shared_context);
|
||||
SETTING_BOOL("custom_bgm_enable", &global->console.sound.system_bgm_enable);
|
||||
SETTING_BOOL("auto_screenshot_filename", &settings->auto_screenshot_filename);
|
||||
SETTING_BOOL("video_force_srgb_disable", &settings->video.force_srgb_disable);
|
||||
SETTING_BOOL("video_fullscreen", &settings->video.fullscreen);
|
||||
SETTING_BOOL("bundle_assets_extract_enable", &settings->bundle_assets_extract_enable);
|
||||
SETTING_BOOL("video_vsync", &settings->video.vsync);
|
||||
SETTING_BOOL("video_hard_sync", &settings->video.hard_sync);
|
||||
SETTING_BOOL("video_black_frame_insertion", &settings->video.black_frame_insertion);
|
||||
SETTING_BOOL("video_disable_composition", &settings->video.disable_composition);
|
||||
SETTING_BOOL("pause_nonactive", &settings->pause_nonactive);
|
||||
SETTING_BOOL("debug_panel_enable", &settings->debug_panel_enable);
|
||||
SETTING_BOOL("video_gpu_screenshot", &settings->video.gpu_screenshot);
|
||||
SETTING_BOOL("video_post_filter_record", &settings->video.post_filter_record);
|
||||
SETTING_BOOL("keyboard_gamepad_enable", &settings->input.keyboard_gamepad_enable);
|
||||
SETTING_BOOL("core_set_supports_no_game_enable", &settings->set_supports_no_game_enable);
|
||||
SETTING_BOOL("audio_enable", &settings->audio.enable);
|
||||
SETTING_BOOL("audio_mute_enable", &settings->audio.mute_enable);
|
||||
SETTING_BOOL("location_allow", &settings->location.allow);
|
||||
SETTING_BOOL("video_font_enable", &settings->video.font_enable);
|
||||
SETTING_BOOL("core_updater_auto_extract_archive", &settings->network.buildbot_auto_extract_archive);
|
||||
SETTING_BOOL("camera_allow", &settings->camera.allow);
|
||||
#if TARGET_OS_IPHONE
|
||||
{ "small_keyboard_enable", &settings->input.small_keyboard_enable},
|
||||
SETTING_BOOL("small_keyboard_enable", &settings->input.small_keyboard_enable);
|
||||
#endif
|
||||
#ifdef GEKKO
|
||||
{ "video_vfilter", &settings->video.vfilter},
|
||||
SETTING_BOOL("video_vfilter", &settings->video.vfilter);
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
#ifdef HAVE_THREADS
|
||||
{ "threaded_data_runloop_enable", &settings->threaded_data_runloop_enable},
|
||||
SETTING_BOOL("threaded_data_runloop_enable", &settings->threaded_data_runloop_enable);
|
||||
#endif
|
||||
{ "menu_throttle_framerate", &settings->menu.throttle_framerate},
|
||||
{ "menu_linear_filter", &settings->menu.linear_filter},
|
||||
{ "dpi_override_enable", &settings->menu.dpi.override_enable},
|
||||
{ "menu_pause_libretro", &settings->menu.pause_libretro},
|
||||
{ "menu_mouse_enable", &settings->menu.mouse.enable},
|
||||
{ "menu_pointer_enable", &settings->menu.pointer.enable},
|
||||
{ "menu_timedate_enable", &settings->menu.timedate_enable},
|
||||
{ "menu_core_enable", &settings->menu.core_enable},
|
||||
{ "menu_dynamic_wallpaper_enable",&settings->menu.dynamic_wallpaper_enable},
|
||||
SETTING_BOOL("menu_throttle_framerate", &settings->menu.throttle_framerate);
|
||||
SETTING_BOOL("menu_linear_filter", &settings->menu.linear_filter);
|
||||
SETTING_BOOL("dpi_override_enable", &settings->menu.dpi.override_enable);
|
||||
SETTING_BOOL("menu_pause_libretro", &settings->menu.pause_libretro);
|
||||
SETTING_BOOL("menu_mouse_enable", &settings->menu.mouse.enable);
|
||||
SETTING_BOOL("menu_pointer_enable", &settings->menu.pointer.enable);
|
||||
SETTING_BOOL("menu_timedate_enable", &settings->menu.timedate_enable);
|
||||
SETTING_BOOL("menu_core_enable", &settings->menu.core_enable);
|
||||
SETTING_BOOL("menu_dynamic_wallpaper_enable", &settings->menu.dynamic_wallpaper_enable);
|
||||
#ifdef HAVE_XMB
|
||||
{ "xmb_shadows_enable", &settings->menu.xmb.shadows_enable},
|
||||
{ "xmb_show_settings", &settings->menu.xmb.show_settings},
|
||||
|
||||
SETTING_BOOL("xmb_shadows_enable", &settings->menu.xmb.shadows_enable);
|
||||
SETTING_BOOL("xmb_show_settings", &settings->menu.xmb.show_settings);
|
||||
#ifdef HAVE_IMAGEVIEWER
|
||||
{ "xmb_show_images", &settings->menu.xmb.show_images},
|
||||
SETTING_BOOL("xmb_show_images", &settings->menu.xmb.show_images);
|
||||
#endif
|
||||
#ifdef HAVE_FFMPEG
|
||||
{ "xmb_show_music", &settings->menu.xmb.show_music},
|
||||
{ "xmb_show_video", &settings->menu.xmb.show_video},
|
||||
SETTING_BOOL("xmb_show_music", &settings->menu.xmb.show_music);
|
||||
SETTING_BOOL("xmb_show_video", &settings->menu.xmb.show_video);
|
||||
#endif
|
||||
|
||||
{ "xmb_show_history", &settings->menu.xmb.show_history},
|
||||
SETTING_BOOL("xmb_show_history", &settings->menu.xmb.show_history);
|
||||
#endif
|
||||
{ "rgui_show_start_screen", &settings->menu_show_start_screen},
|
||||
{ "menu_navigation_wraparound_enable", &settings->menu.navigation.wraparound.enable},
|
||||
{ "menu_navigation_browser_filter_supported_extensions_enable",
|
||||
&settings->menu.navigation.browser.filter.supported_extensions_enable},
|
||||
{ "menu_show_advanced_settings", &settings->menu.show_advanced_settings},
|
||||
SETTING_BOOL("rgui_show_start_screen", &settings->menu_show_start_screen);
|
||||
SETTING_BOOL("menu_navigation_wraparound_enable", &settings->menu.navigation.wraparound.enable);
|
||||
SETTING_BOOL("menu_navigation_browser_filter_supported_extensions_enable",
|
||||
&settings->menu.navigation.browser.filter.supported_extensions_enable);
|
||||
SETTING_BOOL("menu_show_advanced_settings", &settings->menu.show_advanced_settings);
|
||||
#endif
|
||||
#ifdef HAVE_CHEEVOS
|
||||
{ "cheevos_enable", &settings->cheevos.enable},
|
||||
{ "cheevos_test_unofficial", &settings->cheevos.test_unofficial},
|
||||
{ "cheevos_hardcore_mode_enable", &settings->cheevos.hardcore_mode_enable},
|
||||
SETTING_BOOL("cheevos_enable", &settings->cheevos.enable);
|
||||
SETTING_BOOL("cheevos_test_unofficial", &settings->cheevos.test_unofficial);
|
||||
SETTING_BOOL("cheevos_hardcore_mode_enable", &settings->cheevos.hardcore_mode_enable);
|
||||
#endif
|
||||
#ifdef HAVE_OVERLAY
|
||||
{ "input_overlay_enable", &settings->input.overlay_enable},
|
||||
{ "input_overlay_enable_autopreferred", &settings->input.overlay_enable_autopreferred},
|
||||
{ "input_overlay_hide_in_menu", &settings->input.overlay_hide_in_menu},
|
||||
{ "input_osk_overlay_enable", &settings->osk.enable},
|
||||
SETTING_BOOL("input_overlay_enable", &settings->input.overlay_enable);
|
||||
SETTING_BOOL("input_overlay_enable_autopreferred", &settings->input.overlay_enable_autopreferred);
|
||||
SETTING_BOOL("input_overlay_hide_in_menu", &settings->input.overlay_hide_in_menu);
|
||||
SETTING_BOOL("input_osk_overlay_enable", &settings->osk.enable);
|
||||
#endif
|
||||
#ifdef HAVE_COMMAND
|
||||
{ "network_cmd_enable", &settings->network_cmd_enable},
|
||||
{ "stdin_cmd_enable", &settings->stdin_cmd_enable},
|
||||
SETTING_BOOL("network_cmd_enable", &settings->network_cmd_enable);
|
||||
SETTING_BOOL("stdin_cmd_enable", &settings->stdin_cmd_enable);
|
||||
#endif
|
||||
#ifdef HAVE_NETWORKGAMEPAD
|
||||
{ "network_remote_enable", &settings->network_remote_enable},
|
||||
SETTING_BOOL("network_remote_enable", &settings->network_remote_enable);
|
||||
#endif
|
||||
#ifdef HAVE_NETPLAY
|
||||
{ "netplay_spectator_mode_enable",&global->netplay.is_spectate},
|
||||
{ "netplay_mode", &global->netplay.is_client},
|
||||
SETTING_BOOL("netplay_spectator_mode_enable",&global->netplay.is_spectate);
|
||||
SETTING_BOOL("netplay_mode", &global->netplay.is_client);
|
||||
#endif
|
||||
{ "block_sram_overwrite", &settings->block_sram_overwrite},
|
||||
{ "savestate_auto_index", &settings->savestate_auto_index},
|
||||
{ "savestate_auto_save", &settings->savestate_auto_save},
|
||||
{ "savestate_auto_load", &settings->savestate_auto_load},
|
||||
{ "history_list_enable", &settings->history_list_enable},
|
||||
{ "game_specific_options", &settings->game_specific_options},
|
||||
{ "auto_overrides_enable", &settings->auto_overrides_enable},
|
||||
{ "auto_remaps_enable", &settings->auto_remaps_enable},
|
||||
{ "auto_shaders_enable", &settings->auto_shaders_enable},
|
||||
{ "sort_savefiles_enable", &settings->sort_savefiles_enable},
|
||||
{ "sort_savestates_enable", &settings->sort_savestates_enable},
|
||||
{ "config_save_on_exit", &settings->config_save_on_exit},
|
||||
{ "show_hidden_files", &settings->show_hidden_files},
|
||||
{ "input_autodetect_enable", &settings->input.autodetect_enable},
|
||||
{ "audio_rate_control", &settings->audio.rate_control}
|
||||
};
|
||||
SETTING_BOOL("block_sram_overwrite", &settings->block_sram_overwrite);
|
||||
SETTING_BOOL("savestate_auto_index", &settings->savestate_auto_index);
|
||||
SETTING_BOOL("savestate_auto_save", &settings->savestate_auto_save);
|
||||
SETTING_BOOL("savestate_auto_load", &settings->savestate_auto_load);
|
||||
SETTING_BOOL("history_list_enable", &settings->history_list_enable);
|
||||
SETTING_BOOL("game_specific_options", &settings->game_specific_options);
|
||||
SETTING_BOOL("auto_overrides_enable", &settings->auto_overrides_enable);
|
||||
SETTING_BOOL("auto_remaps_enable", &settings->auto_remaps_enable);
|
||||
SETTING_BOOL("auto_shaders_enable", &settings->auto_shaders_enable);
|
||||
SETTING_BOOL("sort_savefiles_enable", &settings->sort_savefiles_enable);
|
||||
SETTING_BOOL("sort_savestates_enable", &settings->sort_savestates_enable);
|
||||
SETTING_BOOL("config_save_on_exit", &settings->config_save_on_exit);
|
||||
SETTING_BOOL("show_hidden_files", &settings->show_hidden_files);
|
||||
SETTING_BOOL("input_autodetect_enable", &settings->input.autodetect_enable);
|
||||
SETTING_BOOL("audio_rate_control", &settings->audio.rate_control);
|
||||
|
||||
memcpy(out, tmp, sizeof(tmp));
|
||||
return ARRAY_SIZE(tmp);
|
||||
memcpy(out, tmp, sizeof(struct config_bool_setting_ptr) * count);
|
||||
free(tmp);
|
||||
return count;
|
||||
}
|
||||
|
||||
#define SETTING_FLOAT(key, configval) \
|
||||
@ -1421,7 +1432,7 @@ static int populate_settings_bool(settings_t *settings, struct config_bool_setti
|
||||
tmp[count].ident = key; \
|
||||
tmp[count].ptr = configval; \
|
||||
count++; \
|
||||
} \
|
||||
}
|
||||
|
||||
static int populate_settings_float(settings_t *settings, struct config_float_setting_ptr *out)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user