replace defines where possible

This commit is contained in:
Ara
2023-12-04 21:34:51 +06:00
parent 24b3048c73
commit e0eacb51be
5 changed files with 50 additions and 50 deletions
+11 -11
View File
@@ -4,27 +4,27 @@
#include <limits.h>
#include "typedefs.h"
#define ENGINE_VERSION_MAJOR 0
#define ENGINE_VERSION_MINOR 15
#define STR_(x) #x
#define STR(x) STR_(x)
#define ENGINE_VERSION STR(ENGINE_VERSION_MAJOR) "." STR(ENGINE_VERSION_MINOR)
const int ENGINE_VERSION_MAJOR = 0;
const int ENGINE_VERSION_MINOR = 15;
#define TOSTR_MACRO(x) #x
#define ENGINE_VERSION TOSTR_MACRO(ENGINE_VERSION_MAJOR) "." TOSTR_MACRO(ENGINE_VERSION_MINOR);
#define CHUNK_W 16
#define CHUNK_H 256
#define CHUNK_D 16
const int CHUNK_W = 16;
const int CHUNK_H = 256;
const int CHUNK_D = 16;
/* Chunk volume (count of voxels per Chunk) */
#define CHUNK_VOL (CHUNK_W * CHUNK_H * CHUNK_D)
const int CHUNK_VOL = (CHUNK_W * CHUNK_H * CHUNK_D);
/* BLOCK_VOID is block id used to mark non-existing voxel (voxel of missing chunk) */
#define BLOCK_VOID (blockid_t)((2 << (sizeof(blockid_t)*CHAR_BIT)) - 1)
const blockid_t BLOCK_VOID = UCHAR_MAX;
inline uint vox_index(int x, int y, int z, int w=CHUNK_W, int d=CHUNK_D) {
return (y * d + z) * w + x;
}
#define SHADERS_FOLDER "shaders"
//cannot replace defines with const while used for substitution
#define SHADERS_FOLDER "shaders"
#define TEXTURES_FOLDER "textures"
#define FONTS_FOLDER "fonts"