Merge branch 'master' of https://github.com/TASVideos/BizHawk
This commit is contained in:
commit
5dd0ea4224
|
@ -609,7 +609,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private bool IsTurboSeeking => PauseOnFrame.HasValue && Global.Config.TurboSeek;
|
||||
|
||||
private bool IsTurboing => Global.ClientControls["Turbo"] || IsTurboSeeking;
|
||||
public bool IsTurboing => Global.ClientControls["Turbo"] || IsTurboSeeking;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -2969,11 +2969,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
Global.CheatList.Pulse();
|
||||
|
||||
if (!PauseAvi)
|
||||
{
|
||||
AvFrameAdvance();
|
||||
}
|
||||
|
||||
if (IsLagFrame && Global.Config.AutofireLagFrames)
|
||||
{
|
||||
Global.AutoFireController.IncrementStarts();
|
||||
|
@ -2997,6 +2992,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
UpdateToolsAfter(SuppressLua);
|
||||
}
|
||||
|
||||
if (!PauseAvi)
|
||||
{
|
||||
AvFrameAdvance();
|
||||
}
|
||||
|
||||
if (GlobalWin.Tools.IsLoaded<TAStudio>() &&
|
||||
GlobalWin.Tools.TAStudio.LastPositionFrame == Emulator.Frame)
|
||||
{
|
||||
|
|
|
@ -150,6 +150,18 @@ namespace BizHawk.Client.EmuHawk
|
|||
return GlobalWin.MainForm.EmulatorPaused;
|
||||
}
|
||||
|
||||
[LuaMethod("isturbo", "Returns true if emulator is in turbo mode, otherwise, false")]
|
||||
public static bool IsTurbo()
|
||||
{
|
||||
return GlobalWin.MainForm.IsTurboing;
|
||||
}
|
||||
|
||||
[LuaMethod("isseeking", "Returns true if emulator is seeking, otherwise, false")]
|
||||
public static bool IsSeeking()
|
||||
{
|
||||
return GlobalWin.MainForm.IsSeeking;
|
||||
}
|
||||
|
||||
[LuaMethod("opencheats", "opens the Cheats dialog")]
|
||||
public static void OpenCheats()
|
||||
{
|
||||
|
|
|
@ -32,34 +32,66 @@ namespace BizHawk.Bizware.BizwareGL
|
|||
public sd.SizeF Measure(string str)
|
||||
{
|
||||
float x = 0;
|
||||
float y = FontInfo.LineHeight;
|
||||
float ox = x;
|
||||
int len = str.Length;
|
||||
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
Cyotek.Drawing.BitmapFont.Character c;
|
||||
if (!FontInfo.Characters.TryGetValue(str[i], out c))
|
||||
c = FontInfo.Characters[unchecked((char)-1)];
|
||||
int c = str[i];
|
||||
|
||||
x += c.XAdvance;
|
||||
if (c == '\r')
|
||||
{
|
||||
if (i != len - 1 && str[i + 1] == '\n')
|
||||
i++;
|
||||
}
|
||||
|
||||
if (c == '\r')
|
||||
{
|
||||
c = '\n';
|
||||
}
|
||||
|
||||
if (c == '\n')
|
||||
{
|
||||
if (x > ox)
|
||||
ox = x;
|
||||
x = 0;
|
||||
y += FontInfo.LineHeight;
|
||||
continue;
|
||||
}
|
||||
|
||||
Cyotek.Drawing.BitmapFont.Character bfc;
|
||||
if (!FontInfo.Characters.TryGetValue((char)c, out bfc))
|
||||
bfc = FontInfo.Characters[unchecked((char)-1)];
|
||||
|
||||
x += bfc.XAdvance;
|
||||
}
|
||||
|
||||
return new sd.SizeF(x, FontInfo.LineHeight);
|
||||
return new sd.SizeF(Math.Max(x, ox), y);
|
||||
}
|
||||
|
||||
public void RenderString(IGuiRenderer renderer, float x, float y, string str)
|
||||
{
|
||||
float ox = x;
|
||||
int len = str.Length;
|
||||
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
int c = str[i];
|
||||
|
||||
if (c == '\r')
|
||||
{
|
||||
if (i != len - 1 && str[i + 1] == '\n')
|
||||
i++;
|
||||
}
|
||||
if (c == '\r') c = '\n';
|
||||
|
||||
if(c == '\n') {
|
||||
if (c == '\r')
|
||||
{
|
||||
c = '\n';
|
||||
}
|
||||
|
||||
if(c == '\n')
|
||||
{
|
||||
x = ox;
|
||||
y += FontInfo.LineHeight;
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue