ChunkDef: Replaced enums with static const ints.
This makes them easier to use in std::min et al.
This commit is contained in:
parent
8889d3b733
commit
81bf846e64
@ -62,16 +62,12 @@ typedef unsigned char HEIGHTTYPE;
|
|||||||
class cChunkDef
|
class cChunkDef
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum
|
// Chunk dimensions:
|
||||||
{
|
static const int Width = 16;
|
||||||
// Chunk dimensions:
|
static const int Height = 256;
|
||||||
Width = 16,
|
static const int NumBlocks = Width * Height * Width;
|
||||||
Height = 256,
|
/// If the data is collected into a single buffer, how large it needs to be:
|
||||||
NumBlocks = Width * Height * Width,
|
static const int BlockDataSize = cChunkDef::NumBlocks * 2 + (cChunkDef::NumBlocks / 2); // 2.5 * numblocks
|
||||||
|
|
||||||
/// If the data is collected into a single buffer, how large it needs to be:
|
|
||||||
BlockDataSize = cChunkDef::NumBlocks * 2 + (cChunkDef::NumBlocks / 2), // 2.5 * numblocks
|
|
||||||
} ;
|
|
||||||
|
|
||||||
/// The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the highest non-air block in the column
|
/// The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the highest non-air block in the column
|
||||||
typedef HEIGHTTYPE HeightMap[Width * Width];
|
typedef HEIGHTTYPE HeightMap[Width * Width];
|
||||||
|
Loading…
Reference in New Issue
Block a user