This commit is contained in:
MihailRis 2024-05-06 03:15:27 +03:00
parent 91aacafecb
commit f27a418dbe
81 changed files with 310 additions and 302 deletions

View file

@ -1,5 +1,5 @@
#ifndef SRC_CONSTANTS_H_
#define SRC_CONSTANTS_H_
#ifndef CONSTANTS_H_
#define CONSTANTS_H_
#include <limits>
#include <string>
@ -26,15 +26,17 @@ inline constexpr int CHUNK_D = 16;
inline constexpr uint VOXEL_USER_BITS = 8;
inline constexpr uint VOXEL_USER_BITS_OFFSET = sizeof(blockstate_t)*8-VOXEL_USER_BITS;
/// @brief pixel size of an item inventory icon
inline constexpr int ITEM_ICON_SIZE = 48;
/* Chunk volume (count of voxels per Chunk) */
/// @brief chunk volume (count of voxels per Chunk)
inline constexpr int CHUNK_VOL = (CHUNK_W * CHUNK_H * CHUNK_D);
/* BLOCK_VOID is block id used to mark non-existing voxel (voxel of missing chunk) */
/// @brief block id used to mark non-existing voxel (voxel of missing chunk)
inline constexpr blockid_t BLOCK_VOID = std::numeric_limits<blockid_t>::max();
/// @brief item id used to mark non-existing item (error)
inline constexpr itemid_t ITEM_VOID = std::numeric_limits<itemid_t>::max();
/// @brief max number of block definitions possible
inline constexpr blockid_t MAX_BLOCKS = BLOCK_VOID;
inline constexpr uint vox_index(uint x, uint y, uint z, uint w=CHUNK_W, uint d=CHUNK_D) {
@ -47,4 +49,4 @@ inline const std::string FONTS_FOLDER = "fonts";
inline const std::string LAYOUTS_FOLDER = "layouts";
inline const std::string SOUNDS_FOLDER = "sounds";
#endif // SRC_CONSTANTS_H_
#endif // CONSTANTS_H_