gui.clearGraphics implemented. This will allow the user to clear the graphics whenever he wants. I also created a function ClearDisplaySurface that is used to clear the graphics whenever the user stops a scripts.

This commit is contained in:
rolanmen1 2012-04-27 20:15:07 +00:00
parent 56b8d6d55e
commit 3bcaa8f2e6
2 changed files with 17 additions and 1 deletions

View File

@ -262,6 +262,7 @@ namespace BizHawk.MultiClient
"drawPie",
"drawIcon",
"drawImage",
"clearGraphics",
};
public static string[] EmuFunctions = new string[]
@ -476,7 +477,7 @@ namespace BizHawk.MultiClient
Global.OSD.ClearGUIText();
}
DisplaySurface luaSurface;
public DisplaySurface luaSurface;
/// <summary>
/// sets the current drawing context to a new surface.
@ -698,6 +699,11 @@ namespace BizHawk.MultiClient
}
}
public void gui_clearGraphics()
{
luaSurface.Clear();
}
//----------------------------------------------------
//Emu library
//----------------------------------------------------

View File

@ -111,6 +111,7 @@ namespace BizHawk.MultiClient
luaList[x].Enabled = false;
Changes(true);
UpdateNumberOfScripts();
ClearDisplaySurface();
}
public void Restart()
@ -286,9 +287,17 @@ namespace BizHawk.MultiClient
}
LuaListView.Refresh();
UpdateNumberOfScripts();
ClearDisplaySurface();
Changes(true);
}
public void ClearDisplaySurface()
{
LuaImp.gui_drawNew();
LuaImp.gui_clearGraphics();
LuaImp.gui_drawFinish();
}
public void RunLuaScripts()
{
for (int x = 0; x < luaList.Count; x++)
@ -431,6 +440,7 @@ namespace BizHawk.MultiClient
indexes.Clear();
DisplayLuaList();
}
ClearDisplaySurface();
UpdateNumberOfScripts();
}