diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java index 9aebeb1ded..d798a25393 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java @@ -400,7 +400,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP WindowManager.LayoutParams attributes = getWindow().getAttributes(); attributes.layoutInDisplayCutoutMode = - BooleanSetting.MAIN_EXPAND_TO_CUTOUT_AREA.getBoolean(mSettings) ? + BooleanSetting.MAIN_EXPAND_TO_CUTOUT_AREA.getBoolean() ? WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES : WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER; @@ -437,7 +437,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP setTitle(NativeLibrary.GetCurrentTitleDescription()); - mEmulationFragment.refreshInputOverlay(mSettings); + mEmulationFragment.refreshInputOverlay(); } @Override @@ -521,7 +521,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP private void updateOrientation() { - setRequestedOrientation(IntSetting.MAIN_EMULATION_ORIENTATION.getInt(mSettings)); + setRequestedOrientation(IntSetting.MAIN_EMULATION_ORIENTATION.getInt()); } private boolean closeSubmenu() @@ -589,11 +589,11 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP // Populate the switch value for joystick center on touch menu.findItem(R.id.menu_emulation_joystick_rel_center) - .setChecked(BooleanSetting.MAIN_JOYSTICK_REL_CENTER.getBoolean(mSettings)); + .setChecked(BooleanSetting.MAIN_JOYSTICK_REL_CENTER.getBoolean()); if (wii) { menu.findItem(R.id.menu_emulation_ir_recenter) - .setChecked(BooleanSetting.MAIN_IR_ALWAYS_RECENTER.getBoolean(mSettings)); + .setChecked(BooleanSetting.MAIN_IR_ALWAYS_RECENTER.getBoolean()); } popup.setOnMenuItemClickListener(this::onOptionsItemSelected); @@ -794,7 +794,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP private void toggleRecenter(boolean state) { BooleanSetting.MAIN_IR_ALWAYS_RECENTER.setBoolean(mSettings, state); - mEmulationFragment.refreshOverlayPointer(mSettings); + mEmulationFragment.refreshOverlayPointer(); } private void editControlsPlacement() @@ -831,7 +831,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this) .setTitle(R.string.emulation_toggle_controls); - int currentController = InputOverlay.getConfiguredControllerType(mSettings); + int currentController = InputOverlay.getConfiguredControllerType(); if (currentController == InputOverlay.OVERLAY_GAMECUBE) { @@ -840,7 +840,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP for (int i = 0; i < gcEnabledButtons.length; i++) { - gcEnabledButtons[i] = BooleanSetting.valueOf(gcSettingBase + i).getBoolean(mSettings); + gcEnabledButtons[i] = BooleanSetting.valueOf(gcSettingBase + i).getBoolean(); } builder.setMultiChoiceItems(R.array.gcpadButtons, gcEnabledButtons, (dialog, indexSelected, isChecked) -> BooleanSetting @@ -854,7 +854,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP for (int i = 0; i < wiiClassicEnabledButtons.length; i++) { wiiClassicEnabledButtons[i] = - BooleanSetting.valueOf(classicSettingBase + i).getBoolean(mSettings); + BooleanSetting.valueOf(classicSettingBase + i).getBoolean(); } builder.setMultiChoiceItems(R.array.classicButtons, wiiClassicEnabledButtons, (dialog, indexSelected, isChecked) -> BooleanSetting @@ -868,7 +868,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP for (int i = 0; i < wiiEnabledButtons.length; i++) { - wiiEnabledButtons[i] = BooleanSetting.valueOf(wiiSettingBase + i).getBoolean(mSettings); + wiiEnabledButtons[i] = BooleanSetting.valueOf(wiiSettingBase + i).getBoolean(); } if (currentController == InputOverlay.OVERLAY_WIIMOTE_NUNCHUK) { @@ -887,15 +887,15 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP builder.setNeutralButton(R.string.emulation_toggle_all, (dialogInterface, i) -> mEmulationFragment.toggleInputOverlayVisibility(mSettings)) .setPositiveButton(R.string.ok, (dialogInterface, i) -> - mEmulationFragment.refreshInputOverlay(mSettings)) + mEmulationFragment.refreshInputOverlay()) .show(); } public void chooseDoubleTapButton() { - int currentValue = IntSetting.MAIN_DOUBLE_TAP_BUTTON.getInt(mSettings); + int currentValue = IntSetting.MAIN_DOUBLE_TAP_BUTTON.getInt(); - int buttonList = InputOverlay.getConfiguredControllerType(mSettings) == + int buttonList = InputOverlay.getConfiguredControllerType() == InputOverlay.OVERLAY_WIIMOTE_CLASSIC ? R.array.doubleTapWithClassic : R.array.doubleTap; int checkedItem = -1; @@ -914,7 +914,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP (DialogInterface dialog, int which) -> IntSetting.MAIN_DOUBLE_TAP_BUTTON.setInt( mSettings, InputOverlayPointer.DOUBLE_TAP_OPTIONS.get(which))) .setPositiveButton(R.string.ok, - (dialogInterface, i) -> mEmulationFragment.initInputPointer(mSettings)) + (dialogInterface, i) -> mEmulationFragment.initInputPointer()) .show(); } @@ -925,7 +925,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP final Slider scaleSlider = dialogBinding.inputScaleSlider; final TextView scaleValue = dialogBinding.inputScaleValue; scaleSlider.setValueTo(150); - scaleSlider.setValue(IntSetting.MAIN_CONTROL_SCALE.getInt(mSettings)); + scaleSlider.setValue(IntSetting.MAIN_CONTROL_SCALE.getInt()); scaleSlider.setStepSize(1); scaleSlider.addOnChangeListener( (slider, progress, fromUser) -> scaleValue.setText(((int) progress + 50) + "%")); @@ -935,7 +935,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP final Slider sliderOpacity = dialogBinding.inputOpacitySlider; final TextView valueOpacity = dialogBinding.inputOpacityValue; sliderOpacity.setValueTo(100); - sliderOpacity.setValue(IntSetting.MAIN_CONTROL_OPACITY.getInt(mSettings)); + sliderOpacity.setValue(IntSetting.MAIN_CONTROL_OPACITY.getInt()); sliderOpacity.setStepSize(1); sliderOpacity.addOnChangeListener( (slider, progress, fromUser) -> valueOpacity.setText(((int) progress) + "%")); @@ -948,13 +948,13 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP { IntSetting.MAIN_CONTROL_SCALE.setInt(mSettings, (int) scaleSlider.getValue()); IntSetting.MAIN_CONTROL_OPACITY.setInt(mSettings, (int) sliderOpacity.getValue()); - mEmulationFragment.refreshInputOverlay(mSettings); + mEmulationFragment.refreshInputOverlay(); }) .setNeutralButton(R.string.default_values, (dialog, which) -> { IntSetting.MAIN_CONTROL_SCALE.delete(mSettings); IntSetting.MAIN_CONTROL_OPACITY.delete(mSettings); - mEmulationFragment.refreshInputOverlay(mSettings); + mEmulationFragment.refreshInputOverlay(); }) .show(); } @@ -962,7 +962,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP private void addControllerIfNotNone(List entries, List values, IntSetting controller, int entry, int value) { - if (controller.getInt(mSettings) != 0) + if (controller.getInt() != 0) { entries.add(getString(entry)); values.add(value); @@ -992,7 +992,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP IntSetting controllerSetting = NativeLibrary.IsEmulatingWii() ? IntSetting.MAIN_OVERLAY_WII_CONTROLLER : IntSetting.MAIN_OVERLAY_GC_CONTROLLER; - int currentValue = controllerSetting.getInt(mSettings); + int currentValue = controllerSetting.getInt(); int checkedItem = -1; for (int i = 0; i < values.size(); i++) @@ -1013,7 +1013,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP .setPositiveButton(R.string.ok, (dialogInterface, i) -> { editor.apply(); - mEmulationFragment.refreshInputOverlay(mSettings); + mEmulationFragment.refreshInputOverlay(); }) .setNeutralButton(R.string.emulation_more_controller_settings, (dialogInterface, i) -> SettingsActivity.launch(this, MenuTag.SETTINGS)) @@ -1025,11 +1025,11 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP new MaterialAlertDialogBuilder(this) .setTitle(R.string.emulation_ir_mode) .setSingleChoiceItems(R.array.irModeEntries, - IntSetting.MAIN_IR_MODE.getInt(mSettings), + IntSetting.MAIN_IR_MODE.getInt(), (dialog, indexSelected) -> IntSetting.MAIN_IR_MODE.setInt(mSettings, indexSelected)) .setPositiveButton(R.string.ok, (dialogInterface, i) -> - mEmulationFragment.refreshOverlayPointer(mSettings)) + mEmulationFragment.refreshOverlayPointer()) .show(); } @@ -1065,7 +1065,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP new MaterialAlertDialogBuilder(this) .setTitle(getString(R.string.emulation_touch_overlay_reset)) .setPositiveButton(R.string.yes, - (dialogInterface, i) -> mEmulationFragment.resetInputOverlay(mSettings)) + (dialogInterface, i) -> mEmulationFragment.resetInputOverlay()) .setNegativeButton(R.string.cancel, null) .show(); } @@ -1160,7 +1160,7 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP public void initInputPointer() { - mEmulationFragment.initInputPointer(mSettings); + mEmulationFragment.initInputPointer(); } @Override diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/SettingDisabledWarningFragment.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/SettingDisabledWarningFragment.kt index f67b0f3862..737a931a85 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/SettingDisabledWarningFragment.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/SettingDisabledWarningFragment.kt @@ -42,8 +42,8 @@ abstract class SettingDisabledWarningFragment( override fun onResume() { super.onResume() val activity = requireActivity() as CheatsActivity - activity.loadGameSpecificSettings().use { settings -> - val cheatsEnabled = setting.getBoolean(settings) + activity.loadGameSpecificSettings().use { + val cheatsEnabled = setting.getBoolean() requireView().visibility = if (cheatsEnabled) View.GONE else View.VISIBLE } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/ControlGroupEnabledSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/ControlGroupEnabledSetting.java index 95aa080429..2e22ce84aa 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/ControlGroupEnabledSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/ControlGroupEnabledSetting.java @@ -2,6 +2,8 @@ package org.dolphinemu.dolphinemu.features.input.model; +import androidx.annotation.NonNull; + import org.dolphinemu.dolphinemu.features.input.model.controlleremu.ControlGroup; import org.dolphinemu.dolphinemu.features.settings.model.AbstractBooleanSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; @@ -16,19 +18,19 @@ public class ControlGroupEnabledSetting implements AbstractBooleanSetting } @Override - public boolean getBoolean(Settings settings) + public boolean getBoolean() { return mControlGroup.getEnabled(); } @Override - public void setBoolean(Settings settings, boolean newValue) + public void setBoolean(@NonNull Settings settings, boolean newValue) { mControlGroup.setEnabled(newValue); } @Override - public boolean isOverridden(Settings settings) + public boolean isOverridden() { return false; } @@ -40,7 +42,7 @@ public class ControlGroupEnabledSetting implements AbstractBooleanSetting } @Override - public boolean delete(Settings settings) + public boolean delete(@NonNull Settings settings) { boolean newValue = mControlGroup.getDefaultEnabledValue() != ControlGroup.DEFAULT_ENABLED_NO; mControlGroup.setEnabled(newValue); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingBooleanSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingBooleanSetting.java index 7241d6e125..6e80fef6dd 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingBooleanSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingBooleanSetting.java @@ -2,6 +2,8 @@ package org.dolphinemu.dolphinemu.features.input.model; +import androidx.annotation.NonNull; + import org.dolphinemu.dolphinemu.features.input.model.controlleremu.NumericSetting; import org.dolphinemu.dolphinemu.features.settings.model.AbstractBooleanSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; @@ -16,19 +18,19 @@ public class InputMappingBooleanSetting implements AbstractBooleanSetting } @Override - public boolean getBoolean(Settings settings) + public boolean getBoolean() { return mNumericSetting.getBooleanValue(); } @Override - public void setBoolean(Settings settings, boolean newValue) + public void setBoolean(@NonNull Settings settings, boolean newValue) { mNumericSetting.setBooleanValue(newValue); } @Override - public boolean isOverridden(Settings settings) + public boolean isOverridden() { return false; } @@ -40,7 +42,7 @@ public class InputMappingBooleanSetting implements AbstractBooleanSetting } @Override - public boolean delete(Settings settings) + public boolean delete(@NonNull Settings settings) { mNumericSetting.setBooleanValue(mNumericSetting.getBooleanDefaultValue()); return true; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingDoubleSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingDoubleSetting.java index e84b61a045..0311e6d2b3 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingDoubleSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingDoubleSetting.java @@ -2,6 +2,8 @@ package org.dolphinemu.dolphinemu.features.input.model; +import androidx.annotation.NonNull; + import org.dolphinemu.dolphinemu.features.input.model.controlleremu.NumericSetting; import org.dolphinemu.dolphinemu.features.settings.model.AbstractFloatSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; @@ -17,19 +19,19 @@ public class InputMappingDoubleSetting implements AbstractFloatSetting } @Override - public float getFloat(Settings settings) + public float getFloat() { return (float) mNumericSetting.getDoubleValue(); } @Override - public void setFloat(Settings settings, float newValue) + public void setFloat(@NonNull Settings settings, float newValue) { mNumericSetting.setDoubleValue(newValue); } @Override - public boolean isOverridden(Settings settings) + public boolean isOverridden() { return false; } @@ -41,7 +43,7 @@ public class InputMappingDoubleSetting implements AbstractFloatSetting } @Override - public boolean delete(Settings settings) + public boolean delete(@NonNull Settings settings) { mNumericSetting.setDoubleValue(mNumericSetting.getDoubleDefaultValue()); return true; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingIntSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingIntSetting.java index 989f2b7cde..176346c63a 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingIntSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingIntSetting.java @@ -2,6 +2,8 @@ package org.dolphinemu.dolphinemu.features.input.model; +import androidx.annotation.NonNull; + import org.dolphinemu.dolphinemu.features.input.model.controlleremu.NumericSetting; import org.dolphinemu.dolphinemu.features.settings.model.AbstractIntSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; @@ -16,19 +18,19 @@ public class InputMappingIntSetting implements AbstractIntSetting } @Override - public int getInt(Settings settings) + public int getInt() { return mNumericSetting.getIntValue(); } @Override - public void setInt(Settings settings, int newValue) + public void setInt(@NonNull Settings settings, int newValue) { mNumericSetting.setIntValue(newValue); } @Override - public boolean isOverridden(Settings settings) + public boolean isOverridden() { return false; } @@ -40,7 +42,7 @@ public class InputMappingIntSetting implements AbstractIntSetting } @Override - public boolean delete(Settings settings) + public boolean delete(@NonNull Settings settings) { mNumericSetting.setIntValue(mNumericSetting.getIntDefaultValue()); return true; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/view/InputDeviceSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/view/InputDeviceSetting.java index e27d0f57ae..3ee7112007 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/view/InputDeviceSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/view/InputDeviceSetting.java @@ -24,13 +24,13 @@ public class InputDeviceSetting extends StringSingleChoiceSetting } @Override - public String getSelectedChoice(Settings settings) + public String getSelectedChoice() { return mController.getDefaultDevice(); } @Override - public String getSelectedValue(Settings settings) + public String getSelectedValue() { return mController.getDefaultDevice(); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.java index 783d03b14c..22d757d4c6 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.java @@ -6,7 +6,7 @@ import androidx.annotation.NonNull; public interface AbstractBooleanSetting extends AbstractSetting { - boolean getBoolean(@NonNull Settings settings); + boolean getBoolean(); void setBoolean(@NonNull Settings settings, boolean newValue); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractFloatSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractFloatSetting.java index aba2013b0f..a432c7139b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractFloatSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractFloatSetting.java @@ -6,7 +6,7 @@ import androidx.annotation.NonNull; public interface AbstractFloatSetting extends AbstractSetting { - float getFloat(@NonNull Settings settings); + float getFloat(); void setFloat(@NonNull Settings settings, float newValue); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractIntSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractIntSetting.java index c79cfa4a2f..dc868d55d9 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractIntSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractIntSetting.java @@ -6,7 +6,7 @@ import androidx.annotation.NonNull; public interface AbstractIntSetting extends AbstractSetting { - int getInt(@NonNull Settings settings); + int getInt(); void setInt(@NonNull Settings settings, int newValue); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java index d5723aeafb..9ffaf20544 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java @@ -6,7 +6,7 @@ import androidx.annotation.NonNull; public interface AbstractSetting { - boolean isOverridden(@NonNull Settings settings); + boolean isOverridden(); boolean isRuntimeEditable(); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractStringSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractStringSetting.java index b440636461..9dd9384090 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractStringSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractStringSetting.java @@ -7,7 +7,7 @@ import androidx.annotation.NonNull; public interface AbstractStringSetting extends AbstractSetting { @NonNull - String getString(@NonNull Settings settings); + String getString(); void setString(@NonNull Settings settings, @NonNull String newValue); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocBooleanSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocBooleanSetting.java index 982fc19eeb..c12bc51ca0 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocBooleanSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocBooleanSetting.java @@ -25,7 +25,7 @@ public class AdHocBooleanSetting implements AbstractBooleanSetting } @Override - public boolean isOverridden(@NonNull Settings settings) + public boolean isOverridden() { return NativeConfig.isOverridden(mFile, mSection, mKey); } @@ -43,7 +43,7 @@ public class AdHocBooleanSetting implements AbstractBooleanSetting } @Override - public boolean getBoolean(@NonNull Settings settings) + public boolean getBoolean() { return NativeConfig.getBoolean(NativeConfig.LAYER_ACTIVE, mFile, mSection, mKey, mDefaultValue); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocStringSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocStringSetting.java index d53f4abd6f..fdba08af71 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocStringSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocStringSetting.java @@ -25,7 +25,7 @@ public class AdHocStringSetting implements AbstractStringSetting } @Override - public boolean isOverridden(@NonNull Settings settings) + public boolean isOverridden() { return NativeConfig.isOverridden(mFile, mSection, mKey); } @@ -43,7 +43,7 @@ public class AdHocStringSetting implements AbstractStringSetting } @NonNull @Override - public String getString(@NonNull Settings settings) + public String getString() { return NativeConfig.getString(NativeConfig.LAYER_ACTIVE, mFile, mSection, mKey, mDefaultValue); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java index ad54b93a61..4f0f53643e 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java @@ -296,7 +296,7 @@ public enum BooleanSetting implements AbstractBooleanSetting } @Override - public boolean isOverridden(@NonNull Settings settings) + public boolean isOverridden() { return NativeConfig.isOverridden(mFile, mSection, mKey); } @@ -329,7 +329,7 @@ public enum BooleanSetting implements AbstractBooleanSetting } @Override - public boolean getBoolean(@NonNull Settings settings) + public boolean getBoolean() { return NativeConfig.getBoolean(NativeConfig.LAYER_ACTIVE, mFile, mSection, mKey, mDefaultValue); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/FloatSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/FloatSetting.java index 734839f8ec..726e92f1e7 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/FloatSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/FloatSetting.java @@ -25,7 +25,7 @@ public enum FloatSetting implements AbstractFloatSetting } @Override - public boolean isOverridden(@NonNull Settings settings) + public boolean isOverridden() { return NativeConfig.isOverridden(mFile, mSection, mKey); } @@ -49,7 +49,7 @@ public enum FloatSetting implements AbstractFloatSetting } @Override - public float getFloat(@NonNull Settings settings) + public float getFloat() { return NativeConfig.getFloat(NativeConfig.LAYER_ACTIVE, mFile, mSection, mKey, mDefaultValue); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java index 6c3c565552..f17e96d2fd 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java @@ -121,7 +121,7 @@ public enum IntSetting implements AbstractIntSetting } @Override - public boolean isOverridden(@NonNull Settings settings) + public boolean isOverridden() { return NativeConfig.isOverridden(mFile, mSection, mKey); } @@ -154,7 +154,7 @@ public enum IntSetting implements AbstractIntSetting } @Override - public int getInt(@NonNull Settings settings) + public int getInt() { return NativeConfig.getInt(NativeConfig.LAYER_ACTIVE, mFile, mSection, mKey, mDefaultValue); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/ScaledIntSetting.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/ScaledIntSetting.kt index 0888235f56..91b69b8fc3 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/ScaledIntSetting.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/ScaledIntSetting.kt @@ -6,8 +6,8 @@ class ScaledIntSetting( private val scale: Int, private val setting: AbstractIntSetting ) : AbstractIntSetting { - override fun isOverridden(settings: Settings): Boolean { - return setting.isOverridden(settings) + override fun isOverridden(): Boolean { + return setting.isOverridden() } override fun isRuntimeEditable(): Boolean { @@ -18,8 +18,8 @@ class ScaledIntSetting( return setting.delete(settings) } - override fun getInt(settings: Settings): Int { - return setting.getInt(settings) / scale + override fun getInt(): Int { + return setting.getInt() / scale } override fun setInt(settings: Settings, newValue: Int) { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/Settings.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/Settings.java index 480dee0174..a67dd63acc 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/Settings.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/Settings.java @@ -95,7 +95,7 @@ public class Settings implements Closeable NativeConfig.loadGameInis(mGameId, mRevision); } - mLoadedRecursiveIsoPathsValue = BooleanSetting.MAIN_RECURSIVE_ISO_PATHS.getBoolean(this); + mLoadedRecursiveIsoPathsValue = BooleanSetting.MAIN_RECURSIVE_ISO_PATHS.getBoolean(); } public void loadSettings(SettingsActivityView view, String gameId, int revision, boolean isWii) @@ -119,7 +119,7 @@ public class Settings implements Closeable NativeLibrary.ReloadLoggerConfig(); NativeLibrary.UpdateGCAdapterScanThread(); - if (mLoadedRecursiveIsoPathsValue != BooleanSetting.MAIN_RECURSIVE_ISO_PATHS.getBoolean(this)) + if (mLoadedRecursiveIsoPathsValue != BooleanSetting.MAIN_RECURSIVE_ISO_PATHS.getBoolean()) { // Refresh game library GameFileCacheManager.startRescan(); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/StringSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/StringSetting.java index 88b37dbbd9..7b9675b038 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/StringSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/StringSetting.java @@ -65,7 +65,7 @@ public enum StringSetting implements AbstractStringSetting } @Override - public boolean isOverridden(@NonNull Settings settings) + public boolean isOverridden() { return NativeConfig.isOverridden(mFile, mSection, mKey); } @@ -89,7 +89,7 @@ public enum StringSetting implements AbstractStringSetting } @NonNull @Override - public String getString(@NonNull Settings settings) + public String getString() { if (!NativeConfig.isSettingSaveable(mFile, mSection, mKey)) { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/DateTimeChoiceSetting.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/DateTimeChoiceSetting.kt index 7dcf284901..d1d411f80e 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/DateTimeChoiceSetting.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/DateTimeChoiceSetting.kt @@ -25,7 +25,7 @@ class DateTimeChoiceSetting( setting.setString(settings, selection) } - fun getSelectedValue(settings: Settings): String { - return setting.getString(settings) + fun getSelectedValue(): String { + return setting.getString() } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FilePicker.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FilePicker.java index d5d1951587..4b0ae749a9 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FilePicker.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FilePicker.java @@ -25,9 +25,9 @@ public final class FilePicker extends SettingsItem mDefaultPathRelativeToUserDirectory = defaultPathRelativeToUserDirectory; } - public String getSelectedValue(Settings settings) + public String getSelectedValue() { - return mSetting.getString(settings); + return mSetting.getString(); } public void setSelectedValue(Settings settings, String selection) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FloatSliderSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FloatSliderSetting.java index 5b91517f75..29432aaaa7 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FloatSliderSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FloatSliderSetting.java @@ -26,9 +26,9 @@ public class FloatSliderSetting extends SliderSetting mSetting = setting; } - public int getSelectedValue(Settings settings) + public int getSelectedValue() { - return Math.round(mSetting.getFloat(settings)); + return Math.round(mSetting.getFloat()); } public void setSelectedValue(Settings settings, float selection) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InputStringSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InputStringSetting.java index 90773e1762..9cd811b82d 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InputStringSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InputStringSetting.java @@ -43,9 +43,9 @@ public class InputStringSetting extends SettingsItem this(context, setting, titleId, descriptionId, choicesId, valuesId, null); } - public String getSelectedValue(Settings settings) + public String getSelectedValue() { - return mSetting.getString(settings); + return mSetting.getString(); } public MenuTag getMenuTag() diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/IntSliderSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/IntSliderSetting.java index b7268dfc7e..e8d19f9059 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/IntSliderSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/IntSliderSetting.java @@ -19,9 +19,9 @@ public final class IntSliderSetting extends SliderSetting mSetting = setting; } - public int getSelectedValue(Settings settings) + public int getSelectedValue() { - return mSetting.getInt(settings); + return mSetting.getInt(); } public void setSelectedValue(Settings settings, int selection) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedSwitchSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedSwitchSetting.java index 95a8237393..621530e980 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedSwitchSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedSwitchSetting.java @@ -17,9 +17,9 @@ public final class InvertedSwitchSetting extends SwitchSetting } @Override - public boolean isChecked(Settings settings) + public boolean isChecked() { - return !mSetting.getBoolean(settings); + return !mSetting.getBoolean(); } @Override diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.java index 7d79f5a888..834b10e077 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.java @@ -17,9 +17,9 @@ public final class PercentSliderSetting extends FloatSliderSetting } @Override - public int getSelectedValue(Settings settings) + public int getSelectedValue() { - return Math.round(mSetting.getFloat(settings) * 100); + return Math.round(mSetting.getFloat() * 100); } @Override diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SettingsItem.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SettingsItem.java index 6f06677be3..7d757c3e69 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SettingsItem.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SettingsItem.java @@ -75,10 +75,10 @@ public abstract class SettingsItem protected abstract AbstractSetting getSetting(); - public boolean isOverridden(Settings settings) + public boolean isOverridden() { AbstractSetting setting = getSetting(); - return setting != null && setting.isOverridden(settings); + return setting != null && setting.isOverridden(); } public boolean isEditable() diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSetting.java index 567f3e88b3..1569785cd3 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSetting.java @@ -43,9 +43,9 @@ public final class SingleChoiceSetting extends SettingsItem return mValuesId; } - public int getSelectedValue(Settings settings) + public int getSelectedValue() { - return mSetting.getInt(settings); + return mSetting.getInt(); } public MenuTag getMenuTag() diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSettingDynamicDescriptions.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSettingDynamicDescriptions.java index 73be08cbd0..b59e535f87 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSettingDynamicDescriptions.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSettingDynamicDescriptions.java @@ -60,9 +60,9 @@ public final class SingleChoiceSettingDynamicDescriptions extends SettingsItem return mDescriptionValuesId; } - public int getSelectedValue(Settings settings) + public int getSelectedValue() { - return mSetting.getInt(settings); + return mSetting.getInt(); } public MenuTag getMenuTag() diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SliderSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SliderSetting.java index e63fde3bad..fccbe0a0b1 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SliderSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SliderSetting.java @@ -31,7 +31,7 @@ public abstract class SliderSetting extends SettingsItem mUnits = units; } - public abstract int getSelectedValue(Settings settings); + public abstract int getSelectedValue(); public int getMin() { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/StringSingleChoiceSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/StringSingleChoiceSetting.java index 1a9e237728..e83fe913cd 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/StringSingleChoiceSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/StringSingleChoiceSetting.java @@ -94,19 +94,19 @@ public class StringSingleChoiceSetting extends SettingsItem return ""; } - public String getSelectedChoice(Settings settings) + public String getSelectedChoice() { - return getChoiceAt(getSelectedValueIndex(settings)); + return getChoiceAt(getSelectedValueIndex()); } - public String getSelectedValue(Settings settings) + public String getSelectedValue() { - return mSetting.getString(settings); + return mSetting.getString(); } - public int getSelectedValueIndex(Settings settings) + public int getSelectedValueIndex() { - String selectedValue = getSelectedValue(settings); + String selectedValue = getSelectedValue(); for (int i = 0; i < mValues.length; i++) { if (mValues[i].equals(selectedValue)) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SwitchSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SwitchSetting.java index 3c6679d297..dc7fa44714 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SwitchSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SwitchSetting.java @@ -26,9 +26,9 @@ public class SwitchSetting extends SettingsItem mSetting = setting; } - public boolean isChecked(Settings settings) + public boolean isChecked() { - return mSetting.getBoolean(settings); + return mSetting.getBoolean(); } public void setChecked(Settings settings, boolean checked) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java index ca405b15fd..e062dd71b2 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java @@ -217,7 +217,7 @@ public final class SettingsAdapter extends RecyclerView.Adapter= Build.VERSION_CODES.O) { - intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, - filePicker.getSelectedValue(mView.getSettings())); + intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, filePicker.getSelectedValue()); } mView.getActivity().startActivityForResult(intent, filePicker.getRequestType()); @@ -441,7 +440,7 @@ public final class SettingsAdapter extends RecyclerView.Adapter 0) @@ -679,7 +678,7 @@ public final class SettingsAdapter extends RecyclerView.Adapter 0) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java index 19b3178ac0..452a636c59 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java @@ -368,9 +368,9 @@ public final class SettingsFragmentPresenter AbstractIntSetting appTheme = new AbstractIntSetting() { @Override - public boolean isOverridden(@NonNull Settings settings) + public boolean isOverridden() { - return IntSetting.MAIN_INTERFACE_THEME.isOverridden(settings); + return IntSetting.MAIN_INTERFACE_THEME.isOverridden(); } @Override @@ -388,9 +388,9 @@ public final class SettingsFragmentPresenter } @Override - public int getInt(@NonNull Settings settings) + public int getInt() { - return IntSetting.MAIN_INTERFACE_THEME.getInt(settings); + return IntSetting.MAIN_INTERFACE_THEME.getInt(); } @Override @@ -416,9 +416,9 @@ public final class SettingsFragmentPresenter AbstractIntSetting themeMode = new AbstractIntSetting() { @Override - public boolean isOverridden(@NonNull Settings settings) + public boolean isOverridden() { - return IntSetting.MAIN_INTERFACE_THEME_MODE.isOverridden(settings); + return IntSetting.MAIN_INTERFACE_THEME_MODE.isOverridden(); } @Override @@ -436,9 +436,9 @@ public final class SettingsFragmentPresenter } @Override - public int getInt(@NonNull Settings settings) + public int getInt() { - return IntSetting.MAIN_INTERFACE_THEME_MODE.getInt(settings); + return IntSetting.MAIN_INTERFACE_THEME_MODE.getInt(); } @Override @@ -455,9 +455,9 @@ public final class SettingsFragmentPresenter AbstractBooleanSetting blackBackgrounds = new AbstractBooleanSetting() { @Override - public boolean isOverridden(@NonNull Settings settings) + public boolean isOverridden() { - return BooleanSetting.MAIN_USE_BLACK_BACKGROUNDS.isOverridden(settings); + return BooleanSetting.MAIN_USE_BLACK_BACKGROUNDS.isOverridden(); } @Override @@ -474,9 +474,9 @@ public final class SettingsFragmentPresenter } @Override - public boolean getBoolean(@NonNull Settings settings) + public boolean getBoolean() { - return BooleanSetting.MAIN_USE_BLACK_BACKGROUNDS.getBoolean(settings); + return BooleanSetting.MAIN_USE_BLACK_BACKGROUNDS.getBoolean(); } @Override @@ -500,15 +500,15 @@ public final class SettingsFragmentPresenter AbstractIntSetting dspEmulationEngine = new AbstractIntSetting() { @Override - public int getInt(@NonNull Settings settings) + public int getInt() { - if (BooleanSetting.MAIN_DSP_HLE.getBoolean(settings)) + if (BooleanSetting.MAIN_DSP_HLE.getBoolean()) { return DSP_HLE; } else { - boolean jit = BooleanSetting.MAIN_DSP_JIT.getBoolean(settings); + boolean jit = BooleanSetting.MAIN_DSP_JIT.getBoolean(); return jit ? DSP_LLE_RECOMPILER : DSP_LLE_INTERPRETER; } } @@ -536,10 +536,10 @@ public final class SettingsFragmentPresenter } @Override - public boolean isOverridden(@NonNull Settings settings) + public boolean isOverridden() { - return BooleanSetting.MAIN_DSP_HLE.isOverridden(settings) || - BooleanSetting.MAIN_DSP_JIT.isOverridden(settings); + return BooleanSetting.MAIN_DSP_HLE.isOverridden() || + BooleanSetting.MAIN_DSP_JIT.isOverridden(); } @Override @@ -681,15 +681,15 @@ public final class SettingsFragmentPresenter AbstractIntSetting synchronizeGpuThread = new AbstractIntSetting() { @Override - public int getInt(@NonNull Settings settings) + public int getInt() { - if (BooleanSetting.MAIN_SYNC_GPU.getBoolean(settings)) + if (BooleanSetting.MAIN_SYNC_GPU.getBoolean()) { return SYNC_GPU_ALWAYS; } else { - boolean syncOnSkipIdle = BooleanSetting.MAIN_SYNC_ON_SKIP_IDLE.getBoolean(settings); + boolean syncOnSkipIdle = BooleanSetting.MAIN_SYNC_ON_SKIP_IDLE.getBoolean(); return syncOnSkipIdle ? SYNC_GPU_ON_IDLE_SKIP : SYNC_GPU_NEVER; } } @@ -717,10 +717,10 @@ public final class SettingsFragmentPresenter } @Override - public boolean isOverridden(@NonNull Settings settings) + public boolean isOverridden() { - return BooleanSetting.MAIN_SYNC_ON_SKIP_IDLE.isOverridden(settings) || - BooleanSetting.MAIN_SYNC_GPU.isOverridden(settings); + return BooleanSetting.MAIN_SYNC_ON_SKIP_IDLE.isOverridden() || + BooleanSetting.MAIN_SYNC_GPU.isOverridden(); } @Override @@ -879,7 +879,7 @@ public final class SettingsFragmentPresenter R.string.texture_filtering, R.string.texture_filtering_description, R.array.textureFilteringEntries, R.array.textureFilteringValues)); - int stereoModeValue = IntSetting.GFX_STEREO_MODE.getInt(mSettings); + int stereoModeValue = IntSetting.GFX_STEREO_MODE.getInt(); final int anaglyphMode = 3; String[] shaderList = stereoModeValue == anaglyphMode ? PostProcessing.getAnaglyphShaderList() : PostProcessing.getShaderList(); @@ -1216,7 +1216,7 @@ public final class SettingsFragmentPresenter sl.add(new SwitchSetting(mContext, new AbstractBooleanSetting() { @Override - public boolean isOverridden(Settings settings) + public boolean isOverridden() { return false; } @@ -1228,20 +1228,20 @@ public final class SettingsFragmentPresenter } @Override - public boolean delete(Settings settings) + public boolean delete(@NonNull Settings settings) { mView.setMappingAllDevices(false); return true; } @Override - public boolean getBoolean(Settings settings) + public boolean getBoolean() { return mView.isMappingAllDevices(); } @Override - public void setBoolean(Settings settings, boolean newValue) + public void setBoolean(@NonNull Settings settings, boolean newValue) { mView.setMappingAllDevices(newValue); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/DateTimeSettingViewHolder.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/DateTimeSettingViewHolder.kt index 79693e9c64..2778a489fc 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/DateTimeSettingViewHolder.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/DateTimeSettingViewHolder.kt @@ -22,7 +22,7 @@ class DateTimeSettingViewHolder( override fun bind(item: SettingsItem) { mItem = item as DateTimeChoiceSetting - val inputTime = mItem!!.getSelectedValue(adapter.settings) + val inputTime = mItem!!.getSelectedValue() binding.textSettingName.text = item.getName() if (!TextUtils.isEmpty(inputTime)) { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/FilePickerViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/FilePickerViewHolder.java index 87b84bd35c..1b75bb72b2 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/FilePickerViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/FilePickerViewHolder.java @@ -35,7 +35,7 @@ public final class FilePickerViewHolder extends SettingViewHolder mFilePicker = (FilePicker) item; mItem = item; - String path = mFilePicker.getSelectedValue(getAdapter().getSettings()); + String path = mFilePicker.getSelectedValue(); if (FileBrowserHelper.isPathEmptyOrValid(path)) { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/InputStringSettingViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/InputStringSettingViewHolder.java index 070284d38a..6743808079 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/InputStringSettingViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/InputStringSettingViewHolder.java @@ -31,7 +31,7 @@ public final class InputStringSettingViewHolder extends SettingViewHolder { mInputString = (InputStringSetting) item; - String inputString = mInputString.getSelectedValue(getAdapter().getSettings()); + String inputString = mInputString.getSelectedValue(); mBinding.textSettingName.setText(item.getName()); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java index 18fd466461..5217e4f889 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java @@ -41,7 +41,7 @@ public abstract class SettingViewHolder extends RecyclerView.ViewHolder protected void setStyle(TextView textView, SettingsItem settingsItem) { - boolean overridden = settingsItem.isOverridden(mAdapter.getSettings()); + boolean overridden = settingsItem.isOverridden(); textView.setTypeface(null, overridden ? Typeface.BOLD : Typeface.NORMAL); if (!settingsItem.isEditable()) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SingleChoiceViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SingleChoiceViewHolder.java index beb15867c5..15ebaf4e82 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SingleChoiceViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SingleChoiceViewHolder.java @@ -18,7 +18,7 @@ import org.dolphinemu.dolphinemu.features.settings.model.view.StringSingleChoice import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag; import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter; -import java.util.function.Function; +import java.util.function.Supplier; public final class SingleChoiceViewHolder extends SettingViewHolder { @@ -39,9 +39,6 @@ public final class SingleChoiceViewHolder extends SettingViewHolder mBinding.textSettingName.setText(item.getName()); - SettingsAdapter adapter = getAdapter(); - Settings settings = adapter.getSettings(); - if (!TextUtils.isEmpty(item.getDescription())) { mBinding.textSettingDescription.setText(item.getDescription()); @@ -49,7 +46,7 @@ public final class SingleChoiceViewHolder extends SettingViewHolder else if (item instanceof SingleChoiceSetting) { SingleChoiceSetting setting = (SingleChoiceSetting) item; - int selected = setting.getSelectedValue(settings); + int selected = setting.getSelectedValue(); Resources resMgr = mBinding.textSettingDescription.getContext().getResources(); String[] choices = resMgr.getStringArray(setting.getChoicesId()); int[] values = resMgr.getIntArray(setting.getValuesId()); @@ -64,14 +61,14 @@ public final class SingleChoiceViewHolder extends SettingViewHolder else if (item instanceof StringSingleChoiceSetting) { StringSingleChoiceSetting setting = (StringSingleChoiceSetting) item; - String choice = setting.getSelectedChoice(settings); + String choice = setting.getSelectedChoice(); mBinding.textSettingDescription.setText(choice); } else if (item instanceof SingleChoiceSettingDynamicDescriptions) { SingleChoiceSettingDynamicDescriptions setting = (SingleChoiceSettingDynamicDescriptions) item; - int selected = setting.getSelectedValue(settings); + int selected = setting.getSelectedValue(); Resources resMgr = mBinding.textSettingDescription.getContext().getResources(); String[] choices = resMgr.getStringArray(setting.getDescriptionChoicesId()); int[] values = resMgr.getIntArray(setting.getDescriptionValuesId()); @@ -85,7 +82,7 @@ public final class SingleChoiceViewHolder extends SettingViewHolder } MenuTag menuTag = null; - Function getSelectedValue = null; + Supplier getSelectedValue = null; if (item instanceof SingleChoiceSetting) { SingleChoiceSetting setting = (SingleChoiceSetting) item; @@ -99,15 +96,14 @@ public final class SingleChoiceViewHolder extends SettingViewHolder getSelectedValue = setting::getSelectedValueIndex; } - if (menuTag != null && - adapter.hasMenuTagActionForValue(menuTag, getSelectedValue.apply(settings))) + if (menuTag != null && getAdapter().hasMenuTagActionForValue(menuTag, getSelectedValue.get())) { mBinding.buttonMoreSettings.setVisibility(View.VISIBLE); final MenuTag finalMenuTag = menuTag; - final Function finalGetSelectedValue = getSelectedValue; + final Supplier finalGetSelectedValue = getSelectedValue; mBinding.buttonMoreSettings.setOnClickListener((view) -> - adapter.onMenuTagAction(finalMenuTag, finalGetSelectedValue.apply(settings))); + getAdapter().onMenuTagAction(finalMenuTag, finalGetSelectedValue.get())); } else { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SliderViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SliderViewHolder.java index 1f60a9825a..8d53bb1365 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SliderViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SliderViewHolder.java @@ -44,9 +44,8 @@ public final class SliderViewHolder extends SettingViewHolder } else { - mBinding.textSettingDescription.setText(mContext - .getString(R.string.slider_setting_value, - mItem.getSelectedValue(getAdapter().getSettings()), mItem.getUnits())); + mBinding.textSettingDescription.setText(mContext.getString(R.string.slider_setting_value, + mItem.getSelectedValue(), mItem.getUnits())); } setStyle(mBinding.textSettingName, mItem); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SwitchSettingViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SwitchSettingViewHolder.java index c4245a9bcd..398711bea2 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SwitchSettingViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SwitchSettingViewHolder.java @@ -38,7 +38,7 @@ public final class SwitchSettingViewHolder extends SettingViewHolder mBinding.textSettingName.setText(item.getName()); mBinding.textSettingDescription.setText(item.getDescription()); - mBinding.settingSwitch.setChecked(mItem.isChecked(getAdapter().getSettings())); + mBinding.settingSwitch.setChecked(mItem.isChecked()); mBinding.settingSwitch.setEnabled(mItem.isEditable()); // Check for IPL to make sure user can skip. @@ -56,14 +56,7 @@ public final class SwitchSettingViewHolder extends SettingViewHolder } } - if (mItem.isChecked(getAdapter().getSettings())) - { - mBinding.settingSwitch.setEnabled(iplExists); - } - else - { - mBinding.settingSwitch.setEnabled(true); - } + mBinding.settingSwitch.setEnabled(iplExists || !mItem.isChecked()); } mBinding.settingSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> @@ -95,7 +88,7 @@ public final class SwitchSettingViewHolder extends SettingViewHolder if (mItem.getSetting() == BooleanSetting.MAIN_SKIP_IPL && !iplExists) { - if (mItem.isChecked(getAdapter().getSettings())) + if (mItem.isChecked()) { showIplNotAvailableError(); return; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java index 27e425d8b6..2a808f8dc5 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java @@ -115,7 +115,7 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C { int overlayX = mInputOverlay.getLeft(); int overlayY = mInputOverlay.getTop(); - mInputOverlay.setSurfacePosition(activity.getSettings(), new Rect( + mInputOverlay.setSurfacePosition(new Rect( surfaceView.getLeft() - overlayX, surfaceView.getTop() - overlayY, surfaceView.getRight() - overlayX, surfaceView.getBottom() - overlayY)); }); @@ -135,7 +135,7 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C super.onResume(); if (mInputOverlay != null && NativeLibrary.IsGameMetadataValid()) - mInputOverlay.refreshControls(activity.getSettings()); + mInputOverlay.refreshControls(); run(activity.isActivityRecreated()); } @@ -171,34 +171,34 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C public void toggleInputOverlayVisibility(Settings settings) { BooleanSetting.MAIN_SHOW_INPUT_OVERLAY - .setBoolean(settings, !BooleanSetting.MAIN_SHOW_INPUT_OVERLAY.getBoolean(settings)); + .setBoolean(settings, !BooleanSetting.MAIN_SHOW_INPUT_OVERLAY.getBoolean()); if (mInputOverlay != null) - mInputOverlay.refreshControls(settings); + mInputOverlay.refreshControls(); } - public void initInputPointer(Settings settings) + public void initInputPointer() { if (mInputOverlay != null) - mInputOverlay.initTouchPointer(settings); + mInputOverlay.initTouchPointer(); } - public void refreshInputOverlay(Settings settings) + public void refreshInputOverlay() { if (mInputOverlay != null) - mInputOverlay.refreshControls(settings); + mInputOverlay.refreshControls(); } - public void refreshOverlayPointer(Settings settings) + public void refreshOverlayPointer() { if (mInputOverlay != null) - mInputOverlay.refreshOverlayPointer(settings); + mInputOverlay.refreshOverlayPointer(); } - public void resetInputOverlay(Settings settings) + public void resetInputOverlay() { if (mInputOverlay != null) - mInputOverlay.resetButtonPlacement(settings); + mInputOverlay.resetButtonPlacement(); } @Override diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java index f0a212248f..1a6a751ffd 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java @@ -36,7 +36,6 @@ import org.dolphinemu.dolphinemu.features.input.model.controlleremu.EmulatedCont import org.dolphinemu.dolphinemu.features.input.model.controlleremu.NumericSetting; import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting; import org.dolphinemu.dolphinemu.features.settings.model.IntSetting; -import org.dolphinemu.dolphinemu.features.settings.model.Settings; import java.util.ArrayList; import java.util.Arrays; @@ -145,13 +144,13 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener requestFocus(); } - public void setSurfacePosition(Settings settings, Rect rect) + public void setSurfacePosition(Rect rect) { mSurfacePosition = rect; - initTouchPointer(settings); + initTouchPointer(); } - public void initTouchPointer(Settings settings) + public void initTouchPointer() { // Check if we have all the data we need yet boolean aspectRatioAvailable = NativeLibrary.IsRunningAndStarted(); @@ -164,7 +163,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener int doubleTapButton = IntSetting.MAIN_DOUBLE_TAP_BUTTON.getIntGlobal(); - if (getConfiguredControllerType(settings) != InputOverlay.OVERLAY_WIIMOTE_CLASSIC && + if (getConfiguredControllerType() != InputOverlay.OVERLAY_WIIMOTE_CLASSIC && doubleTapButton == ButtonType.CLASSIC_BUTTON_A) { doubleTapButton = ButtonType.WIIMOTE_BUTTON_A; @@ -792,7 +791,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener } } - public void refreshControls(Settings settings) + public void refreshControls() { unregisterControllers(); @@ -805,11 +804,11 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT ? "-Portrait" : ""; - mControllerType = getConfiguredControllerType(settings); + mControllerType = getConfiguredControllerType(); IntSetting controllerSetting = NativeLibrary.IsEmulatingWii() ? IntSetting.MAIN_OVERLAY_WII_CONTROLLER : IntSetting.MAIN_OVERLAY_GC_CONTROLLER; - int controllerIndex = controllerSetting.getInt(settings); + int controllerIndex = controllerSetting.getInt(); if (BooleanSetting.MAIN_SHOW_INPUT_OVERLAY.getBooleanGlobal()) { @@ -817,7 +816,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener switch (mControllerType) { case OVERLAY_GAMECUBE: - if (IntSetting.getSettingForSIDevice(controllerIndex).getInt(settings) == + if (IntSetting.getSettingForSIDevice(controllerIndex).getInt() == DISABLED_GAMECUBE_CONTROLLER && mIsFirstRun) { Toast.makeText(getContext(), R.string.disabled_gc_overlay_notice, Toast.LENGTH_SHORT) @@ -866,21 +865,21 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener invalidate(); } - public void refreshOverlayPointer(Settings settings) + public void refreshOverlayPointer() { if (overlayPointer != null) { - overlayPointer.setMode(IntSetting.MAIN_IR_MODE.getInt(settings)); - overlayPointer.setRecenter(BooleanSetting.MAIN_IR_ALWAYS_RECENTER.getBoolean(settings)); + overlayPointer.setMode(IntSetting.MAIN_IR_MODE.getInt()); + overlayPointer.setRecenter(BooleanSetting.MAIN_IR_ALWAYS_RECENTER.getBoolean()); } } - public void resetButtonPlacement(Settings settings) + public void resetButtonPlacement() { boolean isLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; - final int controller = getConfiguredControllerType(settings); + final int controller = getConfiguredControllerType(); if (controller == OVERLAY_GAMECUBE) { if (isLandscape) @@ -908,26 +907,26 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener wiiOnlyPortraitDefaultOverlay(); } } - refreshControls(settings); + refreshControls(); } - public static int getConfiguredControllerType(Settings settings) + public static int getConfiguredControllerType() { IntSetting controllerSetting = NativeLibrary.IsEmulatingWii() ? IntSetting.MAIN_OVERLAY_WII_CONTROLLER : IntSetting.MAIN_OVERLAY_GC_CONTROLLER; - int controllerIndex = controllerSetting.getInt(settings); + int controllerIndex = controllerSetting.getInt(); if (controllerIndex >= 0 && controllerIndex < 4) { // GameCube controller - if (IntSetting.getSettingForSIDevice(controllerIndex).getInt(settings) == 6) + if (IntSetting.getSettingForSIDevice(controllerIndex).getInt() == 6) return OVERLAY_GAMECUBE; } else if (controllerIndex >= 4 && controllerIndex < 8) { // Wii Remote int wiimoteIndex = controllerIndex - 4; - if (IntSetting.getSettingForWiimoteSource(wiimoteIndex).getInt(settings) == 1) + if (IntSetting.getSettingForWiimoteSource(wiimoteIndex).getInt() == 1) { int attachmentIndex = EmulatedController.getSelectedWiimoteAttachment(wiimoteIndex); switch (attachmentIndex) @@ -939,7 +938,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener } NumericSetting sidewaysSetting = EmulatedController.getSidewaysWiimoteSetting(wiimoteIndex); - boolean sideways = new InputMappingBooleanSetting(sidewaysSetting).getBoolean(settings); + boolean sideways = new InputMappingBooleanSetting(sidewaysSetting).getBoolean(); return sideways ? OVERLAY_WIIMOTE_SIDEWAYS : OVERLAY_WIIMOTE; }