VoxelEngine/src/constants.h
2023-11-20 01:30:57 +10:00

30 lines
721 B
C

#ifndef SRC_CONSTANTS_H_
#define SRC_CONSTANTS_H_
#include <limits.h>
#include "typedefs.h"
#define CHUNK_W 16
#define CHUNK_H 256
#define CHUNK_D 16
/* Chunk volume (count of voxels per Chunk) */
#define 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)
inline uint vox_index(int x, int y, int z, int w, int d) {
return (y * d + z) * w + x;
}
#define ATLAS_MARGIN_SIZE 2
#define RES_FLODER "res/"
#define SHADERS_FOLDER "res/shaders"
#define TEXTURES_FOLDER "res/textures"
#define FONTS_FOLDER "res/fonts"
#endif // SRC_CONSTANTS_H_