1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:35:35 +08:00

Add back incorrectly reverted animation handling logic

This reverts commit b904fa6615.
This commit is contained in:
Dean Herbert 2021-06-08 00:02:57 +09:00
parent c0305343bc
commit 6d56e02ddb

View File

@ -54,9 +54,16 @@ namespace osu.Game.Skinning
IEnumerable<Texture> getTextures()
{
ISkin lookupSource = null;
for (int i = 0; true; i++)
{
if ((texture = source.GetTexture($"{componentName}{animationSeparator}{i}", wrapModeS, wrapModeT)) == null)
string frameName = $"{componentName}{animationSeparator}{i}";
// ensure all textures are retrieved from the same skin source.
lookupSource ??= (source as ISkinSource)?.FindProvider(s => s.GetTexture(frameName, wrapModeS, wrapModeT) != null) ?? source;
if ((texture = lookupSource?.GetTexture(frameName, wrapModeS, wrapModeT)) == null)
break;
yield return texture;