mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Rewrite - Add empty drawable whenever sprite not found
This commit is contained in:
parent
6446074976
commit
539806e9d6
@ -118,24 +118,8 @@ namespace osu.Game.Storyboards.Drawables
|
||||
for (int frame = 0; frame < Animation.FrameCount; frame++)
|
||||
{
|
||||
string framePath = Animation.Path.Replace(".", frame + ".");
|
||||
Drawable sprite = storyboard.CreateSpriteFromResourcePath(framePath, textureStore);
|
||||
|
||||
if (sprite != null)
|
||||
{
|
||||
AddFrame(sprite, Animation.FrameDelay);
|
||||
continue;
|
||||
}
|
||||
|
||||
framePath = Animation.Path.Replace("0.", frame + ".");
|
||||
sprite = storyboard.CreateSpriteFromResourcePath(framePath, textureStore);
|
||||
|
||||
if (sprite != null)
|
||||
{
|
||||
AddFrame(sprite, Animation.FrameDelay);
|
||||
}
|
||||
|
||||
// todo: handle animation intentionally declared with more frames than sprites to cause a blinking effect
|
||||
// e.g. beatmap 5381's "spr\play-skip.png"
|
||||
Drawable sprite = storyboard.CreateSpriteFromResourcePath(framePath, textureStore) ?? Drawable.Empty();
|
||||
AddFrame(sprite, Animation.FrameDelay);
|
||||
}
|
||||
|
||||
Animation.ApplyTransforms(this);
|
||||
|
Loading…
Reference in New Issue
Block a user