Draw broken objects as fragments, plane tiles for fences and walls, tileset publishing; mod documentation

This commit is contained in:
cthangover committed 2026-10-29 09:26:10 +01:00
1 parent e153dc9b15
commit 7b28c1bb0a
74 files changed
+2782 -886

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
namespace Cthangover.Mods.Rpg.Tests
{
using Cthangover.Core.Mods.Testing;
/// <summary>Malformed profiles fail before renderer creation rather than stretching unrelated atlas pixels.</summary>
public class RpgVisualGroupValidatorTests
{
[ModTest("visual_groups/invalid_geometry_is_reported")]
static void InvalidGeometryIsReported(ModTestContext ctx)
{
var group = new RpgVisualGroup { Id = "wall", Width = 2, Height = 1, Pattern = new[] { 4, 5 } };
ModAssert.Null(RpgVisualGroupValidator.Error(group), "valid sprite group");
group.Pattern = new[] { 4 };
ModAssert.NotNull(RpgVisualGroupValidator.Error(group), "incomplete pattern");
group.Pattern = new[] { 4, 5 };
group.IsoPlanes = new() { new() { Crop = new[] { 0, 0, 3, 1 }, Points = new[] {
new[] { 0f, 0, 1 }, new[] { 2f, 0, 1 }, new[] { 2f, 0, 0 }, new[] { 0f, 0, 0 } } } };
ModAssert.NotNull(RpgVisualGroupValidator.Error(group), "crop outside packed group");
group.IsoPlanes[0].Crop[2] = 2;
ModAssert.Null(RpgVisualGroupValidator.Error(group), "valid architectural quad");
group.IsoPlanes[0].Points[2][2] = float.NaN;
ModAssert.NotNull(RpgVisualGroupValidator.Error(group), "non-finite geometry");
}
}
}