mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-17 08:07:01 +02:00
added SGSRs to sharpness slider resolve list (#3959)
both SGSRs were not in the resolve *SRs list. just inserted them there. also renamed the fsr* vars to sharpness* for semantics. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3959
This commit is contained in:
parent
caeb315a57
commit
69a85b3bc1
1 changed files with 15 additions and 8 deletions
|
|
@ -1090,7 +1090,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
|||
private fun addQuickSettings() {
|
||||
binding.quickSettingsSheet.apply {
|
||||
val container = binding.quickSettingsSheet.findViewById<ViewGroup>(R.id.quick_settings_container)
|
||||
val isFsrSelected = isFsrScalingFilterSelected()
|
||||
val isSharpnessFilterSelected = isSharpnessScalingFilterSelected()
|
||||
|
||||
container.removeAllViews()
|
||||
|
||||
|
|
@ -1176,7 +1176,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
|||
addQuickSettings()
|
||||
}
|
||||
|
||||
if (isFsrSelected) {
|
||||
if (isSharpnessFilterSelected) {
|
||||
quickSettings.addSliderSetting(
|
||||
R.string.fsr_sharpness,
|
||||
container,
|
||||
|
|
@ -1197,17 +1197,24 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
|||
}
|
||||
}
|
||||
|
||||
private fun isFsrScalingFilterSelected(): Boolean {
|
||||
val fsrFilterValue = resolveFsrScalingFilterValue() ?: return false
|
||||
private fun isSharpnessScalingFilterSelected(): Boolean {
|
||||
val selectedFilter = IntSetting.RENDERER_SCALING_FILTER.getInt(needsGlobal = false)
|
||||
return selectedFilter == fsrFilterValue
|
||||
return selectedFilter in resolveSharpnessScalingFilterValues()
|
||||
}
|
||||
|
||||
private fun resolveFsrScalingFilterValue(): Int? {
|
||||
private fun resolveSharpnessScalingFilterValues(): Set<Int> {
|
||||
val names = resources.getStringArray(R.array.rendererScalingFilterNames)
|
||||
val values = resources.getIntArray(R.array.rendererScalingFilterValues)
|
||||
val fsrIndex = names.indexOf(getString(R.string.scaling_filter_fsr))
|
||||
return if (fsrIndex in values.indices) values[fsrIndex] else null
|
||||
val sharpnessFilterNames = setOf(
|
||||
getString(R.string.scaling_filter_fsr),
|
||||
getString(R.string.scaling_filter_sgsr),
|
||||
getString(R.string.scaling_filter_sgsr_edge),
|
||||
)
|
||||
return names.asSequence()
|
||||
.mapIndexedNotNull { index, name ->
|
||||
if (name in sharpnessFilterNames && index in values.indices) values[index] else null
|
||||
}
|
||||
.toSet()
|
||||
}
|
||||
|
||||
private fun openQuickSettingsMenu() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue