Lua Drawing - fix so that multiple scripts can draw at once

This commit is contained in:
adelikat 2012-10-06 14:36:02 +00:00
parent 644ed40f59
commit 1c17f8dbed
2 changed files with 5 additions and 3 deletions

View File

@ -2317,6 +2317,7 @@ namespace BizHawk.MultiClient
/// </summary> /// </summary>
public void UpdateToolsBefore() public void UpdateToolsBefore()
{ {
LuaConsole1.LuaImp.FrameRegisterBefore(); LuaConsole1.LuaImp.FrameRegisterBefore();
NESNameTableViewer1.UpdateValues(); NESNameTableViewer1.UpdateValues();
NESPPU1.UpdateValues(); NESPPU1.UpdateValues();

View File

@ -840,18 +840,19 @@ namespace BizHawk.MultiClient
/// <param name="includeFrameWaiters">should frame waiters be waken up? only use this immediately before a frame of emulation</param> /// <param name="includeFrameWaiters">should frame waiters be waken up? only use this immediately before a frame of emulation</param>
public void ResumeScripts(bool includeFrameWaiters) public void ResumeScripts(bool includeFrameWaiters)
{ {
LuaImp.gui_drawNewEmu();
for (int i = 0; i < luaList.Count; i++) for (int i = 0; i < luaList.Count; i++)
{ {
try try
{ {
LuaImp.gui_drawNewEmu();
//LuaImp.gui_clearGraphics(); //LuaImp.gui_clearGraphics();
if (luaList[i].Enabled && luaList[i].Thread != null && !(luaList[i].Paused)) if (luaList[i].Enabled && luaList[i].Thread != null && !(luaList[i].Paused))
{ {
bool prohibit = false; bool prohibit = false;
if (luaList[i].FrameWaiting && !includeFrameWaiters) if (luaList[i].FrameWaiting && !includeFrameWaiters)
{
prohibit = true; prohibit = true;
}
if (!prohibit) if (!prohibit)
{ {
var result = LuaImp.ResumeScript(luaList[i].Thread); var result = LuaImp.ResumeScript(luaList[i].Thread);
@ -859,7 +860,6 @@ namespace BizHawk.MultiClient
luaList[i].FrameWaiting = result.WaitForFrame; luaList[i].FrameWaiting = result.WaitForFrame;
} }
} }
LuaImp.gui_drawFinishEmu();
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -872,6 +872,7 @@ namespace BizHawk.MultiClient
else MessageBox.Show(ex.ToString()); else MessageBox.Show(ex.ToString());
} }
} }
LuaImp.gui_drawFinishEmu();
} }
public bool IsRunning() public bool IsRunning()