Add IEmuClientApi method (+Lua) for getting approximate framerate
This commit is contained in:
parent
f56a98116e
commit
98ee0d446f
|
@ -89,6 +89,8 @@ namespace BizHawk.Client.Common
|
|||
_mainForm.FrameSkipMessage();
|
||||
}
|
||||
|
||||
public int GetApproxFramerate() => _mainForm.GetApproxFramerate();
|
||||
|
||||
public bool GetSoundOn() => _config.SoundEnabled;
|
||||
|
||||
public int GetTargetScanlineIntensity() => _config.TargetScanlineFilterIntensity;
|
||||
|
|
|
@ -63,6 +63,9 @@ namespace BizHawk.Client.Common
|
|||
|
||||
void FrameSkip(int numFrames);
|
||||
|
||||
/// <returns>the (host) framerate, approximated from frame durations</returns>
|
||||
int GetApproxFramerate();
|
||||
|
||||
bool GetSoundOn();
|
||||
|
||||
int GetTargetScanlineIntensity();
|
||||
|
|
|
@ -59,6 +59,9 @@ namespace BizHawk.Client.Common
|
|||
|
||||
void FrameSkipMessage();
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
int GetApproxFramerate();
|
||||
|
||||
/// <remarks>only referenced from <see cref="SaveStateApi"/></remarks>
|
||||
void LoadQuickSave(string quickSlotName, bool suppressOSD = false);
|
||||
|
||||
|
|
|
@ -112,6 +112,10 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("local sounds_terrible = client.get_approx_framerate() < 55;")]
|
||||
[LuaMethod("get_approx_framerate", "Gets the (host) framerate, approximated from frame durations.")]
|
||||
public int GetApproxFramerate() => APIs.EmuClient.GetApproxFramerate();
|
||||
|
||||
[LuaMethodExample("local incliget = client.gettargetscanlineintensity( );")]
|
||||
[LuaMethod("gettargetscanlineintensity", "Gets the current scanline intensity setting, used for the scanline display filter")]
|
||||
public int GetTargetScanlineIntensity() => APIs.EmuClient.GetTargetScanlineIntensity();
|
||||
|
|
|
@ -1608,6 +1608,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
private int _framesSinceLastFpsUpdate;
|
||||
private long _timestampLastFpsUpdate;
|
||||
|
||||
public int GetApproxFramerate() => _lastFpsRounded;
|
||||
|
||||
private readonly Throttle _throttle;
|
||||
private bool _unthrottled;
|
||||
|
||||
|
|
Loading…
Reference in New Issue