uquake has the beginning of netchan support, netchan.message works fine

now, the rest I don't know how much of it I can do without breaking the
protocol's compatibility.

client_state_t has moved back to client.h in qw_common and uquake.  Seems
like that's a step backward, but the way it was being used while common
was far worse!  This required massive reworking of headers and such.

Speaking of using cl (the global client_state_t) badly, the sound code did
exactly that.  Mercury should be shot for not fixing that when he did the
sound_lib.a stuff.  The fix illustrates what we need to start doing to the
code to make modularization possible.  I'll be sending a message to the
list about this shortly..
This commit is contained in:
Joseph Carter 2000-02-04 13:40:04 +00:00
parent 233984564e
commit dc627d6b28
59 changed files with 598 additions and 432 deletions

View file

@ -22,14 +22,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Quake is a trademark of Id Software, Inc., (c) 1996 Id Software, Inc. All
// rights reserved.
#include "qtypes.h"
#include "quakedef.h"
#include "console.h"
#include "cdaudio.h"
#include "common.h"
#include "sound.h"
#include "cmd.h"
#include "cvar.h"
#include <qtypes.h>
#include <quakedef.h>
#include <console.h>
#include <cdaudio.h>
#include <common.h>
#include <sound.h>
#include <cmd.h>
#include <cvar.h>
#include <client.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H

View file

@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <cmd.h>
#include <quakedef.h>
#include <client.h>
static qboolean cdValid = false;
static qboolean initialized = false;

View file

