diff --git a/Source/Android/app/src/main/AndroidManifest.xml b/Source/Android/app/src/main/AndroidManifest.xml index be41d3f55b..57a0e62abd 100644 --- a/Source/Android/app/src/main/AndroidManifest.xml +++ b/Source/Android/app/src/main/AndroidManifest.xml @@ -58,7 +58,7 @@ + android:label="@string/grid_menu_core_settings"/> >() - { - @Override - public void call(HashMap settingsBySection) - { - mSettingsBySection = settingsBySection; - mView.onSettingsFileLoaded(settingsBySection); - } - }); + { + @Override + public void call(HashMap settingsBySection) + { + mSettingsBySection = settingsBySection; + mView.onSettingsFileLoaded(settingsBySection); + } + }, + new Action1() + { + @Override + public void call(Throwable throwable) + { + Log.error("[SettingsActivityPresenter] Error reading file " + filename + ".ini: "+ throwable.getMessage()); + mView.onSettingsFileLoaded(null); + } + }); mView.showSettingsFragment(mFileName, false); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsAdapter.java index f386fc94df..bbb9a2ad1a 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsAdapter.java @@ -9,10 +9,12 @@ import android.view.View; import android.view.ViewGroup; import android.widget.SeekBar; import android.widget.TextView; -import android.widget.Toast; import org.dolphinemu.dolphinemu.R; +import org.dolphinemu.dolphinemu.model.settings.BooleanSetting; import org.dolphinemu.dolphinemu.model.settings.FloatSetting; +import org.dolphinemu.dolphinemu.model.settings.IntSetting; +import org.dolphinemu.dolphinemu.model.settings.view.CheckBoxSetting; import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem; import org.dolphinemu.dolphinemu.model.settings.view.SingleChoiceSetting; import org.dolphinemu.dolphinemu.model.settings.view.SliderSetting; @@ -117,6 +119,17 @@ public class SettingsAdapter extends RecyclerView.Adapter notifyDataSetChanged(); } + public void onBooleanClick(CheckBoxSetting item, int position, boolean checked) + { + BooleanSetting setting = item.setChecked(checked); + notifyItemChanged(position); + + if (setting != null) + { + mView.addSetting(setting); + } + } + public void onSingleChoiceClick(SingleChoiceSetting item) { mClickedItem = item; @@ -162,7 +175,7 @@ public class SettingsAdapter extends RecyclerView.Adapter public void onSubmenuClick(SubmenuSetting item) { - Toast.makeText(mContext, "Submenu item clicked", Toast.LENGTH_SHORT).show(); + mView.loadSubMenu(item.getMenuKey()); } @Override @@ -174,7 +187,12 @@ public class SettingsAdapter extends RecyclerView.Adapter int value = getValueForSingleChoiceSelection(scSetting, which); - scSetting.setSelectedValue(value); + IntSetting setting = scSetting.setSelectedValue(value); + if (setting != null) + { + mView.addSetting(setting); + } + closeDialog(); } else if (mClickedItem instanceof SliderSetting) @@ -193,11 +211,19 @@ public class SettingsAdapter extends RecyclerView.Adapter value = (float) mSeekbarProgress; } - sliderSetting.setSelectedValue(value); + FloatSetting setting = sliderSetting.setSelectedValue(value); + if (setting != null) + { + mView.addSetting(setting); + } } else { - sliderSetting.setSelectedValue(mSeekbarProgress); + IntSetting setting = sliderSetting.setSelectedValue(mSeekbarProgress); + if (setting != null) + { + mView.addSetting(setting); + } } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragment.java index a612233789..50ef668b90 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragment.java @@ -12,6 +12,7 @@ import android.view.ViewGroup; import org.dolphinemu.dolphinemu.BuildConfig; import org.dolphinemu.dolphinemu.R; +import org.dolphinemu.dolphinemu.model.settings.Setting; import org.dolphinemu.dolphinemu.model.settings.SettingSection; import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem; import org.dolphinemu.dolphinemu.ui.DividerItemDecoration; @@ -22,7 +23,7 @@ import java.util.HashMap; public final class SettingsFragment extends Fragment implements SettingsFragmentView { private SettingsFragmentPresenter mPresenter = new SettingsFragmentPresenter(this); - private SettingsActivityView mView; + private SettingsActivityView mActivity; private SettingsAdapter mAdapter; @@ -31,7 +32,7 @@ public final class SettingsFragment extends Fragment implements SettingsFragment { super.onAttach(context); - mView = (SettingsActivityView) context; + mActivity = (SettingsActivityView) context; mPresenter.onAttach(); } @@ -76,7 +77,7 @@ public final class SettingsFragment extends Fragment implements SettingsFragment public void onDetach() { super.onDetach(); - mView = null; + mActivity = null; if (mAdapter != null) { @@ -91,11 +92,11 @@ public final class SettingsFragment extends Fragment implements SettingsFragment } @Override - public void passOptionsToActivity(HashMap settings) + public void passSettingsToActivity(HashMap settings) { - if (mView != null) + if (mActivity != null) { - mView.setSettings(settings); + mActivity.setSettings(settings); } } @@ -105,6 +106,24 @@ public final class SettingsFragment extends Fragment implements SettingsFragment mAdapter.setSettings(settingsList); } + @Override + public void loadSubMenu(String menuKey) + { + mActivity.showSettingsFragment(menuKey, true); + } + + @Override + public void showToastMessage(String message) + { + mActivity.showToastMessage(message); + } + + @Override + public void addSetting(Setting setting) + { + mPresenter.addSetting(setting); + } + public static final String FRAGMENT_TAG = BuildConfig.APPLICATION_ID + ".fragment.settings"; public static final String ARGUMENT_MENU_TAG = FRAGMENT_TAG + ".menu_tag"; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentPresenter.java index b53d7517f9..22bb24a38f 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentPresenter.java @@ -1,12 +1,17 @@ package org.dolphinemu.dolphinemu.ui.settings; import org.dolphinemu.dolphinemu.R; +import org.dolphinemu.dolphinemu.model.settings.BooleanSetting; +import org.dolphinemu.dolphinemu.model.settings.IntSetting; import org.dolphinemu.dolphinemu.model.settings.Setting; import org.dolphinemu.dolphinemu.model.settings.SettingSection; import org.dolphinemu.dolphinemu.model.settings.view.CheckBoxSetting; +import org.dolphinemu.dolphinemu.model.settings.view.HeaderSetting; import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem; import org.dolphinemu.dolphinemu.model.settings.view.SingleChoiceSetting; import org.dolphinemu.dolphinemu.model.settings.view.SliderSetting; +import org.dolphinemu.dolphinemu.model.settings.view.SubmenuSetting; +import org.dolphinemu.dolphinemu.utils.EGLHelper; import org.dolphinemu.dolphinemu.utils.SettingsFile; import java.util.ArrayList; @@ -45,23 +50,22 @@ public class SettingsFragmentPresenter { if (mSettings != null) { - mView.passOptionsToActivity(mSettings); + mView.passSettingsToActivity(mSettings); } } + public void addSetting(Setting setting) + { + mSettings.get(setting.getSection()).putSetting(setting.getKey(), setting); + } + public void setSettings(HashMap settings) { if (mSettingsList == null) { - if (settings != null) - { - mSettings = settings; - } + mSettings = settings; - if (mSettings != null) - { - loadSettingsList(); - } + loadSettingsList(); } else { @@ -77,8 +81,23 @@ public class SettingsFragmentPresenter { case SettingsFile.FILE_NAME_DOLPHIN: addCoreSettings(sl); - break; + + case SettingsFile.FILE_NAME_GFX: + addGraphicsSettings(sl); + break; + + case SettingsFile.SECTION_GFX_ENHANCEMENTS: + addEnhanceSettings(sl); + break; + + case SettingsFile.SECTION_GFX_HACKS: + addHackSettings(sl); + break; + + default: + mView.showToastMessage("Unimplemented menu."); + return; } mSettingsList = sl; @@ -87,16 +106,187 @@ public class SettingsFragmentPresenter private void addCoreSettings(ArrayList sl) { - Setting cpuCore = mSettings.get(SettingsFile.SECTION_CORE).getSetting(SettingsFile.KEY_CPU_CORE); - sl.add(new SingleChoiceSetting(cpuCore.getKey(), cpuCore, R.string.cpu_core, 0, R.array.string_emu_cores, R.array.int_emu_cores)); + Setting cpuCore = null; + Setting dualCore = null; + Setting overclockEnable = null; + Setting overclock = null; - Setting dualCore = mSettings.get(SettingsFile.SECTION_CORE).getSetting(SettingsFile.KEY_DUAL_CORE); - sl.add(new CheckBoxSetting(dualCore.getKey(), dualCore, R.string.dual_core, R.string.dual_core_descrip)); + if (mSettings != null) + { + cpuCore = mSettings.get(SettingsFile.SECTION_CORE).getSetting(SettingsFile.KEY_CPU_CORE); + dualCore = mSettings.get(SettingsFile.SECTION_CORE).getSetting(SettingsFile.KEY_DUAL_CORE); + overclockEnable = mSettings.get(SettingsFile.SECTION_CORE).getSetting(SettingsFile.KEY_OVERCLOCK_ENABLE); + overclock = mSettings.get(SettingsFile.SECTION_CORE).getSetting(SettingsFile.KEY_OVERCLOCK_PERCENT); + } + else + { + mSettings = new HashMap<>(); + mSettings.put(SettingsFile.SECTION_CORE, new SettingSection(SettingsFile.SECTION_CORE)); - Setting overclockEnable = mSettings.get(SettingsFile.SECTION_CORE).getSetting(SettingsFile.KEY_OVERCLOCK_ENABLE); - sl.add(new CheckBoxSetting(overclockEnable.getKey(), overclockEnable, R.string.overclock_enable, R.string.overclock_enable_description)); + mView.passSettingsToActivity(mSettings); + } - Setting overclock = mSettings.get(SettingsFile.SECTION_CORE).getSetting(SettingsFile.KEY_OVERCLOCK_PERCENT); - sl.add(new SliderSetting(overclock.getKey(), overclock, R.string.overclock_title, 0, 400, "%")); + // TODO Set default value for cpuCore based on arch. + sl.add(new SingleChoiceSetting(SettingsFile.KEY_CPU_CORE, SettingsFile.SECTION_CORE, R.string.cpu_core, 0, R.array.string_emu_cores, R.array.int_emu_cores, 4, cpuCore)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_DUAL_CORE, SettingsFile.SECTION_CORE, R.string.dual_core, R.string.dual_core_descrip, true, dualCore)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_OVERCLOCK_ENABLE, SettingsFile.SECTION_CORE, R.string.overclock_enable, R.string.overclock_enable_description, false, overclockEnable)); + sl.add(new SliderSetting(SettingsFile.KEY_OVERCLOCK_PERCENT, SettingsFile.SECTION_CORE, R.string.overclock_title, 0, 400, "%", 100, overclock)); + + } + + private void addGraphicsSettings(ArrayList sl) + { + Setting showFps = null; + + if (mSettings != null) + { + showFps = mSettings.get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_SHOW_FPS); + } + else + { + mSettings = new HashMap<>(); + + mSettings.put(SettingsFile.SECTION_GFX_SETTINGS, new SettingSection(SettingsFile.SECTION_GFX_SETTINGS)); + mSettings.put(SettingsFile.SECTION_GFX_ENHANCEMENTS, new SettingSection(SettingsFile.SECTION_GFX_ENHANCEMENTS)); + mSettings.put(SettingsFile.SECTION_GFX_HACKS, new SettingSection(SettingsFile.SECTION_GFX_HACKS)); + + mView.passSettingsToActivity(mSettings); + } + + sl.add(new CheckBoxSetting(SettingsFile.KEY_SHOW_FPS, SettingsFile.SECTION_GFX_SETTINGS, R.string.show_fps, 0, true, showFps)); + + sl.add(new SubmenuSetting(null, null, R.string.enhancements, 0, SettingsFile.SECTION_GFX_ENHANCEMENTS)); + sl.add(new SubmenuSetting(null, null, R.string.hacks, 0, SettingsFile.SECTION_GFX_HACKS)); + } + + private void addEnhanceSettings(ArrayList sl) + { + Setting resolution = mSettings.get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_INTERNAL_RES); + Setting fsaa = mSettings.get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_FSAA); + Setting anisotropic = mSettings.get(SettingsFile.SECTION_GFX_ENHANCEMENTS).getSetting(SettingsFile.KEY_ANISOTROPY); + Setting efbScaledCopy = mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_SCALED_EFB); + Setting perPixel = mSettings.get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_PER_PIXEL); + Setting forceFilter = mSettings.get(SettingsFile.SECTION_GFX_ENHANCEMENTS).getSetting(SettingsFile.KEY_FORCE_FILTERING); + Setting disableFog = mSettings.get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_DISABLE_FOG); + + sl.add(new SingleChoiceSetting(SettingsFile.KEY_INTERNAL_RES, SettingsFile.SECTION_GFX_SETTINGS, R.string.internal_resolution, R.string.internal_resolution_descrip, R.array.internalResolutionEntries, R.array.internalResolutionValues, 0, resolution)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_FSAA, SettingsFile.SECTION_GFX_SETTINGS, R.string.FSAA, R.string.FSAA_descrip, R.array.FSAAEntries, R.array.FSAAValues, 0, fsaa)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_ANISOTROPY, SettingsFile.SECTION_GFX_ENHANCEMENTS, R.string.anisotropic_filtering, R.string.anisotropic_filtering_descrip, R.array.anisotropicFilteringEntries, R.array.anisotropicFilteringValues, 0, anisotropic)); + + // TODO +// Setting shader = mSettings.get(SettingsFile.SECTION_GFX_ENHANCEMENTS).getSetting(SettingsFile.KEY_POST_SHADER) +// sl.add(new SingleChoiceSetting(.getKey(), , R.string., R.string._descrip, R.array., R.array.)); + + sl.add(new CheckBoxSetting(SettingsFile.KEY_SCALED_EFB, SettingsFile.SECTION_GFX_HACKS, R.string.scaled_efb_copy, R.string.scaled_efb_copy_descrip, true, efbScaledCopy)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_PER_PIXEL, SettingsFile.SECTION_GFX_SETTINGS, R.string.per_pixel_lighting, R.string.per_pixel_lighting_descrip, false, perPixel)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_FORCE_FILTERING, SettingsFile.SECTION_GFX_ENHANCEMENTS, R.string.force_texture_filtering, R.string.force_texture_filtering_descrip, false, forceFilter)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_DISABLE_FOG, SettingsFile.SECTION_GFX_SETTINGS, R.string.disable_fog, R.string.disable_fog_descrip, false, disableFog)); + + /* + Check if we support stereo + If we support desktop GL then we must support at least OpenGL 3.2 + If we only support OpenGLES then we need both OpenGLES 3.1 and AEP + */ + EGLHelper helper = new EGLHelper(EGLHelper.EGL_OPENGL_ES2_BIT); + + if ((helper.supportsOpenGL() && helper.GetVersion() >= 320) || + (helper.supportsGLES3() && helper.GetVersion() >= 310 && helper.SupportsExtension("GL_ANDROID_extension_pack_es31a"))) + { + sl.add(new SubmenuSetting(null, null, R.string.stereoscopy, 0, SettingsFile.SECTION_STEREOSCOPY)); + } + } + + private void addHackSettings(ArrayList sl) + { + int efbCopyMethodValue = getEfbCopyMethodValue(); + int xfbValue = getXfbValue(); + + Setting skipEFB = mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_SKIP_EFB); + Setting ignoreFormat = mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_IGNORE_FORMAT); + IntSetting efbCopyMethod = new IntSetting(SettingsFile.KEY_EFB_COPY_METHOD, null, efbCopyMethodValue); + Setting texCacheAccuracy = mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_TEXCACHE_ACCURACY); + IntSetting xfb = new IntSetting(SettingsFile.KEY_XFB, SettingsFile.SECTION_GFX_HACKS, xfbValue); + Setting fastDepth = mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_FAST_DEPTH); + Setting aspectRatio = mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_ASPECT_RATIO); + + sl.add(new HeaderSetting(null, null, R.string.embedded_frame_buffer, 0)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_SKIP_EFB, SettingsFile.SECTION_GFX_HACKS, R.string.skip_efb_access, R.string.skip_efb_access_descrip, false, skipEFB)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_IGNORE_FORMAT, SettingsFile.SECTION_GFX_HACKS, R.string.ignore_format_changes, R.string.ignore_format_changes_descrip, false, ignoreFormat)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_EFB_COPY_METHOD, SettingsFile.SECTION_GFX_HACKS, R.string.efb_copy_method, R.string.efb_copy_method_descrip, R.array.efbCopyMethodEntries, R.array.efbCopyMethodValues, 1, efbCopyMethod)); + + sl.add(new HeaderSetting(null, null, R.string.texture_cache, 0)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_TEXCACHE_ACCURACY, SettingsFile.SECTION_GFX_HACKS, R.string.texture_cache_accuracy, R.string.texture_cache_accuracy_descrip, R.array.textureCacheAccuracyEntries, R.array.textureCacheAccuracyValues, 128, texCacheAccuracy)); + + sl.add(new HeaderSetting(null, null, R.string.external_frame_buffer, 0)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_XFB, SettingsFile.SECTION_GFX_HACKS, R.string.external_frame_buffer, R.string.external_frame_buffer_descrip, R.array.externalFrameBufferEntries, R.array.externalFrameBufferValues, 0, xfb)); + + sl.add(new HeaderSetting(null, null, R.string.other, 0)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_FAST_DEPTH, SettingsFile.SECTION_GFX_HACKS, R.string.fast_depth_calculation, R.string.fast_depth_calculation_descrip, true, fastDepth)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_ASPECT_RATIO, SettingsFile.SECTION_GFX_HACKS, R.string.aspect_ratio, R.string.aspect_ratio_descrip, R.array.aspectRatioEntries, R.array.aspectRatioValues, 0, aspectRatio)); + } + + private int getEfbCopyMethodValue() + { + int efbCopyMethodValue; + try + { + boolean efbCopyOn = ((BooleanSetting) mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_EFB_COPY)).getValue(); + boolean efbCopyTexture = ((BooleanSetting) mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_EFB_TEXTURE)).getValue(); + boolean efbCopyCache = ((BooleanSetting) mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_EFB_CACHE)).getValue(); + + + if (!efbCopyOn) + { + efbCopyMethodValue = 0; + } + else if (efbCopyTexture) + { + efbCopyMethodValue = 1; + } + else if (!efbCopyCache) + { + efbCopyMethodValue = 2; + } + else + { + efbCopyMethodValue = 3; + } + } + catch (NullPointerException ex) + { + efbCopyMethodValue = 1; + } + + return efbCopyMethodValue; + } + + private int getXfbValue() + { + int xfbValue; + + try + { + boolean usingXFB = ((BooleanSetting) mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_XFB)).getValue(); + boolean usingRealXFB = ((BooleanSetting) mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_XFB_REAL)).getValue(); + + if (!usingXFB) + { + xfbValue = 0; + } + else if (!usingRealXFB) + { + xfbValue = 1; + } + else + { + xfbValue = 2; + } + } + catch (NullPointerException ex) + { + xfbValue = 0; + } + + return xfbValue; } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentView.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentView.java index cef3d73dff..f5a035eed3 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentView.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentView.java @@ -2,6 +2,7 @@ package org.dolphinemu.dolphinemu.ui.settings; import android.app.Activity; +import org.dolphinemu.dolphinemu.model.settings.Setting; import org.dolphinemu.dolphinemu.model.settings.SettingSection; import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem; @@ -12,9 +13,15 @@ public interface SettingsFragmentView { void onSettingsFileLoaded(HashMap settings); - void passOptionsToActivity(HashMap settings); + void passSettingsToActivity(HashMap settings); void showSettingsList(ArrayList settingsList); Activity getActivity(); + + void loadSubMenu(String menuKey); + + void showToastMessage(String message); + + void addSetting(Setting setting); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/viewholder/CheckboxSettingViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/viewholder/CheckboxSettingViewHolder.java index 0059446bdc..05985cc671 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/viewholder/CheckboxSettingViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/viewholder/CheckboxSettingViewHolder.java @@ -51,7 +51,7 @@ public class CheckBoxSettingViewHolder extends SettingViewHolder public void onClick(View clicked) { mCheckbox.toggle(); - mItem.setChecked(mCheckbox.isChecked()); - getAdapter().notifyItemChanged(getAdapterPosition()); + + getAdapter().onBooleanClick(mItem, getAdapterPosition(), mCheckbox.isChecked()); } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java index 15ce0a7e36..5bfa678098 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java @@ -36,39 +36,43 @@ public final class SettingsFile public static final String SECTION_GFX_ENHANCEMENTS = "Enhancements"; public static final String SECTION_GFX_HACKS = "Hacks"; + public static final String SECTION_STEREOSCOPY = "Stereoscopy"; - public static final String KEY_CPU_CORE= "CPUCore"; - public static final String KEY_DUAL_CORE= "CPUThread"; - public static final String KEY_OVERCLOCK_ENABLE= "OverclockEnable"; - public static final String KEY_OVERCLOCK_PERCENT= "Overclock"; - public static final String KEY_VIDEO_BACKEND= "GFXBackend"; + public static final String KEY_CPU_CORE = "CPUCore"; + public static final String KEY_DUAL_CORE = "CPUThread"; + public static final String KEY_OVERCLOCK_ENABLE = "OverclockEnable"; + public static final String KEY_OVERCLOCK_PERCENT = "Overclock"; + public static final String KEY_VIDEO_BACKEND = "GFXBackend"; - public static final String KEY_SHOW_FPS= "ShowFPS"; - public static final String KEY_INTERNAL_RES= "EFBScale"; - public static final String KEY_FSAA= "MSAA"; - public static final String KEY_ANISOTROPY= "MaxAnisotropy"; - public static final String KEY_POST_SHADER= "PostProcessingShader"; - public static final String KEY_SCALED_EFB= "EFBScaledCopy"; - public static final String KEY_PER_PIXEL= "EnablePixelLighting"; - public static final String KEY_FORCE_FILTERING= "ForceFiltering"; - public static final String KEY_DISABLE_FOG= "DisableFog"; + public static final String KEY_SHOW_FPS = "ShowFPS"; + public static final String KEY_INTERNAL_RES = "EFBScale"; + public static final String KEY_FSAA = "MSAA"; + public static final String KEY_ANISOTROPY = "MaxAnisotropy"; + public static final String KEY_POST_SHADER = "PostProcessingShader"; + public static final String KEY_SCALED_EFB = "EFBScaledCopy"; + public static final String KEY_PER_PIXEL = "EnablePixelLighting"; + public static final String KEY_FORCE_FILTERING = "ForceFiltering"; + public static final String KEY_DISABLE_FOG = "DisableFog"; - public static final String KEY_STEREO_MODE= "StereoMode"; - public static final String KEY_STEREO_DEPTH= "StereoDepth"; - public static final String KEY_STEREO_CONV= "StereoConvergencePercentage"; - public static final String KEY_STEREO_SWAP= "StereoSwapEyes"; + public static final String KEY_STEREO_MODE = "StereoMode"; + public static final String KEY_STEREO_DEPTH = "StereoDepth"; + public static final String KEY_STEREO_CONV = "StereoConvergencePercentage"; + public static final String KEY_STEREO_SWAP = "StereoSwapEyes"; - public static final String KEY_SKIP_EFB= "EFBAccessEnable"; - public static final String KEY_IGNORE_FORMAT= "EFBEmulateFormatChanges"; - public static final String KEY_EFB_COPY= "EFBCopyEnable"; - public static final String KEY_EFB_TEXTURE= "EFBToTextureEnable"; - public static final String KEY_EFB_CACHE= "EFBCopyCacheEnable"; - public static final String KEY_TEXCACHE_ACCURACY= "SafeTextureCacheColorSamples"; - public static final String KEY_XFB= "UseXFB"; - public static final String KEY_XFB_REAL= "UseRealXFB"; + public static final String KEY_SKIP_EFB = "EFBAccessEnable"; + public static final String KEY_IGNORE_FORMAT = "EFBEmulateFormatChanges"; + public static final String KEY_EFB_COPY = "EFBCopyEnable"; + public static final String KEY_EFB_TEXTURE = "EFBToTextureEnable"; + public static final String KEY_EFB_CACHE = "EFBCopyCacheEnable"; + public static final String KEY_TEXCACHE_ACCURACY = "SafeTextureCacheColorSamples"; + public static final String KEY_XFB = "UseXFB"; + public static final String KEY_XFB_REAL = "UseRealXFB"; public static final String KEY_FAST_DEPTH= "FastDepthCalc"; public static final String KEY_ASPECT_RATIO= "AspectRatio"; + // Internal only, not actually found in settings file. + public static final String KEY_EFB_COPY_METHOD = "EFBCopyMethod"; + private SettingsFile() { } @@ -206,7 +210,7 @@ public final class SettingsFile { int valueAsInt = Integer.valueOf(value); - return new IntSetting(key, current, valueAsInt); + return new IntSetting(key, current.getName(), valueAsInt); } catch (NumberFormatException ex) { @@ -216,7 +220,7 @@ public final class SettingsFile { float valueAsFloat = Float.valueOf(value); - return new FloatSetting(key, current, valueAsFloat); + return new FloatSetting(key, current.getName(), valueAsFloat); } catch (NumberFormatException ex) { @@ -225,11 +229,11 @@ public final class SettingsFile switch (value) { case "True": - return new BooleanSetting(key, current, true); + return new BooleanSetting(key, current.getName(), true); case "False": - return new BooleanSetting(key, current, false); + return new BooleanSetting(key, current.getName(), false); default: - return new StringSetting(key, current, value); + return new StringSetting(key, current.getName(), value); } } diff --git a/Source/Android/app/src/main/res/drawable-hdpi/ic_settings.png b/Source/Android/app/src/main/res/drawable-hdpi/ic_settings.png deleted file mode 100644 index f9a8915fd2..0000000000 Binary files a/Source/Android/app/src/main/res/drawable-hdpi/ic_settings.png and /dev/null differ diff --git a/Source/Android/app/src/main/res/drawable-hdpi/ic_settings_core.png b/Source/Android/app/src/main/res/drawable-hdpi/ic_settings_core.png new file mode 100644 index 0000000000..27985eba15 Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-hdpi/ic_settings_core.png differ diff --git a/Source/Android/app/src/main/res/drawable-hdpi/ic_settings_graphics.png b/Source/Android/app/src/main/res/drawable-hdpi/ic_settings_graphics.png new file mode 100644 index 0000000000..8264acb8cd Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-hdpi/ic_settings_graphics.png differ diff --git a/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings.png b/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings.png deleted file mode 100644 index 12e5d100dd..0000000000 Binary files a/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings.png and /dev/null differ diff --git a/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings_core.png b/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings_core.png new file mode 100644 index 0000000000..c6fae13587 Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings_core.png differ diff --git a/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings_graphics.png b/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings_graphics.png new file mode 100644 index 0000000000..de130a60fb Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings_graphics.png differ diff --git a/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings.png b/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings.png deleted file mode 100644 index 6bb8f6e080..0000000000 Binary files a/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings.png and /dev/null differ diff --git a/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings_core.png b/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings_core.png new file mode 100644 index 0000000000..4c5f2493a5 Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings_core.png differ diff --git a/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings_graphics.png b/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings_graphics.png new file mode 100644 index 0000000000..7b7e2f7a1a Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings_graphics.png differ diff --git a/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings.png b/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings.png deleted file mode 100644 index 97e9ca945c..0000000000 Binary files a/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings.png and /dev/null differ diff --git a/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings_core.png b/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings_core.png new file mode 100644 index 0000000000..9c8fde1b43 Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings_core.png differ diff --git a/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings_graphics.png b/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings_graphics.png new file mode 100644 index 0000000000..d7b1ac95ce Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings_graphics.png differ diff --git a/Source/Android/app/src/main/res/drawable/ic_settings_core_tv.png b/Source/Android/app/src/main/res/drawable/ic_settings_core_tv.png new file mode 100644 index 0000000000..9c8fde1b43 Binary files /dev/null and b/Source/Android/app/src/main/res/drawable/ic_settings_core_tv.png differ diff --git a/Source/Android/app/src/main/res/drawable/ic_settings_graphics_tv.png b/Source/Android/app/src/main/res/drawable/ic_settings_graphics_tv.png new file mode 100644 index 0000000000..d7b1ac95ce Binary files /dev/null and b/Source/Android/app/src/main/res/drawable/ic_settings_graphics_tv.png differ diff --git a/Source/Android/app/src/main/res/drawable/ic_settings_tv.png b/Source/Android/app/src/main/res/drawable/ic_settings_tv.png deleted file mode 100644 index 9e242e7748..0000000000 Binary files a/Source/Android/app/src/main/res/drawable/ic_settings_tv.png and /dev/null differ diff --git a/Source/Android/app/src/main/res/menu/menu_game_grid.xml b/Source/Android/app/src/main/res/menu/menu_game_grid.xml index 5b6bf23ac0..a87f89f32d 100644 --- a/Source/Android/app/src/main/res/menu/menu_game_grid.xml +++ b/Source/Android/app/src/main/res/menu/menu_game_grid.xml @@ -7,9 +7,14 @@ android:icon="@drawable/ic_refresh" app:showAsAction="ifRoom"/> + \ No newline at end of file diff --git a/Source/Android/app/src/main/res/values/arrays.xml b/Source/Android/app/src/main/res/values/arrays.xml index 5017b8e3ec..d8320239bd 100644 --- a/Source/Android/app/src/main/res/values/arrays.xml +++ b/Source/Android/app/src/main/res/values/arrays.xml @@ -20,66 +20,38 @@ @string/interpreter @string/jit_arm_recompiler - + 0 3 - + @string/interpreter @string/jit_arm64_recompiler - + 0 4 - + @string/interpreter - + 0 - + @string/interpreter @string/cached_interpreter - + 0 5 - - - - - @string/software_renderer - @string/opengl_es3 - - - Software Renderer - OGL - - - - - @string/software_renderer - @string/opengl - - - Software Renderer - OGL - - - - - @string/software_renderer - - - Software Renderer - + @@ -119,37 +91,11 @@ @string/texture_cache_accuracy_medium @string/texture_cache_accuracy_high - + 128 512 0 - - - - - 100 - 90 - 80 - 70 - 60 - 50 - 40 - 30 - 20 - 10 - - - 100,000000 - 90,000000 - 80,000000 - 70,000000 - 60,000000 - 50,000000 - 40,000000 - 30,000000 - 20,000000 - 10,000000 - + @@ -174,7 +120,7 @@ 5x Native (3200x2640) 6x Native (3840x3168) for 4K - + 2 3 4 @@ -183,7 +129,7 @@ 7 8 9 - + @@ -191,11 +137,11 @@ 2x 4x - + 0 1 2 - + @@ -205,13 +151,13 @@ 8x 16x - + 0 1 2 3 4 - + @@ -220,12 +166,12 @@ Top-and-Bottom Anaglyph - + 0 1 2 3 - + @@ -234,12 +180,12 @@ Force 4:3 Stretch To Window - + 0 1 2 3 - + Europe diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index e4fae28f1f..ba3982396f 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -320,7 +320,8 @@ - Settings + Settings + Video Settings Refresh Library diff --git a/Source/Android/app/src/main/res/xml/preferences.xml b/Source/Android/app/src/main/res/xml/preferences.xml deleted file mode 100644 index 3a5bc32422..0000000000 --- a/Source/Android/app/src/main/res/xml/preferences.xml +++ /dev/null @@ -1,4834 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -