Remove emu.registerbefore and emu.registerafter in favor of event.framebefore() and event.frameafter()

This commit is contained in:
adelikat 2012-10-12 20:55:01 +00:00
parent b65064eb13
commit 30098b0ab1
1 changed files with 8 additions and 20 deletions

View File

@ -26,8 +26,8 @@ namespace BizHawk.MultiClient
private Lua currThread; private Lua currThread;
private LuaFunction savestate_registersavefunc; private LuaFunction savestate_registersavefunc;
private LuaFunction savestate_registerloadfunc; private LuaFunction savestate_registerloadfunc;
private LuaFunction frame_registerbeforefunc; private LuaFunction frame_startfunc;
private LuaFunction frame_registerafterfunc; private LuaFunction frame_endfunc;
public void SavestateRegisterSave(string name) public void SavestateRegisterSave(string name)
{ {
@ -65,11 +65,11 @@ namespace BizHawk.MultiClient
public void FrameRegisterBefore() public void FrameRegisterBefore()
{ {
if (frame_registerbeforefunc != null) if (frame_startfunc != null)
{ {
try try
{ {
frame_registerbeforefunc.Call(); frame_startfunc.Call();
} }
catch (SystemException e) catch (SystemException e)
{ {
@ -82,11 +82,11 @@ namespace BizHawk.MultiClient
public void FrameRegisterAfter() public void FrameRegisterAfter()
{ {
if (frame_registerafterfunc != null) if (frame_endfunc != null)
{ {
try try
{ {
frame_registerafterfunc.Call(); frame_endfunc.Call();
} }
catch (SystemException e) catch (SystemException e)
{ {
@ -383,8 +383,6 @@ namespace BizHawk.MultiClient
"limitframerate", "limitframerate",
"displayvsync", "displayvsync",
"enablerewind", "enablerewind",
"registerbefore",
"registerafter",
"on_snoop", "on_snoop",
}; };
@ -1180,16 +1178,6 @@ namespace BizHawk.MultiClient
} }
} }
public void emu_registerbefore(LuaFunction luaf)
{
frame_registerbeforefunc = luaf;
}
public void emu_registerafter(LuaFunction luaf)
{
frame_registerafterfunc = luaf;
}
public void emu_on_snoop(LuaFunction luaf) public void emu_on_snoop(LuaFunction luaf)
{ {
if (luaf != null) if (luaf != null)
@ -2683,12 +2671,12 @@ namespace BizHawk.MultiClient
public void event_onframestart(LuaFunction luaf) public void event_onframestart(LuaFunction luaf)
{ {
emu_registerbefore(luaf); frame_startfunc = luaf;
} }
public void event_onframeend(LuaFunction luaf) public void event_onframeend(LuaFunction luaf)
{ {
emu_registerafter(luaf); frame_endfunc = luaf;
} }
public void event_oninputpoll(LuaFunction luaf) public void event_oninputpoll(LuaFunction luaf)