1 //----------------------------------------------------------------------------- 2 // Definitions header file 3 //----------------------------------------------------------------------------- 4 5 #ifndef __DEFINITIONS_H__ 6 #define __DEFINITIONS_H__ 7 8 // Here comes some linux compatibility stuff 9 #ifndef WIN32 10 extern char* lstrlwr(char *s); 11 12 #define _strlwr lstrlwr 13 #define strlwr lstrlwr 14 #define stricmp strcasecmp 15 #define strnicmp strncasecmp 16 #endif 17 18 #define MODIF_FOG 0 19 20 #define _VERSION_ "cake engine" 21 #define OUTPUT_FILENAME "cake_log.html" 22 #define CONFIG_FILENAME "config.ini" 23 24 #define STR_ASK "/?" 25 #define TEXT_STYLE_KEYWORD '�' /**< Character introducing a style modification. */ 26 #define COMMAND_SEPARATOR ';' /**< Character that separate two commands. */ 27 #define COMMAND_PIPE '|' /**< Pipe character. */ 28 29 #define LINESBLOC 64 /**< Number of console lines to allocate at same time */ 30 #define HISTBLOC 32 /**< Number of command history lines to allocate at same time */ 31 #define MAXPROMPTLEN 25 /**< Maximum length for command prompr */ 32 #define RESIZE_SQUARE 12 /**< Size of resize square for console resizing */ 33 #define TAB_LEN 5 /**< Tabulations size */ 34 #define DELETE_CHAR 127 /**< Delete key char */ 35 #define N_LINES_MAX 128 /**< Maximum number of lines for a single message */ 36 37 #define FILENAME_LENGTH 1025 /**< maximum filename length */ 38 #define PATH_LENGTH 1025 /**< maximum path length */ 39 40 #define CONSOLE_LINELENGTH 4096 /**< Maximum length for a console line */ 41 #define COMMAND_LINELENGTH CONSOLE_LINELENGTH 42 43 #define MAX_OVERLAY_VERTS 262144 /**< Overlay vertices (should be enough for 1600x1200) */ 44 #define MAX_OVERLAY_ELEMS 1048576 /**< Overlay elements (should be enough for 1600x1200) */ 45 #define MAX_OVERLAY_QUADS 16384 /**< Overlay quads (should be enough for 1600x1200) */ 46 #define MAX_ANIMFRAMES 8 /**< Maximum number of animation frames - should be increased for videos */ 47 #define MAX_PARAMS 8 /**< Maximum number of parameters for a function (vertex or texture modificator) */ 48 #define MAX_LAYERS 8 /**< Maximum number of layers for a shader */ 49 #define MAX_TEXTURE_UNITS 2 /**< Number of texture units supported */ 50 #define BUFFER_SIZE_BLOC 1024 /**< Vertex buffer allocation bloc size */ 51 #define ELEMS_BLOC 4096 /**< Elems buffer allocation bloc size */ 52 #define MAX_DEFORMS 4 /**< Maximum number of simultaneous vertex deformations */ 53 #define MAX_NSHADERS 256 /**< Maximum number of shaders */ 54 55 #define FOG_TEXTURE_WIDTH 256 /**< Fog texture width */ 56 #define FOG_TEXTURE_HEIGHT 256 /**< Fog texture height */ 57 #define FOG_TEXTURE_BPP 1 /**< Byte per pixel for the fog texture */ 58 59 /** 60 * Following definitions are for bezier patch building and lod. 61 * @todo Shall I use fix distance between different tesselations instead 62 * of defining the max and min tesselation distance for all tesselation ? 63 */ 64 #define MAX_SUBDIV 4 /**< Maximum dubdivisions */ 65 #define MINLIMIT 2500 /**< Distance corresponding to maximal curve tesselation */ 66 #define MAXLIMIT 20000 /**< Distance corresponding to minimal curve tesselation */ 67 68 // plane types are used to speed some tests 69 // 0-2 are axial planes 70 #define PLANE_X 0 71 #define PLANE_Y 1 72 #define PLANE_Z 2 73 74 // 3-5 are non-axial planes snapped to the nearest 75 #define PLANE_ANYX 3 76 #define PLANE_ANYY 4 77 #define PLANE_ANYZ 5 78 79 #define PLANE_NON_AXIAL 3 80 81 // angle indexes 82 #define PITCH 0 /**< up / down */ 83 #define YAW 1 /**< left / right */ 84 #define ROLL 2 /**< fall over */ 85 86 #define MAX_PLAYERNAME_LENGTH 256 /**< Maximum player name string length */ 87 88 /** 89 * Following definitions are for shaders initialisation. If SHADER_USE_REFERENCES is 90 * defined, shader files are all parsed at cake start and shaders are stored in a list 91 * and start position is stored. If it is not start, shaders are reparsed each time a 92 * map is loaded. When SHADER_USE_REFERENCES is set to 1, shader may be wrong parsed 93 * if shader files content change during runtime because references are not updated. 94 */ 95 #define SHADER_USE_REFERENCES 1 /**< Enable/Disable the reference method */ 96 #define SHADER_ALLOWDUPLICATE 1 97 #define SHADER_NAME_MAX_LENGTH 512 /**< Maximum shadername length */ 98 99 // Char type 100 #define NORMAL_CHAR 1 101 #define PROPFONT1_CHAR 2 102 #define PROPFONT1_GLOW_CHAR 3 103 #define PROPFONT2_CHAR 4 104 105 // Font style 106 #define FONT_BIG 1 107 #define FONT_SMALL 2 108 #define FONT_GIANT 4 109 #define FONT_SHADOWED 8 110 111 #define SMALL_CHAR_WIDTH 8 112 #define SMALL_CHAR_HEIGHT 16 113 114 #define BIG_CHAR_WIDTH 16 115 #define BIG_CHAR_HEIGHT 16 116 117 #define GIANT_CHAR_WIDTH 32 118 #define GIANT_CHAR_HEIGHT 48 119 120 #define PROP_CHAR_HEIGHT 27 121 #define PROP_SMALL_SCALE 0.75 122 #define PROP_BIG_SCALE 1 123 #define PROP_SMALL_SPACING 1.5 124 #define PROP_BIG_SPACING 1 125 126 #define PROP_SMALL_HEIGHT PROP_CHAR_HEIGHT*PROP_SMALL_SCALE 127 #define PROP_BIG_HEIGHT PROP_CHAR_HEIGHT*PROP_BIG_SCALE 128 129 #endif /* __DEFINITIONS_H__ */ 130