From eccce01cfffc05f0d5437601fd73dd0339dcd08b Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 13 Jul 2024 23:21:56 +0900 Subject: [PATCH] reorder variable declarations --- src/DotRecast.Recast/RcLayers.cs | 3 --- src/DotRecast.Recast/RcRecast.cs | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/DotRecast.Recast/RcLayers.cs b/src/DotRecast.Recast/RcLayers.cs index 6b92f6b..e8b5911 100644 --- a/src/DotRecast.Recast/RcLayers.cs +++ b/src/DotRecast.Recast/RcLayers.cs @@ -29,9 +29,6 @@ namespace DotRecast.Recast public static class RcLayers { - const int RC_MAX_LAYERS = RcRecast.RC_NOT_CONNECTED; - const int RC_MAX_NEIS = 16; - private static void AddUnique(List a, int v) { if (!a.Contains(v)) diff --git a/src/DotRecast.Recast/RcRecast.cs b/src/DotRecast.Recast/RcRecast.cs index 39bef31..146d91f 100644 --- a/src/DotRecast.Recast/RcRecast.cs +++ b/src/DotRecast.Recast/RcRecast.cs @@ -49,6 +49,11 @@ namespace DotRecast.Recast /// The number of spans allocated per span spool. /// @see rcSpanPool public const int RC_SPANS_PER_POOL = 2048; + + // Must be 255 or smaller (not 256) because layer IDs are stored as + // a byte where 255 is a special value. + public const int RC_MAX_LAYERS = RC_NOT_CONNECTED; + public const int RC_MAX_NEIS = 16; /// Heighfield border flag. /// If a heightfield region ID has this bit set, then the region is a border