Command Line: Resize window properly when scale/overscan changes via command line switches
This commit is contained in:
parent
06d6e59ac8
commit
1f2457769b
2 changed files with 12 additions and 5 deletions
|
@ -49,7 +49,7 @@ FrameInfo VideoDecoder::GetFrameInfo()
|
||||||
void VideoDecoder::GetScreenSize(ScreenSize &size, bool ignoreScale)
|
void VideoDecoder::GetScreenSize(ScreenSize &size, bool ignoreScale)
|
||||||
{
|
{
|
||||||
if(_videoFilter) {
|
if(_videoFilter) {
|
||||||
OverscanDimensions overscan = _videoFilter->GetOverscan();
|
OverscanDimensions overscan = ignoreScale ? _videoFilter->GetOverscan() : EmulationSettings::GetOverscanDimensions();
|
||||||
FrameInfo frameInfo{ overscan.GetScreenWidth(), overscan.GetScreenHeight(), PPU::ScreenWidth, PPU::ScreenHeight, 4 };
|
FrameInfo frameInfo{ overscan.GetScreenWidth(), overscan.GetScreenHeight(), PPU::ScreenWidth, PPU::ScreenHeight, 4 };
|
||||||
double aspectRatio = EmulationSettings::GetAspectRatio();
|
double aspectRatio = EmulationSettings::GetAspectRatio();
|
||||||
double scale = (ignoreScale ? 1 : EmulationSettings::GetVideoScale());
|
double scale = (ignoreScale ? 1 : EmulationSettings::GetVideoScale());
|
||||||
|
|
|
@ -51,6 +51,7 @@ namespace Mesen.GUI.Forms
|
||||||
private float _xFactor = 1;
|
private float _xFactor = 1;
|
||||||
private float _yFactor = 1;
|
private float _yFactor = 1;
|
||||||
private bool _enableResize = false;
|
private bool _enableResize = false;
|
||||||
|
private bool _overrideWindowSize = false;
|
||||||
|
|
||||||
private Dictionary<EmulatorShortcut, Func<bool>> _actionEnabledFuncs = new Dictionary<EmulatorShortcut, Func<bool>>();
|
private Dictionary<EmulatorShortcut, Func<bool>> _actionEnabledFuncs = new Dictionary<EmulatorShortcut, Func<bool>>();
|
||||||
|
|
||||||
|
@ -146,9 +147,15 @@ namespace Mesen.GUI.Forms
|
||||||
|
|
||||||
menuTimer.Start();
|
menuTimer.Start();
|
||||||
|
|
||||||
this.ProcessCommandLineArguments(_commandLineArgs, true);
|
InteropEmu.ScreenSize originalSize = InteropEmu.GetScreenSize(false);
|
||||||
|
|
||||||
VideoInfo.ApplyConfig();
|
VideoInfo.ApplyConfig();
|
||||||
|
this.ProcessCommandLineArguments(_commandLineArgs, true);
|
||||||
|
VideoInfo.ApplyConfig();
|
||||||
|
InteropEmu.ScreenSize newSize = InteropEmu.GetScreenSize(false);
|
||||||
|
if(originalSize.Width != newSize.Width || originalSize.Height != newSize.Height) {
|
||||||
|
_overrideWindowSize = true;
|
||||||
|
}
|
||||||
|
|
||||||
InitializeVsSystemMenu();
|
InitializeVsSystemMenu();
|
||||||
InitializeFdsDiskMenu();
|
InitializeFdsDiskMenu();
|
||||||
InitializeEmulationSpeedMenu();
|
InitializeEmulationSpeedMenu();
|
||||||
|
@ -178,7 +185,7 @@ namespace Mesen.GUI.Forms
|
||||||
CheckForUpdates(false);
|
CheckForUpdates(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ConfigManager.Config.WindowSize.HasValue) {
|
if(ConfigManager.Config.WindowSize.HasValue && !_overrideWindowSize) {
|
||||||
this.ClientSize = ConfigManager.Config.WindowSize.Value;
|
this.ClientSize = ConfigManager.Config.WindowSize.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,7 +219,7 @@ namespace Mesen.GUI.Forms
|
||||||
|
|
||||||
this.BindShortcuts();
|
this.BindShortcuts();
|
||||||
|
|
||||||
if(ConfigManager.Config.WindowSize.HasValue) {
|
if(ConfigManager.Config.WindowSize.HasValue && !_overrideWindowSize) {
|
||||||
this.Size = ConfigManager.Config.WindowSize.Value;
|
this.Size = ConfigManager.Config.WindowSize.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue