Files
RobustToolbox/Robust.Client.Tests/Graphics/AtlasTextureTest.cs
metalgearslothandGitHub 04217c0e55 Cache texture UVs (#6894)
* Cache texture UVs

O(0) beats doing basic maths operations. Followup work to make some hot drawing paths (fonts + RSIs) use the AtlasTexture methods instead.

* 2026-08-02: Support headless atlas textures
2026-08-02 04:17:07 +00:00

28 lines
677 B
C#

using NUnit.Framework;
using Robust.Client.Graphics;
using Robust.Shared.Maths;
namespace Robust.Client.Tests.Graphics;
[TestFixture]
public sealed class AtlasTextureTest
{
[Test]
public void AllowsNonClydeSourceTextures()
{
var source = new TestTexture((64, 64));
var atlas = new AtlasTexture(source, UIBox2.FromDimensions(8, 16, 32, 32));
Assert.That(atlas.SourceTexture, Is.SameAs(source));
Assert.That(atlas.ClydeTexture, Is.Null);
}
private sealed class TestTexture(Vector2i size) : Texture(size)
{
public override Color GetPixel(int x, int y)
{
return Color.Black;
}
}
}