Lua - implement emu.limitframerate, also add on screen message when limit frame rate is toggled

This commit is contained in:
andres.delikat 2012-07-12 19:23:39 +00:00
parent 9c947652f5
commit 2304b2d4e2
2 changed files with 33 additions and 2 deletions

View File

@ -289,6 +289,7 @@ namespace BizHawk.MultiClient
"setrenderplanes",
"frameskip",
"minimizeframeskip",
"limitframerate",
};
public static string[] MemoryFunctions = new string[]
@ -845,9 +846,9 @@ namespace BizHawk.MultiClient
}
}
public void emu_minimizeframeskip(object minimize)
public void emu_minimizeframeskip(object boolean)
{
string temp = minimize.ToString();
string temp = boolean.ToString();
if (!String.IsNullOrWhiteSpace(temp))
{
if (temp == "0" || temp.ToLower() == "false")
@ -862,6 +863,23 @@ namespace BizHawk.MultiClient
}
}
public void emu_limitframerate(object boolean)
{
string temp = boolean.ToString();
if (!String.IsNullOrWhiteSpace(temp))
{
if (temp == "0" || temp.ToLower() == "false")
{
Global.Config.LimitFramerate = false;
}
else
{
Global.Config.LimitFramerate = true;
}
Global.MainForm.LimitFrameRateMessage();
}
}
public void emu_frameskip(object num_frames)
{
try

View File

@ -53,6 +53,19 @@ namespace BizHawk.MultiClient
private void miLimitFramerate_Click(object sender, EventArgs e)
{
Global.Config.LimitFramerate ^= true;
LimitFrameRateMessage();
}
public void LimitFrameRateMessage()
{
if (Global.Config.LimitFramerate)
{
Global.OSD.AddMessage("Framerate limiting on");
}
else
{
Global.OSD.AddMessage("Framerate limiting off");
}
}
private void miDisplayVsync_Click(object sender, EventArgs e)