diff --git a/osu.Framework.Font.Tests/Visual/Shaders/ShaderTestScene.cs b/osu.Framework.Font.Tests/Visual/Shaders/ShaderTestScene.cs index 261d57a..62f9c65 100644 --- a/osu.Framework.Font.Tests/Visual/Shaders/ShaderTestScene.cs +++ b/osu.Framework.Font.Tests/Visual/Shaders/ShaderTestScene.cs @@ -73,6 +73,9 @@ protected class TestShaderContainer : Container, IMultiShaderBufferedDrawable private readonly List shaders = new(); + // todo: should have a better way to let user able to customize formats? + private readonly MultiShaderBufferedDrawNodeSharedData sharedData = new(); + public IReadOnlyList Shaders { get => shaders; @@ -95,9 +98,8 @@ private void load(ShaderManager shaders) RoundedTextureShader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE_ROUNDED); } - // todo: should have a better way to let user able to customize formats? protected override DrawNode CreateDrawNode() - => new TestShaderContainerShaderEffectDrawNode(this, new MultiShaderBufferedDrawNodeSharedData()); + => new TestShaderContainerShaderEffectDrawNode(this, sharedData); /// /// to apply . diff --git a/osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText.cs b/osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText.cs index 258109e..69daf32 100644 --- a/osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText.cs +++ b/osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText.cs @@ -26,6 +26,9 @@ public class KaraokeSpriteText : KaraokeSpriteText private readonly MaskingContainer backLyricTextContainer; private readonly T backLyricText; + // todo: should have a better way to let user able to customize formats? + private readonly MultiShaderBufferedDrawNodeSharedData sharedData = new MultiShaderBufferedDrawNodeSharedData(); + public IShader TextureShader { get; private set; } public IShader RoundedTextureShader { get; private set; } diff --git a/osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText_DrawNode.cs b/osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText_DrawNode.cs index 059377c..d183710 100644 --- a/osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText_DrawNode.cs +++ b/osu.Framework.Font/Graphics/Sprites/KaraokeSpriteText_DrawNode.cs @@ -18,9 +18,8 @@ protected override Quad ComputeScreenSpaceDrawQuad() return ToScreenSpace(newRectangle); } - // todo: should have a better way to let user able to customize formats? protected override DrawNode CreateDrawNode() - => new KaraokeSpriteTextShaderEffectDrawNode(this, new MultiShaderBufferedDrawNodeSharedData()); + => new KaraokeSpriteTextShaderEffectDrawNode(this, sharedData); /// /// to apply . diff --git a/osu.Framework.Font/Graphics/Sprites/LyricSpriteText.cs b/osu.Framework.Font/Graphics/Sprites/LyricSpriteText.cs index c22c97a..1f3db02 100644 --- a/osu.Framework.Font/Graphics/Sprites/LyricSpriteText.cs +++ b/osu.Framework.Font/Graphics/Sprites/LyricSpriteText.cs @@ -27,6 +27,9 @@ public partial class LyricSpriteText : Drawable, IMultiShaderBufferedDrawable, I private const float default_text_size = 48; private static readonly char[] default_never_fixed_width_characters = { '.', ',', ':', ' ' }; + // todo: should have a better way to let user able to customize formats? + private readonly MultiShaderBufferedDrawNodeSharedData sharedData = new MultiShaderBufferedDrawNodeSharedData(); + [Resolved] private FontStore store { get; set; } diff --git a/osu.Framework.Font/Graphics/Sprites/LyricSpriteText_DrawNode.cs b/osu.Framework.Font/Graphics/Sprites/LyricSpriteText_DrawNode.cs index 8e5b6ef..a992610 100644 --- a/osu.Framework.Font/Graphics/Sprites/LyricSpriteText_DrawNode.cs +++ b/osu.Framework.Font/Graphics/Sprites/LyricSpriteText_DrawNode.cs @@ -21,9 +21,8 @@ protected override Quad ComputeScreenSpaceDrawQuad() return ToScreenSpace(newRectangle); } - // todo: should have a better way to let user able to customize formats? protected override DrawNode CreateDrawNode() - => new LyricSpriteTextShaderEffectDrawNode(this, new MultiShaderBufferedDrawNodeSharedData()); + => new LyricSpriteTextShaderEffectDrawNode(this, sharedData); /// /// to apply .