RecastLayers: set RC_MAX_LAYERS and RC_MAX_NEIS as optional defines (#624)
It makes possible for a project integrating Recast to set custom values via CXXFLAGS while remaining build system agnostic. Type checking is kept.
This commit is contained in:
parent
cc944f28c1
commit
5c494ad1ee
@ -28,8 +28,21 @@
|
|||||||
|
|
||||||
// Must be 255 or smaller (not 256) because layer IDs are stored as
|
// Must be 255 or smaller (not 256) because layer IDs are stored as
|
||||||
// a byte where 255 is a special value.
|
// a byte where 255 is a special value.
|
||||||
static const int RC_MAX_LAYERS = 63;
|
#ifndef RC_MAX_LAYERS_DEF
|
||||||
static const int RC_MAX_NEIS = 16;
|
#define RC_MAX_LAYERS_DEF 63
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if RC_MAX_LAYERS_DEF > 255
|
||||||
|
#error RC_MAX_LAYERS_DEF must be 255 or smaller
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef RC_MAX_NEIS_DEF
|
||||||
|
#define RC_MAX_NEIS_DEF 16
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Keep type checking.
|
||||||
|
static const int RC_MAX_LAYERS = RC_MAX_LAYERS_DEF;
|
||||||
|
static const int RC_MAX_NEIS = RC_MAX_NEIS_DEF;
|
||||||
|
|
||||||
struct rcLayerRegion
|
struct rcLayerRegion
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user