Add screen crop feature

This commit is contained in:
Adam Scott
2026-03-24 14:18:15 -04:00
parent 2b6667a98d
commit a5059cbca8
14 changed files with 310 additions and 56 deletions

View File

@@ -678,7 +678,8 @@ enum class BooleanSetting(
SYSCONF_WIIMOTE_MOTOR(Settings.FILE_SYSCONF, "BT", "MOT", true),
GFX_VSYNC(Settings.FILE_GFX, Settings.SECTION_GFX_HARDWARE, "VSync", false),
GFX_WIDESCREEN_HACK(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "wideScreenHack", false),
GFX_CROP(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "Crop", false),
GFX_CROP_TO_ASPECT_RATIO(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "Crop", false),
GFX_CROP_CUSTOM(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "CropCustom", false),
GFX_SHOW_FPS(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "ShowFPS", false),
GFX_SHOW_FTIMES(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "ShowFTimes", false),
GFX_SHOW_VPS(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "ShowVPS", false),

View File

@@ -133,6 +133,30 @@ enum class IntSetting(
"PerfSampWindowMS",
1000
),
GFX_CROP_CUSTOM_TOP(
Settings.FILE_GFX,
Settings.SECTION_GFX_SETTINGS,
"CropCustomTop",
0
),
GFX_CROP_CUSTOM_BOTTOM(
Settings.FILE_GFX,
Settings.SECTION_GFX_SETTINGS,
"CropCustomBottom",
0
),
GFX_CROP_CUSTOM_LEFT(
Settings.FILE_GFX,
Settings.SECTION_GFX_SETTINGS,
"CropCustomLeft",
0
),
GFX_CROP_CUSTOM_RIGHT(
Settings.FILE_GFX,
Settings.SECTION_GFX_SETTINGS,
"CropCustomRight",
0
),
LOGGER_VERBOSITY(Settings.FILE_LOGGER, Settings.SECTION_LOGGER_OPTIONS, "Verbosity", 1),
WIIMOTE_1_SOURCE(Settings.FILE_WIIMOTE, "Wiimote1", "Source", 1),
WIIMOTE_2_SOURCE(Settings.FILE_WIIMOTE, "Wiimote2", "Source", 0),

View File

@@ -1974,15 +1974,73 @@ class SettingsFragmentPresenter(
)
)
sl.add(HeaderSetting(context, R.string.misc, 0))
sl.add(HeaderSetting(context, R.string.crop, 0))
sl.add(
SwitchSetting(
context,
BooleanSetting.GFX_CROP,
R.string.crop,
R.string.crop_description
BooleanSetting.GFX_CROP_TO_ASPECT_RATIO,
R.string.crop_to_aspect_ratio,
R.string.crop_to_aspect_ratio_description
)
)
sl.add(
SwitchSetting(
context,
BooleanSetting.GFX_CROP_CUSTOM,
R.string.crop_custom,
R.string.crop_custom_description
)
)
sl.add(
IntSliderSetting(
context,
IntSetting.GFX_CROP_CUSTOM_TOP,
R.string.crop_custom_top,
R.string.crop_custom_top_description,
0,
528,
"px",
1,
)
)
sl.add(
IntSliderSetting(
context,
IntSetting.GFX_CROP_CUSTOM_BOTTOM,
R.string.crop_custom_bottom,
R.string.crop_custom_bottom_description,
0,
528,
"px",
1,
)
)
sl.add(
IntSliderSetting(
context,
IntSetting.GFX_CROP_CUSTOM_LEFT,
R.string.crop_custom_left,
R.string.crop_custom_left_description,
min=0,
max=640,
units="px",
stepSize=1,
)
)
sl.add(
IntSliderSetting(
context,
IntSetting.GFX_CROP_CUSTOM_RIGHT,
R.string.crop_custom_right,
R.string.crop_custom_right_description,
0,
640,
"px",
1,
)
)
sl.add(HeaderSetting(context, R.string.misc, 0))
sl.add(
SwitchSetting(
context,

View File

@@ -338,7 +338,18 @@
<string name="dump_mip_texture_description">Whether to dump mipmapped game textures to User/Dump/Textures/&lt;game_id&gt;/.</string>
<string name="misc">Misc</string>
<string name="crop">Crop</string>
<string name="crop_description">Crops the picture from its native aspect ratio to 4:3 or 16:9. If unsure, leave this unchecked.</string>
<string name="crop_to_aspect_ratio">To Aspect Ratio</string>
<string name="crop_to_aspect_ratio_description">Crops the picture from its native aspect ratio to 4:3 or 16:9. If unsure, leave this unchecked.</string>
<string name="crop_custom">Custom</string>
<string name="crop_custom_description">Enables options to crop the picture by discrete native pixels (independent of the internal resolution setting) in order to attain a specific user target aspect ratio. Useful to resolve letterboxing issues. If unsure, leave this unchecked.</string>
<string name="crop_custom_top">Custom Top</string>
<string name="crop_custom_top_description">Crops the picture top side by discrete native pixels (independent of the internal resolution setting) in order to attain a specific user target aspect ratio. If unsure, leave this value to 0.</string>
<string name="crop_custom_bottom">Custom Bottom</string>
<string name="crop_custom_bottom_description">Crops the picture bottom side by discrete native pixels (independent of the internal resolution setting) in order to attain a specific user target aspect ratio. If unsure, leave this value to 0.</string>
<string name="crop_custom_left">Custom Left</string>
<string name="crop_custom_left_description">Crops the picture left side by discrete native pixels (independent of the internal resolution setting) in order to attain a specific user target aspect ratio. If unsure, leave this value to 0.</string>
<string name="crop_custom_right">Custom Right</string>
<string name="crop_custom_right_description">Crops the picture right side by discrete native pixels (independent of the internal resolution setting) in order to attain a specific user target aspect ratio. If unsure, leave this value to 0.</string>
<string name="progressive_scan">Enable Progressive Scan</string>
<string name="vsync">V-Sync</string>
<string name="vsync_description">This setting is unnecessary on most Android devices, because Android always enables V-Sync. If unsure, leave this unchecked.</string>