mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-01 09:37:03 +02:00
* 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
28 lines
677 B
C#
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;
|
|
}
|
|
}
|
|
}
|