Fix lua drawing from disappearing while paused, only have it update once per frame, and have it draw before frame advance

This commit is contained in:
adelikat 2012-09-02 14:54:30 +00:00
parent bc3e9edb96
commit b45a9b80a3
2 changed files with 12 additions and 1 deletions

View File

@ -559,6 +559,14 @@ namespace BizHawk.MultiClient
volatile bool VsyncToggle = false; volatile bool VsyncToggle = false;
volatile bool VsyncRequested = false; volatile bool VsyncRequested = false;
SwappableDisplaySurfaceSet sourceSurfaceSet = new SwappableDisplaySurfaceSet(); SwappableDisplaySurfaceSet sourceSurfaceSet = new SwappableDisplaySurfaceSet();
DisplaySurface luaEmuSurface = null;
public void PreFrameUpdateLuaSource()
{
luaEmuSurface = luaEmuSurfaceSet.GetCurrent();
}
public void UpdateSource(IVideoProvider videoProvider) public void UpdateSource(IVideoProvider videoProvider)
{ {
var newPendingSurface = sourceSurfaceSet.AllocateSurface(videoProvider.BufferWidth, videoProvider.BufferHeight, false); var newPendingSurface = sourceSurfaceSet.AllocateSurface(videoProvider.BufferWidth, videoProvider.BufferHeight, false);
@ -584,7 +592,7 @@ namespace BizHawk.MultiClient
int w = currNativeWidth; int w = currNativeWidth;
int h = currNativeHeight; int h = currNativeHeight;
DisplaySurface luaEmuSurface = luaEmuSurfaceSet.GetCurrent();
DisplaySurface luaSurface = luaNativeSurfaceSet.GetCurrent(); DisplaySurface luaSurface = luaNativeSurfaceSet.GetCurrent();
//do we have anything to do? //do we have anything to do?
@ -598,7 +606,9 @@ namespace BizHawk.MultiClient
Global.RenderPanel.Clear(Color.FromArgb(videoProvider.BackgroundColor)); Global.RenderPanel.Clear(Color.FromArgb(videoProvider.BackgroundColor));
Global.RenderPanel.Render(surfaceToRender); Global.RenderPanel.Render(surfaceToRender);
if (luaEmuSurface != null) if (luaEmuSurface != null)
{
Global.RenderPanel.RenderOverlay(luaEmuSurface); Global.RenderPanel.RenderOverlay(luaEmuSurface);
}
RenderOSD(); RenderOSD();

View File

@ -1900,6 +1900,7 @@ namespace BizHawk.MultiClient
UpdateToolsBefore(); UpdateToolsBefore();
#if WINDOWS #if WINDOWS
LuaConsole1.ResumeScripts(true); LuaConsole1.ResumeScripts(true);
Global.DisplayManager.PreFrameUpdateLuaSource();
#endif #endif
} }