From 0cec51110acbb2aa61cdd49489f0e3b5f5f50ceb Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 13 Nov 2017 17:52:16 +0900 Subject: [PATCH 1/4] Fix replay clock always running 1 frame behind * Fixes swells never completing. * Fixes forward playback missing notes every now and then. * Probably more stuff. --- osu.Game/Rulesets/UI/RulesetInputManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index 0419070b42..ddce60d819 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -148,6 +148,7 @@ protected override void Update() } clock.CurrentTime = newTime.Value; + Clock.ProcessFrame(); } requireMoreUpdateLoops = clock.CurrentTime != parentClock.CurrentTime; From 495155874cf7fa4e4d0d7cb749c09fabd2799529 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 13 Nov 2017 19:02:53 +0900 Subject: [PATCH 2/4] Make sure that the clock is only updated once per time value --- osu-framework | 2 +- osu.Game/Rulesets/UI/RulesetInputManager.cs | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 47aabeaee5..81a3551886 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 47aabeaee5a8d85a0e6769fd601736f8dc1eb051 +Subproject commit 81a35518860cc533c4bf55b407c4e63d47ad11ce diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index ddce60d819..8c4d6de1fe 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -76,6 +76,8 @@ public ReplayInputHandler ReplayInputHandler #region Clock control + protected override bool ShouldProcessClock => false; // We handle processing the clock ourselves + private ManualClock clock; private IFrameBasedClock parentClock; @@ -148,10 +150,15 @@ protected override void Update() } clock.CurrentTime = newTime.Value; - Clock.ProcessFrame(); } requireMoreUpdateLoops = clock.CurrentTime != parentClock.CurrentTime; + + // The manual clock time has changed in the above code. The framed clock now needs to be updated + // to ensure that the its time is valid for our children before input is processed + Clock.ProcessFrame(); + + // Process input base.Update(); } From a2cb9d4086a70f72c735d942b9756d2d4a11cb19 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 13 Nov 2017 19:43:00 +0900 Subject: [PATCH 3/4] Fix audio not playing during player loading Regression due to changed audio initialisation logic. --- osu.Game/Screens/Play/Player.cs | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 59d56a5a44..675d20fe63 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -144,22 +144,6 @@ private void load(AudioManager audio, OsuConfigManager config, APIAccess api) userAudioOffset.ValueChanged += v => offsetClock.Offset = v; userAudioOffset.TriggerChange(); - Task.Run(() => - { - adjustableSourceClock.Reset(); - - // this is temporary until we have blocking (async.Wait()) audio component methods. - // then we can call ResetAsync().Wait() or the blocking version above. - while (adjustableSourceClock.IsRunning) - Thread.Sleep(1); - - Schedule(() => - { - decoupledClock.ChangeSource(adjustableSourceClock); - applyRateFromMods(); - }); - }); - Children = new Drawable[] { storyboardContainer = new Container @@ -329,10 +313,26 @@ protected override void OnEntering(Screen last) .Delay(250) .FadeIn(250); - this.Delay(750).Schedule(() => + Task.Run(() => { - if (!pauseContainer.IsPaused) - decoupledClock.Start(); + adjustableSourceClock.Reset(); + + // this is temporary until we have blocking (async.Wait()) audio component methods. + // then we can call ResetAsync().Wait() or the blocking version above. + while (adjustableSourceClock.IsRunning) + Thread.Sleep(1); + + Schedule(() => + { + decoupledClock.ChangeSource(adjustableSourceClock); + applyRateFromMods(); + + this.Delay(750).Schedule(() => + { + if (!pauseContainer.IsPaused) + decoupledClock.Start(); + }); + }); }); pauseContainer.Alpha = 0; From 952530e1a8fe6cb2235263584ce38a8a026f68e1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 13 Nov 2017 20:03:58 +0900 Subject: [PATCH 4/4] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 81a3551886..c95b9350ed 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 81a35518860cc533c4bf55b407c4e63d47ad11ce +Subproject commit c95b9350edb6305cfefdf08f902f6f73d336736b