抽出TextureLoader,增加部分可调参数

This commit is contained in:
ww-rm
2025-05-07 17:43:42 +08:00
parent 3c91f335fc
commit 3f9c4dfe99
9 changed files with 293 additions and 143 deletions

View File

@@ -29,26 +29,6 @@ namespace SpineViewer.Spine.Implementations.SpineObject
};
}
private class TextureLoader : SpineRuntime36.TextureLoader
{
public void Load(AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == TextureFilter.Linear)
texture.Smooth = true;
if (page.uWrap == TextureWrap.Repeat && page.vWrap == TextureWrap.Repeat)
texture.Repeated = true;
page.rendererObject = texture;
}
public void Unload(object texture)
{
((SFML.Graphics.Texture)texture).Dispose();
}
}
private static readonly TextureLoader textureLoader = new();
private static readonly Animation EmptyAnimation = new(EMPTY_ANIMATION, [], 0);
private readonly Atlas atlas;