Lua - move threading code into the frame loops, now emu.frameadvance works per frame not per emulator loop

This commit is contained in:
andres.delikat 2012-01-28 21:43:55 +00:00
parent 33ca14a344
commit 41708a8579
2 changed files with 63 additions and 59 deletions

View File

@ -332,11 +332,7 @@ namespace BizHawk.MultiClient
{
for (; ; )
{
//client input-related duties
if (LuaConsole1.LuaImp.isRunning)
{
LuaConsole1.LuaImp.LuaWait.WaitOne();
}
Input.Instance.Update();
//handle events and dispatch as a hotkey action, or a hotkey button, or an input button
@ -352,10 +348,7 @@ namespace BizHawk.MultiClient
StepRunLoop_Throttle();
Render();
if (LuaConsole1.LuaImp.isRunning)
{
Global.MainForm.MainWait.Set();
}
CheckMessages();
if (exit)
break;
@ -1626,6 +1619,17 @@ namespace BizHawk.MultiClient
bool genSound = false;
if (runFrame)
{
//client input-related duties
if (LuaConsole1.LuaImp.isRunning)
{
LuaConsole1.LuaImp.LuaWait.WaitOne();
}
if (LuaConsole1.LuaImp.isRunning)
{
Global.MainForm.MainWait.Set();
}
runloop_fps++;
bool ff = Global.ClientControls["Fast Forward"];
bool updateFpsString = (runloop_last_ff != ff);