Android: Expose color correction settings

This commit is contained in:
Charles Lombardo 2023-08-11 17:10:03 -04:00
parent f9959656e7
commit 80b329b77f
8 changed files with 109 additions and 10 deletions

View File

@ -595,6 +595,18 @@ enum class BooleanSetting(
"ArbitraryMipmapDetection",
true
),
GFX_CC_CORRECT_COLOR_SPACE(
Settings.FILE_GFX,
Settings.SECTION_GFX_COLOR_CORRECTION,
"CorrectColorSpace",
false
),
GFX_CC_CORRECT_GAMMA(
Settings.FILE_GFX,
Settings.SECTION_GFX_COLOR_CORRECTION,
"CorrectGamma",
false
),
GFX_STEREO_SWAP_EYES(Settings.FILE_GFX, Settings.SECTION_STEREOSCOPY, "StereoSwapEyes", false),
GFX_HACK_EFB_ACCESS_ENABLE(
Settings.FILE_GFX,

View File

@ -10,7 +10,8 @@ enum class FloatSetting(
) : AbstractFloatSetting {
// These entries have the same names and order as in C++, just for consistency.
MAIN_EMULATION_SPEED(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "EmulationSpeed", 1.0f),
MAIN_OVERCLOCK(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "Overclock", 1.0f);
MAIN_OVERCLOCK(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "Overclock", 1.0f),
GFX_CC_GAME_GAMMA(Settings.FILE_GFX, Settings.SECTION_GFX_COLOR_CORRECTION, "GameGamma", 2.35f);
override val isOverridden: Boolean
get() = NativeConfig.isOverridden(file, section, key)

View File

@ -119,6 +119,12 @@ enum class IntSetting(
"MaxAnisotropy",
0
),
GFX_CC_GAME_COLOR_SPACE(
Settings.FILE_GFX,
Settings.SECTION_GFX_COLOR_CORRECTION,
"GameColorSpace",
0
),
GFX_STEREO_MODE(Settings.FILE_GFX, Settings.SECTION_STEREOSCOPY, "StereoMode", 0),
GFX_STEREO_DEPTH(Settings.FILE_GFX, Settings.SECTION_STEREOSCOPY, "StereoDepth", 20),
GFX_STEREO_CONVERGENCE_PERCENTAGE(

View File

@ -135,6 +135,7 @@ class Settings : Closeable {
const val SECTION_LOGGER_OPTIONS = "Options"
const val SECTION_GFX_SETTINGS = "Settings"
const val SECTION_GFX_ENHANCEMENTS = "Enhancements"
const val SECTION_GFX_COLOR_CORRECTION = "ColorCorrection"
const val SECTION_GFX_HACKS = "Hacks"
const val SECTION_DEBUG = "Debug"
const val SECTION_EMULATED_USB_DEVICES = "EmulatedUSBDevices"

View File

@ -272,6 +272,7 @@ class SettingsFragment : Fragment(), SettingsFragmentView {
titles[MenuTag.DEBUG] = R.string.debug_submenu
titles[MenuTag.GRAPHICS] = R.string.graphics_settings
titles[MenuTag.ENHANCEMENTS] = R.string.enhancements_submenu
titles[MenuTag.COLOR_CORRECTION] = R.string.color_correction_submenu
titles[MenuTag.STEREOSCOPY] = R.string.stereoscopy_submenu
titles[MenuTag.HACKS] = R.string.hacks_submenu
titles[MenuTag.STATISTICS] = R.string.statistics_submenu

View File

@ -72,9 +72,8 @@ class SettingsFragmentPresenter(
&& GpuDriverHelper.supportsCustomDriverLoading()
) {
this.gpuDriver =
GpuDriverHelper.getInstalledDriverMetadata() ?: GpuDriverHelper.getSystemDriverMetadata(
context.applicationContext
)
GpuDriverHelper.getInstalledDriverMetadata()
?: GpuDriverHelper.getSystemDriverMetadata(context.applicationContext)
}
}
@ -1333,6 +1332,13 @@ class SettingsFragmentPresenter(
R.array.textureFilteringValues
)
)
sl.add(
SubmenuSetting(
context,
R.string.color_correction_submenu,
MenuTag.COLOR_CORRECTION
)
)
val stereoModeValue = IntSetting.GFX_STEREO_MODE.int
val anaglyphMode = 3
@ -1429,6 +1435,53 @@ class SettingsFragmentPresenter(
}
}
private fun addColorCorrectionSettings(sl: ArrayList<SettingsItem>) {
sl.apply {
add(HeaderSetting(context, R.string.color_space, 0))
add(
SwitchSetting(
context,
BooleanSetting.GFX_CC_CORRECT_COLOR_SPACE,
R.string.correct_color_space,
R.string.correct_color_space_description
)
)
add(
SingleChoiceSetting(
context,
IntSetting.GFX_CC_GAME_COLOR_SPACE,
R.string.game_color_space,
0,
R.array.colorSpaceEntries,
R.array.colorSpaceValues
)
)
add(HeaderSetting(context, R.string.gamma, 0))
add(
FloatSliderSetting(
context,
FloatSetting.GFX_CC_GAME_GAMMA,
R.string.game_gamma,
R.string.game_gamma_description,
2.2f,
2.8f,
"",
0.01f,
true
)
)
add(
SwitchSetting(
context,
BooleanSetting.GFX_CC_CORRECT_GAMMA,
R.string.correct_sdr_gamma,
0
)
)
}
}
private fun addHackSettings(sl: ArrayList<SettingsItem>) {
sl.add(HeaderSetting(context, R.string.embedded_frame_buffer, 0))
sl.add(

View File

@ -685,4 +685,15 @@
<item>21</item>
<item>22</item>
</integer-array>
<string-array name="colorSpaceEntries">
<item>@string/ntscm_space</item>
<item>@string/ntscj_space</item>
<item>@string/pal_space</item>
</string-array>
<integer-array name="colorSpaceValues">
<item>0</item>
<item>1</item>
<item>2</item>
</integer-array>
</resources>

View File

@ -222,6 +222,20 @@
<string name="disable_copy_filter_description">Disables the blending of adjacent rows when copying the EFB. This is known in some games as \"deflickering\" or \"smoothing\". Disabling the filter is usually safe, and may result in a sharper image.</string>
<string name="arbitrary_mipmap_detection">Arbitrary Mipmap Detection</string>
<string name="arbitrary_mipmap_detection_description">Enables detection of arbitrary mipmaps, which some games use for special distance-based effects.\nMay have false positives that result in blurry textures at increased internal resolution, such as in games that use very low resolution mipmaps. Disabling this can also reduce stutter in games that frequently load new textures.\n\nIf unsure, leave this checked.</string>
<string name="color_correction_submenu">Color Correction</string>
<string name="color_space">Color Space</string>
<string name="correct_color_space">Correct Color Space</string>
<string name="correct_color_space_description">Converts the colors from the color spaces that GC/Wii were meant to work with to sRGB/Rec.709.</string>
<string name="game_color_space">Game Color Space</string>
<string name="ntscm_space">NTSC-M (SMPTE 170M)</string>
<string name="ntscj_space">NTSC-J (ARUB TR-89)</string>
<string name="pal_space">PAL (EBU)</string>
<string name="gamma">Gamma</string>
<string name="game_gamma">Game Gamma</string>
<string name="game_gamma_description">NTSC-M and NTSC-J target gamma ~2.2. PAL targets gamma ~2.8.\nNone of the two were necessarily followed by games or TVs. 2.35 is a good generic value for all regions.\nIf a game allows you to chose a gamma value, match it here.</string>
<string name="correct_sdr_gamma">Correct SDR Gamma</string>
<string name="sdr_display_gamma_target">SDR Display Gamma Target</string>
<string name="custom_gamma_target">Custom Gamma Target</string>
<string name="stereoscopy_submenu">Stereoscopy</string>
<string name="stereoscopy_submenu_description">Stereoscopy allows you to get a better feeling of depth if you have the necessary hardware.\nHeavily decreases emulation speed and sometimes causes issues</string>
<string name="wide_screen_hack">Widescreen Hack</string>