Skip to content

Commit

Permalink
Fix storyboard incorrectly re-ordering elements (ppy#7302)
Browse files Browse the repository at this point in the history
Fix storyboard incorrectly re-ordering elements
  • Loading branch information
peppy authored Dec 20, 2019
2 parents 95b086f + 705cdde commit ce41be5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void TestDecodeStoryboardEvents()
Assert.AreEqual(new Vector2(320, 240), sprite.InitialPosition);
Assert.IsTrue(sprite.IsDrawable);
Assert.AreEqual(Anchor.Centre, sprite.Origin);
Assert.AreEqual("SB/black.jpg", sprite.Path);
Assert.AreEqual("SB/lyric/ja-21.png", sprite.Path);

var animation = background.Elements.OfType<StoryboardAnimation>().First();
Assert.NotNull(animation);
Expand Down
5 changes: 0 additions & 5 deletions osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Extensions;
Expand Down Expand Up @@ -42,10 +41,6 @@ protected override void ParseStreamInto(LineBufferedReader stream, Storyboard st
{
this.storyboard = storyboard;
base.ParseStreamInto(stream, storyboard);

// OrderBy is used to guarantee that the parsing order of elements with equal start times is maintained (stably-sorted)
foreach (StoryboardLayer layer in storyboard.Layers)
layer.Elements = layer.Elements.OrderBy(h => h.StartTime).ToList();
}

protected override void ParseLine(Storyboard storyboard, Section section, string line)
Expand Down

0 comments on commit ce41be5

Please sign in to comment.