3rdParty: allow cropping each side separately in mupen64plus-video-parallel

This commit is contained in:
Rosalie Wanders
2025-05-18 19:16:18 +02:00
parent 1c6d8a6f59
commit 5cab9282e7
7 changed files with 104 additions and 44 deletions
+2 -2
View File
@@ -6,7 +6,7 @@
[subrepo]
remote = git@github.com:/Rosalie241/parallel-rdp-standalone.git
branch = RMG
commit = 74a9badf728fcb6a01ceb2ca9668aae5d1f1157c
parent = cb2948ec7404a7ee91e08fd5c3acb65c41629856
commit = 7d1281997ff5a03378c9dd51fefb164cdb4e7877
parent = fddf5eb4a7e99767c4095b34f542098670cdc78b
method = merge
cmdver = 0.4.6
@@ -61,17 +61,15 @@ MainDialog::MainDialog(QWidget* parent) : QDialog(parent)
}
this->resolutionUpscaleComboBox->setCurrentIndex(comboBoxIndex);
// set deinterlacer combobox
this->deinterlacerComboBox->setCurrentIndex(ConfigGetParamBool(configVideoParallel, KEY_DEINTERLACE) ? 1 : 0);
// set downscaling combobox
this->downscalerComboBox->setCurrentIndex(ConfigGetParamInt(configVideoParallel, KEY_DOWNSCALE));
// set cropOverscan combobox
this->cropOverscanSpinBox->setValue(ConfigGetParamInt(configVideoParallel, KEY_OVERSCANCROP));
// set verticalStretch combobox
this->verticalStretchSpinBox->setValue(ConfigGetParamInt(configVideoParallel, KEY_VERTICAL_STRETCH));
this->overscanGroupBox->setChecked(ConfigGetParamBool(configVideoParallel, KEY_OVERSCANCROPENABLE));
this->overscanLeftSpinBox->setValue(ConfigGetParamInt(configVideoParallel, KEY_OVERSCANCROPLEFT));
this->overscanRightSpinBox->setValue(ConfigGetParamInt(configVideoParallel, KEY_OVERSCANCROPRIGHT));
this->overscanTopSpinBox->setValue(ConfigGetParamInt(configVideoParallel, KEY_OVERSCANCROPTOP));
this->overscanBottomSpinBox->setValue(ConfigGetParamInt(configVideoParallel, KEY_OVERSCANCROPBOTTOM));
this->superSampledDitherCheckBox->setChecked(ConfigGetParamBool(configVideoParallel, KEY_SSDITHER));
this->viAaCheckBox->setChecked(ConfigGetParamBool(configVideoParallel, KEY_AA));
@@ -127,8 +125,16 @@ void MainDialog::on_buttonBox_clicked(QAbstractButton* button)
ConfigSetParameter(configVideoParallel, KEY_DOWNSCALE, M64TYPE_INT, &downscalingValue);
// cropOverscan
int cropOverscanValue = this->cropOverscanSpinBox->value();
ConfigSetParameter(configVideoParallel, KEY_OVERSCANCROP, M64TYPE_INT, &cropOverscanValue);
int overscanEnabled = this->overscanGroupBox->isChecked();
int overscanLeft = this->overscanLeftSpinBox->value();
int overscanRight = this->overscanRightSpinBox->value();
int overscanTop = this->overscanTopSpinBox->value();
int overscanBottom = this->overscanBottomSpinBox->value();
ConfigSetParameter(configVideoParallel, KEY_OVERSCANCROPENABLE, M64TYPE_BOOL, &overscanEnabled);
ConfigSetParameter(configVideoParallel, KEY_OVERSCANCROPLEFT, M64TYPE_INT, &overscanLeft);
ConfigSetParameter(configVideoParallel, KEY_OVERSCANCROPRIGHT, M64TYPE_INT, &overscanRight);
ConfigSetParameter(configVideoParallel, KEY_OVERSCANCROPTOP, M64TYPE_INT, &overscanTop);
ConfigSetParameter(configVideoParallel, KEY_OVERSCANCROPBOTTOM, M64TYPE_INT, &overscanBottom);
// verticalStretch
int verticalStretchValue = this->verticalStretchSpinBox->value();
@@ -167,8 +173,12 @@ void MainDialog::on_buttonBox_clicked(QAbstractButton* button)
this->resolutionUpscaleComboBox->setCurrentText("None");
this->deinterlacerComboBox->setCurrentIndex(0);
this->downscalerComboBox->setCurrentIndex(0);
this->cropOverscanSpinBox->setValue(0);
this->verticalStretchSpinBox->setValue(0);
this->overscanGroupBox->setChecked(false);
this->overscanLeftSpinBox->setValue(0);
this->overscanRightSpinBox->setValue(0);
this->overscanTopSpinBox->setValue(0);
this->overscanBottomSpinBox->setValue(0);
this->superSampledDitherCheckBox->setChecked(true);
this->viAaCheckBox->setChecked(true);
@@ -201,27 +201,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Crop overscan</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="cropOverscanSpinBox">
<property name="suffix">
<string> px</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<property name="bottomMargin">
@@ -358,6 +337,53 @@
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="overscanGroupBox">
<property name="title">
<string>Overscan</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QSpinBox" name="overscanTopSpinBox">
<property name="minimum">
<number>-99</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QSpinBox" name="overscanLeftSpinBox">
<property name="minimum">
<number>-99</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="overscanRightSpinBox">
<property name="minimum">
<number>-99</number>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="overscanBottomSpinBox">
<property name="minimum">
<number>-99</number>
</property>
</widget>
</item>
</layout>
<zorder>overscanBottomSpinBox</zorder>
<zorder>overscanRightSpinBox</zorder>
<zorder>overscanLeftSpinBox</zorder>
<zorder>overscanTopSpinBox</zorder>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
+10 -2
View File
@@ -181,7 +181,11 @@ EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle _CoreLibHandle, void *Co
ConfigSetDefaultBool(configVideoParallel, KEY_DEINTERLACE, 0, "Deinterlacing method. False=Bob, True=Weave");
ConfigSetDefaultBool(configVideoParallel, KEY_SSREADBACKS, 0, "Enable superscaling of readbacks when upsampling");
ConfigSetDefaultBool(configVideoParallel, KEY_SSDITHER, 1, "Enable superscaling of dithering when upsampling");
ConfigSetDefaultInt(configVideoParallel, KEY_OVERSCANCROP, 0, "Amount of overscan pixels to crop on all sides");
ConfigSetDefaultInt(configVideoParallel, KEY_OVERSCANCROPLEFT, 0, "Amount of overscan pixels to crop on the left side");
ConfigSetDefaultInt(configVideoParallel, KEY_OVERSCANCROPRIGHT, 0, "Amount of overscan pixels to crop on the right side");
ConfigSetDefaultInt(configVideoParallel, KEY_OVERSCANCROPTOP, 0, "Amount of overscan pixels to crop on the top side");
ConfigSetDefaultInt(configVideoParallel, KEY_OVERSCANCROPBOTTOM, 0, "Amount of overscan pixels to crop on the bottom side");
ConfigSetDefaultBool(configVideoParallel, KEY_OVERSCANCROPENABLE, 0, "Whether to enable overscan");
ConfigSetDefaultInt(configVideoParallel, KEY_VERTICAL_STRETCH, 0, "Amount of pixels to stretch by vertically. Can fix PAL ports that didn't fill the PAL resolution of 288p (use value of 24 in that case).");
ConfigSetDefaultBool(configVideoParallel, KEY_AA, 1, "VI anti-aliasing, smooths polygon edges.");
ConfigSetDefaultBool(configVideoParallel, KEY_DIVOT, 1, "Allow VI divot filter, cleans up stray black pixels.");
@@ -307,7 +311,11 @@ EXPORT int CALL RomOpen(void)
vk_native_tex_rect = ConfigGetParamBool(configVideoParallel, KEY_NATIVETEXTRECT);
vk_interlacing = ConfigGetParamBool(configVideoParallel, KEY_DEINTERLACE);
vk_downscaling_steps = ConfigGetParamInt(configVideoParallel, KEY_DOWNSCALE);
vk_overscan = ConfigGetParamInt(configVideoParallel, KEY_OVERSCANCROP);
vk_overscan_left = ConfigGetParamInt(configVideoParallel, KEY_OVERSCANCROPLEFT);
vk_overscan_right = ConfigGetParamInt(configVideoParallel, KEY_OVERSCANCROPRIGHT);
vk_overscan_top = ConfigGetParamInt(configVideoParallel, KEY_OVERSCANCROPTOP);
vk_overscan_bottom = ConfigGetParamInt(configVideoParallel, KEY_OVERSCANCROPBOTTOM);
vk_overscan_enable = ConfigGetParamBool(configVideoParallel, KEY_OVERSCANCROPENABLE);
vk_vertical_stretch = ConfigGetParamInt(configVideoParallel, KEY_VERTICAL_STRETCH);
m64p_error netplay_init = ConfigReceiveNetplayConfig(NULL, 0);
+5 -1
View File
@@ -35,7 +35,11 @@ extern ptr_ConfigSetParameter ConfigSetParameter;
#define KEY_WIDESCREEN "WidescreenStretch"
#define KEY_SSDITHER "SuperscaledDither"
#define KEY_SSREADBACKS "SuperscaledReads"
#define KEY_OVERSCANCROP "CropOverscan"
#define KEY_OVERSCANCROPLEFT "CropOverscanLeft"
#define KEY_OVERSCANCROPRIGHT "CropOverscanRight"
#define KEY_OVERSCANCROPTOP "CropOverscanTop"
#define KEY_OVERSCANCROPBOTTOM "CropOverscanBottom"
#define KEY_OVERSCANCROPENABLE "CropOverscanEnable"
#define KEY_VERTICAL_STRETCH "VerticalStretch"
#define KEY_DIVOT "Divot"
#define KEY_GAMMADITHER "GammaDither"
+12 -4
View File
@@ -19,9 +19,13 @@ static std::unique_ptr<MupenWSIPlatform> wsi_platform;
int32_t vk_rescaling;
bool vk_ssreadbacks;
bool vk_ssdither;
unsigned vk_overscan;
unsigned vk_vertical_stretch;
unsigned vk_downscaling_steps;
uint32_t vk_overscan_left;
uint32_t vk_overscan_right;
uint32_t vk_overscan_top;
uint32_t vk_overscan_bottom;
bool vk_overscan_enable;
uint32_t vk_vertical_stretch;
uint32_t vk_downscaling_steps;
bool vk_native_texture_lod;
bool vk_native_tex_rect;
bool vk_divot_filter, vk_gamma_dither;
@@ -180,7 +184,11 @@ static void render_frame(Vulkan::Device &device)
opts.blend_previous_frame = vk_interlacing;
opts.upscale_deinterlacing = !vk_interlacing;
opts.downscale_steps = vk_downscaling_steps;
opts.crop_overscan_pixels = vk_overscan;
opts.crop_rect.left = vk_overscan_left;
opts.crop_rect.right = vk_overscan_right;
opts.crop_rect.top = vk_overscan_top;
opts.crop_rect.bottom = vk_overscan_bottom;
opts.crop_rect.enable = vk_overscan_enable;
if (vk_vertical_stretch) {
opts.crop_rect.top = vk_vertical_stretch;
opts.crop_rect.bottom = vk_vertical_stretch;
+7 -3
View File
@@ -13,9 +13,13 @@ extern "C"
extern bool vk_ssreadbacks;
extern bool vk_ssdither;
extern unsigned vk_overscan;
extern unsigned vk_vertical_stretch;
extern unsigned vk_downscaling_steps;
extern uint32_t vk_overscan_left;
extern uint32_t vk_overscan_right;
extern uint32_t vk_overscan_top;
extern uint32_t vk_overscan_bottom;
extern bool vk_overscan_enable;
extern uint32_t vk_vertical_stretch;
extern uint32_t vk_downscaling_steps;
extern bool vk_native_texture_lod;
extern bool vk_native_tex_rect;
extern bool vk_divot_filter, vk_gamma_dither;