Inline MainForm.IsLagFrame and change global usage in OSDManager
This commit is contained in:
parent
dc352c0225
commit
b972b8a771
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue