]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - quakedef.h
fix an engine crash in vid_glx
[xonotic/darkplaces.git] / quakedef.h
1 /*
2 Copyright (C) 1996-1997 Id Software, Inc.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20 // quakedef.h -- primary header for client
21
22 #ifndef QUAKEDEF_H
23 #define QUAKEDEF_H
24
25 #if defined(__GNUC__) && (__GNUC__ > 2)
26 #define DP_FUNC_PRINTF(n) __attribute__ ((format (printf, n, n+1)))
27 #define DP_FUNC_PURE      __attribute__ ((pure))
28 #else
29 #define DP_FUNC_PRINTF(n)
30 #define DP_FUNC_PURE
31 #endif
32
33 #include <sys/types.h>
34 #include <ctype.h>
35 #include <math.h>
36 #include <string.h>
37 #include <stdarg.h>
38 #include <stdio.h>
39 #include <stdlib.h>
40 #include <limits.h>
41 #include <setjmp.h>
42
43 #include "qtypes.h"
44
45 extern const char *buildstring;
46 extern char engineversion[128];
47
48 #define GAMENAME "id1"
49
50 #define MAX_NUM_ARGVS   50
51
52 #ifdef DP_SMALLMEMORY
53 #define MAX_INPUTLINE                   1024
54 #define CON_TEXTSIZE                    16384
55 #define CON_MAXLINES                    256
56 #define HIST_TEXTSIZE                   2048
57 #define HIST_MAXLINES                   16
58 #define MAX_ALIAS_NAME                  32
59 #define CMDBUFSIZE                              131072
60 #define MAX_ARGS                                80
61
62 #define NET_MAXMESSAGE                  65536
63 #define MAX_PACKETFRAGMENT              1024
64 #define MAX_EDICTS                              4096
65 #define MAX_MODELS                              1024
66 #define MAX_SOUNDS                              1024
67 #define MAX_LIGHTSTYLES                 64
68 #define MAX_STYLESTRING                 16
69 #define MAX_SCOREBOARD                  32
70 #define MAX_SCOREBOARDNAME              128
71 #define MAX_USERINFO_STRING             196
72 #define MAX_SERVERINFO_STRING   512
73 #define MAX_LOCALINFO_STRING    1 // not actually used by DP servers
74 #define CL_MAX_USERCMDS                 32
75 #define CVAR_HASHSIZE                   1024
76 #define M_MAX_EDICTS                    4096
77 #define MAX_DEMOS                               8
78 #define MAX_DEMONAME                    16
79 #define MAX_SAVEGAMES                   12
80 #define SAVEGAME_COMMENT_LENGTH 39
81 #define MAX_CLIENTNETWORKEYES   2
82 #define MAX_LEVELNETWORKEYES    0 // no portal support
83 #define MAX_OCCLUSION_QUERIES   256
84
85 #define CRYPTO_HOSTKEY_HASHSIZE 256
86 #define MAX_NETWM_ICON 1026 // one 32x32
87
88 #define MAX_WATERPLANES                 2
89 #define MAX_CUBEMAPS                    64
90 #define MAX_EXPLOSIONS                  8
91 #define MAX_DLIGHTS                             16
92 #define MAX_CACHED_PICS                 1024 // this is 144 bytes each (or 152 on 64bit)
93 #define CACHEPICHASHSIZE                256
94 #define MAX_PARTICLEEFFECTNAME  256
95 #define MAX_PARTICLEEFFECTINFO  1024
96 #define MAX_PARTICLETEXTURES    256
97 #define MAXCLVIDEOS                             1
98 #define MAX_GECKO_INSTANCES             1
99 #define MAX_DYNAMIC_TEXTURE_COUNT       2
100 #define MAX_MAP_LEAFS                   8192
101
102 #define MAXTRACKS                               256
103 #define MAX_DYNAMIC_CHANNELS    64
104 #define MAX_CHANNELS                    260
105 #define MODLIST_TOTALSIZE               32
106 #define MAX_FAVORITESERVERS             32
107 #define MAX_DECALSYSTEM_QUEUE   64
108 #define PAINTBUFFER_SIZE                512
109 #define MAX_BINDMAPS                    8
110 #define MAX_PARTICLES_INITIAL   8192
111 #define MAX_PARTICLES                   8192
112 #define MAX_DECALS_INITIAL              1024
113 #define MAX_DECALS                              1024
114 #define MAX_ENITIES_INITIAL             256
115 #define MAX_STATICENTITIES              256
116 #define MAX_EFFECTS                             16
117 #define MAX_BEAMS                               16
118 #define MAX_TEMPENTITIES                256
119 #else
120 #define MAX_INPUTLINE                   16384 ///< maximum length of console commandline, QuakeC strings, and many other text processing buffers
121 #define CON_TEXTSIZE                    1048576 ///< max scrollback buffer characters in console
122 #define CON_MAXLINES                    16384 ///< max scrollback buffer lines in console
123 #define HIST_TEXTSIZE                   262144 ///< max command history buffer characters in console
124 #define HIST_MAXLINES                   4096 ///< max command history buffer lines in console
125 #define MAX_ALIAS_NAME                  32
126 #define CMDBUFSIZE                              655360 ///< maximum script size that can be loaded by the exec command (8192 in Quake)
127 #define MAX_ARGS                                80 ///< maximum number of parameters to a console command or alias
128
129 #define NET_MAXMESSAGE                  65536 ///< max reliable packet size (sent as multiple fragments of MAX_PACKETFRAGMENT)
130 #define MAX_PACKETFRAGMENT              1024 ///< max length of packet fragment
131 #define MAX_EDICTS                              32768 ///< max number of objects in game world at once (32768 protocol limit)
132 #define MAX_MODELS                              8192 ///< max number of models loaded at once (including during level transitions)
133 #define MAX_SOUNDS                              4096 ///< max number of sounds loaded at once
134 #define MAX_LIGHTSTYLES                 256 ///< max flickering light styles in level (note: affects savegame format)
135 #define MAX_STYLESTRING                 64 ///< max length of flicker pattern for light style
136 #define MAX_SCOREBOARD                  255 ///< max number of players in game at once (255 protocol limit)
137 #define MAX_SCOREBOARDNAME              128 ///< max length of player name in game
138 #define MAX_USERINFO_STRING             1280 ///< max length of infostring for PROTOCOL_QUAKEWORLD (196 in QuakeWorld)
139 #define MAX_SERVERINFO_STRING   1280 ///< max length of server infostring for PROTOCOL_QUAKEWORLD (512 in QuakeWorld)
140 #define MAX_LOCALINFO_STRING    32768 ///< max length of server-local infostring for PROTOCOL_QUAKEWORLD (32768 in QuakeWorld)
141 #define CL_MAX_USERCMDS                 128 ///< max number of predicted input packets in queue
142 #define CVAR_HASHSIZE                   65536 ///< number of hash buckets for accelerating cvar name lookups
143 #define M_MAX_EDICTS                    32768 ///< max objects in menu vm
144 #define MAX_DEMOS                               8 ///< max demos provided to demos command
145 #define MAX_DEMONAME                    16 ///< max demo name length for demos command
146 #define MAX_SAVEGAMES                   12 ///< max savegames listed in savegame menu
147 #define SAVEGAME_COMMENT_LENGTH 39 ///< max comment length of savegame in menu
148 #define MAX_CLIENTNETWORKEYES   16 ///< max number of locations that can be added to pvs when culling network entities (must be at least 2 for prediction)
149 #define MAX_LEVELNETWORKEYES    512 ///< max number of locations that can be added to pvs when culling network entities (must be at least 2 for prediction)
150 #define MAX_OCCLUSION_QUERIES   4096 ///< max number of GL_ARB_occlusion_query objects that can be used in one frame
151
152 #define CRYPTO_HOSTKEY_HASHSIZE 8192 ///< number of hash buckets for accelerating host key lookups
153 #define MAX_NETWM_ICON 352822 // 16x16, 22x22, 24x24, 32x32, 48x48, 64x64, 128x128, 256x256, 512x512
154
155 #define MAX_WATERPLANES                 16 ///< max number of water planes visible (each one causes additional view renders)
156 #define MAX_CUBEMAPS                    256 ///< max number of cubemap textures loaded for light filters
157 #define MAX_EXPLOSIONS                  64 ///< max number of explosion shell effects active at once (not particle related)
158 #define MAX_DLIGHTS                             256 ///< max number of dynamic lights (rocket flashes, etc) in scene at once
159 #define MAX_CACHED_PICS                 1024 ///< max number of 2D pics loaded at once
160 #define CACHEPICHASHSIZE                256 ///< number of hash buckets for accelerating 2D pic name lookups
161 #define MAX_PARTICLEEFFECTNAME  256 ///< maximum number of unique names of particle effects (for particleeffectnum)
162 #define MAX_PARTICLEEFFECTINFO  4096 ///< maximum number of unique particle effects (each name may associate with several of these)
163 #define MAX_PARTICLETEXTURES    256 ///< maximum number of unique particle textures in the particle font
164 #define MAXCLVIDEOS                             65 ///< maximum number of video streams being played back at once (1 is reserved for the playvideo command)
165 #define MAX_GECKO_INSTANCES             16 ///< maximum number of web browser textures active at once
166 #define MAX_DYNAMIC_TEXTURE_COUNT       64 ///< maximum number of dynamic textures (web browsers, playvideo, etc)
167 #define MAX_MAP_LEAFS                   65536 ///< maximum number of BSP leafs in world (8192 in Quake)
168
169 #define MAXTRACKS                               256 ///< max CD track index
170 // 0 to NUM_AMBIENTS - 1 = water, etc
171 // NUM_AMBIENTS to NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS - 1 = normal entity sounds
172 // NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS to total_channels = static sounds
173 #define MAX_DYNAMIC_CHANNELS    512
174 #define MAX_CHANNELS                    1028
175 #define MODLIST_TOTALSIZE               256
176 #define MAX_FAVORITESERVERS             256
177 #define MAX_DECALSYSTEM_QUEUE   1024
178 #define PAINTBUFFER_SIZE                2048
179 #define MAX_BINDMAPS                    8
180 #define MAX_PARTICLES_INITIAL   8192 ///< initial allocation for cl.particles
181 #define MAX_PARTICLES                   1048576 ///< upper limit on cl.particles size
182 #define MAX_DECALS_INITIAL              8192 ///< initial allocation for cl.decals
183 #define MAX_DECALS                              1048576 ///< upper limit on cl.decals size
184 #define MAX_ENITIES_INITIAL             256 ///< initial size of cl.entities
185 #define MAX_STATICENTITIES              1024 ///< limit on size of cl.static_entities
186 #define MAX_EFFECTS                             256 ///< limit on size of cl.effects
187 #define MAX_BEAMS                               256 ///< limit on size of cl.beams
188 #define MAX_TEMPENTITIES                4096 ///< max number of temporary models visible per frame (certain sprite effects, certain types of CSQC entities also use this)
189 #endif
190
191
192 #define CMD_TOKENIZELENGTH (MAX_INPUTLINE + MAX_ARGS) ///< maximum tokenizable commandline length (counting trailing 0)
193
194
195 #define MAX_QPATH               128                     ///< max length of a quake game pathname
196 #ifdef PATH_MAX
197 #define MAX_OSPATH              PATH_MAX
198 #elif MAX_PATH
199 #define MAX_OSPATH              MAX_PATH
200 #else
201 #define MAX_OSPATH              1024            ///< max length of a filesystem pathname
202 #endif
203
204 #define ON_EPSILON              0.1                     ///< point on plane side epsilon
205
206 #define NET_MINRATE             1000 ///< limits "rate" and "sv_maxrate" cvars
207
208 //
209 // stats are integers communicated to the client by the server
210 //
211 #define MAX_CL_STATS            256
212 #define STAT_HEALTH                     0
213 //#define       STAT_FRAGS                      1
214 #define STAT_WEAPON                     2
215 #define STAT_AMMO                       3
216 #define STAT_ARMOR                      4
217 #define STAT_WEAPONFRAME        5
218 #define STAT_SHELLS                     6
219 #define STAT_NAILS                      7
220 #define STAT_ROCKETS            8
221 #define STAT_CELLS                      9
222 #define STAT_ACTIVEWEAPON       10
223 #define STAT_TOTALSECRETS       11
224 #define STAT_TOTALMONSTERS      12
225 #define STAT_SECRETS            13              ///< bumped on client side by svc_foundsecret
226 #define STAT_MONSTERS           14              ///< bumped by svc_killedmonster
227 #define STAT_ITEMS                      15 ///< FTE, DP
228 #define STAT_VIEWHEIGHT         16 ///< FTE, DP
229 //#define STAT_TIME                     17 ///< FTE
230 //#define STAT_VIEW2            20 ///< FTE
231 #define STAT_VIEWZOOM           21 ///< DP
232 #define STAT_MOVEVARS_AIRCONTROL_PENALTY                                        221 ///< DP
233 #define STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW 222 ///< DP
234 #define STAT_MOVEVARS_AIRSTRAFEACCEL_QW 223 ///< DP
235 #define STAT_MOVEVARS_AIRCONTROL_POWER                                  224 ///< DP
236 #define STAT_MOVEFLAGS                              225 ///< DP
237 #define STAT_MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL       226 ///< DP
238 #define STAT_MOVEVARS_WARSOWBUNNY_ACCEL                         227 ///< DP
239 #define STAT_MOVEVARS_WARSOWBUNNY_TOPSPEED                      228 ///< DP
240 #define STAT_MOVEVARS_WARSOWBUNNY_TURNACCEL                     229 ///< DP
241 #define STAT_MOVEVARS_WARSOWBUNNY_BACKTOSIDERATIO       230 ///< DP
242 #define STAT_MOVEVARS_AIRSTOPACCELERATE                         231 ///< DP
243 #define STAT_MOVEVARS_AIRSTRAFEACCELERATE                       232 ///< DP
244 #define STAT_MOVEVARS_MAXAIRSTRAFESPEED                         233 ///< DP
245 #define STAT_MOVEVARS_AIRCONTROL                                        234 ///< DP
246 #define STAT_FRAGLIMIT                                                          235 ///< DP
247 #define STAT_TIMELIMIT                                                          236 ///< DP
248 #define STAT_MOVEVARS_WALLFRICTION                                      237 ///< DP
249 #define STAT_MOVEVARS_FRICTION                                          238 ///< DP
250 #define STAT_MOVEVARS_WATERFRICTION                                     239 ///< DP
251 #define STAT_MOVEVARS_TICRATE                                           240 ///< DP
252 #define STAT_MOVEVARS_TIMESCALE                                         241 ///< DP
253 #define STAT_MOVEVARS_GRAVITY                                           242 ///< DP
254 #define STAT_MOVEVARS_STOPSPEED                                         243 ///< DP
255 #define STAT_MOVEVARS_MAXSPEED                                          244 ///< DP
256 #define STAT_MOVEVARS_SPECTATORMAXSPEED                         245 ///< DP
257 #define STAT_MOVEVARS_ACCELERATE                                        246 ///< DP
258 #define STAT_MOVEVARS_AIRACCELERATE                                     247 ///< DP
259 #define STAT_MOVEVARS_WATERACCELERATE                           248 ///< DP
260 #define STAT_MOVEVARS_ENTGRAVITY                                        249 ///< DP
261 #define STAT_MOVEVARS_JUMPVELOCITY                                      250 ///< DP
262 #define STAT_MOVEVARS_EDGEFRICTION                                      251 ///< DP
263 #define STAT_MOVEVARS_MAXAIRSPEED                                       252 ///< DP
264 #define STAT_MOVEVARS_STEPHEIGHT                                        253 ///< DP
265 #define STAT_MOVEVARS_AIRACCEL_QW                                       254 ///< DP
266 #define STAT_MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION        255 ///< DP
267
268 // moveflags values
269 #define MOVEFLAG_VALID 0x80000000
270 #define MOVEFLAG_Q2AIRACCELERATE 0x00000001
271 #define MOVEFLAG_NOGRAVITYONGROUND 0x00000002
272 #define MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE 0x00000004
273
274 // stock defines
275
276 #define IT_SHOTGUN                              1
277 #define IT_SUPER_SHOTGUN                2
278 #define IT_NAILGUN                              4
279 #define IT_SUPER_NAILGUN                8
280 #define IT_GRENADE_LAUNCHER             16
281 #define IT_ROCKET_LAUNCHER              32
282 #define IT_LIGHTNING                    64
283 #define IT_SUPER_LIGHTNING      128
284 #define IT_SHELLS               256
285 #define IT_NAILS                512
286 #define IT_ROCKETS              1024
287 #define IT_CELLS                2048
288 #define IT_AXE                  4096
289 #define IT_ARMOR1               8192
290 #define IT_ARMOR2               16384
291 #define IT_ARMOR3               32768
292 #define IT_SUPERHEALTH          65536
293 #define IT_KEY1                 131072
294 #define IT_KEY2                 262144
295 #define IT_INVISIBILITY                 524288
296 #define IT_INVULNERABILITY              1048576
297 #define IT_SUIT                                 2097152
298 #define IT_QUAD                                 4194304
299 #define IT_SIGIL1               (1<<28)
300 #define IT_SIGIL2               (1<<29)
301 #define IT_SIGIL3               (1<<30)
302 #define IT_SIGIL4               (1<<31)
303
304 //===========================================
305 // AK nexuiz changed and added defines
306
307 #define NEX_IT_UZI              1
308 #define NEX_IT_SHOTGUN          2
309 #define NEX_IT_GRENADE_LAUNCHER 4
310 #define NEX_IT_ELECTRO          8
311 #define NEX_IT_CRYLINK          16
312 #define NEX_IT_NEX              32
313 #define NEX_IT_HAGAR            64
314 #define NEX_IT_ROCKET_LAUNCHER  128
315 #define NEX_IT_SHELLS           256
316 #define NEX_IT_BULLETS          512
317 #define NEX_IT_ROCKETS          1024
318 #define NEX_IT_CELLS            2048
319 #define NEX_IT_LASER            4094
320 #define NEX_IT_STRENGTH         8192
321 #define NEX_IT_INVINCIBLE       16384
322 #define NEX_IT_SPEED            32768
323 #define NEX_IT_SLOWMO           65536
324
325 //===========================================
326 //rogue changed and added defines
327
328 #define RIT_SHELLS              128
329 #define RIT_NAILS               256
330 #define RIT_ROCKETS             512
331 #define RIT_CELLS               1024
332 #define RIT_AXE                 2048
333 #define RIT_LAVA_NAILGUN        4096
334 #define RIT_LAVA_SUPER_NAILGUN  8192
335 #define RIT_MULTI_GRENADE       16384
336 #define RIT_MULTI_ROCKET        32768
337 #define RIT_PLASMA_GUN          65536
338 #define RIT_ARMOR1              8388608
339 #define RIT_ARMOR2              16777216
340 #define RIT_ARMOR3              33554432
341 #define RIT_LAVA_NAILS          67108864
342 #define RIT_PLASMA_AMMO         134217728
343 #define RIT_MULTI_ROCKETS       268435456
344 #define RIT_SHIELD              536870912
345 #define RIT_ANTIGRAV            1073741824
346 #define RIT_SUPERHEALTH         2147483648
347
348 //MED 01/04/97 added hipnotic defines
349 //===========================================
350 //hipnotic added defines
351 #define HIT_PROXIMITY_GUN_BIT 16
352 #define HIT_MJOLNIR_BIT       7
353 #define HIT_LASER_CANNON_BIT  23
354 #define HIT_PROXIMITY_GUN   (1<<HIT_PROXIMITY_GUN_BIT)
355 #define HIT_MJOLNIR         (1<<HIT_MJOLNIR_BIT)
356 #define HIT_LASER_CANNON    (1<<HIT_LASER_CANNON_BIT)
357 #define HIT_WETSUIT         (1<<(23+2))
358 #define HIT_EMPATHY_SHIELDS (1<<(23+3))
359
360 //===========================================
361
362 #include "zone.h"
363 #include "fs.h"
364 #include "common.h"
365 #include "cvar.h"
366 #include "bspfile.h"
367 #include "sys.h"
368 #include "vid.h"
369 #include "mathlib.h"
370
371 #include "r_textures.h"
372
373 #include "crypto.h"
374 #include "draw.h"
375 #include "screen.h"
376 #include "netconn.h"
377 #include "protocol.h"
378 #include "cmd.h"
379 #include "sbar.h"
380 #include "sound.h"
381 #include "model_shared.h"
382 #include "world.h"
383 #include "client.h"
384 #include "render.h"
385 #include "progs.h"
386 #include "progsvm.h"
387 #include "server.h"
388
389 #include "input.h"
390 #include "keys.h"
391 #include "console.h"
392 #include "menu.h"
393
394 #include "glquake.h"
395
396 #include "palette.h"
397
398 extern qboolean noclip_anglehack;
399
400 extern cvar_t developer;
401 extern cvar_t developer_extra;
402 extern cvar_t developer_insane;
403 extern cvar_t developer_loadfile;
404 extern cvar_t developer_loading;
405
406 #define STARTCONFIGFILENAME "quake.rc"
407 #define CONFIGFILENAME "config.cfg"
408
409 /* Preprocessor macros to identify platform
410     DP_OS_NAME  - "friendly" name of the OS, for humans to read
411     DP_OS_STR   - "identifier" of the OS, more suited for code to use
412     DP_ARCH_STR - "identifier" of the processor architecture
413  */
414 #if defined(__linux__)
415 # define DP_OS_NAME             "Linux"
416 # define DP_OS_STR              "linux"
417 #elif defined(_WIN64)
418 # define DP_OS_NAME             "Windows64"
419 # define DP_OS_STR              "win64"
420 #elif defined(WIN32)
421 # define DP_OS_NAME             "Windows"
422 # define DP_OS_STR              "win32"
423 #elif defined(__FreeBSD__)
424 # define DP_OS_NAME             "FreeBSD"
425 # define DP_OS_STR              "freebsd"
426 #elif defined(__NetBSD__)
427 # define DP_OS_NAME             "NetBSD"
428 # define DP_OS_STR              "netbsd"
429 #elif defined(__OpenBSD__)
430 # define DP_OS_NAME             "OpenBSD"
431 # define DP_OS_STR              "openbsd"
432 #elif defined(MACOSX)
433 # define DP_OS_NAME             "Mac OS X"
434 # define DP_OS_STR              "osx"
435 #elif defined(__MORPHOS__)
436 # define DP_OS_NAME             "MorphOS"
437 # define DP_OS_STR              "morphos"
438 #else
439 # define DP_OS_NAME             "Unknown"
440 #endif
441
442 #if defined(__GNUC__)
443 # if defined(__i386__)
444 #  define DP_ARCH_STR           "686"
445 #  define SSE_POSSIBLE
446 #  ifdef __SSE__
447 #   define SSE_PRESENT
448 #  endif
449 #  ifdef __SSE2__
450 #   define SSE2_PRESENT
451 #  endif
452 # elif defined(__x86_64__)
453 #  define DP_ARCH_STR           "x86_64"
454 #  define SSE_PRESENT
455 #  define SSE2_PRESENT
456 # elif defined(__powerpc__)
457 #  define DP_ARCH_STR           "ppc"
458 # endif
459 #elif defined(_WIN64)
460 # define DP_ARCH_STR            "x86_64"
461 # define SSE_PRESENT
462 # define SSE2_PRESENT
463 #elif defined(WIN32)
464 # define DP_ARCH_STR            "x86"
465 # define SSE_POSSIBLE
466 #endif
467
468 #ifdef SSE_PRESENT
469 # define SSE_POSSIBLE
470 #endif
471
472 #ifdef NO_SSE
473 # undef SSE_PRESENT
474 # undef SSE_POSSIBLE
475 # undef SSE2_PRESENT
476 #endif
477
478 #ifdef SSE2_PRESENT
479 #define Sys_HaveSSE() true
480 #define Sys_HaveSSE2() true
481 #elif defined(SSE_POSSIBLE)
482 // runtime detection of SSE/SSE2 capabilities for x86
483 qboolean Sys_HaveSSE(void);
484 qboolean Sys_HaveSSE2(void);
485 #else
486 #define Sys_HaveSSE() false
487 #define Sys_HaveSSE2() false
488 #endif
489
490 /// incremented every frame, never reset
491 extern int host_framecount;
492 /// not bounded in any way, changed at start of every frame, never reset
493 extern double realtime;
494
495 void Host_InitCommands(void);
496 void Host_Main(void);
497 void Host_Shutdown(void);
498 void Host_StartVideo(void);
499 void Host_Error(const char *error, ...) DP_FUNC_PRINTF(1);
500 void Host_Quit_f(void);
501 void Host_ClientCommands(const char *fmt, ...) DP_FUNC_PRINTF(1);
502 void Host_ShutdownServer(void);
503 void Host_Reconnect_f(void);
504 void Host_NoOperation_f(void);
505
506 void Host_AbortCurrentFrame(void);
507
508 /// skill level for currently loaded level (in case the user changes the cvar while the level is running, this reflects the level actually in use)
509 extern int current_skill;
510
511 //
512 // chase
513 //
514 extern cvar_t chase_active;
515 extern cvar_t cl_viewmodel_scale;
516
517 void Chase_Init (void);
518 void Chase_Reset (void);
519 void Chase_Update (void);
520
521 void fractalnoise(unsigned char *noise, int size, int startgrid);
522 void fractalnoisequick(unsigned char *noise, int size, int startgrid);
523 float noise4f(float x, float y, float z, float w);
524
525 void Sys_Shared_Init(void);
526
527 // Flag in size field of demos to indicate a client->server packet. Demo
528 // playback will ignore this, but it may be useful to make DP sniff packets to
529 // debug protocol exploits.
530 #define DEMOMSG_CLIENT_TO_SERVER 0x80000000
531
532 // In Quake, any char in 0..32 counts as whitespace
533 //#define ISWHITESPACE(ch) ((unsigned char) ch <= (unsigned char) ' ')
534 #define ISWHITESPACE(ch) (!(ch) || (ch) == ' ' || (ch) == '\t' || (ch) == '\r' || (ch) == '\n')
535
536 // This also includes extended characters, and ALL control chars
537 #define ISWHITESPACEORCONTROL(ch) ((signed char) (ch) <= (signed char) ' ')
538
539
540 #define FLOAT_IS_TRUE_FOR_INT(x) ((x) & 0x7FFFFFFF) // also match "negative zero" floats of value 0x80000000
541
542 #endif
543