use the Emulator property instead of Global.Emulator in some lua library files

This commit is contained in:
adelikat 2016-12-04 12:37:29 -06:00
parent b11a76f739
commit e99bc9ba41
2 changed files with 8 additions and 7 deletions

View File

@ -16,6 +16,7 @@ namespace BizHawk.Client.EmuHawk
{
[RequiredService]
public IEmulator Emulator { get; set; }
[RequiredService]
public IVideoProvider VideoProvider { get; set; }
@ -155,9 +156,9 @@ namespace BizHawk.Client.EmuHawk
"getwindowsize",
"Gets the main window's size Possible values are 1, 2, 3, 4, 5, and 10"
)]
public static int GetWindowSize()
public int GetWindowSize()
{
return Global.Config.TargetZoomFactors[Global.Emulator.SystemId];
return Global.Config.TargetZoomFactors[Emulator.SystemId];
}
[LuaMethodAttributes(
@ -378,7 +379,7 @@ namespace BizHawk.Client.EmuHawk
{
if (size == 1 || size == 2 || size == 3 || size == 4 || size == 5 || size == 10)
{
Global.Config.TargetZoomFactors[Global.Emulator.SystemId] = size;
Global.Config.TargetZoomFactors[Emulator.SystemId] = size;
GlobalWin.MainForm.FrameBufferResized();
GlobalWin.OSD.AddMessage("Window size set to " + size + "x");
}

View File

@ -123,8 +123,8 @@ namespace BizHawk.Client.EmuHawk
var g = _luaSurface == null ? Graphics.FromImage(_nullGraphicsBitmap) : _luaSurface.GetGraphics();
//we don't like CoreComm, right? Someone should find a different way to do this then.
var tx = Global.Emulator.CoreComm.ScreenLogicalOffsetX;
var ty = Global.Emulator.CoreComm.ScreenLogicalOffsetY;
var tx = Emulator.CoreComm.ScreenLogicalOffsetX;
var ty = Emulator.CoreComm.ScreenLogicalOffsetY;
if (tx != 0 || ty != 0)
{
var transform = g.Transform;
@ -706,8 +706,8 @@ namespace BizHawk.Client.EmuHawk
}
else
{
x -= Global.Emulator.CoreComm.ScreenLogicalOffsetX;
y -= Global.Emulator.CoreComm.ScreenLogicalOffsetY;
x -= Emulator.CoreComm.ScreenLogicalOffsetX;
y -= Emulator.CoreComm.ScreenLogicalOffsetY;
}
GlobalWin.OSD.AddGUIText(message, x, y, Color.Black, forecolor ?? Color.White, a);