diff options
author | WlodekM <[email protected]> | 2024-06-16 10:35:45 +0300 |
---|---|---|
committer | WlodekM <[email protected]> | 2024-06-16 10:35:45 +0300 |
commit | abef6da56913f1c55528103e60a50451a39628b1 (patch) | |
tree | b3c8092471ecbb73e568cd0d336efa0e7871ee8d /src/Constants.h |
initial commit
Diffstat (limited to 'src/Constants.h')
-rw-r--r-- | src/Constants.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/src/Constants.h b/src/Constants.h new file mode 100644 index 0000000..46677ac --- /dev/null +++ b/src/Constants.h @@ -0,0 +1,78 @@ +#ifndef CC_CONSTANTS_H +#define CC_CONSTANTS_H +/* +Defines useful constants +Copyright 2014-2023 ClassiCube | Licensed under BSD-3 +*/ + +#define GAME_MAX_CMDARGS 5 +#define GAME_APP_VER "0.1.69b" +#define GAME_API_VER 1 + +#if defined CC_BUILD_WEB +#define GAME_APP_ALT "ClassiHax 0.1.69b web mobile" +#define GAME_APP_NAME "ClassiHax 0.1.69b web" +#define GAME_APP_TITLE "ClassiHax" +#else +#define GAME_APP_NAME "ClassiHax 0.1.69b" +#define GAME_APP_TITLE "ClassiHax 0.1.69b" +#endif + +/* Max number of characters strings can have. */ +#define STRING_SIZE 64 +/* Max number of characters filenames can have. */ +#define FILENAME_SIZE 260 + +/* Chunk axis length in blocks. */ +#define CHUNK_SIZE 16 +#define HALF_CHUNK_SIZE 8 +#define CHUNK_SIZE_2 (CHUNK_SIZE * CHUNK_SIZE) +#define CHUNK_SIZE_3 (CHUNK_SIZE * CHUNK_SIZE * CHUNK_SIZE) + +#define CHUNK_MAX 15 +/* Local index in a chunk for a coordinate. */ +#define CHUNK_MASK 15 +/* Chunk index for a coordinate. */ +#define CHUNK_SHIFT 4 + +/* Chunk axis length (plus neighbours) in blocks. */ +#define EXTCHUNK_SIZE 18 +#define EXTCHUNK_SIZE_2 (EXTCHUNK_SIZE * EXTCHUNK_SIZE) +#define EXTCHUNK_SIZE_3 (EXTCHUNK_SIZE * EXTCHUNK_SIZE * EXTCHUNK_SIZE) + +/* Minor adjustment to max UV coords, to avoid pixel bleeding errors due to rounding. */ +#define UV2_Scale (15.99f / 16.0f) + +#define GAME_DEF_TICKS (1.0 / 20) +#define GAME_NET_TICKS (1.0 / 60) + +#define GUI_MAX_CHATLINES 30 + +enum FACE_CONSTS { + FACE_XMIN = 0, /* Face X = 0 */ + FACE_XMAX = 1, /* Face X = 1 */ + FACE_ZMIN = 2, /* Face Z = 0 */ + FACE_ZMAX = 3, /* Face Z = 1 */ + FACE_YMIN = 4, /* Face Y = 0 */ + FACE_YMAX = 5, /* Face Y = 1 */ + FACE_COUNT= 6 /* Number of faces on a cube */ +}; + +enum SKIN_TYPE { SKIN_64x32, SKIN_64x64, SKIN_64x64_SLIM, SKIN_INVALID = 0xF0 }; +#define DRAWER2D_MAX_COLORS 256 + +#define UInt8_MaxValue ((cc_uint8)255) +#define Int16_MaxValue ((cc_int16)32767) +#define UInt16_MaxValue ((cc_uint16)65535) +#define Int32_MinValue ((cc_int32)-2147483647L - (cc_int32)1L) +#define Int32_MaxValue ((cc_int32)2147483647L) + +#define SKINS_SERVER "http://cdn.classicube.net/skin" +#define UPDATES_SERVER "http://cdn.classicube.net/client" +#define SERVICES_SERVER "https://www.classicube.net/api" +#define RESOURCE_SERVER "http://static.classicube.net" +/* Webpage where users can register for a new account */ +#define REGISTERNEW_URL "https://www.classicube.net/acc/register/" + +#define DEFAULT_USERNAME "Singleplayer" +#endif |