defines.h

Go to the documentation of this file.
00001 
00006 /*
00007 All original material Copyright (C) 2002-2010 UFO: Alien Invasion.
00008 
00009 Copyright (C) 1997-2001 Id Software, Inc.
00010 
00011 This program is free software; you can redistribute it and/or
00012 modify it under the terms of the GNU General Public License
00013 as published by the Free Software Foundation; either version 2
00014 of the License, or (at your option) any later version.
00015 
00016 This program is distributed in the hope that it will be useful,
00017 but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00019 
00020 See the GNU General Public License for more details.
00021 
00022 You should have received a copy of the GNU General Public License
00023 along with this program; if not, write to the Free Software
00024 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00025 
00026 */
00027 
00028 #ifndef SHARED_DEFINES_H
00029 #define SHARED_DEFINES_H
00030 
00038 /* if a brush just barely pokes onto the other side, let it slide by without chopping */
00039 #define PLANESIDE_EPSILON   0.001
00040 
00041 /* if you increase this, you also have to change the aircraft buy/sell menu scripts */
00042 #define MAX_ACTIVETEAM  8
00043 
00045 #define LEAFNODE -1
00046 #define PLANENUM_LEAF -1
00047 
00048 /* bsp constants */
00049 #define TEXINFO_NODE        -1      /* side is already on a node */
00050 #define MAXEDGES        20
00051 
00052 #define TEAM_DEFAULT 1
00053 
00055 #define DEBUG_ALL       0x07FE
00056 #define DEBUG_SHARED    0x02
00057 #define DEBUG_ENGINE    0x04
00058 #define DEBUG_SYSTEM    0x08
00059 #define DEBUG_COMMANDS  0x10
00060 #define DEBUG_CLIENT    0x20
00061 #define DEBUG_SERVER    0x40
00062 #define DEBUG_GAME      0x80
00063 #define DEBUG_RENDERER  0x0100
00064 #define DEBUG_SOUND     0x0200
00065 #define DEBUG_EVENTSYS  0x0400
00066 /* note that pathing and routing are not included in DEBUG_ALL (too much output) */
00067 #define DEBUG_PATHING   0x0800
00068 #define DEBUG_ROUTING   0x1000
00069 
00070 #define NONE        -1
00071 #define NONE_AMMO   0
00072 
00073 /* Move/Routing values */
00074 #define MAX_ROUTE       33
00075 #define MAX_MOVELENGTH  60
00076 
00077 /* Timeunits for the various actions. */
00078 #define TU_CROUCH           3   
00079 #define TU_TURN             1   
00080 #define TU_MOVE_STRAIGHT    2   
00081 #define TU_MOVE_DIAGONAL    3   
00082 #define TU_MOVE_CLIMB       4   
00083 #define TU_MOVE_FALL        0   
00084 #define TU_DOOR_ACTION      1   
00085 #define TU_CROUCH_MOVING_FACTOR 1.5 
00086 #define TU_FLYING_MOVING_FACTOR 2   
00088 #define TU_GET_RELOAD(containerOut, containerIn, weapon) (csi.ids[(containerOut)].out + (weapon)->reload + csi.ids[(containerIn)].in)
00089 
00090 /* door states */
00091 #define STATE_OPENED        0
00092 #define STATE_CLOSED        1
00093 
00094 #define MAX_STRING_CHARS    1024    /* max length of a string passed to Cmd_TokenizeString */
00095 /* common/cmd.c */
00096 #define MAX_STRING_TOKENS   80  /* max tokens resulting from Cmd_TokenizeString */
00097 
00098 /* ALL */
00099 #define MAX_TEXPATH         32  
00101 /* per-level limits */
00102 /* 25 - bases are 5*5 - see BASE_SIZE*/
00103 #define MAX_TILESTRINGS     25
00104 #define MAX_TEAMS           8
00105 #define MAX_CLIENTS         256 /* absolute limit */
00106 #define MAX_EDICTS          1024    /* must change protocol to increase more */
00107 #define MAX_MODELS          256 /* these are sent over the net as bytes */
00108 #define MAX_GENERAL         (MAX_CLIENTS*2) /* general config strings */
00109 
00110 /* not really max hp - but an initial value */
00111 #define MAX_HP 100
00112 
00113 /* game print flags */
00114 #define PRINT_NONE      -1  /* suppress printing */
00115 #define PRINT_CHAT      0   /* chat messages */
00116 #define PRINT_HUD       1   /* translated hud strings */
00117 #define PRINT_CONSOLE   2   /* critical messages goes to the game console */
00118 
00119 #define ERR_FATAL           0   /* exit the entire game with a popup window */
00120 #define ERR_DROP            1   /* print to console and disconnect from game */
00121 #define ERR_DISCONNECT      2   /* don't kill server */
00122 
00123 /* substract this from the ent->pos[z] to get the ground position */
00124 #define GROUND_DELTA    28
00125 
00126 /* important units */
00127 #define UNIT_SIZE   32
00128 #define UNIT_HEIGHT 64
00129 /* player height - 12 to be able to walk trough doors
00130  * UNIT_HEIGHT is the height of one level */
00131 #define PLAYER_HEIGHT       (UNIT_HEIGHT - 16)
00132 #define QUANT   4
00133 /* WALL_SIZE is the distance a wall may protrude from the edge of a cell without interfeeting with an actor entering the cell */
00134 #define WALL_SIZE 5
00135 
00140 #define MAX_MAP_MODELS      1024
00141 #define MAX_MAP_BRUSHES     16384
00142 #define MAX_MAP_ENTITIES    2048
00143 #define MAX_MAP_ENTSTRING   0x40000
00144 #define MAX_MAP_TEXINFO     16384
00145 #define MAX_MAP_PLANES      65536
00146 #define MAX_MAP_NODES       65536
00147 #define MAX_MAP_BRUSHSIDES  65536
00148 #define MAX_MAP_LEAFS       65536
00149 #define MAX_MAP_VERTS       65536
00150 #define MAX_MAP_FACES       65536
00151 #define MAX_MAP_LEAFBRUSHES 65536
00152 #define MAX_MAP_EDGES       128000
00153 #define MAX_MAP_SURFEDGES   256000
00154 #define MAX_MAP_LIGHTING    0x1000000
00155 /* WIDTH * WIDTH * 4 */
00156 #define MAX_MAP_ROUTING     0x100000
00157 
00158 #define MAX_LEAFS       1024
00159 
00160 #if defined(COMPILE_MAP)
00161   #define MAX_MAPTILES  1
00162 #elif defined(COMPILE_UFO)
00163   #define MAX_MAPTILES  64
00164 #endif
00165 
00166 #define MAX_MOD_KNOWN   512
00167 
00169 #define MAX_KEY     32
00170 #define MAX_VALUE   1024
00171 
00173 #define LUMP_ENTITIES       0
00174 #define LUMP_PLANES         1
00175 #define LUMP_VERTEXES       2
00176 #define LUMP_ROUTING        3
00177 #define LUMP_NODES          4
00178 #define LUMP_TEXINFO        5
00179 #define LUMP_FACES          6
00180 #define LUMP_LIGHTING_NIGHT 7
00181 #define LUMP_LIGHTING_DAY   8
00182 #define LUMP_LEAFS          9
00183 #define LUMP_LEAFBRUSHES    10
00184 #define LUMP_EDGES          11
00185 #define LUMP_SURFEDGES      12
00186 #define LUMP_MODELS         13
00187 #define LUMP_BRUSHES        14
00188 #define LUMP_BRUSHSIDES     15
00189 #define LUMP_NORMALS        16
00190 #define HEADER_LUMPS        17
00191 
00192 #define SIDE_FRONT      0
00193 #define SIDE_ON         2
00194 #define SIDE_BACK       1
00195 
00197 #define PLANE_X         0
00198 #define PLANE_Y         1
00199 #define PLANE_Z         2
00200 
00202 #define PLANE_ANYX      3
00203 #define PLANE_ANYY      4
00204 #define PLANE_ANYZ      5
00205 #define PLANE_NONE      6
00206 
00207 #define AXIAL(p) ((p)->type < PLANE_ANYX)
00208 
00211 #define ANGLE_UP    -1
00212 #define ANGLE_DOWN  -2
00213 
00214 /*
00215 ==============================================================
00216 COLLISION DETECTION
00217 ==============================================================
00218 */
00219 
00229 #define CONTENTS_SOLID  0x0001 
00230 #define CONTENTS_WINDOW 0x0002 
00231 #define CONTENTS_LADDER 0x0004
00232 #define CONTENTS_WATER  0x0020
00233 
00235 /* ufo2map/map.c, ufo2map/portals.c */
00236 #define LAST_VISIBLE_CONTENTS   0x80
00237 
00238 #define CONTENTS_LEVEL_ALL  0xFF00
00239 #define CONTENTS_LEVEL_1    0x0100
00240 #define CONTENTS_LEVEL_2    0x0200
00241 #define CONTENTS_LEVEL_3    0x0400
00242 #define CONTENTS_LEVEL_4    0x0800
00243 #define CONTENTS_LEVEL_5    0x1000
00244 #define CONTENTS_LEVEL_6    0x2000
00245 #define CONTENTS_LEVEL_7    0x4000
00246 #define CONTENTS_LEVEL_8    0x8000
00247 
00249 #define CONTENTS_ACTORCLIP      0x00010000
00250 #define CONTENTS_PASSABLE       0x00020000
00251 #define CONTENTS_TERRAIN        0x00040000 
00252 #define CONTENTS_LIGHTCLIP      0x00080000 
00253 #define CONTENTS_ACTOR          0x00800000 
00254 #define CONTENTS_ORIGIN         0x01000000 
00255 #define CONTENTS_WEAPONCLIP     0x02000000 
00256 #define CONTENTS_DEADACTOR      0x04000000
00257 #define CONTENTS_DETAIL         0x08000000 
00258 #define CONTENTS_TRANSLUCENT    0x10000000 
00260 #define SURF_LIGHT      0x00000001 
00261 #define SURF_SLICK      0x00000002 
00262 #define SURF_WARP       0x00000008 
00263 #define SURF_BLEND33    0x00000010 
00264 #define SURF_BLEND66    0x00000020 
00265 #define SURF_FLOWING    0x00000040 
00266 #define SURF_NODRAW     0x00000080 
00267 #define SURF_HINT       0x00000100 
00268 #define SURF_SKIP       0x00000200 
00269 #define SURF_PHONG      0x00000400 
00270 #define SURF_BURN       0x00000800 
00271 #define SURF_FOOTSTEP   0x00001000 
00272 #define SURF_ORIGIN     0x00002000 
00273 #define SURF_ALPHATEST  0x02000000 
00275 /* content masks */
00276 #define MASK_ALL            (-1)
00277 #define MASK_SOLID          (CONTENTS_SOLID | CONTENTS_WINDOW)
00278 #define MASK_IMPASSABLE     (MASK_SOLID | CONTENTS_ACTORCLIP)
00279 #define MASK_PASSABLE       (CONTENTS_PASSABLE | CONTENTS_WATER)
00280 #define MASK_SHOT           (CONTENTS_SOLID | CONTENTS_ACTOR | CONTENTS_WEAPONCLIP | CONTENTS_WINDOW | CONTENTS_DEADACTOR)
00281 #define MASK_VISIBILILITY   (CONTENTS_SOLID | CONTENTS_WATER)
00282 #define MASK_CLIP           (CONTENTS_ACTORCLIP | CONTENTS_WEAPONCLIP | CONTENTS_LIGHTCLIP)
00283 
00284 /*============================================================== */
00285 
00286 #define ROUTING_NOT_REACHABLE   0xFF    
00287 #define ROUTING_UNREACHABLE     -1      
00289 /* Battlescape map dimensions (WIDTH*WIDTH*HEIGHT) */
00290 
00291 #define MAX_WORLD_WIDTH 4096
00292 
00293 #define GRID_WIDTH (MAX_WORLD_WIDTH / UNIT_SIZE)
00294 
00295 #define PATHFINDING_WIDTH (GRID_WIDTH * 2)
00296 
00297 #define PATHFINDING_HEIGHT 8
00298 
00299 #define CELL_HEIGHT (UNIT_HEIGHT / QUANT)
00300 
00301 /* NOTE: this only allows quadratic units */
00302 #define ACTOR_SIZE_INVALID 0
00303 #define ACTOR_SIZE_NORMAL 1
00304 #define ACTOR_SIZE_2x2 2
00305 #define ACTOR_MAX_SIZE  (ACTOR_SIZE_2x2)
00306 
00307 /* Maximum falling distance in QUANT units (model units / QUANT) */
00308 #define PATHFINDING_MAX_FALL    16
00309 /* The height of the box where we don't need the full actor's torso width */
00310 #define PATHFINDING_LEGROOMHEIGHT   4
00311 /* Minimum step-up height in QUANT units (model units/QUANT)
00312  * Note that 4 is the minimum to rise one cell every 4 moved horizontally. */
00313 #define PATHFINDING_MIN_STEPUP      2
00314 /* Minimum step-up height in QUANT units (model units/QUANT)
00315  * Note that 4 is the minimum to rise one cell every 4 moved horizontally. */
00316 #define PATHFINDING_MAX_STEPUP      4
00317 /* A stepup value indicating that there is no way to enter the cell. */
00318 #define PATHFINDING_NO_STEPUP       (2 * CELL_HEIGHT)
00319 /* A special bit mask indicating that the stepup causes the actor to rise a cell. */
00320 #define PATHFINDING_BIG_STEPUP      0x80
00321 /* A special bit mask indicating that the stepup causes the actor to walk down a cell. */
00322 #define PATHFINDING_BIG_STEPDOWN        0x40
00323 /* Minimum height for an opening to be an opening in step units (model units/QUANT)
00324  * Must be larger than PATHFINDING_MAX_STEPUP!!
00325  */
00326 #define PATHFINDING_MIN_OPENING 6
00327 
00328 #define PATHFINDING_MICROSTEP_SIZE  4
00329 
00331 #define PATHFINDING_MICROSTEP_SKIP  2
00332 
00333 /* DIRECTION constants- define "odd" directions */
00334 #define DIRECTION_FALL          13
00335 #define DIRECTION_CLIMB_UP      8
00336 #define DIRECTION_CLIMB_DOWN    9
00337 #define DIRECTION_STAND_UP      10
00338 #define DIRECTION_CROUCH        11
00339 
00340 
00341 #define ACTOR_MAX_STATES        2
00342 
00351 #define LEVEL_LASTVISIBLE       255
00352 #define LEVEL_LIGHTCLIP         256
00353 #define LEVEL_LASTLIGHTBLOCKING 256
00354 #define LEVEL_WEAPONCLIP        257
00355 #define LEVEL_ACTORCLIP         258
00356 #define LEVEL_MAX               259
00357 #define NUM_REGULAR_MODELS      (LEVEL_ACTORCLIP + 1)
00358 
00359 /* TestLine level masks */
00360 #define TL_FLAG_NONE            0x0000
00361 #define TL_FLAG_REGULAR_LEVELS  0x00FF
00362 #define TL_FLAG_ACTORCLIP       0x0100
00363 #define TL_FLAG_WEAPONCLIP      0x0200
00364 #define TL_FLAG_ALL             0x0300
00365 
00366 #define LIGHTMAP_NIGHT  0
00367 #define LIGHTMAP_DAY    1
00368 #define LIGHTMAP_MAX    2
00369 
00370 #define PSIDE_FRONT         1
00371 #define PSIDE_BACK          2
00372 #define PSIDE_BOTH          (PSIDE_FRONT|PSIDE_BACK)
00373 #define PSIDE_FACING        4
00374 
00375 #define MAX_TOKEN_CHARS     256 /* max length of an individual token */
00376 
00377 #define ON_EPSILON  0.1
00378 
00379 /* 1/32 epsilon to keep floating point happy */
00380 #define DIST_EPSILON    (0.03125)
00381 #define DIST_EPSILON2   (0.0625125) /* DIST_EPSILON * 2 + small bit more */
00382 
00383 #define MAP_DIST_EPSILON    0.01
00384 #define NORMAL_EPSILON  0.00001
00385 
00386 #define MAX_MAP_SIDES (MAX_MAP_BRUSHES*6)
00387 #define MAX_MAP_TEXTURES    1024
00388 
00389 #define MAX_MAP_LIGHTMAP    (512 * 512)
00390 
00391 #define MAP_SIZE_OFFSET 100
00392 
00393 #endif /* SHARED_DEFINES_H */

Generated by  doxygen 1.6.2