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

Ensure all frames in an animation are retrieved from the same skin

This commit is contained in:
Dean Herbert 2021-06-04 16:18:04 +09:00
parent 06275a6a7d
commit 37c8c63fc5

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.FindProvider(s => s.GetTexture(frameName, wrapModeS, wrapModeT) != null);
if ((texture = lookupSource?.GetTexture(frameName, wrapModeS, wrapModeT)) == null)
break;
yield return texture;