uquake compile updates..

This commit is contained in:
Zephaniah E. Hull 2000-01-28 01:03:09 +00:00
parent 3012055a7b
commit 63978c73c6
15 changed files with 102 additions and 155 deletions

View file

@ -21,13 +21,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// cmd.c -- Quake script command processing module
#include "quakedef.h"
#include "common.h"
#include "cmd.h"
#include "console.h"
#include "cvar.h"
#include "sys.h"
#include "client.h"
#include <lib_replace.h>
#include <zone.h>
#include <string.h>
#include <common_quakedef.h>
void Cmd_ForwardToServer (void);

View file

@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* crc.c */
#include "quakedef.h"
#include <qtypes.h>
#include "crc.h"
// this is a 16 bit, non-reflected CRC using the polynomial 0x1021

View file

@ -22,18 +22,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// cvar.c -- dynamic variable tracking
#include <zone.h>
#include "qtypes.h"
#include "qstructs.h"
#include "lib_replace.h"
#include "console.h"
#include "common.h"
#include "cmd.h"
#include "client.h"
#ifdef SERVERONLY
#include "qwsvdef.h"
#else
#include "quakedef.h"
#ifdef UQUAKE
#include "server.h"
#endif
#include <string.h>
cvar_t *cvar_vars;
char *cvar_null_string = "";
@ -124,6 +123,7 @@ void SV_SendServerInfoChange(char *key, char *value);
Cvar_Set
============
*/
#if defined(QUAKEWORLD)
void Cvar_Set (char *var_name, char *value)
{
cvar_t *var;
@ -160,6 +160,33 @@ void Cvar_Set (char *var_name, char *value)
Q_strcpy (var->string, value);
var->value = Q_atof (var->string);
}
#elif defined(UQUAKE)
void Cvar_Set (char *var_name, char *value)
{
cvar_t *var;
qboolean changed;
var = Cvar_FindVar (var_name);
if (!var)
{ // there is an error in C code if this happens
Con_Printf ("Cvar_Set: variable %s not found\n", var_name);
return;
}
changed = Q_strcmp(var->string, value);
Z_Free (var->string); // free the old value string
var->string = Z_Malloc (Q_strlen(value)+1);
Q_strcpy (var->string, value);
var->value = Q_atof (var->string);
if (var->server && changed)
{
if (sv.active)
SV_BroadcastPrintf ("\"%s\" changed to \"%s\"\n", var->name, var->string);
}
}
#endif
/*
============

View file

@ -22,6 +22,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// this file is shared by quake and qcc
#ifndef _PR_COMP_H
#define _PR_COMP_H
typedef enum {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t;
@ -177,3 +180,4 @@ typedef struct
int entityfields;
} dprograms_t;
#endif // _PR_COMP_H

View file

@ -20,6 +20,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _PROGS_H
#define _PROGS_H
#include "pr_comp.h" // defs shared with qcc
#include "progdefs.h" // generated by program cdefs
@ -148,3 +151,4 @@ extern int num_prstr;
char *PR_GetString(int num);
int PR_SetString(char *s);
#endif // _PROGS_H

View file

@ -25,13 +25,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdio.h>
#include <sys/types.h>
#define MAX_QPATH 64
#define MAX_QPATH 64
#define MAX_CL_STATS 32
#define NUM_CSHIFTS 4
#define MAX_MODELS 256
#define MAX_SOUNDS 256
#define NUM_CSHIFTS 4
#define MAX_MODELS 256
#define MAX_SOUNDS 256
#define MAX_SCOREBOARDNAME 32
#define MAX_NUM_ARGVS 50
#define NUM_SAFE_ARGVS 7
#define MAX_NUM_ARGVS 50
#define NUM_SAFE_ARGVS 7
#define MAX_STYLESTRING 64
#define MAX_EDICTS 768
#define MAX_LIGHTSTYLES 64
#define MAX_DATAGRAM 1450
#define MAX_MSGLEN 1450
#define clc_stringcmd 4
#endif // _QDEFS_H

View file

@ -51,6 +51,7 @@ typedef struct cvar_s
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;

View file

@ -214,7 +214,7 @@ CL_COMMON_SRC = $(MISC_SRC) $(CL_GUI_SRC) $(CL_SRC) \
#
DEFS = @DEFS@
CFLAGS = @CFLAGS@ $(OPTFLAGS) $(DEFS) -I. $(SRC_DIR_INC) \
-I$(COMMON_ODIR) -I$(COMMON_DIR)
-I$(COMMON_ODIR) -I$(COMMON_DIR) -DUQUAKE
GENERAL_SRC = $(CL_COMMON_SRC) \
$(SYS_SRC) chasecam.c world.c $(SRV_PR_SRC) \

View file

@ -21,6 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef _CLIENT_H
#define _CLIENT_H
#include <qtypes.h>
#include <common.h>
#include <quakefs.h>
typedef struct
{
vec3_t viewangles;
@ -49,12 +54,6 @@ typedef struct
byte translations[VID_GRADES*256];
} scoreboard_t;
typedef struct
{
int destcolor[3];
int percent; // 0-256
} cshift_t;
#define CSHIFT_CONTENTS 0
#define CSHIFT_DAMAGE 1
#define CSHIFT_BONUS 2
@ -143,99 +142,6 @@ 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
usercmd_t cmd; // last command sent to the server
// information for local display
int stats[MAX_CL_STATS]; // health, etc
int items; // inventory bit flags
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. The server sets punchangle when
// the view is temporarliy offset, and an angle reset commands at the start
// of each level and after teleporting.
vec3_t mviewangles[2]; // during demo playback viewangles is lerped
// between these
vec3_t viewangles;
vec3_t mvelocity[2]; // update by server, used for lean+bob
// (0 is newest)
vec3_t velocity; // lerped between mvelocity[0] and [1]
vec3_t punchangle; // temporary offset
// pitch drifting vars
float idealpitch;
float pitchvel;
qboolean nodrift;
float driftmove;
double laststop;
float viewheight;
float crouch; // local amount for smoothing stepups
qboolean paused; // send over by server
qboolean onground;
qboolean inwater;
int intermission; // don't change view angle, full screen, etc
int completed_time; // latched at intermission start
double mtime[2]; // the timestamp of last two messages
double time; // clients view of time, should be between
// servertime and oldservertime to generate
// a lerp point for other data
double oldtime; // previous cl.time, time-oldtime is used
// to decay light values and smooth step ups
float last_received_message; // (realtime) for net trouble icon
//
// 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
int viewentity; // cl_entitites[cl.viewentity] = player
int maxclients;
int gametype;
// refresh related state
struct model_s *worldmodel; // cl_entitites[0].model
struct efrag_s *free_efrags;
int num_entities; // held in cl_entities array
int num_statics; // held in cl_staticentities array
entity_t viewent; // the gun model
int cdtrack, looptrack; // cd audio
// frag scoreboard
scoreboard_t *scores; // [cl.maxclients]
#ifdef QUAKE2
// light level at player's position including dlights
// this is sent back to the server each frame
// architectually ugly but it works
int light_level;
#endif
} client_state_t;
//
// cvars
@ -278,8 +184,6 @@ extern cvar_t _windowed_mouse;
#define MAX_TEMP_ENTITIES 64 // lightning bolts, etc
#define MAX_STATIC_ENTITIES 128 // torches, etc
extern client_state_t cl;
// FIXME, allocate dynamically
extern efrag_t cl_efrags[MAX_EFRAGS];
extern entity_t cl_entities[MAX_EDICTS];

View file

@ -22,8 +22,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// common.c -- misc functions used in client and server
#include "quakedef.h"
#include <string.h>
#include <qtypes.h>
#include <qdefs.h>
#include <cvar.h>
#include <quakefs.h>
#include <common.h>
#include <net.h>
#include <zone.h>
#include <sys.h>
#include <qendian.h>
#include <console.h>
#include <cmd.h>
#include <stdarg.h>
#include <lib_replace.h>
#define NUM_SAFE_ARGVS 7

View file

@ -19,17 +19,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// comndef.h -- general definitions
#ifndef _COMMON_H
#define _COMMON_H
#include <register_check.h>
#if !defined BYTE_DEFINED
typedef unsigned char byte;
#define BYTE_DEFINED 1
#endif
#undef true
#undef false
typedef enum {false, true} qboolean;
#include <qtypes.h>
//============================================================================
@ -134,23 +128,6 @@ float MSG_ReadAngle (void);
//============================================================================
void Q_memset (void *dest, int fill, int count);
void Q_memcpy (void *dest, void *src, int count);
int Q_memcmp (void *m1, void *m2, int count);
void Q_strcpy (char *dest, char *src);
void Q_strncpy (char *dest, char *src, int count);
int Q_strlen (char *str);
char *Q_strrchr (char *s, char c);
void Q_strcat (char *dest, char *src);
int Q_strcmp (char *s1, char *s2);
int Q_strncmp (char *s1, char *s2, int count);
int Q_strcasecmp (char *s1, char *s2);
int Q_strncasecmp (char *s1, char *s2, int n);
int Q_atoi (char *str);
float Q_atof (char *str);
//============================================================================
extern char com_token[1024];
extern qboolean com_eof;
@ -178,16 +155,11 @@ char *va(char *format, ...);
extern int com_filesize;
struct cache_user_s;
extern char com_gamedir[MAX_OSPATH];
void COM_WriteFile (char *filename, void *data, int len);
int COM_OpenFile (char *filename, int *hndl);
int COM_FOpenFile (char *filename, FILE **file);
void COM_CloseFile (int h);
byte *COM_LoadStackFile (char *path, void *buffer, int bufsize);
byte *COM_LoadTempFile (char *path);
byte *COM_LoadHunkFile (char *path);
void COM_LoadCacheFile (char *path, struct cache_user_s *cu);
extern qboolean standard_quake, rogue, hipnotic;
#endif // _COMMON_H

View file

@ -1,4 +1,7 @@
#ifndef _PROGDEFS_H
#define _PROGDEFS_H
/* file generated by qcc, do not modify */
typedef struct
@ -141,3 +144,5 @@ typedef struct
} entvars_t;
#define PROGHEADER_CRC 5927
#endif // _PROGDEFS_H

View file

@ -65,13 +65,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define ON_EPSILON 0.1 // point on plane side epsilon
#define MAX_MSGLEN 8000 // max length of a reliable message
#define MAX_DATAGRAM 1024 // max length of unreliable message
//
// per-level limits
//
#define MAX_EDICTS 600 // FIXME: ouch! ouch! ouch!
#define MAX_LIGHTSTYLES 64
#define MAX_MODELS 256 // these are sent over the net as bytes
#define MAX_SOUNDS 256 // so they cannot be blindly increased

View file

@ -19,6 +19,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// server.h
#include <qtypes.h>
#include <progs.h>
#include <setjmp.h>
typedef struct
{
int maxclients;

View file

@ -19,6 +19,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// world.h
#ifndef _WORLD_H
#define _WORLD_H
#include <model.h>
typedef struct
{
vec3_t normal;
@ -78,3 +83,5 @@ trace_t SV_Move (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type, e
// passedict is explicitly excluded from clipping checks (normally NULL)
qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace);
#endif // _WORLD_H