ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/define.h
(Generate patch)

Comparing deliantra/server/include/define.h (file contents):
Revision 1.75 by root, Mon Sep 10 10:43:10 2007 UTC vs.
Revision 1.84 by root, Wed Aug 27 03:41:24 2008 UTC

1/* 1/*
2 * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team 4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2003-2005,2007 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2003-2005,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen 6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 * 7 *
8 * Crossfire TRT is free software: you can redistribute it and/or modify 8 * Deliantra is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or 10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version. 11 * (at your option) any later version.
12 * 12 *
13 * This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it will be useful,
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * 20 *
21 * The authors can be reached via e-mail to <crossfire@schmorp.de> 21 * The authors can be reached via e-mail to <support@deliantra.net>
22 */ 22 */
23 23
24/* This file is best viewed with a window width of about 100 character */ 24/* This file is best viewed with a window width of about 100 character */
25 25
26/* This file is really too large. With all the .h files 26/* This file is really too large. With all the .h files
42#define FABS(x) fabs (x) 42#define FABS(x) fabs (x)
43 43
44#ifdef __NetBSD__ 44#ifdef __NetBSD__
45# include <sys/param.h> 45# include <sys/param.h>
46#endif 46#endif
47#ifndef MIN
48# define MIN(x,y) min (x, y)
49#endif
50#ifndef MAX
51# define MAX(x,y) max (x, y)
52#endif
53 47
54// maximum length of an object name in the protocol 48// maximum length of an object name in the protocol
55#define NAME_LEN 127 49#define NAME_LEN 127
56 50
57/* MAX3 is basically like MAX, but instead does 3 values. */
58#ifndef MAX3
59# define MAX3(x,y, z) (MAX(x, MAX(y,z)))
60#endif
61
62/* MIN3 is basically like MIN, but instead does 3 values. */
63#ifndef MIN3 51#undef MIN
64# define MIN3(x,y, z) (MIN(x, MIN(y,z))) 52#undef MAX
65#endif
66 53
67#define MAX_STAT 30 /* The maximum legal value of any stat */ 54#define MAX_STAT 30 /* The maximum legal value of any stat */
68#define MIN_STAT 1 /* The minimum legal value of any stat */ 55#define MIN_STAT 1 /* The minimum legal value of any stat */
69 56
70//TODO: not only use more reasonable values, also enforce them 57//TODO: not only use more reasonable values, also enforce them
88#define MAX_ANIMATIONS 256 75#define MAX_ANIMATIONS 256
89 76
90#define MAX_NAME 48 77#define MAX_NAME 48
91#define MAX_EXT_TITLE 98 78#define MAX_EXT_TITLE 98
92 79
93/* Fatal variables: */
94//TODO: remove all calls to fatal and replace them by cleanup 80//TODO: remove all calls to fatal and replace them by cleanup
95#define OUT_OF_MEMORY 0 81#define OUT_OF_MEMORY 0
96#define MAP_ERROR 1 82#define MAP_ERROR 1
97#define ARCHTABLE_TOO_SMALL 2 // unused 83#define ARCHTABLE_TOO_SMALL 2 // unused
98#define TOO_MANY_ERRORS 3 84#define TOO_MANY_ERRORS 3
313// maximum supported subtype number + 1, can be increased to 256 299// maximum supported subtype number + 1, can be increased to 256
314// currently (2007-09) in use: 50 300// currently (2007-09) in use: 50
315#define NUM_SUBTYPES 64 301#define NUM_SUBTYPES 64
316 302
317/* Subtypes for BUILDER */ 303/* Subtypes for BUILDER */
318#define ST_BD_BUILD 1 /* Builds an item */ 304#define ST_BD_BUILD 1 /* Builds an item */
319#define ST_BD_REMOVE 2 /* Removes an item */ 305#define ST_BD_REMOVE 2 /* Removes an item */
320 306
321/* Subtypes for MATERIAL */ 307/* Subtypes for MATERIAL */
322#define ST_MAT_FLOOR 1 /* Floor */ 308#define ST_MAT_FLOOR 1 /* Floor */
323#define ST_MAT_WALL 2 /* Wall */ 309#define ST_MAT_WALL 2 /* Wall */
324#define ST_MAT_ITEM 3 /* All other items, including doors & such */ 310#define ST_MAT_ITEM 3 /* All other items, including doors & such */
395 * freearr, add these values. <= SIZEOFFREE1 will get you 381 * freearr, add these values. <= SIZEOFFREE1 will get you
396 * within 1 space. <= SIZEOFFREE2 wll get you withing 382 * within 1 space. <= SIZEOFFREE2 wll get you withing
397 * 2 spaces, and the entire array (< SIZEOFFREE) is 383 * 2 spaces, and the entire array (< SIZEOFFREE) is
398 * three spaces 384 * three spaces
399 */ 385 */
386#define SIZEOFFREE0 0
400#define SIZEOFFREE1 8 387#define SIZEOFFREE1 8
401#define SIZEOFFREE2 24 388#define SIZEOFFREE2 24
389#define SIZEOFFREE3 48
402#define SIZEOFFREE 49 390#define SIZEOFFREE 49
403 391
404#define NROF_SOUNDS (23 + NROFREALSPELLS) /* Number of sounds */ 392#define NROF_SOUNDS (23 + NROFREALSPELLS) /* Number of sounds */
405 393
406/* 394/*
407 * If any FLAG's are added or changed, make sure the flag_names structure in 395 * If any FLAG's are added or changed, make sure the flag_names structure in
600 * 588 *
601 */ 589 */
602#define OB_TYPE_MOVE_BLOCK(ob1, type) \ 590#define OB_TYPE_MOVE_BLOCK(ob1, type) \
603 ((type) && (ob1->move_type & type) == ob1->move_type) 591 ((type) && (ob1->move_type & type) == ob1->move_type)
604 592
605#define SET_GENERATE_TYPE(xyz,va) (xyz)->stats.sp=(va)
606#define GENERATE_TYPE(xyz) ((xyz)->stats.sp)
607#define GENERATE_SPEED(xyz) ((xyz)->stats.maxsp) /* if(!RANDOM()%<speed>) */ 593#define GENERATE_SPEED(xyz) ((xyz)->stats.maxsp) /* if(!RANDOM()%<speed>) */
608 594
609#define EXIT_PATH(xyz) (xyz)->slaying 595#define EXIT_PATH(xyz) (xyz)->slaying
610#define EXIT_LEVEL(xyz) (xyz)->stats.food 596#define EXIT_LEVEL(xyz) (xyz)->stats.food
611#define EXIT_X(xyz) (xyz)->stats.hp 597#define EXIT_X(xyz) (xyz)->stats.hp
773// also make sure that this is a float, not double, constant 759// also make sure that this is a float, not double, constant
774#define MIN_ACTIVE_SPEED (1.f / 65536.f) 760#define MIN_ACTIVE_SPEED (1.f / 65536.f)
775 761
776#define RANDOM() (rndm.next () & 0xffffffU) 762#define RANDOM() (rndm.next () & 0xffffffU)
777 763
778/* Returns the weight of the given object. Note: it does not take the number of
779 * items (nrof) into account.
780 * (this looks rather bogus, schmorp)
781 */
782#define WEIGHT(op) ((op)->nrof ? (op)->weight : (op)->weight + (op)->carrying)
783
784/* 764/*
785 * Warning! 765 * Warning!
786 * If you add message types here, don't forget 766 * If you add message types here, don't forget
787 * to keep the client up to date too! 767 * to keep the client up to date too!
788 */ 768 */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines