mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-30 00:17:13 +00:00
refactor(dNavigation): fixed-width ints in the navmesh file headers
They are read straight from the .bin files; int32_t is the same layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
#include "Recast.h"
|
#include "Recast.h"
|
||||||
#include "DetourCommon.h"
|
#include "DetourCommon.h"
|
||||||
#include "DetourNavMesh.h"
|
#include "DetourNavMesh.h"
|
||||||
@@ -9,17 +11,22 @@
|
|||||||
static const int NAVMESHSET_MAGIC = 'M' << 24 | 'S' << 16 | 'E' << 8 | 'T'; // char[4] of 'MSET'
|
static const int NAVMESHSET_MAGIC = 'M' << 24 | 'S' << 16 | 'E' << 8 | 'T'; // char[4] of 'MSET'
|
||||||
static const int NAVMESHSET_VERSION = 1;
|
static const int NAVMESHSET_VERSION = 1;
|
||||||
|
|
||||||
|
// Read straight from the .bin navmesh files
|
||||||
struct NavMeshSetHeader {
|
struct NavMeshSetHeader {
|
||||||
int magic;
|
int32_t magic;
|
||||||
int version;
|
int32_t version;
|
||||||
int numTiles;
|
int32_t numTiles;
|
||||||
dtNavMeshParams params;
|
dtNavMeshParams params;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NavMeshTileHeader {
|
struct NavMeshTileHeader {
|
||||||
dtTileRef tileRef;
|
dtTileRef tileRef;
|
||||||
int dataSize;
|
int32_t dataSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// The layout the files were always read with on 64-bit builds
|
||||||
|
static_assert(sizeof(NavMeshSetHeader) == 12 + sizeof(dtNavMeshParams));
|
||||||
|
static_assert(sizeof(NavMeshTileHeader) == (sizeof(dtTileRef) == 8 ? 16 : 8));
|
||||||
|
|
||||||
static const int MAX_POLYS = 256;
|
static const int MAX_POLYS = 256;
|
||||||
static const int MAX_SMOOTH = 2048;
|
static const int MAX_SMOOTH = 2048;
|
||||||
|
|||||||
Reference in New Issue
Block a user