forked from bit/DotRecastNetSim
refactor: class NavMeshSetHeader -> struct NavMeshSetHeader
This commit is contained in:
parent
afabec2b7d
commit
b9ec4391f2
|
@ -67,7 +67,7 @@ namespace DotRecast.Detour.Io
|
||||||
|
|
||||||
bool cCompatibility = header.version == NavMeshSetHeader.NAVMESHSET_VERSION;
|
bool cCompatibility = header.version == NavMeshSetHeader.NAVMESHSET_VERSION;
|
||||||
DtNavMesh mesh = new DtNavMesh(header.option, header.maxVertsPerPoly);
|
DtNavMesh mesh = new DtNavMesh(header.option, header.maxVertsPerPoly);
|
||||||
ReadTiles(bb, is32Bit, header, cCompatibility, mesh);
|
ReadTiles(bb, is32Bit, ref header, cCompatibility, mesh);
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ namespace DotRecast.Detour.Io
|
||||||
return header;
|
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.
|
// Read tiles.
|
||||||
for (int i = 0; i < header.numTiles; ++i)
|
for (int i = 0; i < header.numTiles; ++i)
|
||||||
|
|
|
@ -18,7 +18,7 @@ freely, subject to the following restrictions:
|
||||||
|
|
||||||
namespace DotRecast.Detour.Io
|
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_MAGIC = 'M' << 24 | 'S' << 16 | 'E' << 8 | 'T'; // 'MSET';
|
||||||
public const int NAVMESHSET_VERSION = 1;
|
public const int NAVMESHSET_VERSION = 1;
|
||||||
|
@ -28,7 +28,7 @@ namespace DotRecast.Detour.Io
|
||||||
public int magic;
|
public int magic;
|
||||||
public int version;
|
public int version;
|
||||||
public int numTiles;
|
public int numTiles;
|
||||||
public DtNavMeshParams option = new DtNavMeshParams();
|
public DtNavMeshParams option;
|
||||||
public int maxVertsPerPoly;
|
public int maxVertsPerPoly;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue