fix premature commitation

This commit is contained in:
beirich 2012-08-19 19:16:08 +00:00
parent d1e8bfbd01
commit 728c970f16
1 changed files with 5 additions and 9 deletions

View File

@ -2400,9 +2400,9 @@ namespace BizHawk.MultiClient
private void Render() private void Render()
{ {
var video = Global.Emulator.VideoProvider; var video = Global.Emulator.VideoProvider;
if (video.BufferHeight != lastHeight || video.VirtualWidth != lastWidth) if (video.BufferHeight != lastHeight || video.BufferWidth != lastWidth)
{ {
lastWidth = video.VirtualWidth; lastWidth = video.BufferWidth;
lastHeight = video.BufferHeight; lastHeight = video.BufferHeight;
FrameBufferResized(); FrameBufferResized();
} }
@ -2420,18 +2420,14 @@ namespace BizHawk.MultiClient
int borderHeight = Size.Height - renderTarget.Size.Height; int borderHeight = Size.Height - renderTarget.Size.Height;
// start at target zoom and work way down until we find acceptable zoom // start at target zoom and work way down until we find acceptable zoom
int videoWidth = video.BufferWidth; // just so its initialized for (; zoom >= 1; zoom--)
int videoHeight = video.BufferHeight;
for (; zoom >= 1; zoom--)
{ {
videoWidth = 320 * zoom; if ((((video.BufferWidth * zoom) + borderWidth) < area.Width) && (((video.BufferHeight * zoom) + borderHeight) < area.Height))
videoHeight = video.BufferHeight * zoom;
if ((videoWidth + borderWidth < area.Width) && (videoHeight + borderHeight < area.Height))
break; break;
} }
// Change size // Change size
Size = new Size(videoWidth + borderWidth, videoHeight + borderHeight); Size = new Size((video.BufferWidth * zoom) + borderWidth, (video.BufferHeight * zoom + borderHeight));
PerformLayout(); PerformLayout();
Global.RenderPanel.Resized = true; Global.RenderPanel.Resized = true;