fix bug where changing cores could sometimes leave client sizing logic in wrong state and yield a mis-sized window

This commit is contained in:
zeromus 2014-05-18 02:11:17 +00:00
parent cc179df444
commit b9b5cbaf12
1 changed files with 8 additions and 5 deletions

View File

@ -1070,8 +1070,7 @@ namespace BizHawk.Client.EmuHawk
#region Private variables
private int _lastWidth = -1;
private int _lastHeight = -1;
private Size _lastVideoSize = new Size(-1, -1), _lastVirtualSize = new Size(-1, -1);
private readonly SaveSlotManager _stateSlots = new SaveSlotManager();
// AVI/WAV state
@ -1622,11 +1621,15 @@ namespace BizHawk.Client.EmuHawk
private void Render()
{
//private Size _lastVideoSize = new Size(-1, -1), _lastVirtualSize = new Size(-1, -1);
var video = Global.Emulator.VideoProvider;
if (video.BufferHeight != _lastHeight || video.BufferWidth != _lastWidth)
bool change = false;
Size currVideoSize = new Size(video.BufferWidth,video.BufferHeight);
Size currVirtualSize = new Size(video.VirtualWidth,video.VirtualWidth);
if (currVideoSize != _lastVideoSize || currVirtualSize != _lastVirtualSize)
{
_lastWidth = video.BufferWidth;
_lastHeight = video.BufferHeight;
_lastVideoSize = currVideoSize;
_lastVirtualSize = currVirtualSize;
FrameBufferResized();
}