diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 75a5dd8f7d..e120c7f193 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -231,12 +231,9 @@ private void initializeStoryboard(bool asyncLoad) { var beatmap = Beatmap.Value.Beatmap; - storyboard = beatmap.Storyboard.CreateDrawable(); - storyboard.Width = storyboard.Height * beatmap.Storyboard.AspectRatio(beatmap.BeatmapInfo); + storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value); storyboard.Masking = true; - if (!beatmap.Storyboard.ReplacesBackground(beatmap.BeatmapInfo)) - storyboard.BackgroundTexture = Beatmap.Value.Background; storyboardContainer.Add(asyncLoad ? new AsyncLoadWrapper(storyboard) { RelativeSizeAxes = Axes.Both } : (Drawable)storyboard); } diff --git a/osu.Game/Storyboards/Storyboard.cs b/osu.Game/Storyboards/Storyboard.cs index f74074e977..59cbe74650 100644 --- a/osu.Game/Storyboards/Storyboard.cs +++ b/osu.Game/Storyboards/Storyboard.cs @@ -47,7 +47,17 @@ public bool ReplacesBackground(BeatmapInfo beatmapInfo) public float AspectRatio(BeatmapInfo beatmapInfo) => beatmapInfo.WidescreenStoryboard ? 16 / 9f : 4 / 3f; - public DrawableStoryboard CreateDrawable() - => new DrawableStoryboard(this); + public DrawableStoryboard CreateDrawable(WorkingBeatmap working = null) + { + var drawable = new DrawableStoryboard(this); + if (working != null) + { + var beatmapInfo = working.Beatmap.BeatmapInfo; + drawable.Width = drawable.Height * AspectRatio(beatmapInfo); + if (!ReplacesBackground(beatmapInfo)) + drawable.BackgroundTexture = working.Background; + } + return drawable; + } } } diff --git a/osu.Game/Tests/Visual/TestCaseStoryboard.cs b/osu.Game/Tests/Visual/TestCaseStoryboard.cs index 75e23db475..c6ef3f4ecf 100644 --- a/osu.Game/Tests/Visual/TestCaseStoryboard.cs +++ b/osu.Game/Tests/Visual/TestCaseStoryboard.cs @@ -81,13 +81,9 @@ private void loadStoryboard(WorkingBeatmap working) var decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = true }; storyboardContainer.Clock = decoupledClock; - storyboard = working.Beatmap.Storyboard.CreateDrawable(); + storyboard = working.Beatmap.Storyboard.CreateDrawable(beatmapBacking); storyboard.Passing = false; - var beatmap = working.Beatmap; - if (!beatmap.Storyboard.ReplacesBackground(beatmap.BeatmapInfo)) - storyboard.BackgroundTexture = working.Background; - storyboardContainer.Add(storyboard); decoupledClock.ChangeSource(working.Track); }