7 /* rezim kompatibility s woknama ... */
9 #define snprintf(t, s, ...) _snprintf_s(t, s, s, __VA_ARGS__)
10 #define close(...) while(0);
11 #define chdir(...) _chdir(__VA_ARGS__)
13 #define srandom(x) srand((unsigned int)x)
14 #define sleep(x) Sleep(x)
15 #define strcat(d, s) strcat_s(d, sizeof(s), s)
21 #define TYPE_BACKGROUND 0
23 #define TYPE_JUMP 32 /* proskakovatko */
24 #define TYPE_FOREGROUND 48 /* pred maniakem */
25 #define TYPE_JUMP_FOREGROUND 64 /* proskakovatko pred maniakem */
27 #define TYPE_BIRTHPLACE 666
41 #define T_AMMO_SHOTGUN 9
43 #define T_AMMO_RIFLE 11
47 #define T_AMMO_GRENADE 15
50 #define T_INVISIBILITY 18
52 #define T_NOTHING_FORE 20
60 #define T_BLOODRAIN 28
65 #define E_INCOMPATIBLE_VERSION 0
66 #define E_PLAYER_REFUSED 1
67 #define E_NAME_IN_USE 2
69 #define WEAPON_BLOODRAIN 7
70 #define WEAPON_CHAINSAW 6
72 #define WEAPON_GRENADE 4
73 #define WEAPON_RIFLE 3
75 #define WEAPON_SHOTGUN 1
78 #define WEAPON_MASK_BLOODRAIN 128
79 #define WEAPON_MASK_CHAINSAW 64
80 #define WEAPON_MASK_BFG 32
81 #define WEAPON_MASK_GRENADE 16
82 #define WEAPON_MASK_RIFLE 8
83 #define WEAPON_MASK_UZI 4
84 #define WEAPON_MASK_SHOTGUN 2
85 #define WEAPON_MASK_GUN 1
87 #define S_WALKING 0x0001
88 #define S_LOOKLEFT 0x0002
89 #define S_LOOKRIGHT 0x0004
90 #define S_FALLING 0x0008
91 #define S_SHOOTING 0x0010
92 #define S_HOLDING 0x0020
93 #define S_INVISIBLE 0x0040
95 #define S_CREEP 0x0100
96 #define S_GRENADE 0x0200
98 #define S_CLIMB_DOWN 0x0800
99 #define S_NOISE 0x1000
100 #define S_CHAINSAW 0x2000
102 #define S_BLOODRAIN 0x8000
103 #define S_JETPACK 0x10000
104 #define S_JETPACK_ON 0x20000
105 #define S_ONFIRE 0x40000
106 #define S_CHAIN 0x80000
108 #define M_DEFAULT 0x00
114 #define M_WEAPON 0x20
120 #define C_D_GREEN 0x02
122 #define C_D_BLUE 0x04
123 #define C_D_MAGENTA 0x05
124 #define C_D_CYAN 0x06
126 #define C_D_GREY 0x08
129 #define C_YELLOW 0x0b
131 #define C_MAGENTA 0x0d
136 #define E_DEFAULTS 0x01
138 #define E_CONN_SUCC 0x04
142 unsigned char *weapon_name
[ARMS
];
146 1,2: left(01), right(10), center (00)
158 /* object attribute table */
161 unsigned char fall
; /* 1=can fall, 0=can't */
162 int bounce_x
,bounce_y
; /* slow down during horizontal/vertical bouncing */
163 int slow_down_x
; /* slow down when not falling, speed is multiplied with this constant */
164 unsigned char maintainer
;
165 unsigned char foreground
; /* is this object in foreground? */
166 /* who computes the object:
169 bit 2=server sends updates to clients
174 /* weapon attribut table */
178 unsigned char cadence
;
181 unsigned char lethalness
;
182 unsigned char armor_damage
;
183 unsigned char basic_ammo
;
184 unsigned char add_ammo
;
185 unsigned char max_ammo
;
186 int shell_xspeed
,shell_yspeed
;
190 /* object in the game */
193 int x
,y
,xspeed
,yspeed
; /* position and velocity */
194 unsigned char type
; /* one of T_...... constants */
195 unsigned int id
:24; /* unique ID */
196 int ttl
:16; /* time to live */
197 unsigned int sprite
:16; /* sprite number */
198 unsigned int anim_pos
:16; /* animating position */
199 /* 16b hole in the structure */
200 unsigned int status
; /* status - especially for hero objects */
201 void * data
; /* object's own data, this is individual filled */
202 unsigned char update_counter
; /* increased with each update of the object */
203 unsigned long_long last_updated
; /* last time object was updated */
210 struct object_list
*next
,*prev
;
215 extern struct object_list
*last_obj
;
217 extern struct sprite
*sprites
;
218 extern char **sprite_names
;
219 extern int n_sprites
;
222 extern unsigned char *area
;
223 extern unsigned char *area_a
;
225 extern void load_sprites(char *);
226 extern void load_data(char *);
227 extern int find_sprite(char *,int *);
228 extern void init_area(void);
229 extern void reinit_area(void);
230 extern void free_area(void);
231 extern char *md5_level(int);
232 extern struct it
* new_obj(
244 void delete_obj(unsigned long id
);
245 extern void put_int(char *p
,int num
, int *offset
);
246 extern int get_int(char *p
);
247 extern void put_int16(char *p
,short num
, int *offset
);
248 extern int get_int16(char *p
);
249 extern void put_long_long(char *p
,unsigned long_long num
, int *offset
);
250 extern unsigned long_long
get_long_long(char *p
);
251 extern void free_sprites(int);
258 get_dimensions(int type
,int status
,struct pos
*s
,int *w
,int *h
);
260 void update_position(
270 extern void _skip_ws(char**txt
);
271 extern int _convert_type(unsigned char c
);
272 extern char * load_level(int);
273 extern void chdir_to_data_files(void);