Split `Config.AVWriterResize` tuple into 2 props

fixes 32d2f2311
This commit is contained in:
YoshiRulz 2023-03-26 12:36:24 +10:00
parent 32d2f23117
commit eee8a7e0cc
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 10 additions and 8 deletions

View File

@ -374,6 +374,8 @@ namespace BizHawk.Client.Common
public bool AVWriterPad { get; set; } = false;
public (int Width, int Height) AVWriterResize { get; set; } = (0, 0);
public int AVWriterResizeHeight { get; set; } = 0;
public int AVWriterResizeWidth { get; set; } = 0;
}
}

View File

@ -68,8 +68,8 @@ namespace BizHawk.Client.EmuHawk
{
checkBoxASync = { Checked = config.VideoWriterAudioSyncEffective },
checkBoxPad = { Checked = config.AVWriterPad },
numericTextBoxH = { Text = Math.Max(0, config.AVWriterResize.Height).ToString() },
numericTextBoxW = { Text = Math.Max(0, config.AVWriterResize.Width).ToString() },
numericTextBoxH = { Text = Math.Max(0, config.AVWriterResizeHeight).ToString() },
numericTextBoxW = { Text = Math.Max(0, config.AVWriterResizeWidth).ToString() },
labelDescriptionBody = { Text = "" }
};
@ -106,7 +106,7 @@ namespace BizHawk.Client.EmuHawk
if (ret is not null)
{
config.AVWriterResize = dlg.checkBoxResize.Checked
(config.AVWriterResizeWidth, config.AVWriterResizeHeight) = dlg.checkBoxResize.Checked
? (dlg.numericTextBoxW.IntValue, dlg.numericTextBoxH.IntValue)
: (-1, -1);
config.AVWriterPad = dlg.checkBoxPad.Checked;

View File

@ -3381,9 +3381,9 @@ namespace BizHawk.Client.EmuHawk
aw = Config.VideoWriterAudioSyncEffective ? new VideoStretcher(aw) : new AudioStretcher(aw);
aw.SetMovieParameters(Emulator.VsyncNumerator(), Emulator.VsyncDenominator());
if (Config.AVWriterResize.Width > 0 && Config.AVWriterResize.Height > 0)
if (Config.AVWriterResizeWidth > 0 && Config.AVWriterResizeHeight > 0)
{
aw.SetVideoParameters(Config.AVWriterResize.Width, Config.AVWriterResize.Height);
aw.SetVideoParameters(Config.AVWriterResizeWidth, Config.AVWriterResizeHeight);
}
else
{
@ -3546,7 +3546,7 @@ namespace BizHawk.Client.EmuHawk
{
IVideoProvider output;
IDisposable disposableOutput = null;
if (Config.AVWriterResize.Width > 0 && Config.AVWriterResize.Height > 0)
if (Config.AVWriterResizeWidth > 0 && Config.AVWriterResizeHeight > 0)
{
BitmapBuffer bbIn = null;
Bitmap bmpIn = null;
@ -3558,7 +3558,7 @@ namespace BizHawk.Client.EmuHawk
bbIn.DiscardAlpha();
Bitmap bmpOut = new(width: Config.AVWriterResize.Width, height: Config.AVWriterResize.Height, PixelFormat.Format32bppArgb);
Bitmap bmpOut = new(width: Config.AVWriterResizeWidth, height: Config.AVWriterResizeHeight, PixelFormat.Format32bppArgb);
bmpIn = bbIn.ToSysdrawingBitmap();
using (var g = Graphics.FromImage(bmpOut))
{