Add MrGameEng.Atlases: texture atlas builder, runtime loader and CLI tool
CI / build-test (push) Failing after 1m13s

AtlasBuilder packs a directory tree of loose images into atlas pages plus
JSON metadata (deterministic shelf packing, incremental rebuilds, orphan
cleanup); TextureAtlas loads them back handing out Texture2DRegions, so
sprites from one page batch into a single draw call. The asset handle
generator maps .atlas files to TextureAtlas and skips page images.
Demonstrated in the sample (Assets/Atlases + 'atlas' console command),
wrapped as tools/MrGameEng.AtlasTool for build scripts.

Documented dependency exception: Atlases depends on Graphics and Assets.
This commit is contained in:
Leonid Pershin
2026-06-11 08:18:30 +03:00
parent d6f19b9119
commit b318d1e795
21 changed files with 1209 additions and 1 deletions
@@ -86,6 +86,22 @@ public class AssetHandlesGeneratorTests
Assert.DoesNotContain("Image", source);
}
[Fact]
public void AtlasFiles_GetTextureAtlasHandles_AndPagesAreExcluded()
{
var source = RunGenerator(
[
@"D:\game\Assets\Atlases\Things.Pawn.atlas",
@"D:\game\Assets\Atlases\Things.Pawn.atlas.0.png",
@"D:\game\Assets\Atlases\Things.Pawn.atlas.1.png",
]);
Assert.Contains(
"AssetRef<global::MrGameEng.Atlases.TextureAtlas> ThingsPawn = new(\"Atlases/Things.Pawn.atlas\")",
source);
Assert.DoesNotContain("Texture2D> ThingsPawn", source);
}
[Fact]
public void NestedDirectories_BecomeNestedClasses()
{