1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Fix HardwareCorrectionOffsetClock breaking ElapsedTime readings

This commit is contained in:
Dean Herbert 2020-06-14 11:33:59 +09:00
parent a8e83c5be5
commit 7b95c55afb

View File

@ -251,8 +251,9 @@ namespace osu.Game.Screens.Play
private class HardwareCorrectionOffsetClock : FramedOffsetClock
{
// we always want to apply the same real-time offset, so it should be adjusted by the playback rate to achieve this.
public override double CurrentTime => SourceTime + Offset * Rate;
// we always want to apply the same real-time offset, so it should be adjusted by the difference in playback rate (from realtime) to achieve this.
// base implementation already adds offset at 1.0 rate, so we only add the difference from that here.
public override double CurrentTime => base.CurrentTime + Offset * (1 - Rate);
public HardwareCorrectionOffsetClock(IClock source, bool processSource = true)
: base(source, processSource)