mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Fix incorrect offset due to another intermediate Decoupleable clock
This commit is contained in:
@ -31,16 +31,12 @@ namespace osu.Game.Screens.Play
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected readonly DecoupleableInterpolatingFramedClock AdjustableClock;
|
protected readonly DecoupleableInterpolatingFramedClock AdjustableClock;
|
||||||
|
|
||||||
protected readonly IClock SourceClock;
|
|
||||||
|
|
||||||
protected GameplayClockContainer(IClock sourceClock)
|
protected GameplayClockContainer(IClock sourceClock)
|
||||||
{
|
{
|
||||||
SourceClock = sourceClock;
|
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
AdjustableClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
|
AdjustableClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
|
||||||
AdjustableClock.ChangeSource(SourceClock);
|
AdjustableClock.ChangeSource(sourceClock);
|
||||||
|
|
||||||
IsPaused.BindValueChanged(OnPauseChanged);
|
IsPaused.BindValueChanged(OnPauseChanged);
|
||||||
}
|
}
|
||||||
@ -101,7 +97,7 @@ namespace osu.Game.Screens.Play
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const double MINIMUM_SKIP_TIME = 1000;
|
public const double MINIMUM_SKIP_TIME = 1000;
|
||||||
|
|
||||||
protected new DecoupleableInterpolatingFramedClock SourceClock => (DecoupleableInterpolatingFramedClock)base.SourceClock;
|
protected Track Track => (Track)AdjustableClock.Source;
|
||||||
|
|
||||||
public readonly BindableNumber<double> UserPlaybackRate = new BindableDouble(1)
|
public readonly BindableNumber<double> UserPlaybackRate = new BindableDouble(1)
|
||||||
{
|
{
|
||||||
@ -126,15 +122,13 @@ namespace osu.Game.Screens.Play
|
|||||||
private Bindable<double> userAudioOffset;
|
private Bindable<double> userAudioOffset;
|
||||||
|
|
||||||
public MasterGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStartTime, bool startAtGameplayStart = false)
|
public MasterGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStartTime, bool startAtGameplayStart = false)
|
||||||
: base(new DecoupleableInterpolatingFramedClock())
|
: base(beatmap.Track)
|
||||||
{
|
{
|
||||||
this.beatmap = beatmap;
|
this.beatmap = beatmap;
|
||||||
this.gameplayStartTime = gameplayStartTime;
|
this.gameplayStartTime = gameplayStartTime;
|
||||||
this.startAtGameplayStart = startAtGameplayStart;
|
this.startAtGameplayStart = startAtGameplayStart;
|
||||||
|
|
||||||
firstHitObjectTime = beatmap.Beatmap.HitObjects.First().StartTime;
|
firstHitObjectTime = beatmap.Beatmap.HitObjects.First().StartTime;
|
||||||
|
|
||||||
SourceClock.ChangeSource(beatmap.Track);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -234,7 +228,7 @@ namespace osu.Game.Screens.Play
|
|||||||
public void StopUsingBeatmapClock()
|
public void StopUsingBeatmapClock()
|
||||||
{
|
{
|
||||||
removeSourceClockAdjustments();
|
removeSourceClockAdjustments();
|
||||||
SourceClock.ChangeSource(new TrackVirtual(beatmap.Track.Length));
|
AdjustableClock.ChangeSource(new TrackVirtual(beatmap.Track.Length));
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool speedAdjustmentsApplied;
|
private bool speedAdjustmentsApplied;
|
||||||
@ -244,10 +238,8 @@ namespace osu.Game.Screens.Play
|
|||||||
if (speedAdjustmentsApplied)
|
if (speedAdjustmentsApplied)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var track = (Track)SourceClock.Source;
|
Track.AddAdjustment(AdjustableProperty.Frequency, pauseFreqAdjust);
|
||||||
|
Track.AddAdjustment(AdjustableProperty.Tempo, UserPlaybackRate);
|
||||||
track.AddAdjustment(AdjustableProperty.Frequency, pauseFreqAdjust);
|
|
||||||
track.AddAdjustment(AdjustableProperty.Tempo, UserPlaybackRate);
|
|
||||||
|
|
||||||
localGameplayClock.MutableNonGameplayAdjustments.Add(pauseFreqAdjust);
|
localGameplayClock.MutableNonGameplayAdjustments.Add(pauseFreqAdjust);
|
||||||
localGameplayClock.MutableNonGameplayAdjustments.Add(UserPlaybackRate);
|
localGameplayClock.MutableNonGameplayAdjustments.Add(UserPlaybackRate);
|
||||||
@ -260,10 +252,8 @@ namespace osu.Game.Screens.Play
|
|||||||
if (!speedAdjustmentsApplied)
|
if (!speedAdjustmentsApplied)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var track = (Track)SourceClock.Source;
|
Track.RemoveAdjustment(AdjustableProperty.Frequency, pauseFreqAdjust);
|
||||||
|
Track.RemoveAdjustment(AdjustableProperty.Tempo, UserPlaybackRate);
|
||||||
track.RemoveAdjustment(AdjustableProperty.Frequency, pauseFreqAdjust);
|
|
||||||
track.RemoveAdjustment(AdjustableProperty.Tempo, UserPlaybackRate);
|
|
||||||
|
|
||||||
localGameplayClock.MutableNonGameplayAdjustments.Remove(pauseFreqAdjust);
|
localGameplayClock.MutableNonGameplayAdjustments.Remove(pauseFreqAdjust);
|
||||||
localGameplayClock.MutableNonGameplayAdjustments.Remove(UserPlaybackRate);
|
localGameplayClock.MutableNonGameplayAdjustments.Remove(UserPlaybackRate);
|
||||||
|
Reference in New Issue
Block a user