1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Remove "pause rate adjust" flow

This commit is contained in:
Dean Herbert 2024-01-18 14:21:02 +09:00
parent 799c74cfe5
commit 8ab8c90e33
No known key found for this signature in database
3 changed files with 6 additions and 21 deletions

View File

@ -27,11 +27,6 @@ namespace osu.Game.Beatmaps
{ {
private readonly bool applyOffsets; private readonly bool applyOffsets;
/// <summary>
/// The total frequency adjustment from pause transforms. Should eventually be handled in a better way.
/// </summary>
public readonly BindableDouble ExternalPauseFrequencyAdjust = new BindableDouble(1);
private readonly OffsetCorrectionClock? userGlobalOffsetClock; private readonly OffsetCorrectionClock? userGlobalOffsetClock;
private readonly OffsetCorrectionClock? platformOffsetClock; private readonly OffsetCorrectionClock? platformOffsetClock;
private readonly OffsetCorrectionClock? userBeatmapOffsetClock; private readonly OffsetCorrectionClock? userBeatmapOffsetClock;
@ -69,13 +64,13 @@ namespace osu.Game.Beatmaps
{ {
// Audio timings in general with newer BASS versions don't match stable. // Audio timings in general with newer BASS versions don't match stable.
// This only seems to be required on windows. We need to eventually figure out why, with a bit of luck. // This only seems to be required on windows. We need to eventually figure out why, with a bit of luck.
platformOffsetClock = new OffsetCorrectionClock(interpolatedTrack, ExternalPauseFrequencyAdjust) { Offset = RuntimeInfo.OS == RuntimeInfo.Platform.Windows ? 15 : 0 }; platformOffsetClock = new OffsetCorrectionClock(interpolatedTrack) { Offset = RuntimeInfo.OS == RuntimeInfo.Platform.Windows ? 15 : 0 };
// User global offset (set in settings) should also be applied. // User global offset (set in settings) should also be applied.
userGlobalOffsetClock = new OffsetCorrectionClock(platformOffsetClock, ExternalPauseFrequencyAdjust); userGlobalOffsetClock = new OffsetCorrectionClock(platformOffsetClock);
// User per-beatmap offset will be applied to this final clock. // User per-beatmap offset will be applied to this final clock.
finalClockSource = userBeatmapOffsetClock = new OffsetCorrectionClock(userGlobalOffsetClock, ExternalPauseFrequencyAdjust); finalClockSource = userBeatmapOffsetClock = new OffsetCorrectionClock(userGlobalOffsetClock);
} }
else else
{ {

View File

@ -207,7 +207,6 @@ namespace osu.Game.Screens.Play
musicController.ResetTrackAdjustments(); musicController.ResetTrackAdjustments();
track.BindAdjustments(AdjustmentsFromMods); track.BindAdjustments(AdjustmentsFromMods);
track.AddAdjustment(AdjustableProperty.Frequency, GameplayClock.ExternalPauseFrequencyAdjust);
track.AddAdjustment(AdjustableProperty.Frequency, UserPlaybackRate); track.AddAdjustment(AdjustableProperty.Frequency, UserPlaybackRate);
speedAdjustmentsApplied = true; speedAdjustmentsApplied = true;
@ -219,7 +218,6 @@ namespace osu.Game.Screens.Play
return; return;
track.UnbindAdjustments(AdjustmentsFromMods); track.UnbindAdjustments(AdjustmentsFromMods);
track.RemoveAdjustment(AdjustableProperty.Frequency, GameplayClock.ExternalPauseFrequencyAdjust);
track.RemoveAdjustment(AdjustableProperty.Frequency, UserPlaybackRate); track.RemoveAdjustment(AdjustableProperty.Frequency, UserPlaybackRate);
speedAdjustmentsApplied = false; speedAdjustmentsApplied = false;

View File

@ -1,15 +1,12 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Framework.Timing; using osu.Framework.Timing;
namespace osu.Game.Screens.Play namespace osu.Game.Screens.Play
{ {
public class OffsetCorrectionClock : FramedOffsetClock public class OffsetCorrectionClock : FramedOffsetClock
{ {
private readonly BindableDouble pauseRateAdjust;
private double offset; private double offset;
public new double Offset public new double Offset
@ -28,10 +25,9 @@ namespace osu.Game.Screens.Play
public double RateAdjustedOffset => base.Offset; public double RateAdjustedOffset => base.Offset;
public OffsetCorrectionClock(IClock source, BindableDouble pauseRateAdjust) public OffsetCorrectionClock(IClock source)
: base(source) : base(source)
{ {
this.pauseRateAdjust = pauseRateAdjust;
} }
public override void ProcessFrame() public override void ProcessFrame()
@ -42,12 +38,8 @@ namespace osu.Game.Screens.Play
private void updateOffset() private void updateOffset()
{ {
// changing this during the pause transform effect will cause a potentially large offset to be suddenly applied as we approach zero 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.
if (pauseRateAdjust.Value == 1) base.Offset = 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.Offset = Offset * Rate;
}
} }
} }
} }