diff options
author | Charles Lombardo <clombardo169@gmail.com> | 2023-08-26 03:58:52 +0200 |
---|---|---|
committer | Charles Lombardo <clombardo169@gmail.com> | 2023-08-30 01:42:42 +0200 |
commit | 21ad5f5cc515efd80223b548218588b78ae91a53 (patch) | |
tree | 32a8a6b13cb4db9b842e16199cda118bf34cf657 /src/android | |
parent | android: Proper state restoration on settings dialogs (diff) | |
download | yuzu-21ad5f5cc515efd80223b548218588b78ae91a53.tar yuzu-21ad5f5cc515efd80223b548218588b78ae91a53.tar.gz yuzu-21ad5f5cc515efd80223b548218588b78ae91a53.tar.bz2 yuzu-21ad5f5cc515efd80223b548218588b78ae91a53.tar.lz yuzu-21ad5f5cc515efd80223b548218588b78ae91a53.tar.xz yuzu-21ad5f5cc515efd80223b548218588b78ae91a53.tar.zst yuzu-21ad5f5cc515efd80223b548218588b78ae91a53.zip |
Diffstat (limited to 'src/android')
3 files changed, 15 insertions, 7 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/AbstractSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/AbstractSetting.kt index 73215c247..8b6d29fe5 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/AbstractSetting.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/AbstractSetting.kt @@ -9,6 +9,8 @@ interface AbstractSetting { val key: String val category: Settings.Category val defaultValue: Any + val androidDefault: Any? + get() = null val valueAsString: String get() = "" diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt index f7528642e..e0c0538c7 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt @@ -7,17 +7,18 @@ import org.yuzu.yuzu_emu.utils.NativeConfig enum class BooleanSetting( override val key: String, - override val category: Settings.Category + override val category: Settings.Category, + override val androidDefault: Boolean? = null ) : AbstractBooleanSetting { CPU_DEBUG_MODE("cpu_debug_mode", Settings.Category.Cpu), FASTMEM("cpuopt_fastmem", Settings.Category.Cpu), FASTMEM_EXCLUSIVES("cpuopt_fastmem_exclusives", Settings.Category.Cpu), RENDERER_USE_SPEED_LIMIT("use_speed_limit", Settings.Category.Core), - USE_DOCKED_MODE("use_docked_mode", Settings.Category.System), + USE_DOCKED_MODE("use_docked_mode", Settings.Category.System, false), RENDERER_USE_DISK_SHADER_CACHE("use_disk_shader_cache", Settings.Category.Renderer), RENDERER_FORCE_MAX_CLOCK("force_max_clock", Settings.Category.Renderer), RENDERER_ASYNCHRONOUS_SHADERS("use_asynchronous_shaders", Settings.Category.Renderer), - RENDERER_REACTIVE_FLUSHING("use_reactive_flushing", Settings.Category.Renderer), + RENDERER_REACTIVE_FLUSHING("use_reactive_flushing", Settings.Category.Renderer, false), RENDERER_DEBUG("debug", Settings.Category.Renderer), PICTURE_IN_PICTURE("picture_in_picture", Settings.Category.Android), USE_CUSTOM_RTC("custom_rtc_enabled", Settings.Category.System); @@ -27,7 +28,9 @@ enum class BooleanSetting( override fun setBoolean(value: Boolean) = NativeConfig.setBoolean(key, value) - override val defaultValue: Boolean by lazy { NativeConfig.getBoolean(key, true) } + override val defaultValue: Boolean by lazy { + androidDefault ?: NativeConfig.getBoolean(key, true) + } override val valueAsString: String get() = if (boolean) "1" else "0" diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt index a64757207..151362124 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt @@ -7,13 +7,14 @@ import org.yuzu.yuzu_emu.utils.NativeConfig enum class IntSetting( override val key: String, - override val category: Settings.Category + override val category: Settings.Category, + override val androidDefault: Int? = null ) : AbstractIntSetting { CPU_ACCURACY("cpu_accuracy", Settings.Category.Cpu), REGION_INDEX("region_index", Settings.Category.System), LANGUAGE_INDEX("language_index", Settings.Category.System), RENDERER_BACKEND("backend", Settings.Category.Renderer), - RENDERER_ACCURACY("gpu_accuracy", Settings.Category.Renderer), + RENDERER_ACCURACY("gpu_accuracy", Settings.Category.Renderer, 0), RENDERER_RESOLUTION("resolution_setup", Settings.Category.Renderer), RENDERER_VSYNC("use_vsync", Settings.Category.Renderer), RENDERER_SCALING_FILTER("scaling_filter", Settings.Category.Renderer), @@ -27,7 +28,9 @@ enum class IntSetting( override fun setInt(value: Int) = NativeConfig.setInt(key, value) - override val defaultValue: Int by lazy { NativeConfig.getInt(key, true) } + override val defaultValue: Int by lazy { + androidDefault ?: NativeConfig.getInt(key, true) + } override val valueAsString: String get() = int.toString() |