mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
Remove ClockToProcess, always process underlying clock
This commit is contained in:
parent
5e82f40d67
commit
6301111fa3
@ -19,7 +19,7 @@ namespace osu.Game.Screens.Play
|
||||
/// </summary>
|
||||
public class GameplayClock : IFrameBasedClock
|
||||
{
|
||||
private readonly IFrameBasedClock underlyingClock;
|
||||
internal readonly IFrameBasedClock UnderlyingClock;
|
||||
|
||||
public readonly BindableBool IsPaused = new BindableBool();
|
||||
|
||||
@ -30,12 +30,12 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
public GameplayClock(IFrameBasedClock underlyingClock)
|
||||
{
|
||||
this.underlyingClock = underlyingClock;
|
||||
UnderlyingClock = underlyingClock;
|
||||
}
|
||||
|
||||
public double CurrentTime => underlyingClock.CurrentTime;
|
||||
public double CurrentTime => UnderlyingClock.CurrentTime;
|
||||
|
||||
public double Rate => underlyingClock.Rate;
|
||||
public double Rate => UnderlyingClock.Rate;
|
||||
|
||||
/// <summary>
|
||||
/// The rate of gameplay when playback is at 100%.
|
||||
@ -59,19 +59,19 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsRunning => underlyingClock.IsRunning;
|
||||
public bool IsRunning => UnderlyingClock.IsRunning;
|
||||
|
||||
public void ProcessFrame()
|
||||
{
|
||||
// intentionally not updating the underlying clock (handled externally).
|
||||
}
|
||||
|
||||
public double ElapsedFrameTime => underlyingClock.ElapsedFrameTime;
|
||||
public double ElapsedFrameTime => UnderlyingClock.ElapsedFrameTime;
|
||||
|
||||
public double FramesPerSecond => underlyingClock.FramesPerSecond;
|
||||
public double FramesPerSecond => UnderlyingClock.FramesPerSecond;
|
||||
|
||||
public FrameTimeInfo TimeInfo => underlyingClock.TimeInfo;
|
||||
public FrameTimeInfo TimeInfo => UnderlyingClock.TimeInfo;
|
||||
|
||||
public IClock Source => underlyingClock;
|
||||
public IClock Source => UnderlyingClock;
|
||||
}
|
||||
}
|
||||
|
@ -80,15 +80,13 @@ namespace osu.Game.Screens.Play
|
||||
protected override void Update()
|
||||
{
|
||||
if (!IsPaused.Value)
|
||||
ClockToProcess.ProcessFrame();
|
||||
GameplayClock.UnderlyingClock.ProcessFrame();
|
||||
|
||||
base.Update();
|
||||
}
|
||||
|
||||
protected abstract void OnIsPausedChanged(ValueChangedEvent<bool> isPaused);
|
||||
|
||||
protected virtual IFrameBasedClock ClockToProcess => AdjustableClock;
|
||||
|
||||
protected abstract GameplayClock CreateGameplayClock(IFrameBasedClock source);
|
||||
}
|
||||
}
|
||||
|
@ -128,8 +128,6 @@ namespace osu.Game.Screens.Play
|
||||
Seek(skipTarget);
|
||||
}
|
||||
|
||||
protected override IFrameBasedClock ClockToProcess => userOffsetClock;
|
||||
|
||||
protected override GameplayClock CreateGameplayClock(IFrameBasedClock source)
|
||||
{
|
||||
// Lazer's audio timings in general doesn't match stable. This is the result of user testing, albeit limited.
|
||||
|
Loading…
Reference in New Issue
Block a user