mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
Add test coverage of storyboard animation start time
This commit is contained in:
parent
24138b65a7
commit
cf25ee8e84
@ -97,6 +97,25 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCorrectAnimationStartTime()
|
||||
{
|
||||
var decoder = new LegacyStoryboardDecoder();
|
||||
|
||||
using (var resStream = TestResources.OpenResource("animation-starts-before-alpha.osb"))
|
||||
using (var stream = new LineBufferedReader(resStream))
|
||||
{
|
||||
var storyboard = decoder.Decode(stream);
|
||||
|
||||
StoryboardLayer background = storyboard.Layers.Single(l => l.Depth == 3);
|
||||
Assert.AreEqual(1, background.Elements.Count);
|
||||
|
||||
Assert.AreEqual(2000, background.Elements[0].StartTime);
|
||||
// This property should be used in DrawableStoryboardAnimation as a starting point for animation playback.
|
||||
Assert.AreEqual(1000, (background.Elements[0] as StoryboardAnimation)?.EarliestTransformTime);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestOutOfOrderStartTimes()
|
||||
{
|
||||
|
@ -0,0 +1,5 @@
|
||||
[Events]
|
||||
//Storyboard Layer 0 (Background)
|
||||
Animation,Background,Centre,"img.jpg",320,240,2,150,LoopForever
|
||||
S,0,1000,1500,0.08 // animation should start playing from this point in time..
|
||||
F,0,2000,,0,1 // .. not this point in time
|
Loading…
Reference in New Issue
Block a user