Lua - fix emu.registerbefore() and emu.registerafter()

This commit is contained in:
adelikat 2012-10-06 16:13:45 +00:00
parent ba95c5c5fc
commit b8070bc92f
2 changed files with 26 additions and 4 deletions

View File

@ -2317,8 +2317,11 @@ namespace BizHawk.MultiClient
/// </summary>
public void UpdateToolsBefore()
{
#if WINDOWS
LuaConsole1.StartLuaDrawing();
LuaConsole1.LuaImp.FrameRegisterBefore();
#endif
NESNameTableViewer1.UpdateValues();
NESPPU1.UpdateValues();
PCEBGViewer1.UpdateValues();
@ -2335,18 +2338,24 @@ namespace BizHawk.MultiClient
public void UpdateToolsAfter()
{
#if WINDOWS
LuaConsole1.ResumeScripts(true);
Global.DisplayManager.PreFrameUpdateLuaSource();
#endif
RamWatch1.UpdateValues();
RamSearch1.UpdateValues();
HexEditor1.UpdateValues();
//The other tool updates are earlier, TAStudio needs to be later so it can display the latest
//frame of execution in its list view.
LuaConsole1.LuaImp.FrameRegisterAfter();
TAStudio1.UpdateValues();
SNESGraphicsDebugger1.UpdateToolsAfter();
TraceLogger1.UpdateValues();
#if WINDOWS
LuaConsole1.LuaImp.FrameRegisterAfter();
Global.DisplayManager.PreFrameUpdateLuaSource();
LuaConsole1.EndLuaDrawing();
#endif
}
private unsafe Image MakeScreenshotImage()

View File

@ -840,7 +840,10 @@ namespace BizHawk.MultiClient
/// <param name="includeFrameWaiters">should frame waiters be waken up? only use this immediately before a frame of emulation</param>
public void ResumeScripts(bool includeFrameWaiters)
{
LuaImp.gui_drawNewEmu();
if (LuaImp.luaSurface == null)
{
LuaImp.gui_drawNewEmu();
}
for (int i = 0; i < luaList.Count; i++)
{
try
@ -872,6 +875,16 @@ namespace BizHawk.MultiClient
else MessageBox.Show(ex.ToString());
}
}
//LuaImp.gui_drawFinishEmu();
}
public void StartLuaDrawing()
{
LuaImp.gui_drawNewEmu();
}
public void EndLuaDrawing()
{
LuaImp.gui_drawFinishEmu();
}