editor: #undef O after use
[0verkill.git] / cfg.h
blob8fb635db2c8e94067c908a83cf75a2d1ae400c4e
1 #ifndef __CONFIG_H
2 #define __CONFIG_H
4 #include "math.h"
6 /* #define LEAK_DEBUG */
7 /* #define LEAK_DEBUG_LIST */
10 /* if you want to disable 3D support, comment following line out */
11 #define TRI_D /* compile with 3D support */
13 #define VERSION_MAJOR 0
14 #define VERSION_MINOR 16
16 /* minimal version number accepted by the server */
17 #define MIN_CLIENT_VERSION_MINOR 16 /* server accepts client with this number */
18 #define MIN_SERVER_VERSION_MINOR 16 /* client can connect to server with this number */
20 /* all TTLs are in microseconds */
22 #define DEFAULT_FONT_NAME "-misc-fixed-bold-r-normal-*-13-*-*-*-c-*-iso8859-*"
24 #define LEVEL_FILE "level.dat"
25 #define GAME_SPRITES_FILE "sprites.dat"
26 #define BANNER_FILE "banner.dat"
28 #define STATIC_DATA_SUFFIX ".st"
29 #define DYNAMIC_DATA_SUFFIX ".dn"
30 #define LEVEL_SPRITES_SUFFIX ".sp"
32 #define CFG_FILE ".0verkill"
34 #define AREA_X 1000
35 #define AREA_Y 500
37 #define MAX_PLAYER_VIEW_X_RADIUS 40 /* unused */
38 #define MAX_PLAYER_VIEW_Y_RADIUS 15 /* unused */
40 #define MAX_DUMB_TIME 30000000 /* delete player after 30 dumb seconds */
41 #define MICROSECONDS 1000000 /* microseconds in one second */
42 #define FPS 32
43 #define CLIENT_FPS 32
44 #define PERIOD_USEC MICROSECONDS/FPS
45 #define CLIENT_PERIOD_USEC MICROSECONDS/CLIENT_FPS
46 #define MENU_PERIOD_USEC MICROSECONDS/20 /* 20Hz FPS */
47 #define DELAY_BEFORE_SLEEP_USEC 120000000 /* 120 seconds */
50 #define BULGE_WIDTH 20 /* dimensions of eyes bulging skull */
51 #define BULGE_HEIGHT 12
53 #define TITLE_WIDTH 72 /* dimensions of 0verkill title */
54 #define TITLE_HEIGHT 10
56 #define PLAYER_WIDTH 15
57 #define PLAYER_HEIGHT 13
59 #define CREEP_WIDTH 15 /* this isn't original width of image, because width of player must be still the same */
60 #define CREEP_HEIGHT 5
62 #define CREEP_YOFFSET (int2double(PLAYER_HEIGHT-CREEP_HEIGHT))
64 #define CORPSE_HEIGHT 3
65 #define CORPSE_WIDTH 34
67 /* All velocities are in pixels per second (not per tick) */
68 #define WALK_ACCEL (float2double(1*36))
69 #define MAX_SPEED_WALK_FAST (float2double(3*36))
70 #define MAX_SPEED_CREEP (float2double((double).5*36))
71 #define FALL_ACCEL (float2double((double).25*36*36/FPS))
72 #define MAX_X_SPEED (float2double(2*36))
73 #define MAX_Y_SPEED (float2double(5*36))
74 #define PLAYER_SLOW_DOWN_X (float2double(.9))
75 #define MIN_X_SPEED (float2double((double).2*36))
76 #define MIN_Y_SPEED (float2double((double).2*36))
77 #define SPEED_JUMP (float2double((double)2.5*36))
78 #define OVERKILL 15 /* if death dammage is greater than OVERKILL player is pulverized, otherwise corpse is created */
79 /* initial time to live of some objects */
81 #define N_SHRAPNELS_EXPLODE 40 /* # shrapnels per grenade explosion */
83 #define SHELL_TTL 160
84 #define SHRAPNEL_TTL 100
85 #define CORPSE_TTL 6000
86 #define MESS_TTL 1200
88 /* lethalness of killing objects */
89 #define KILL_LETHALNESS 5
90 #define KILL_ARMOR_DAMAGE 5
92 #define NOISE_TTL 30
93 #define JETFIRE_TTL 10
95 #define HOLD_GUN_AFTER_SHOOT 8
96 #define MESS_HEIGHT 2
97 #define FIRE_YOFFSET (int2double(6))
98 #define GRENADE_FIRE_YOFFSET (int2double(2))
99 #define FIRE_IMPACT (float2double((double).3*36)) /* impact of bullet crashing into player */
100 #define SHRAPNEL_IMPACT (float2double((double)1.78*36)) /* impact of shrapnel crashing into player */
101 #define JETFIRE_IMPACT (float2double((double)2.13*36)) /* impact of flame on player */
102 #define GRENADE_DELAY (weapon[WEAPON_GRENADE].cadence>>4)
104 #define MESSAGE_TTL 10000000 /* in microseconds */
105 #define MESSAGE_COLOR 11 /* yellow */
106 #define N_MESSAGES 4 /* maximal number of messages */
107 #define MAX_MESSAGE_LENGTH 70 /* maximal length of chat message */
108 #define MAX_PACKET_LENGTH 296-12 /* maximal packet length */
110 #define N_SHRAPNELS 10 /* number of shrapnel sprites */
112 #define MAX_NAME_LEN 24 /* maximal length of player's name */
113 #define MAX_HOST_LEN 64 /* maximal length of hostname */
114 #define MAX_PORT_LEN 8 /* maximal length of port number */
116 #define DEFAULT_PORT 6666 /* default game port */
118 #define MEDIKIT_HEALTH_ADD 30
119 #define ARMOR_ADD 50
120 #define INVISIBILITY_DURATION 2000
121 #define ILLNESS_SPEED 10 /* player's suffering duration */
122 #define BURNING_SPEED 15 /* player's juiciness ;-) */
124 #define INVISIBILITY_RESPAWN_TIME 200000000 /* in microseconds */
125 #define ARMOR_RESPAWN_TIME 50000000 /* in microseconds */
126 #define MEDIKIT_RESPAWN_TIME 30000000 /* in microseconds */
127 #define WEAPON_RESPAWN_TIME 30000000 /* in microseconds */
128 #define AMMO_RESPAWN_TIME 25000000 /* in microseconds */
129 #define PS_RESPAWN_TIME 3000000 /* in microseconds */
131 #define TOP_PLAYERS_N 10
133 /* when TRI_D is defined variable tri_d says plane to draw to */
134 /* 0 is normal plane, 1 is "extra" plane */
135 /* this variable works for all console functions and sprite functions */
137 #ifdef TRI_D
138 extern int TRI_D_ON; /* view in 3D */
139 extern int tri_d;
140 #endif
143 #ifdef WIN32
144 #include <windows.h>
145 #define long_long __int64
146 #define bzero(a,b) memset((a), 0, (b))
147 #undef ERROR
148 #ifdef SERVER
149 extern int consoleApp;
150 #define ERROR(a) {if (!console_ok)c_shutdown();if(consoleApp)fprintf(stderr,a);}
151 #define EXIT(a) {if (!consoleApp)ReportStatusToSCMgr(SERVICE_STOPPED, NO_ERROR, 0);exit(a);}
152 #else
153 #define ERROR(a) {if (!console_ok)c_shutdown();fprintf(stderr,a);}
154 #define EXIT(a) {exit(a);}
155 #endif
156 #define random rand
157 #define BASE_DIR "."
158 #define DATA_PATH "data\\"
159 #else
160 #ifndef DATA_PATH
161 #define DATA_PATH "data/"
162 #endif
164 #define long_long long long
165 #ifdef CLIENT
166 #define ERROR(a) {if (!console_ok)c_shutdown();fprintf(stderr,a);}
167 #else
168 #define ERROR(a) {fprintf(stderr,a);}
169 #endif
171 #include <stdlib.h>
172 #define EXIT(a) exit(a);
173 #endif
176 #include "console.h"
178 #endif