diff --git a/include/client.h b/include/client.h index bebd964..cb35d27 100644 --- a/include/client.h +++ b/include/client.h @@ -40,6 +40,7 @@ #include "render.h" #include "cvar.h" #include "quakefs.h" +#include "qdefs.h" typedef struct { diff --git a/include/console.h b/include/console.h index 1873cd1..a347084 100644 --- a/include/console.h +++ b/include/console.h @@ -26,6 +26,11 @@ $Id$ */ +#ifndef __console_h +#define __console_h + +#include "qtypes.h" + // // console // @@ -52,3 +57,4 @@ void Con_ToggleConsole_f (void); void Con_NotifyBox (char *text); // during startup for sound / cd warnings +#endif // __console_h diff --git a/include/cvar.h b/include/cvar.h index 6ae0318..2c00a72 100644 --- a/include/cvar.h +++ b/include/cvar.h @@ -30,7 +30,7 @@ #define _CVAR_H //#include "qtypes.h" -//#include "quakeio.h" +#include "quakeio.h" #include "cmd.h" typedef struct cvar_s diff --git a/include/draw.h b/include/draw.h index a991775..2d38927 100644 --- a/include/draw.h +++ b/include/draw.h @@ -26,6 +26,10 @@ $Id$ */ +#ifndef __draw_h +#define __draw_h + +#include "wad.h" extern qpic_t *draw_disc; // also used on sbar @@ -44,3 +48,5 @@ void Draw_FadeScreen (void); void Draw_String (int x, int y, char *str); qpic_t *Draw_PicFromWad (char *name); qpic_t *Draw_CachePic (char *path); + +#endif // __draw_h diff --git a/include/keys.h b/include/keys.h index 1dab447..e54106c 100644 --- a/include/keys.h +++ b/include/keys.h @@ -29,6 +29,7 @@ #ifndef __keys_h #define __keys_h +#include "quakeio.h" #include "qtypes.h" // diff --git a/include/progs.h b/include/progs.h index 01f380d..01eb679 100644 --- a/include/progs.h +++ b/include/progs.h @@ -34,6 +34,7 @@ #include "pr_comp.h" // defs shared with qcc #include "progdefs.h" // generated by program cdefs #include "link.h" +#include "quakeio.h" typedef union eval_s diff --git a/include/protocol.h b/include/protocol.h index 98a8288..87e65ea 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -29,6 +29,8 @@ #ifndef __protocol_h #define __protocol_h +#include "qtypes.h" + #define PROTOCOL_VERSION 15 // if the high bit of the servercmd is set, the low bits are fast update flags: diff --git a/include/qdefs.h b/include/qdefs.h index 258ebcb..6257cdf 100644 --- a/include/qdefs.h +++ b/include/qdefs.h @@ -28,17 +28,18 @@ $Id$ */ -#ifndef _QDEFS_H -#define _QDEFS_H +#ifndef __qdefs_h +#define __qdefs_h -#include -#include +#include "qtypes.h" +#include "cvar.h" -#define MAX_QPATH 64 +#define MAX_OSPATH 128 // max length of a filesystem pathname +#define MAX_QPATH 64 // max length of a quake game pathname #define MAX_CL_STATS 32 #define NUM_CSHIFTS 4 -#define MAX_MODELS 256 -#define MAX_SOUNDS 256 +#define MAX_MODELS 256 // these are sent over the net as bytes +#define MAX_SOUNDS 256 // so they cannot be blindly increased #define MAX_SCOREBOARD 16 #define MAX_SCOREBOARDNAME 32 #define MAX_STYLESTRING 64 @@ -49,4 +50,148 @@ #define MAX_MSGLEN 8000 // max length of a reliable message #define clc_stringcmd 4 -#endif // _QDEFS_H +#define QUAKE_GAME // as opposed to utilities + +//define PARANOID // speed sapping error checking + +#ifdef QUAKE2 +#define GAMENAME "id1" // directory to look in by default +#else +#define GAMENAME "id1" +#endif + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) && !defined(WINDED) +void VID_LockBuffer (void); +void VID_UnlockBuffer (void); +#else +#define VID_LockBuffer() +#define VID_UnlockBuffer() +#endif + +#ifdef USE_INTEL_ASM +#define UNALIGNED_OK 1 // set to 0 if unaligned accesses are not supported +#else +#define UNALIGNED_OK 0 +#endif + +// !!! if this is changed, it must be changed in d_ifacea.h too !!! +#define CACHE_SIZE 32 // used to align key data structures + +#define MINIMUM_MEMORY 0x550000 +#define MINIMUM_MEMORY_LEVELPAK (MINIMUM_MEMORY + 0x100000) + +#define MAX_NUM_ARGVS 50 + + +#define ON_EPSILON 0.1 // point on plane side epsilon + +#define SAVEGAME_COMMENT_LENGTH 39 + +// +// stats are integers communicated to the client by the server +// +#define MAX_CL_STATS 32 +#define STAT_HEALTH 0 +#define STAT_FRAGS 1 +#define STAT_WEAPON 2 +#define STAT_AMMO 3 +#define STAT_ARMOR 4 +#define STAT_WEAPONFRAME 5 +#define STAT_SHELLS 6 +#define STAT_NAILS 7 +#define STAT_ROCKETS 8 +#define STAT_CELLS 9 +#define STAT_ACTIVEWEAPON 10 +#define STAT_TOTALSECRETS 11 +#define STAT_TOTALMONSTERS 12 +#define STAT_SECRETS 13 // bumped on client side by svc_foundsecret +#define STAT_MONSTERS 14 // bumped by svc_killedmonster + +// stock defines + +#define IT_SHOTGUN 1 +#define IT_SUPER_SHOTGUN 2 +#define IT_NAILGUN 4 +#define IT_SUPER_NAILGUN 8 +#define IT_GRENADE_LAUNCHER 16 +#define IT_ROCKET_LAUNCHER 32 +#define IT_LIGHTNING 64 +#define IT_SUPER_LIGHTNING 128 +#define IT_SHELLS 256 +#define IT_NAILS 512 +#define IT_ROCKETS 1024 +#define IT_CELLS 2048 +#define IT_AXE 4096 +#define IT_ARMOR1 8192 +#define IT_ARMOR2 16384 +#define IT_ARMOR3 32768 +#define IT_SUPERHEALTH 65536 +#define IT_KEY1 131072 +#define IT_KEY2 262144 +#define IT_INVISIBILITY 524288 +#define IT_INVULNERABILITY 1048576 +#define IT_SUIT 2097152 +#define IT_QUAD 4194304 +#define IT_SIGIL1 (1<<28) +#define IT_SIGIL2 (1<<29) +#define IT_SIGIL3 (1<<30) +#define IT_SIGIL4 (1<<31) + +//=========================================== +//rogue changed and added defines + +#define RIT_SHELLS 128 +#define RIT_NAILS 256 +#define RIT_ROCKETS 512 +#define RIT_CELLS 1024 +#define RIT_AXE 2048 +#define RIT_LAVA_NAILGUN 4096 +#define RIT_LAVA_SUPER_NAILGUN 8192 +#define RIT_MULTI_GRENADE 16384 +#define RIT_MULTI_ROCKET 32768 +#define RIT_PLASMA_GUN 65536 +#define RIT_ARMOR1 8388608 +#define RIT_ARMOR2 16777216 +#define RIT_ARMOR3 33554432 +#define RIT_LAVA_NAILS 67108864 +#define RIT_PLASMA_AMMO 134217728 +#define RIT_MULTI_ROCKETS 268435456 +#define RIT_SHIELD 536870912 +#define RIT_ANTIGRAV 1073741824 +#define RIT_SUPERHEALTH 2147483648 + +//MED 01/04/97 added hipnotic defines +//=========================================== +//hipnotic added defines +#define HIT_PROXIMITY_GUN_BIT 16 +#define HIT_MJOLNIR_BIT 7 +#define HIT_LASER_CANNON_BIT 23 +#define HIT_PROXIMITY_GUN (1< -#include -#include -#include +#ifndef __qtypes +#define __qtypes #define MAX_QPATH 64 @@ -61,17 +56,4 @@ typedef int func_t; typedef int string_t; typedef byte pixel_t; -/* -typedef enum {key_game, key_console, key_message, key_menu} keydest_t; -typedef enum { ALIAS_SINGLE=0, ALIAS_GROUP } aliasframetype_t; -typedef enum { ALIAS_SKIN_SINGLE=0, ALIAS_SKIN_GROUP } aliasskintype_t; -typedef enum {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t; -typedef void (*builtin_t) (void); -typedef enum {touchessolid, drawnode, nodrawnode} solidstate_t; -typedef enum { ST_SYNC=0, ST_RAND } synctype_t; -typedef enum { SPR_SINGLE=0, SPR_GROUP } spriteframetype_t; -typedef enum {MS_WINDOWED, MS_FULLSCREEN, MS_FULLDIB, MS_UNINIT} modestate_t; -typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t; -*/ - -#endif // _QTYPES_H +#endif // __qtypes diff --git a/include/r_shared.h b/include/r_shared.h index 90d3125..3c05a18 100644 --- a/include/r_shared.h +++ b/include/r_shared.h @@ -26,6 +26,11 @@ $Id$ */ +#ifndef __r_shared_h +#define __r_shared_h + +#include "d_iface.h" + #ifndef GLQUAKE // r_shared.h: general refresh-related stuff shared between the refresh and the // driver @@ -164,3 +169,5 @@ typedef struct edge_s #endif // _R_SHARED_H_ #endif // GLQUAKE + +#endif // __r_shared_h diff --git a/include/vid.h b/include/vid.h index af233b0..e0fb3e3 100644 --- a/include/vid.h +++ b/include/vid.h @@ -29,6 +29,8 @@ #ifndef __vid_h #define __vid_h +#include "qtypes.h" + #define VID_CBITS 6 #define VID_GRADES (1 << VID_CBITS) diff --git a/include/view.h b/include/view.h index 34c67a3..ffac7fa 100644 --- a/include/view.h +++ b/include/view.h @@ -26,6 +26,11 @@ $Id$ */ +#ifndef __view_h +#define __view_h + +#include "cvar.h" + extern byte gammatable[256]; // palette is sent through this extern byte ramps[3][256]; extern float v_blend[4]; @@ -40,3 +45,4 @@ void V_RenderView (void); float V_CalcRoll (vec3_t angles, vec3_t velocity); void V_UpdatePalette (void); +#endif // __cvar_h diff --git a/include/wad.h b/include/wad.h index aca66ef..08c6331 100644 --- a/include/wad.h +++ b/include/wad.h @@ -26,6 +26,10 @@ $Id$ */ +#ifndef __wad_h +#define __wad_h + +#include "qtypes.h" //=============== // TYPES @@ -81,3 +85,5 @@ void *W_GetLumpName (char *name); void *W_GetLumpNum (int num); void SwapPic (qpic_t *pic); + +#endif // __wad_h diff --git a/source/cl_parse.c b/source/cl_parse.c index 6606a3a..346a1cf 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -41,6 +41,7 @@ #include "sbar.h" #include "screen.h" #include "server.h" +#include "qdefs.h" char *svc_strings[] = { diff --git a/source/cl_tent.c b/source/cl_tent.c index 78ef5f0..ed27f00 100644 --- a/source/cl_tent.c +++ b/source/cl_tent.c @@ -30,6 +30,11 @@ # include "config.h" #endif +#include "protocol.h" +#include "client.h" +#include "msg.h" +#include "sys.h" +#include "console.h" int num_temp_entities; entity_t cl_temp_entities[MAX_TEMP_ENTITIES]; diff --git a/source/console.c b/source/console.c index 4092c0b..b32dd13 100644 --- a/source/console.c +++ b/source/console.c @@ -38,6 +38,16 @@ #endif #include +#include "va.h" +#include "draw.h" +#include "host.h" +#include "sys.h" +#include "qargs.h" +#include "client.h" +#include "console.h" +#include "screen.h" +#include "keys.h" + int con_linewidth; float con_cursorspeed = 4; @@ -109,7 +119,7 @@ Con_Clear_f void Con_Clear_f (void) { if (con_text) - Q_memset (con_text, ' ', CON_TEXTSIZE); + memset (con_text, ' ', CON_TEXTSIZE); } @@ -175,7 +185,7 @@ void Con_CheckResize (void) width = 38; con_linewidth = width; con_totallines = CON_TEXTSIZE / con_linewidth; - Q_memset (con_text, ' ', CON_TEXTSIZE); + memset (con_text, ' ', CON_TEXTSIZE); } else { @@ -193,8 +203,8 @@ void Con_CheckResize (void) if (con_linewidth < numchars) numchars = con_linewidth; - Q_memcpy (tbuf, con_text, CON_TEXTSIZE); - Q_memset (con_text, ' ', CON_TEXTSIZE); + memcpy (tbuf, con_text, CON_TEXTSIZE); + memset (con_text, ' ', CON_TEXTSIZE); for (i=0 ; i + +#include "sys.h" +#include "client.h" +#include "vid.h" +#include "keys.h" +#include "cmd.h" +#include "zone.h" +#include "cvar.h" +#include "screen.h" +#include "console.h" +#include "menu.h" /* @@ -194,8 +206,8 @@ void Key_Console (int key) cmd = Cvar_CompleteVariable (key_lines[edit_line]+1); if (cmd) { - Q_strcpy (key_lines[edit_line]+1, cmd); - key_linepos = Q_strlen(cmd)+1; + strcpy (key_lines[edit_line]+1, cmd); + key_linepos = strlen(cmd)+1; key_lines[edit_line][key_linepos] = ' '; key_linepos++; key_lines[edit_line][key_linepos] = 0; @@ -219,8 +231,8 @@ void Key_Console (int key) && !key_lines[history_line][1]); if (history_line == edit_line) history_line = (edit_line+1)&31; - Q_strcpy(key_lines[edit_line], key_lines[history_line]); - key_linepos = Q_strlen(key_lines[edit_line]); + strcpy(key_lines[edit_line], key_lines[history_line]); + key_linepos = strlen(key_lines[edit_line]); return; } @@ -240,8 +252,8 @@ void Key_Console (int key) } else { - Q_strcpy(key_lines[edit_line], key_lines[history_line]); - key_linepos = Q_strlen(key_lines[edit_line]); + strcpy(key_lines[edit_line], key_lines[history_line]); + key_linepos = strlen(key_lines[edit_line]); } return; } @@ -361,7 +373,7 @@ int Key_StringToKeynum (char *str) for (kn=keynames ; kn->name ; kn++) { - if (!Q_strcasecmp(str,kn->name)) + if (!strcasecmp(str,kn->name)) return kn->keynum; } return -1; @@ -419,9 +431,9 @@ void Key_SetBinding (int keynum, char *binding) } // allocate memory for new binding - l = Q_strlen (binding); + l = strlen (binding); new = Z_Malloc (l+1); - Q_strcpy (new, binding); + strcpy (new, binding); new[l] = 0; keybindings[keynum] = new; } diff --git a/source/menu.c b/source/menu.c index 68e8a05..d37cdce 100644 --- a/source/menu.c +++ b/source/menu.c @@ -30,11 +30,25 @@ # include "config.h" #endif - #ifdef _WIN32 #include "winquake.h" #endif +#include "view.h" +#include "va.h" +#include "cmd.h" +#include "cvar.h" +#include "vid.h" +#include "net.h" +#include "qtypes.h" +#include "menu.h" +#include "draw.h" +#include "keys.h" +#include "screen.h" +#include "host.h" +#include "server.h" +#include "console.h" + void (*vid_menudrawfn)(void); void (*vid_menukeyfn)(int key); @@ -709,8 +723,8 @@ void M_Menu_Setup_f (void) key_dest = key_menu; m_state = m_setup; m_entersound = true; - Q_strcpy(setup_myname, cl_name->string); - Q_strcpy(setup_hostname, hostname->string); + strcpy(setup_myname, cl_name->string); + strcpy(setup_hostname, hostname->string); setup_top = setup_oldtop = ((int)cl_color->value) >> 4; setup_bottom = setup_oldbottom = ((int)cl_color->value) & 15; } @@ -806,9 +820,9 @@ forward: goto forward; // setup_cursor == 4 (OK) - if (Q_strcmp(cl_name->string, setup_myname) != 0) + if (strcmp(cl_name->string, setup_myname) != 0) Cbuf_AddText ( va ("name \"%s\"\n", setup_myname) ); - if (Q_strcmp(hostname->string, setup_hostname) != 0) + if (strcmp(hostname->string, setup_hostname) != 0) Cvar_Set(hostname, setup_hostname); if (setup_top != setup_oldtop || setup_bottom != setup_oldbottom) Cbuf_AddText( va ("color %i %i\n", setup_top, setup_bottom) ); @@ -2383,7 +2397,7 @@ void M_LanConfig_Key (int key) lanConfig_cursor = 0; } - l = Q_atoi(lanConfig_portname); + l = atoi(lanConfig_portname); if (l > 65535) l = lanConfig_port; else @@ -2942,9 +2956,9 @@ void M_ServerList_Draw (void) for (j = i+1; j < hostCacheCount; j++) if (strcmp(hostcache[j].name, hostcache[i].name) < 0) { - Q_memcpy(&temp, &hostcache[j], sizeof(hostcache_t)); - Q_memcpy(&hostcache[j], &hostcache[i], sizeof(hostcache_t)); - Q_memcpy(&hostcache[i], &temp, sizeof(hostcache_t)); + memcpy(&temp, &hostcache[j], sizeof(hostcache_t)); + memcpy(&hostcache[j], &hostcache[i], sizeof(hostcache_t)); + memcpy(&hostcache[i], &temp, sizeof(hostcache_t)); } } slist_sorted = true; diff --git a/source/net_udp.c b/source/net_udp.c index ac81313..610f4f6 100644 --- a/source/net_udp.c +++ b/source/net_udp.c @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef __sun__ #include diff --git a/source/sbar.c b/source/sbar.c index 7cc7731..c055615 100644 --- a/source/sbar.c +++ b/source/sbar.c @@ -30,7 +30,15 @@ # include "config.h" #endif - +#include "sbar.h" +#include "qdefs.h" +#include "vid.h" +#include "va.h" +#include "draw.h" +#include "wad.h" +#include "screen.h" +#include "client.h" +#include "server.h" int sb_updates; // if >= vid.numpages, no update needed diff --git a/source/view.c b/source/view.c index 16bfe95..482214f 100644 --- a/source/view.c +++ b/source/view.c @@ -30,6 +30,7 @@ # include "config.h" #endif +#include "view.h" #include "r_local.h" /* diff --git a/source/zone.c b/source/zone.c index 4e9f1df..71d943c 100644 --- a/source/zone.c +++ b/source/zone.c @@ -31,6 +31,7 @@ #endif #include +#include #include "qargs.h" #include "sys.h"