Autolock hack is nothing without autounlock hack
This commit is contained in:
parent
2859d6c45b
commit
ef0b380192
|
@ -158,7 +158,11 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnlockEmuSurfaceLua() => UnlockSurface(DisplaySurfaceID.EmuCore);
|
public void ThisIsTheLuaAutounlockHack()
|
||||||
|
{
|
||||||
|
UnlockSurface(DisplaySurfaceID.EmuCore);
|
||||||
|
UnlockSurface(DisplaySurfaceID.Client);
|
||||||
|
}
|
||||||
|
|
||||||
public void DrawNew(string name, bool clear)
|
public void DrawNew(string name, bool clear)
|
||||||
{
|
{
|
||||||
|
|
|
@ -169,11 +169,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
lf.Call(name);
|
lf.Call(name);
|
||||||
}
|
}
|
||||||
GuiAPI.UnlockEmuSurfaceLua();
|
GuiAPI.ThisIsTheLuaAutounlockHack();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
GuiAPI.UnlockEmuSurfaceLua();
|
GuiAPI.ThisIsTheLuaAutounlockHack();
|
||||||
LogToLuaConsole($"error running function attached by lua function event.onsavestate\nError message: {e.Message}");
|
LogToLuaConsole($"error running function attached by lua function event.onsavestate\nError message: {e.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -186,11 +186,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
lf.Call(name);
|
lf.Call(name);
|
||||||
}
|
}
|
||||||
GuiAPI.UnlockEmuSurfaceLua();
|
GuiAPI.ThisIsTheLuaAutounlockHack();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
GuiAPI.UnlockEmuSurfaceLua();
|
GuiAPI.ThisIsTheLuaAutounlockHack();
|
||||||
LogToLuaConsole($"error running function attached by lua function event.onloadstate\nError message: {e.Message}");
|
LogToLuaConsole($"error running function attached by lua function event.onloadstate\nError message: {e.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -204,11 +204,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
lf.Call();
|
lf.Call();
|
||||||
}
|
}
|
||||||
GuiAPI.UnlockEmuSurfaceLua();
|
GuiAPI.ThisIsTheLuaAutounlockHack();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
GuiAPI.UnlockEmuSurfaceLua();
|
GuiAPI.ThisIsTheLuaAutounlockHack();
|
||||||
LogToLuaConsole($"error running function attached by lua function event.onframestart\nError message: {e.Message}");
|
LogToLuaConsole($"error running function attached by lua function event.onframestart\nError message: {e.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,11 +222,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
lf.Call();
|
lf.Call();
|
||||||
}
|
}
|
||||||
GuiAPI.UnlockEmuSurfaceLua();
|
GuiAPI.ThisIsTheLuaAutounlockHack();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
GuiAPI.UnlockEmuSurfaceLua();
|
GuiAPI.ThisIsTheLuaAutounlockHack();
|
||||||
LogToLuaConsole($"error running function attached by lua function event.onframeend\nError message: {e.Message}");
|
LogToLuaConsole($"error running function attached by lua function event.onframeend\nError message: {e.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
exitCallback.Call();
|
exitCallback.Call();
|
||||||
}
|
}
|
||||||
GuiAPI.UnlockEmuSurfaceLua();
|
GuiAPI.ThisIsTheLuaAutounlockHack();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
|
@ -302,7 +302,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
LuaLibraryBase.SetCurrentThread(lf);
|
LuaLibraryBase.SetCurrentThread(lf);
|
||||||
|
|
||||||
var execResult = _currThread.Resume(0);
|
var execResult = _currThread.Resume(0);
|
||||||
GuiAPI.UnlockEmuSurfaceLua();
|
GuiAPI.ThisIsTheLuaAutounlockHack();
|
||||||
|
|
||||||
_lua.RunScheduledDisposes(); // TODO: I don't think this is needed anymore, we run this regularly anyway
|
_lua.RunScheduledDisposes(); // TODO: I don't think this is needed anymore, we run this regularly anyway
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
GuiAPI.UnlockEmuSurfaceLua();
|
GuiAPI.ThisIsTheLuaAutounlockHack();
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|
Loading…
Reference in New Issue