Skip to content

Commit

Permalink
refactor: class NavMeshSetHeader -> struct NavMeshSetHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
ikpil committed Nov 9, 2023
1 parent afabec2 commit b9ec439
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/DotRecast.Detour/Io/DtMeshSetReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ DtNavMesh Read(RcByteBuffer bb, int maxVertPerPoly, bool is32Bit)

bool cCompatibility = header.version == NavMeshSetHeader.NAVMESHSET_VERSION;
DtNavMesh mesh = new DtNavMesh(header.option, header.maxVertsPerPoly);
ReadTiles(bb, is32Bit, header, cCompatibility, mesh);
ReadTiles(bb, is32Bit, ref header, cCompatibility, mesh);
return mesh;
}

Expand Down Expand Up @@ -104,7 +104,7 @@ private NavMeshSetHeader ReadHeader(RcByteBuffer bb, int maxVertsPerPoly)
return header;
}

private void ReadTiles(RcByteBuffer bb, bool is32Bit, NavMeshSetHeader header, bool cCompatibility, DtNavMesh mesh)
private void ReadTiles(RcByteBuffer bb, bool is32Bit, ref NavMeshSetHeader header, bool cCompatibility, DtNavMesh mesh)
{
// Read tiles.
for (int i = 0; i < header.numTiles; ++i)
Expand Down
4 changes: 2 additions & 2 deletions src/DotRecast.Detour/Io/NavMeshSetHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ 3. This notice may not be removed or altered from any source distribution.

namespace DotRecast.Detour.Io
{
public class NavMeshSetHeader
public struct NavMeshSetHeader
{
public const int NAVMESHSET_MAGIC = 'M' << 24 | 'S' << 16 | 'E' << 8 | 'T'; // 'MSET';
public const int NAVMESHSET_VERSION = 1;
Expand All @@ -28,7 +28,7 @@ public class NavMeshSetHeader
public int magic;
public int version;
public int numTiles;
public DtNavMeshParams option = new DtNavMeshParams();
public DtNavMeshParams option;
public int maxVertsPerPoly;
}
}

0 comments on commit b9ec439

Please sign in to comment.