@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <lib_replace.h>
#include <zone.h>
#include <string.h>
#include <net.h>
#include <common_quakedef.h>
void Cmd_ForwardToServer (void);
@ -628,14 +629,13 @@ void Cmd_ForwardToServer (void)
if (cls.demoplayback)
return; // not really connected
#ifdef QUAKEWORLD
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
SZ_Print (&cls.netchan.message, Cmd_Argv(0));
if (Cmd_Argc() > 1) {
SZ_Print (&cls.netchan.message, " ");
SZ_Print (&cls.netchan.message, Cmd_Args());
}
#elif UQUAKE
#if 0
MSG_WriteByte (&cls.message, clc_stringcmd);
SZ_Print (&cls.message, Cmd_Argv(0));
if (Cmd_Argc() > 1) {
@ -663,10 +663,9 @@ void Cmd_ForwardToServer_f (void)
return; // not really connected
if (Cmd_Argc() > 1) {
#ifdef QUAKEWORLD
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
SZ_Print (&cls.netchan.message, Cmd_Args());
#elif UQUAKE
#if 0
MSG_WriteByte (&cls.message, clc_stringcmd);
SZ_Print (&cls.message, Cmd_Args());
#endif

View file

@ -35,6 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdlib.h>
#include <setjmp.h>
#include <time.h>
#include <cvar.h>
#ifdef HAVE_STRING_H
#include <strings.h>
#endif

View file

@ -1,4 +1,5 @@
/*
cvar.h
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -19,13 +20,11 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// cvar.h
#ifndef _CVAR_H
#define _CVAR_H
#include "qtypes.h"
#include "qstructs.h"
#include <qtypes.h>
/*
cvar_t variables are used to hold scalar or string variables that can be changed or displayed at the console or prog code as well as accessed directly
@ -59,6 +58,18 @@ Cvars are restricted from having the same names as commands to keep this
interface from being ambiguous.
*/
typedef struct cvar_s
{
char *name;
char *string;
qboolean archive; // set to true to cause it to be saved to vars.rc
qboolean info; // added to serverinfo or userinfo when changed
qboolean server; // notifies players when changed (UQUAKE)
float value;
struct cvar_s *next;
} cvar_t;
void Cvar_RegisterVariable (cvar_t *variable);
// registers a cvar that allready has the name, string, and optionally the
// archive elements set.

View file

@ -1,4 +1,5 @@
/*
d_fill.c - clears a specified rectangle to the specified color
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -19,9 +20,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// d_clear: clears a specified rectangle to the specified color
#include "quakedef.h"
#include <quakedef.h>
#include <vid.h>
/*

View file

@ -1,4 +1,5 @@
/*
draw.c - the only file outside the refresh that touches the vid buffer
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -20,9 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// draw.c -- this is the only file outside the refresh that touches the
// vid buffer
#include <qtypes.h>
#include <quakedef.h>
#include <wad.h>
@ -31,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <sys.h>
#include <lib_replace.h>
#include <console.h>
#include <quakefs.h>
typedef struct {
vrect_t rect;

View file

@ -1,4 +1,5 @@
/*
draw.h - functions outside the refresh allowed to touch the vid buffer
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -20,11 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// draw.h -- these are the only functions outside the refresh allowed
// to touch the vid buffer
#include "qtypes.h"
#include "wad.h"
#include <qtypes.h>
#include <wad.h>
extern qpic_t *draw_disc; // also used on sbar

View file

@ -1,4 +1,5 @@
/*
gl_mesh.c - triangle model functions
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Portions Copyright (C) 1999,2000 Nelson Rush.
@ -20,14 +21,14 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// gl_mesh.c: triangle model functions
#include "qtypes.h"
#include "quakedef.h"
#include "model.h"
#include "console.h"
#include "common.h"
#include "sys.h"
#include <qtypes.h>
#include <quakedef.h>
#include <model.h>
#include <console.h>
#include <common.h>
#include <sys.h>
#include <client.h>
/*
=================================================================

View file

@ -1,4 +1,5 @@
/*
mathlib.c - math primitives
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Portions Copyright (C) 1999,2000 Nelson Rush.
@ -20,12 +21,11 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// mathlib.c -- math primitives
#include <math.h>
#include "qtypes.h"
#include "quakedef.h"
#include "mathlib.h"
#include <qtypes.h>
#include <quakedef.h>
#include <mathlib.h>
void Sys_Error (char *error, ...);

View file

@ -21,9 +21,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef QUAKEWORLD
# include "qwsvdef.h"
#else
# include "quakedef.h"
# include <qwsvdef.h>
#elif UQUAKE
# include <client.h>
# include <server.h>
# include <world.h>
# include <progs.h>
# include <quakedef.h>
#endif
#include <qtypes.h>
@ -34,6 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <sys.h>
#include <console.h>
#define RETURN_EDICT(e) (((int *)pr_globals)[OFS_RETURN] = EDICT_TO_PROG(e))
#define RETURN_STRING(s) (((int *)pr_globals)[OFS_RETURN] = PR_SetString(s))

View file

@ -1,4 +1,5 @@
/*
pr_edict.c - entity dictionary
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Portions Copyright (C) 1999,2000 Nelson Rush.
@ -20,12 +21,15 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// sv_edict.c -- entity dictionary
#ifdef QUAKEWORLD
#include "qwsvdef.h"
#else
#include "quakedef.h"
#include <qwsvdef.h>
#elif UQUAKE
# include <client.h>
# include <server.h>
# include <world.h>
# include <progs.h>
# include <quakedef.h>
#endif
#include <qtypes.h>

View file

@ -21,9 +21,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef QUAKEWORLD
#include "qwsvdef.h"
#else
#include "quakedef.h"
#include <qwsvdef.h>
#elif UQUAKE
# include <client.h>
# include <server.h>
# include <world.h>
# include <progs.h>
# include <quakedef.h>
#endif
#include <sys.h>

View file

@ -1,4 +1,5 @@
/*
qargs.c - command line argument processing routines
Copyright (C) 1996-1997 Id Software, Inc.
Portions Copyright (C) 1999,2000 Nelson Rush.
Copyright (C) 1999,2000 contributors of the QuakeForge project
@ -20,15 +21,15 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// common.c -- misc functions used in client and server
#include <ctype.h>
#include <qtypes.h>
#include "common.h"
#include "crc.h"
#include "sys.h"
#include "cmd.h"
#include "console.h"
#include <common.h>
#include <crc.h>
#include <sys.h>
#include <cmd.h>
#include <console.h>
#include <client.h>
usercmd_t nullcmd; // guarenteed to be zero

View file

@ -25,8 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdio.h>
#include <sys/types.h>
#include <qtypes.h>
#include <render.h>
//=============================================================================
@ -46,138 +44,10 @@ typedef struct
//=============================================================================
typedef struct cvar_s
{
char *name;
char *string;
qboolean archive; // set to true to cause it to be saved to vars.rc
qboolean info; // added to serverinfo or userinfo when changed
qboolean server; // notifies players when changed (UQUAKE)
float value;
struct cvar_s *next;
} cvar_t;
typedef struct
{
int destcolor[3];
int percent; // 0-256
} cshift_t;
#if defined(QUAKEWORLD) || defined(UQUAKE)
#include "client.h"
#endif
//
// the client_state_t structure is wiped completely at every
// server signon
//
typedef struct
{
int movemessages; // since connecting to this server
// throw out the first couple, so the player
// doesn't accidentally do something the
// first frame
// information for local display
int stats[MAX_CL_STATS]; // health, etc
float item_gettime[32]; //cl.time of aquiring item, for blinking
float faceanimtime; // use anim frame if cl.time < this
cshift_t cshifts[NUM_CSHIFTS]; // color shifts for damage, powerups
cshift_t prev_cshifts[NUM_CSHIFTS]; // and content types
// the client maintains its own idea of view angles, which are
// sent to the server each frame. And only reset at level change
// and teleport times
vec3_t viewangles;
// the client simulates or interpolates movement to get these values
double time; // this is the time value that the client
// is rendering at. allways <= realtime
// pitch drifting vars
float pitchvel;
qboolean nodrift;
float driftmove;
double laststop;
qboolean paused; // send over by server
int completed_time; // latched at intermission start
float punchangle; // temporar yview kick from weapon firing
int intermission; // don't change view angle, full screen, etc
//
// information that is static for the entire time connected to a server
//
struct model_s *model_precache[MAX_MODELS];
struct sfx_s *sound_precache[MAX_SOUNDS];
char levelname[40]; // for display on solo scoreboard
// refresh related state
struct model_s *worldmodel; // cl_entitites[0].model
struct efrag_s *free_efrags;
int num_statics; // held in cl_staticentities array
int cdtrack; // cd audio
entity_t viewent; // weapon model
int playernum;
int gametype;
int maxclients;
#ifdef QUAKEWORLD
// QW specific!
// all player information
player_info_t players[MAX_CLIENTS];
int servercount; // server identification for prespawns
char serverinfo[MAX_SERVERINFO_STRING];
int parsecount; // server message counter
int validsequence; // this is the sequence number of the last good
// packetentity_t we got. If this is 0, we can't
// render a frame yet
int spectator;
double last_ping_request; // while showing scoreboard
frame_t frames[UPDATE_BACKUP];
vec3_t simorg;
vec3_t simvel;
vec3_t simangles;
//
// information that is static for the entire time connected to a server
//
char model_name[MAX_MODELS][MAX_QPATH];
char sound_name[MAX_SOUNDS][MAX_QPATH];
#elif defined(UQUAKE)
// UQ specific.
int num_entities; // held in cl_entities array
float last_received_message; // (realtime) for net trouble icon
double mtime[2]; // the timestamp of last two messages
double oldtime; // previous cl.time, time-oldtime is used
// to decay light values and smooth step ups
qboolean onground;
qboolean inwater;
float viewheight;
float idealpitch;
// frag scoreboard
scoreboard_t *scores; // [cl.maxclients]
usercmd_t cmd; // last command sent to the server
int items; // inventory bit flags
vec3_t mviewangles[2]; // during demo playback viewangles is lerped
// between these
vec3_t mvelocity[2]; // update by server, used for lean+bob
// (0 is newest)
vec3_t velocity; // lerped between mvelocity[0] and [1]
#endif
} client_state_t;
extern client_state_t cl;
#endif // _QSTRUCTS_H

View file

@ -1,4 +1,5 @@
/*
r_local.h - private refresh defs
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -19,10 +20,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// r_local.h -- private refresh defs
#include "r_shared.h"
#include <r_shared.h>
#include <client.h>
#define ALIAS_BASE_SIZE_RATIO (1.0 / 11.0)
// normalizing factor so player model works out to about

View file

@ -1,4 +1,5 @@
/*
sbar.c - status bar code
Copyright (C) 1996-1997 Id Software, Inc.
Portions Copyright (C) 1999,2000 Nelson Rush.
Copyright (C) 1999,2000 contributors of the QuakeForge project
@ -20,18 +21,20 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// sbar.c -- status bar code
#include "quakedef.h"
#include "qtypes.h"
#include "wad.h"
#include "common.h"
#include "client.h"
#include "draw.h"
#include "sbar.h"
#include "screen.h"
#include "cmd.h"
#include <quakedef.h>
#include <qtypes.h>
#include <wad.h>
#include <common.h>
#include <client.h>
#include <draw.h>
#include <sbar.h>
#include <screen.h>
#include <cmd.h>
#include <protocol.h>
#ifdef UQUAKE
# include <server.h>
#endif
extern void M_DrawPic (int x, int y, qpic_t *pic);

View file

@ -1,4 +1,5 @@
/*
snd_dma.c - main control for any streaming sound output device
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -19,26 +20,27 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// snd_dma.c -- main control for any streaming sound output device
#include <string.h>
#include <stdlib.h>
#include "qtypes.h"
#include "sound.h"
#include "mathlib.h"
#include "model.h"
#include "lib_replace.h"
#include "cvar.h"
#include "cmd.h"
#include "sys.h"
#include "common_quakedef.h"
#include "qargs.h"
#include <qtypes.h>
#include <sound.h>
#include <mathlib.h>
#include <model.h>
#include <lib_replace.h>
#include <cvar.h>
#include <cmd.h>
#include <sys.h>
#include <common_quakedef.h>
#include <qargs.h>
#include <console.h>
#ifdef _WIN32
#include "winquake.h"
#include <winquake.h>
#endif
snd_t snd;
void S_Play(void);
void S_PlayVol(void);
void S_SoundList(void);
@ -46,9 +48,6 @@ void S_Update_();
void S_StopAllSounds(qboolean clear);
void S_StopAllSoundsC(void);
// QuakeWorld hack
#define viewentity playernum+1
// =======================================================================
// Internal sound data & structures
// =======================================================================
@ -391,7 +390,7 @@ channel_t *SND_PickChannel(int entnum, int entchannel)
}
// don't let monster sounds override player sounds
if (channels[ch_idx].entnum == cl.viewentity && entnum != cl.viewentity && channels[ch_idx].sfx)
if (channels[ch_idx].entnum == snd.playernum && entnum != snd.playernum && channels[ch_idx].sfx)
continue;
if (channels[ch_idx].end - paintedtime < life_left)
@ -422,10 +421,10 @@ void SND_Spatialize(channel_t *ch)
vec_t dist;
vec_t lscale, rscale, scale;
vec3_t source_vec;
sfx_t *snd;
sfx_t *sndfx;
// anything coming from the view entity will allways be full volume
if (ch->entnum == cl.viewentity)
if (ch->entnum == snd.playernum)
{
ch->leftvol = ch->master_vol;
ch->rightvol = ch->master_vol;
@ -434,7 +433,7 @@ void SND_Spatialize(channel_t *ch)
// calculate stereo seperation and distance attenuation
snd = ch->sfx;
sndfx = ch->sfx;
VectorSubtract(ch->origin, listener_origin, source_vec);
dist = VectorNormalize(source_vec) * ch->dist_mult;
@ -693,10 +692,10 @@ void S_UpdateAmbientSounds (void)
return;
// calc ambient sound levels
if (!cl.worldmodel)
if (!snd.worldmodel)
return;
l = Mod_PointInLeaf (listener_origin, cl.worldmodel);
l = Mod_PointInLeaf (listener_origin, snd.worldmodel);
if (!l || !ambient_level.value)
{
for (ambient_channel = 0 ; ambient_channel< NUM_AMBIENTS ; ambient_channel++)
@ -1019,7 +1018,7 @@ void S_LocalSound (char *sound)
Con_Printf ("S_LocalSound: can't cache %s\n", sound);
return;
}
S_StartSound (cl.viewentity, -1, sfx, vec3_origin, 1, 1);
S_StartSound (snd.playernum, -1, sfx, vec3_origin, 1, 1);
}

View file

@ -1,4 +1,5 @@
/*
sound.h - client sound i/o functions
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -19,15 +20,14 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// sound.h -- client sound i/o functions
#ifndef __SOUND__
#define __SOUND__
#include <qtypes.h>
#include <qstructs.h>
#include <qdefs.h>
#include <zone.h>
#include <cvar.h>
#define DEFAULT_SOUND_PACKET_VOLUME 255
#define DEFAULT_SOUND_PACKET_ATTENUATION 1.0
@ -96,6 +96,13 @@ typedef struct
int dataofs; // chunk starts this many bytes from file start
} wavinfo_t;
typedef struct {
int playernum;
struct model_s *worldmodel;
} snd_t;
extern snd_t snd;
void S_Init (void);
void S_Startup (void);
void S_Shutdown (void);

View file

@ -25,7 +25,7 @@
USA.
*/
#include "quakedef.h"
#include <quakedef.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
@ -43,10 +43,11 @@
#include <sys/mman.h>
#include <sys/stat.h>
#include "qtypes.h"
#include "sys.h"
#include "common.h"
#include <qtypes.h>
#include <sys.h>
#include <common.h>
#include <lib_replace.h>
#include <client.h>
#ifdef UQUAKE
qboolean isDedicated;

View file

@ -1,4 +1,5 @@
/*
vid_ggi.c - general LibGGI video driver
Copyright (C) 1999 Marcus Sundberg [mackan@stacken.kth.se]
Portions Copyright (C) 1996-1997 Id Software, Inc.
@ -18,7 +19,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// vid_ggi.c -- general LibGGI video driver
#define _BSD
@ -29,8 +29,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <string.h>
#include <ggi/ggi.h>
#include "quakedef.h"
#include "d_local.h"
#include <quakedef.h>
#include <d_local.h>
#include <sound.h>
#include <keys.h>
#include <cvar.h>
@ -39,6 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <lib_replace.h>
#include <draw.h>
#include <console.h>
#include <client.h>
viddef_t vid; // global video state
unsigned short d_8to16table[256];

View file

@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <sys.h>
#include <lib_replace.h>
#include <cmd.h>
#include <client.h>
cvar_t _windowed_mouse = {"_windowed_mouse","0", true};
static float old_windowed_mouse = 0;

View file

@ -1,12 +1,12 @@
/*
vid_svgalib.c - Linux SVGALib video routines
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999-2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
Copyright (C) 1999-2000 Nelson Rush.
Copyright (C) 1999-2000 Marcus Sundberg [mackan@stacken.kth.se]
Copyright (C) 1999-2000 XoXus [xoxus@usa.net]
Please see the file "AUTHORS" for a list of contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
@ -23,8 +23,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "quakedef.h"
#include "d_local.h"
#include <quakedef.h>
#include <common.h>
#include <d_local.h>
#include <sound.h>
#include <cvar.h>
#include <lib_replace.h>

View file

@ -1,4 +1,5 @@
/*
vid_x.c - general x video driver
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999-2000 contributors of the QuakeForge project
Copyright (C) 2000 Marcus Sundberg [mackan@stacken.kth.se]
@ -20,10 +21,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// vid_x.c -- general x video driver
#define _BSD
#include "config.h"
#include <config.h>
#include <ctype.h>
#include <sys/time.h>
@ -44,8 +44,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <X11/extensions/XShm.h>
#include <errno.h>
#include "quakedef.h"
#include "d_local.h"
#include <quakedef.h>
#include <d_local.h>
#include <sound.h>
#include <keys.h>
#include <cvar.h>
@ -55,6 +55,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <lib_replace.h>
#include <draw.h>
#include <console.h>
#include <client.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>

View file

@ -1,4 +1,5 @@
/*
// zone.c
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -19,15 +20,15 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Z_zone.c
#include "qtypes.h"
#include "quakedef.h"
#include "sys.h"
#include "lib_replace.h"
#include "common.h"
#include "console.h"
#include "cmd.h"
#include <qtypes.h>
#include <quakedef.h>
#include <sys.h>
#include <lib_replace.h>
#include <common.h>
#include <console.h>
#include <cmd.h>
#include <zone.h>
//#define DYNAMIC_SIZE 0xc000
#define DYNAMIC_SIZE 0x20000

View file

@ -33,6 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <sbar.h>
#include <screen.h>
#include <cvars.h>
#include <client.h>
char *svc_strings[] =
{
@ -256,7 +257,7 @@ void Model_NextDownload (void)
}
// all done
cl.worldmodel = cl.model_precache[1];
snd.worldmodel = cl.worldmodel = cl.model_precache[1];
R_NewMap ();
Hunk_Check (); // make sure nothing is hurt
@ -589,7 +590,8 @@ void CL_ParseServerData (void)
}
// parse player slot, high bit means spectator
cl.playernum = MSG_ReadByte ();
snd.playernum = cl.playernum = MSG_ReadByte ();
snd.playernum++;
if (cl.playernum & 128)
{
cl.spectator = true;

View file

@ -1,4 +1,5 @@
/*
gl_cl_parse.c - parse a message received from the server (GL renderer)
Copyright (C) 1996-1997 Id Software, Inc.
Portions Copyright (C) 1999,2000 Nelson Rush.
Copyright (C) 1999,2000 contributors of the QuakeForge project
@ -20,12 +21,12 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// cl_parse.c -- parse a message received from the server
#include "quakedef.h"
#include "model.h"
#include "pmove.h"
#include "glquake.h"
#include <quakedef.h>
#include <model.h>
#include <pmove.h>
#include <glquake.h>
#include <client.h>
/*
=====================

View file

@ -1,4 +1,5 @@
/*
sw_cl_parse.c - parse a message received from the server (software renderer)
Copyright (C) 1996-1997 Id Software, Inc.
Portions Copyright (C) 1999,2000 Nelson Rush.
Copyright (C) 1999,2000 contributors of the QuakeForge project
@ -20,11 +21,11 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// cl_parse.c -- parse a message received from the server
#include "quakedef.h"
#include "model.h"
#include "pmove.h"
#include <quakedef.h>
#include <model.h>
#include <pmove.h>
#include <client.h>
/*
=====================

View file

@ -1,4 +1,5 @@
/*
client.h
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -19,26 +20,28 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// client.h
#ifndef _CLIENT_H
#define _CLIENT_H
#include "config.h"
#include <config.h>
#ifdef HAS_ZLIB
#include <zlib.h>
#else
#include "nozip.h"
#include <nozip.h>
#endif
#include "qtypes.h"
#include "zone.h"
#include "protocol.h"
#include "vid.h"
#include "render.h"
#include "common.h"
#include "sys.h"
#include "cmd.h"
#include <net.h>
#include <qtypes.h>
#include <zone.h>
#include <protocol.h>
#include <vid.h>
#include <render.h>
#include <common.h>
#include <sys.h>
#include <cmd.h>
#include <cvar.h>
#include <qstructs.h>
typedef struct
{
@ -218,49 +221,34 @@ extern client_static_t cls;
// the client_state_t structure is wiped completely at every
// server signon
//
/*
//
// the client_state_t structure is wiped completely at every
// server signon
//
typedef struct
{
int servercount; // server identification for prespawns
char serverinfo[MAX_SERVERINFO_STRING];
int parsecount; // server message counter
int validsequence; // this is the sequence number of the last good
// packetentity_t we got. If this is 0, we can't
// render a frame yet
int movemessages; // since connecting to this server
// throw out the first couple, so the player
// doesn't accidentally do something the
// first frame
int spectator;
double last_ping_request; // while showing scoreboard
double last_servermessage;
// sentcmds[cl.netchan.outgoing_sequence & UPDATE_MASK] = cmd
frame_t frames[UPDATE_BACKUP];
int movemessages; // since connecting to this server
// throw out the first couple, so the player
// doesn't accidentally do something the
// first frame
// information for local display
int stats[MAX_CL_STATS]; // health, etc
float item_gettime[32]; //cl.time of aquiring item, for blinking
float faceanimtime; // use anim frame if cl.time < this
int stats[MAX_CL_STATS]; // health, etc
float item_gettime[32]; //cl.time of aquiring item, for blinking
float faceanimtime; // use anim frame if cl.time < this
cshift_t cshifts[NUM_CSHIFTS]; // color shifts for damage, powerups
cshift_t prev_cshifts[NUM_CSHIFTS]; // and content types
cshift_t cshifts[NUM_CSHIFTS]; // color shifts for damage, powerups
cshift_t prev_cshifts[NUM_CSHIFTS]; // and content types
// the client maintains its own idea of view angles, which are
// sent to the server each frame. And only reset at level change
// and teleport times
vec3_t viewangles;
vec3_t viewangles;
// the client simulates or interpolates movement to get these values
double time; // this is the time value that the client
// is rendering at. allways <= realtime
vec3_t simorg;
vec3_t simvel;
vec3_t simangles;
double time; // this is the time value that the client
// is rendering at. allways <= realtime
// pitch drifting vars
float pitchvel;
@ -269,43 +257,84 @@ typedef struct
double laststop;
float crouch; // local amount for smoothing stepups
qboolean paused; // send over by server
qboolean paused; // send over by server
int completed_time; // latched at intermission start
float punchangle; // temporar yview kick from weapon firing
int intermission; // don't change view angle, full screen, etc
//
// information that is static for the entire time connected to a server
//
struct model_s *model_precache[MAX_MODELS];
struct sfx_s *sound_precache[MAX_SOUNDS];
float punchangle; // temporar yview kick from weapon firing
int intermission; // don't change view angle, full screen, etc
int completed_time; // latched ffrom time at intermission start
char levelname[40]; // for display on solo scoreboard
// refresh related state
struct model_s *worldmodel; // cl_entitites[0].model
struct efrag_s *free_efrags;
int num_statics; // held in cl_staticentities array
int cdtrack; // cd audio
entity_t viewent; // weapon model
int playernum;
int gametype;
int maxclients;
#ifdef QUAKEWORLD
// QW specific!
// all player information
player_info_t players[MAX_CLIENTS];
int servercount; // server identification for prespawns
char serverinfo[MAX_SERVERINFO_STRING];
int parsecount; // server message counter
int validsequence; // this is the sequence number of the last good
// packetentity_t we got. If this is 0, we can't
// render a frame yet
int spectator;
double last_ping_request; // while showing scoreboard
frame_t frames[UPDATE_BACKUP];
vec3_t simorg;
vec3_t simvel;
vec3_t simangles;
//
// information that is static for the entire time connected to a server
//
char model_name[MAX_MODELS][MAX_QPATH];
char sound_name[MAX_SOUNDS][MAX_QPATH];
#elif defined(UQUAKE)
// UQ specific.
int num_entities; // held in cl_entities array
float last_received_message; // (realtime) for net trouble icon
double mtime[2]; // the timestamp of last two messages
double oldtime; // previous cl.time, time-oldtime is used
// to decay light values and smooth step ups
qboolean onground;
qboolean inwater;
float viewheight;
float idealpitch;
// frag scoreboard
struct scoreboard_t *scores; // [cl.maxclients]
struct model_s *model_precache[MAX_MODELS];
struct sfx_s *sound_precache[MAX_SOUNDS];
char levelname[40]; // for display on solo scoreboard
int playernum;
// refresh related state
struct model_s *worldmodel; // cl_entitites[0].model
struct efrag_s *free_efrags;
int num_entities; // stored bottom up in cl_entities array
int num_statics; // stored top down in cl_entitiers
int cdtrack; // cd audio
entity_t viewent; // weapon model
// all player information
player_info_t players[MAX_CLIENTS];
struct usercmd_t cmd; // last command sent to the server
int items; // inventory bit flags
vec3_t mviewangles[2]; // during demo playback viewangles is lerped
// between these
vec3_t mvelocity[2]; // update by server, used for lean+bob
// (0 is newest)
vec3_t velocity; // lerped between mvelocity[0] and [1]
#endif
} client_state_t;
extern client_state_t cl;
*/
extern client_state_t cl;
//
// cvars

View file

@ -1,4 +1,5 @@
/*
net.h - interface to the networking layer
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -23,10 +24,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef _NET_H
#define _NET_H
// net.h -- quake's interface to the networking layer
#include "qtypes.h"
#include "common.h"
#include <qtypes.h>
#include <common.h>
#include <cvar.h>
#define PORT_ANY -1
@ -125,7 +126,6 @@ void Netchan_Setup (netchan_t *chan, netadr_t adr, int qport);
qboolean Netchan_CanPacket (netchan_t *chan);
qboolean Netchan_CanReliable (netchan_t *chan);
#include "qstructs.h"
extern cvar_t hostname;
#endif // _NET_H

View file

@ -1,4 +1,5 @@
/*
protocol.h - communications protocols
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -23,7 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef _PROTOCOL_H
#define _PROTOCOL_H
// protocol.h -- communications protocols
#include <net.h>
#include <render.h>
#define PROTOCOL_VERSION 28

View file

@ -1,4 +1,5 @@
/*
qwsvdef.h - primary header for server
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -19,7 +20,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// quakedef.h -- primary header for server
#define QUAKE_GAME // as opposed to utilities
#include <config.h>
@ -38,25 +38,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <setjmp.h>
#include <ctype.h>
#include "bothdefs.h"
#include <bothdefs.h>
#include "common.h"
#include "bspfile.h"
#include "sys.h"
#include "zone.h"
#include "mathlib.h"
#include <common.h>
#include <bspfile.h>
#include <sys.h>
#include <zone.h>
#include <mathlib.h>
#include "cvar.h"
#include "net.h"
#include "protocol.h"
#include "cmd.h"
#include "model.h"
#include "crc.h"
#include "progs.h"
#include <cvar.h>
#include <net.h>
#include <protocol.h>
#include <cmd.h>
#include <model.h>
#include <crc.h>
#include <progs.h>
#include "server.h"
#include "world.h"
#include "pmove.h"
#include <server.h>
#include <world.h>
#include <pmove.h>
#include <qstructs.h>
#ifndef max
# define max(a,b) ((a) > (b) ? (a) : (b))

View file

@ -18,6 +18,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _BSPFILE_H
#define _BSPFILE_H
#include <render.h>
// upper design bounds
@ -298,6 +302,8 @@ typedef struct epair_s
char *value;
} epair_t;
#if 0
// this is defined in render.h now
typedef struct
{
vec3_t origin;
@ -305,6 +311,7 @@ typedef struct
int numbrushes;
epair_t *epairs;
} entity_t;
#endif
extern int num_entities;
extern entity_t entities[MAX_MAP_ENTITIES];
@ -322,3 +329,5 @@ void GetVectorForKey (entity_t *ent, char *key, vec3_t vec);
epair_t *ParseEpair (void);
#endif
#endif // _BSPFILE_H

View file

@ -23,9 +23,12 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "quakedef.h"
#include <quakedef.h>
#include <cvar.h>
#include <mathlib.h>
#include <client.h>
#include <server.h>
#include <world.h>
cvar_t cl_chasecam = {"cl_chasecam", "0", true};
cvar_t cl_chasecam_up = {"cl_chasecam_up", "16", true};

View file

@ -1,4 +1,5 @@
/*
cl_demo.c - demo functions for uquake
Copyright (C) 1996-1997 Id Software, Inc.
Portions Copyright (C) 1999,2000 Nelson Rush.
@ -20,7 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <qtypes.h>
#include "quakedef.h"
#include <client.h>
#include <quakedef.h>
#include <net.h>
#include <sys.h>
#include <mathlib.h>

View file

@ -1,4 +1,5 @@
/*
cl.input.c - builds an intended movement command to send to the server
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,13 +18,13 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// cl.input.c -- builds an intended movement command to send to the server
// Quake is a trademark of Id Software, Inc., (c) 1996 Id Software, Inc. All
// rights reserved.
#include <qtypes.h>
#include "quakedef.h"
#include <client.h>
#include <quakedef.h>
#include <mathlib.h>
#include <lib_replace.h>
#include <cmd.h>

View file

@ -1,4 +1,5 @@
/*
cl_main.c - client main loop
Copyright (C) 1996-1997 Id Software, Inc.
Portions Copyright (C) 1999,2000 Nelson Rush.
@ -18,12 +19,13 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// cl_main.c -- client main loop
#include "quakedef.h"
#include <quakedef.h>
#include <qtypes.h>
#include <qstructs.h>
#include <client.h>
#include <sound.h>
#include <common.h>
#include <net.h>
#include <console.h>
#include <screen.h>
@ -32,6 +34,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <protocol.h>
#include <cvar.h>
#include <input.h>
#include <zone.h>
#include <client.h>
#include <server.h>
// we need to declare some mouse variables here, because the menu system
// references them even when on a unix system.
@ -84,7 +89,7 @@ void CL_ClearState (void)
// wipe the entire cl structure
memset (&cl, 0, sizeof(cl));
SZ_Clear (&cls.message);
SZ_Clear (&cls.netchan.message);
// clear other arrays
memset (cl_efrags, 0, sizeof(cl_efrags));
@ -128,10 +133,10 @@ void CL_Disconnect (void)
CL_Stop_f ();
Con_DPrintf ("Sending clc_disconnect\n");
SZ_Clear (&cls.message);
MSG_WriteByte (&cls.message, clc_disconnect);
NET_SendUnreliableMessage (cls.netcon, &cls.message);
SZ_Clear (&cls.message);
SZ_Clear (&cls.netchan.message);
MSG_WriteByte (&cls.netchan.message, clc_disconnect);
NET_SendUnreliableMessage (cls.netcon, &cls.netchan.message);
SZ_Clear (&cls.netchan.message);
NET_Close (cls.netcon);
cls.state = ca_disconnected;
@ -196,26 +201,26 @@ Con_DPrintf ("CL_SignonReply: %i\n", cls.signon);
switch (cls.signon)
{
case 1:
MSG_WriteByte (&cls.message, clc_stringcmd);
MSG_WriteString (&cls.message, "prespawn");
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
MSG_WriteString (&cls.netchan.message, "prespawn");
cls.state = ca_onserver;
break;
case 2:
MSG_WriteByte (&cls.message, clc_stringcmd);
MSG_WriteString (&cls.message, va("name \"%s\"\n", cl_name.string));
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
MSG_WriteString (&cls.netchan.message, va("name \"%s\"\n", cl_name.string));
MSG_WriteByte (&cls.message, clc_stringcmd);
MSG_WriteString (&cls.message, va("color %i %i\n", ((int)cl_color.value)>>4, ((int)cl_color.value)&15));
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
MSG_WriteString (&cls.netchan.message, va("color %i %i\n", ((int)cl_color.value)>>4, ((int)cl_color.value)&15));
MSG_WriteByte (&cls.message, clc_stringcmd);
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
snprintf(str, sizeof(str), "spawn %s", cls.spawnparms);
MSG_WriteString (&cls.message, str);
MSG_WriteString (&cls.netchan.message, str);
break;
case 3:
MSG_WriteByte (&cls.message, clc_stringcmd);
MSG_WriteString (&cls.message, "begin");
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
MSG_WriteString (&cls.netchan.message, "begin");
Cache_Report (); // print remaining memory
break;
@ -706,12 +711,12 @@ void CL_SendCmd (void)
if (cls.demoplayback)
{
SZ_Clear (&cls.message);
SZ_Clear (&cls.netchan.message);
return;
}
// send the reliable message
if (!cls.message.cursize)
if (!cls.netchan.message.cursize)
return; // no message at all
if (!NET_CanSendMessage (cls.netcon))
@ -720,10 +725,10 @@ void CL_SendCmd (void)
return;
}
if (NET_SendMessage (cls.netcon, &cls.message) == -1)
if (NET_SendMessage (cls.netcon, &cls.netchan.message) == -1)
Host_Error ("CL_WriteToServer: lost server connection");
SZ_Clear (&cls.message);
SZ_Clear (&cls.netchan.message);
}
/*
@ -733,7 +738,7 @@ CL_Init
*/
void CL_Init (void)
{
SZ_Alloc (&cls.message, 1024);
SZ_Alloc (&cls.netchan.message, 1024);
CL_InitInput ();
CL_InitTEnts ();

View file

@ -31,6 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <screen.h>
#include <lib_replace.h>
#include <cmd.h>
#include <client.h>
#include <server.h>
void CL_ParseUpdate (int bits);
@ -204,9 +206,9 @@ void CL_KeepaliveMessage (void)
// write out a nop
Con_Printf ("--> client to server keepalive\n");
MSG_WriteByte (&cls.message, clc_nop);
NET_SendMessage (cls.netcon, &cls.message);
SZ_Clear (&cls.message);
MSG_WriteByte (&cls.netchan.message, clc_nop);
NET_SendMessage (cls.netcon, &cls.netchan.message);
SZ_Clear (&cls.netchan.message);
}
/*
@ -319,7 +321,8 @@ void CL_ParseServerInfo (void)
// local state
cl_entities[0].model = cl.worldmodel = cl.model_precache[1];
cl_entities[0].model = snd.worldmodel = cl.worldmodel =
cl.model_precache[1];
R_NewMap ();
@ -634,7 +637,7 @@ void CL_ParseServerMessage (void)
break;
case svc_setview:
cl.playernum = MSG_ReadShort ();
snd.playernum = cl.playernum = MSG_ReadShort ();
cl.playernum--;
break;

View file

@ -1,4 +1,5 @@
/*
cl_tent.c - client side temporary entities
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,15 +18,15 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// cl_tent.c -- client side temporary entities
#include "quakedef.h"
#include <quakedef.h>
#include <qtypes.h>
#include <sound.h>
#include <mathlib.h>
#include <protocol.h>
#include <console.h>
#include <sys.h>
#include <client.h>
int num_temp_entities;
entity_t cl_temp_entities[MAX_TEMP_ENTITIES];

View file

@ -1,4 +1,5 @@
/*
client.h
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,22 +18,25 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// client.h
#ifndef _CLIENT_H
#define _CLIENT_H
#include "config.h"
#include <config.h>
#ifdef HAS_ZLIB
#include <zlib.h>
#else
#include "nozip.h"
#include <nozip.h>
#endif
#include <qtypes.h>
#include <common.h>
#include <quakefs.h>
#include <vid.h>
#include <net.h>
#include <bspfile.h>
#include <model.h>
typedef struct
{
@ -112,7 +116,7 @@ ca_dedicated, // a dedicated server with no ability to start a client
ca_disconnected, // full screen console with no connection
ca_connected, // valid netcon, talking to a server
ca_onserver, // processing data lists, etc
ca_active // everything is in, so frames can be rendered
ca_active // everything is in, so frames can be rendered
} cactive_t;
//
@ -123,9 +127,9 @@ typedef struct
{
cactive_t state;
#ifdef QUAKEWORLD
netchan_t netchan;
#ifdef QUAKEWORLD
char userinfo[MAX_INFO_STRING];
char servername[MAX_OSPATH];
@ -150,7 +154,7 @@ typedef struct
// connection information
int signon; // 0 to SIGNONS
struct qsocket_s *netcon;
sizebuf_t message; // net msg write buffer
// sizebuf_t message; // net msg write buffer
#endif
// demos - this stuff can't go into client_state_t
@ -168,8 +172,119 @@ typedef struct
extern client_static_t cls;
//
// the client_state_t structure is wiped completely at every
// server signon
//
typedef struct
{
int movemessages; // since connecting to this server
// throw out the first couple, so the player
// doesn't accidentally do something the
// first frame
#include <qstructs.h>
// information for local display
int stats[MAX_CL_STATS]; // health, etc
float item_gettime[32]; //cl.time of aquiring item, for blinking
float faceanimtime; // use anim frame if cl.time < this
cshift_t cshifts[NUM_CSHIFTS]; // color shifts for damage, powerups
cshift_t prev_cshifts[NUM_CSHIFTS]; // and content types
// the client maintains its own idea of view angles, which are
// sent to the server each frame. And only reset at level change
// and teleport times
vec3_t viewangles;
// the client simulates or interpolates movement to get these values
double time; // this is the time value that the client
// is rendering at. allways <= realtime
// pitch drifting vars
float pitchvel;
qboolean nodrift;
float driftmove;
double laststop;
qboolean paused; // send over by server
int completed_time; // latched at intermission start
float punchangle; // temporar yview kick from weapon firing
int intermission; // don't change view angle, full screen, etc
//
// information that is static for the entire time connected to a server
//
struct model_s *model_precache[MAX_MODELS];
struct sfx_s *sound_precache[MAX_SOUNDS];
char levelname[40]; // for display on solo scoreboard
// refresh related state
struct model_s *worldmodel; // cl_entitites[0].model
struct efrag_s *free_efrags;
int num_statics; // held in cl_staticentities array
int cdtrack; // cd audio
entity_t viewent; // weapon model
int playernum;
int gametype;
int maxclients;
#ifdef QUAKEWORLD
// QW specific!
// all player information
player_info_t players[MAX_CLIENTS];
int servercount; // server identification for prespawns
char serverinfo[MAX_SERVERINFO_STRING];
int parsecount; // server message counter
int validsequence; // this is the sequence number of the last good
// packetentity_t we got. If this is 0, we can't
// render a frame yet
int spectator;
double last_ping_request; // while showing scoreboard
frame_t frames[UPDATE_BACKUP];
vec3_t simorg;
vec3_t simvel;
vec3_t simangles;
//
// information that is static for the entire time connected to a server
//
char model_name[MAX_MODELS][MAX_QPATH];
char sound_name[MAX_SOUNDS][MAX_QPATH];
#elif defined(UQUAKE)
// UQ specific.
int num_entities; // held in cl_entities array
float last_received_message; // (realtime) for net trouble icon
double mtime[2]; // the timestamp of last two messages
double oldtime; // previous cl.time, time-oldtime is used
// to decay light values and smooth step ups
qboolean onground;
qboolean inwater;
float viewheight;
float idealpitch;
// frag scoreboard
scoreboard_t *scores; // [cl.maxclients]
usercmd_t cmd; // last command sent to the server
int items; // inventory bit flags
vec3_t mviewangles[2]; // during demo playback viewangles is lerped
// between these
vec3_t mvelocity[2]; // update by server, used for lean+bob
// (0 is newest)
vec3_t velocity; // lerped between mvelocity[0] and [1]
#endif
} client_state_t;
extern client_state_t cl;
//
// cvars

View file

@ -1,4 +1,5 @@
/*
d_edge.c
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,11 +18,11 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// d_edge.c
#include "quakedef.h"
#include "d_local.h"
#include <quakedef.h>
#include <d_local.h>
#include <mathlib.h>
#include <client.h>
static int miplevel;

View file

@ -1,4 +1,5 @@
/*
host.c - coordinates spawning and killing of local servers
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,10 +18,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// host.c -- coordinates spawning and killing of local servers
#include "quakedef.h"
#include "r_local.h"
#include <quakedef.h>
#include <r_local.h>
#include <qtypes.h>
#include <console.h>
#include <lib_replace.h>
@ -41,6 +41,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <wad.h>
#include <protocol.h>
#include <mathlib.h>
#include <client.h>
#include <server.h>
/*

View file

@ -31,6 +31,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <screen.h>
#include <lib_replace.h>
#include <protocol.h>
#include <client.h>
#include <server.h>
#include <world.h>
extern cvar_t pausable;

View file

@ -20,6 +20,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <qstructs.h>
#include <qtypes.h>
#include <keys.h>
#include <draw.h>

View file

@ -1,4 +1,5 @@
/*
net.h - interface to the networking layer
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,11 +18,14 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// net.h -- quake's interface to the networking layer
#ifndef _NET_H
#define _NET_H
#include <cvar.h>
#include <qstructs.h>
#include <common.h>
struct qsockaddr
{
short sa_family;
@ -99,14 +103,15 @@ struct qsockaddr
// string value
// note:
// There are two address forms used above. The short form is just a
// port number. The address that goes along with the port is defined as
// "whatever address you receive this reponse from". This lets us use
// the host OS to solve the problem of multiple host addresses (possibly
// with no routing between them); the host will use the right address
// when we reply to the inbound connection request. The long from is
// a full address and port in a string. It is used for returning the
// address of a server that is not running locally.
// There are two address forms used above. The short form is just
// a port number. The address that goes along with the port is
// defined as "whatever address you receive this reponse from".
// This lets us use the host OS to solve the problem of multiple
// host addresses (possibly with no routing between them); the
// host will use the right address when we reply to the inbound
// connection request. The long from is a full address and port
// in a string. It is used for returning the address of a server
// that is not running locally.
#define CCREQ_CONNECT 0x01
#define CCREQ_SERVER_INFO 0x02
@ -119,6 +124,45 @@ struct qsockaddr
#define CCREP_PLAYER_INFO 0x84
#define CCREP_RULE_INFO 0x85
typedef struct {
qboolean fatal_error;
float last_received;
float frame_latency;
float frame_rate;
int drop_count;
int good_count;
#ifdef QUAKEWORLD
netadr_t remote_address;
int qport;
#endif
double cleartime;
double rate;
int incoming_sequence;
int incoming_acknowledged;
int incoming_reliable_acknowledged;
int incoming_reliable_sequence;
int outgoing_sequence;
int outgoing_reliable;
int last_reliable_sequence;
sizebuf_t message;
byte message_bug[MAX_MSGLEN];
int reliable_length;
byte reliable_buf[MAX_MSGLEN];
#ifdef QUAKEWORLD
int outgoing_size[MAX_LATENT];
int outgoing_time[MAX_LATENT];
#endif
} netchan_t;
typedef struct qsocket_s
{
struct qsocket_s *next;

View file

@ -1,4 +1,5 @@
/*
net_dgrm.c
Copyright (C) 1996-1997 Id Software, Inc.
Portions Copyright (C) 1999,2000 Nelson Rush.
@ -18,7 +19,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// net_dgrm.c
// This is enables a simple IP banning mechanism
#define BAN_TEST
@ -53,8 +53,10 @@ unsigned long inet_addr(const char *cp);
#endif
#endif // BAN_TEST
#include "quakedef.h"
#include "net_dgrm.h"
#include <quakedef.h>
#include <client.h>
#include <server.h>
#include <net_dgrm.h>
#include <qtypes.h>
#include <cmd.h>
#include <lib_replace.h>

View file

@ -1,4 +1,5 @@
/*
net_loop.c
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,10 +18,11 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// net_loop.c
#include "quakedef.h"
#include "net_loop.h"
#include <quakedef.h>
#include <client.h>
#include <server.h>
#include <net_loop.h>
#include <lib_replace.h>
#include <sys.h>
#include <console.h>

View file

@ -1,4 +1,5 @@
/*
net_main.c
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,10 +18,11 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// net_main.c
#include "quakedef.h"
#include "net_vcr.h"
#include <quakedef.h>
#include <client.h>
#include <server.h>
#include <net_vcr.h>
#include <qtypes.h>
#include <net.h>
#include <sys.h>

View file

@ -1,4 +1,5 @@
/*
net_vcr.c
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,10 +18,11 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// net_vcr.c
#include "quakedef.h"
#include "net_vcr.h"
#include <quakedef.h>
#include <client.h>
#include <server.h>
#include <net_vcr.h>
#include <sys.h>
extern int vcrFile;

View file

@ -180,10 +180,10 @@ typedef struct
#include <common_quakedef.h>
#include "progs.h"
#include "server.h"
//#include "progs.h"
//#include "server.h"
#include "world.h"
//#include "world.h"
void Host_ClearMemory (void);

View file

@ -1,4 +1,5 @@
/*
r_misc.c
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,10 +18,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// r_misc.c
#include "quakedef.h"
#include "r_local.h"
#include <quakedef.h>
#include <r_local.h>
#include <mathlib.h>
#include <sys.h>
#include <console.h>
@ -28,6 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <cvars.h>
#include <view.h>
#include <sbar.h>
#include <console.h>
#include <server.h>
/*

View file

@ -19,11 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "quakedef.h"
#include "r_local.h"
#include <quakedef.h>
#include <r_local.h>
#include <mathlib.h>
#include <lib_replace.h>
#include <console.h>
#include <server.h>
#define MAX_PARTICLES 2048 // default max # of particles at one
// time

View file

@ -1,4 +1,5 @@
/*
sv_main.c - server main program
Copyright (C) 1996-1997 Id Software, Inc.
Portions Copyright (C) 1999,2000 Nelson Rush.
@ -18,9 +19,11 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// sv_main.c -- server main program
#include "quakedef.h"
#include <quakedef.h>
#include <client.h>
#include <server.h>
#include <world.h>
#include <qtypes.h>
#include <cvar.h>
#include <protocol.h>

View file

@ -1,4 +1,5 @@
/*
sv_move.c - monster movement
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,10 +18,12 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// sv_move.c -- monster movement
#include "quakedef.h"
#include <quakedef.h>
#include <mathlib.h>
#include <client.h>
#include <server.h>
#include <world.h>
#define STEPSIZE 18

View file

@ -1,4 +1,5 @@
/*
sv_phys.c
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,13 +18,15 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// sv_phys.c
#include "quakedef.h"
#include <quakedef.h>
#include <qtypes.h>
#include <console.h>
#include <mathlib.h>
#include <sys.h>
#include <client.h>
#include <server.h>
#include <world.h>
/*

View file

@ -1,4 +1,5 @@
/*
sv_user.c - server code for moving users
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,9 +18,8 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// sv_user.c -- server code for moving users
#include "quakedef.h"
#include <quakedef.h>
#include <qtypes.h>
#include <mathlib.h>
#include <lib_replace.h>
@ -30,6 +30,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <cmd.h>
#include <keys.h>
#include <protocol.h>
#include <client.h>
#include <server.h>
#include <world.h>
edict_t *sv_player;

View file

@ -1,4 +1,5 @@
/*
sw_cl_parse.c - parse a message received from the server (software renderer)
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,12 +18,13 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// cl_parse.c -- parse a message received from the server
#include "quakedef.h"
#include <quakedef.h>
#include <protocol.h>
#include <mathlib.h>
#include <sys.h>
#include <client.h>
#include <server.h>
entity_t *CL_EntityNum (int num);

View file

@ -1,4 +1,5 @@
/*
world.c - world query functions
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,13 +18,15 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// world.c -- world query functions
#include "quakedef.h"
#include <quakedef.h>
#include <qtypes.h>
#include <sys.h>
#include <mathlib.h>
#include <console.h>
#include <client.h>
#include <server.h>
#include <world.h>
/*

View file

@ -1,4 +1,5 @@
/*
world.h
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
@ -17,7 +18,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// world.h
#ifndef _WORLD_H
#define _WORLD_H