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
64 #define E_INCOMPATIBLE_VERSION 0
65 #define E_PLAYER_REFUSED 1
67 #define WEAPON_BLOODRAIN 7
68 #define WEAPON_CHAINSAW 6
70 #define WEAPON_GRENADE 4
71 #define WEAPON_RIFLE 3
73 #define WEAPON_SHOTGUN 1
76 #define WEAPON_MASK_BLOODRAIN 128
77 #define WEAPON_MASK_CHAINSAW 64
78 #define WEAPON_MASK_BFG 32
79 #define WEAPON_MASK_GRENADE 16
80 #define WEAPON_MASK_RIFLE 8
81 #define WEAPON_MASK_UZI 4
82 #define WEAPON_MASK_SHOTGUN 2
83 #define WEAPON_MASK_GUN 1
85 #define S_WALKING 0x0001
86 #define S_LOOKLEFT 0x0002
87 #define S_LOOKRIGHT 0x0004
88 #define S_FALLING 0x0008
89 #define S_SHOOTING 0x0010
90 #define S_HOLDING 0x0020
91 #define S_INVISIBLE 0x0040
93 #define S_CREEP 0x0100
94 #define S_GRENADE 0x0200
96 #define S_CLIMB_DOWN 0x0800
97 #define S_NOISE 0x1000
98 #define S_CHAINSAW 0x2000
100 #define S_BLOODRAIN 0x8000
101 #define S_JETPACK 0x10000
102 #define S_JETPACK_ON 0x20000
103 #define S_ONFIRE 0x40000
104 #define S_CHAIN 0x80000
106 #define M_DEFAULT 0x00
112 #define M_WEAPON 0x20
118 #define C_D_GREEN 0x02
120 #define C_D_BLUE 0x04
121 #define C_D_MAGENTA 0x05
122 #define C_D_CYAN 0x06
124 #define C_D_GREY 0x08
127 #define C_YELLOW 0x0b
129 #define C_MAGENTA 0x0d
134 #define E_DEFAULTS 0x01
136 #define E_CONN_SUCC 0x04
140 unsigned char *weapon_name
[ARMS
];
144 1,2: left(01), right(10), center (00)
156 /* object attribute table */
159 unsigned char fall
; /* 1=can fall, 0=can't */
160 int bounce_x
,bounce_y
; /* slow down during horizontal/vertical bouncing */
161 int slow_down_x
; /* slow down when not falling, speed is multiplied with this constant */
162 unsigned char maintainer
;
163 unsigned char foreground
; /* is this object in foreground? */
164 /* who computes the object:
167 bit 2=server sends updates to clients
172 /* weapon attribut table */
176 unsigned char cadence
;
179 unsigned char lethalness
;
180 unsigned char armor_damage
;
181 unsigned char basic_ammo
;
182 unsigned char add_ammo
;
183 unsigned char max_ammo
;
184 int shell_xspeed
,shell_yspeed
;
188 /* object in the game */
191 int x
,y
,xspeed
,yspeed
; /* position and velocity */
192 unsigned char type
; /* one of T_...... constants */
193 unsigned int id
:24; /* unique ID */
194 int ttl
:16; /* time to live */
195 unsigned int sprite
:16; /* sprite number */
196 unsigned int anim_pos
:16; /* animating position */
197 /* 16b hole in the structure */
198 unsigned int status
; /* status - especially for hero objects */
199 void * data
; /* object's own data, this is individual filled */
200 unsigned char update_counter
; /* increased with each update of the object */
201 unsigned long_long last_updated
; /* last time object was updated */
208 struct object_list
*next
,*prev
;
213 extern struct object_list
*last_obj
;
215 extern struct sprite
*sprites
;
216 extern char **sprite_names
;
217 extern int n_sprites
;
220 extern unsigned char *area
;
221 extern unsigned char *area_a
;
223 extern void load_sprites(char *);
224 extern void load_data(char *);
225 extern int find_sprite(char *,int *);
226 extern void init_area(void);
227 extern void reinit_area(void);
228 extern void free_area(void);
229 extern char *md5_level(int);
230 extern struct it
* new_obj(
242 void delete_obj(unsigned long id
);
243 extern void put_int(char *p
,int num
, int *offset
);
244 extern int get_int(char *p
);
245 extern void put_int16(char *p
,short num
, int *offset
);
246 extern int get_int16(char *p
);
247 extern void put_long_long(char *p
,unsigned long_long num
, int *offset
);
248 extern unsigned long_long
get_long_long(char *p
);
249 extern void free_sprites(int);
256 get_dimensions(int type
,int status
,struct pos
*s
,int *w
,int *h
);
258 void update_position(
268 extern void _skip_ws(char**txt
);
269 extern int _convert_type(unsigned char c
);
270 extern char * load_level(int);
271 extern void chdir_to_data_files(void);