From 968924eca6e168e4fb71d5ee968419b437d64aa9 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Tue, 17 Jul 2012 01:06:13 +0200 Subject: [PATCH] (Wii) Use rarch_settings_change for toggling settings-related options as much as possible --- console/console_settings.c | 6 ++++++ console/console_settings.h | 2 ++ ps3/frontend/menu.c | 7 +++---- wii/frontend/rgui.c | 15 +++++++++++---- wii/frontend/rgui.h | 3 ++- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/console/console_settings.c b/console/console_settings.c index fba27c8347..f85c94677f 100644 --- a/console/console_settings.c +++ b/console/console_settings.c @@ -34,6 +34,9 @@ void rarch_settings_change(unsigned setting) if(g_console.aspect_ratio_index < LAST_ASPECT_RATIO) g_console.aspect_ratio_index++; break; + case S_AUDIO_MUTE: + g_extern.audio_data.mute = !g_extern.audio_data.mute; + break; case S_FRAME_ADVANCE: g_console.frame_advance_enable = true; g_console.menu_enable = false; @@ -147,6 +150,9 @@ void rarch_settings_default(unsigned setting) case S_DEF_ASPECT_RATIO: g_console.aspect_ratio_index = ASPECT_RATIO_4_3; break; + case S_DEF_AUDIO_MUTE: + g_extern.audio_data.mute = false; + break; case S_DEF_HW_TEXTURE_FILTER: g_settings.video.smooth = 1; break; diff --git a/console/console_settings.h b/console/console_settings.h index 1aee227b48..a159097f5f 100644 --- a/console/console_settings.h +++ b/console/console_settings.h @@ -31,6 +31,7 @@ enum { S_ASPECT_RATIO_DECREMENT = 0, S_ASPECT_RATIO_INCREMENT, + S_AUDIO_MUTE, S_FRAME_ADVANCE, S_HW_TEXTURE_FILTER, S_HW_TEXTURE_FILTER_2, @@ -59,6 +60,7 @@ enum enum { S_DEF_ASPECT_RATIO = 0, + S_DEF_AUDIO_MUTE, S_DEF_HW_TEXTURE_FILTER, S_DEF_HW_TEXTURE_FILTER_2, S_DEF_OVERSCAN, diff --git a/ps3/frontend/menu.c b/ps3/frontend/menu.c index 20c6dca347..c846f520e0 100644 --- a/ps3/frontend/menu.c +++ b/ps3/frontend/menu.c @@ -1357,11 +1357,10 @@ static void producesettingentry(menu * menu_obj, unsigned switchvalue) break; case SETTING_EMU_AUDIO_MUTE: if((input_state & (1 << RETRO_DEVICE_ID_JOYPAD_LEFT)) || (input_state & (1 << RETRO_DEVICE_ID_JOYPAD_RIGHT)) || (input_state & (1 << RETRO_DEVICE_ID_JOYPAD_B))) - { - g_extern.audio_data.mute = !g_extern.audio_data.mute; - } + rarch_settings_change(S_AUDIO_MUTE); + if(input_state & (1 << RETRO_DEVICE_ID_JOYPAD_START)) - g_extern.audio_data.mute = false; + rarch_settings_default(S_DEF_AUDIO_MUTE); break; case SETTING_ENABLE_CUSTOM_BGM: if((input_state & (1 << RETRO_DEVICE_ID_JOYPAD_LEFT)) || (input_state & (1 << RETRO_DEVICE_ID_JOYPAD_RIGHT)) || (input_state & (1 << RETRO_DEVICE_ID_JOYPAD_B))) diff --git a/wii/frontend/rgui.c b/wii/frontend/rgui.c index f495f8b37f..485a86b563 100644 --- a/wii/frontend/rgui.c +++ b/wii/frontend/rgui.c @@ -226,7 +226,11 @@ static void render_text(rgui_handle_t *rgui, size_t begin, size_t end) w = 5; break; case RGUI_SETTINGS_VIDEO_FILTER: - type_str = g_settings.video.smooth ? "Bilinear" : "None"; + type_str = g_settings.video.smooth ? "Bilinear filtering" : "Point filtering"; + w = 8; + break; + case RGUI_SETTINGS_AUDIO_MUTE: + type_str = g_extern.audio_data.mute ? "ON" : "OFF"; w = 8; break; default: @@ -292,9 +296,11 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting) break;*/ case RGUI_SETTINGS_VIDEO_FILTER: - g_settings.video.smooth = !g_settings.video.smooth; + rarch_settings_change(S_HW_TEXTURE_FILTER); + break; + case RGUI_SETTINGS_AUDIO_MUTE: + rarch_settings_change(S_AUDIO_MUTE); break; - default: break; } @@ -304,7 +310,8 @@ static void rgui_settings_populate_entries(rgui_handle_t *rgui) { rgui_list_clear(rgui->folder_buf); - rgui_list_push(rgui->folder_buf, "Filter", RGUI_SETTINGS_VIDEO_FILTER, 0); + rgui_list_push(rgui->folder_buf, "Hardware filtering", RGUI_SETTINGS_VIDEO_FILTER, 0); + rgui_list_push(rgui->folder_buf, "Mute Audio", RGUI_SETTINGS_AUDIO_MUTE, 1); } static bool rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action) diff --git a/wii/frontend/rgui.h b/wii/frontend/rgui.h index ed58623d31..454eed5002 100644 --- a/wii/frontend/rgui.h +++ b/wii/frontend/rgui.h @@ -33,7 +33,8 @@ typedef enum // settings options are done here too //RGUI_SETTINGS_VIDEO_STRETCH, - RGUI_SETTINGS_VIDEO_FILTER + RGUI_SETTINGS_VIDEO_FILTER, + RGUI_SETTINGS_AUDIO_MUTE } rgui_file_type_t; typedef enum