mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-10-31 21:00:51 +01:00
24 lines
No EOL
760 B
C#
24 lines
No EOL
760 B
C#
using System.Linq;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using MLEM.Data;
|
|
using MLEM.Textures;
|
|
using NUnit.Framework;
|
|
|
|
namespace Tests {
|
|
public class TestDataTextureAtlas {
|
|
|
|
[Test]
|
|
public void Test() {
|
|
using var game = TestGame.Create();
|
|
using var texture = new Texture2D(game.GraphicsDevice, 1, 1);
|
|
var atlas = DataTextureAtlas.LoadAtlasData(new TextureRegion(texture), game.RawContent, "Texture.atlas");
|
|
Assert.AreEqual(atlas.Regions.Count(), 5);
|
|
|
|
var table = atlas["LongTableUp"];
|
|
Assert.AreEqual(table.Area, new Rectangle(0, 32, 64, 48));
|
|
Assert.AreEqual(table.PivotPixels, new Vector2(16, 48 - 32));
|
|
}
|
|
|
|
}
|
|
} |