Inline MainForm.IsLagFrame and change global usage in OSDManager

This commit is contained in:
YoshiRulz 2020-06-12 05:47:23 +10:00
parent dc352c0225
commit b972b8a771
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 4 additions and 6 deletions

View File

@ -264,7 +264,7 @@ namespace BizHawk.Client.EmuHawk
var point = GetCoordinates(g, GlobalWin.Config.FrameCounter, message);
DrawOsdMessage(g, message, Color.FromArgb(GlobalWin.Config.MessagesColor), point.X, point.Y);
if (GlobalWin.MainForm.IsLagFrame)
if (GlobalWin.Emulator.CanPollInput() && GlobalWin.Emulator.AsInputPollable().IsLagFrame)
{
DrawOsdMessage(g, GlobalWin.Emulator.Frame.ToString(), FixedAlertMessageColor, point.X, point.Y);
}

View File

@ -2863,8 +2863,6 @@ namespace BizHawk.Client.EmuHawk
PressFrameAdvance = false;
}
public bool IsLagFrame => Emulator.CanPollInput() && Emulator.AsInputPollable().IsLagFrame;
private void StepRunLoop_Core(bool force = false)
{
var runFrame = false;
@ -2874,7 +2872,7 @@ namespace BizHawk.Client.EmuHawk
double frameAdvanceTimestampDeltaMs = (double)(currentTimestamp - _frameAdvanceTimestamp) / Stopwatch.Frequency * 1000.0;
bool frameProgressTimeElapsed = frameAdvanceTimestampDeltaMs >= Config.FrameProgressDelayMs;
if (Config.SkipLagFrame && IsLagFrame && frameProgressTimeElapsed && Emulator.Frame > 0)
if (Config.SkipLagFrame && Emulator.CanPollInput() && Emulator.AsInputPollable().IsLagFrame && frameProgressTimeElapsed && Emulator.Frame > 0)
{
runFrame = true;
}
@ -3015,12 +3013,12 @@ namespace BizHawk.Client.EmuHawk
CheatList.Pulse();
if (IsLagFrame && Config.AutofireLagFrames)
if (Emulator.CanPollInput() && Emulator.AsInputPollable().IsLagFrame && Config.AutofireLagFrames)
{
InputManager.AutoFireController.IncrementStarts();
}
GlobalWin.InputManager.AutofireStickyXorAdapter.IncrementLoops(IsLagFrame);
GlobalWin.InputManager.AutofireStickyXorAdapter.IncrementLoops(Emulator.CanPollInput() && Emulator.AsInputPollable().IsLagFrame);
PressFrameAdvance = false;