mirror of
https://git.code.sf.net/p/quake/nuq
synced 2024-11-21 19:51:09 +00:00
prelim header changes. doesn't build yet
This commit is contained in:
parent
0a132a2933
commit
2718705414
30 changed files with 305 additions and 351 deletions
|
@ -26,7 +26,10 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __bspfile_h
|
||||
#define __bspfile_h
|
||||
|
||||
#include "qtypes.h"
|
||||
|
||||
// upper design bounds
|
||||
|
||||
|
@ -299,7 +302,7 @@ void PrintBSPFileSizes (void);
|
|||
|
||||
//===============
|
||||
|
||||
|
||||
/*
|
||||
typedef struct epair_s
|
||||
{
|
||||
struct epair_s *next;
|
||||
|
@ -329,5 +332,7 @@ vec_t FloatForKey (entity_t *ent, char *key);
|
|||
void GetVectorForKey (entity_t *ent, char *key, vec3_t vec);
|
||||
|
||||
epair_t *ParseEpair (void);
|
||||
|
||||
*/
|
||||
#endif
|
||||
|
||||
#endif // __bspfile_h
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
cdaudio.h
|
||||
|
||||
@description@
|
||||
Redbook CD Audio function prototypes
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -26,6 +26,9 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __cdaudio_h
|
||||
#define __cdaudio_h
|
||||
|
||||
|
||||
int CDAudio_Init(void);
|
||||
void CDAudio_Play(byte track, qboolean looping);
|
||||
|
@ -35,4 +38,4 @@ void CDAudio_Resume(void);
|
|||
void CDAudio_Shutdown(void);
|
||||
void CDAudio_Update(void);
|
||||
|
||||
extern cvar_t *bgmvolume;
|
||||
#endif // __cdaudio_h
|
||||
|
|
|
@ -26,6 +26,20 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __client_h
|
||||
#define __client_h
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "info.h"
|
||||
#include "mathlib.h"
|
||||
#include "protocol.h"
|
||||
#include "net.h"
|
||||
#include "model.h"
|
||||
#include "sound.h"
|
||||
#include "render.h"
|
||||
#include "cvar.h"
|
||||
#include "quakefs.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -382,3 +396,5 @@ void V_SetContentsColor (int contents);
|
|||
//
|
||||
void CL_InitTEnts (void);
|
||||
void CL_SignonReply (void);
|
||||
|
||||
#endif // __client_h
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
#ifndef __cmd_h
|
||||
#define __cmd_h
|
||||
|
||||
#include "qtypes.h"
|
||||
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
|
|
151
include/common.h
151
include/common.h
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
common.h
|
||||
sizebuf.h
|
||||
|
||||
@description@
|
||||
|
||||
|
@ -26,18 +26,8 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
|
||||
#if !defined BYTE_DEFINED
|
||||
typedef unsigned char byte;
|
||||
#define BYTE_DEFINED 1
|
||||
#endif
|
||||
|
||||
#undef true
|
||||
#undef false
|
||||
|
||||
typedef enum {false, true} qboolean;
|
||||
|
||||
//============================================================================
|
||||
#ifndef __sizebuf_h
|
||||
#define __sizebuf_h
|
||||
|
||||
typedef struct sizebuf_s
|
||||
{
|
||||
|
@ -55,137 +45,4 @@ void *SZ_GetSpace (sizebuf_t *buf, int length);
|
|||
void SZ_Write (sizebuf_t *buf, void *data, int length);
|
||||
void SZ_Print (sizebuf_t *buf, char *data); // strcats onto the sizebuf
|
||||
|
||||
//============================================================================
|
||||
|
||||
typedef struct link_s
|
||||
{
|
||||
struct link_s *prev, *next;
|
||||
} link_t;
|
||||
|
||||
|
||||
void ClearLink (link_t *l);
|
||||
void RemoveLink (link_t *l);
|
||||
void InsertLinkBefore (link_t *l, link_t *before);
|
||||
void InsertLinkAfter (link_t *l, link_t *after);
|
||||
|
||||
// (type *)STRUCT_FROM_LINK(link_t *link, type, member)
|
||||
// ent = STRUCT_FROM_LINK(link,entity_t,order)
|
||||
// FIXME: remove this mess!
|
||||
#define STRUCT_FROM_LINK(l,t,m) ((t *)((byte *)l - (int)&(((t *)0)->m)))
|
||||
|
||||
//============================================================================
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL ((void *)0)
|
||||
#endif
|
||||
|
||||
#define Q_MAXCHAR ((char)0x7f)
|
||||
#define Q_MAXSHORT ((short)0x7fff)
|
||||
#define Q_MAXINT ((int)0x7fffffff)
|
||||
#define Q_MAXLONG ((int)0x7fffffff)
|
||||
#define Q_MAXFLOAT ((int)0x7fffffff)
|
||||
|
||||
#define Q_MINCHAR ((char)0x80)
|
||||
#define Q_MINSHORT ((short)0x8000)
|
||||
#define Q_MININT ((int)0x80000000)
|
||||
#define Q_MINLONG ((int)0x80000000)
|
||||
#define Q_MINFLOAT ((int)0x7fffffff)
|
||||
|
||||
//============================================================================
|
||||
|
||||
extern qboolean bigendien;
|
||||
|
||||
extern short (*BigShort) (short l);
|
||||
extern short (*LittleShort) (short l);
|
||||
extern int (*BigLong) (int l);
|
||||
extern int (*LittleLong) (int l);
|
||||
extern float (*BigFloat) (float l);
|
||||
extern float (*LittleFloat) (float l);
|
||||
|
||||
//============================================================================
|
||||
|
||||
void MSG_WriteChar (sizebuf_t *sb, int c);
|
||||
void MSG_WriteByte (sizebuf_t *sb, int c);
|
||||
void MSG_WriteShort (sizebuf_t *sb, int c);
|
||||
void MSG_WriteLong (sizebuf_t *sb, int c);
|
||||
void MSG_WriteFloat (sizebuf_t *sb, float f);
|
||||
void MSG_WriteString (sizebuf_t *sb, char *s);
|
||||
void MSG_WriteCoord (sizebuf_t *sb, float f);
|
||||
void MSG_WriteAngle (sizebuf_t *sb, float f);
|
||||
|
||||
extern int msg_readcount;
|
||||
extern qboolean msg_badread; // set if a read goes beyond end of message
|
||||
|
||||
void MSG_BeginReading (void);
|
||||
int MSG_ReadChar (void);
|
||||
int MSG_ReadByte (void);
|
||||
int MSG_ReadShort (void);
|
||||
int MSG_ReadLong (void);
|
||||
float MSG_ReadFloat (void);
|
||||
char *MSG_ReadString (void);
|
||||
|
||||
float MSG_ReadCoord (void);
|
||||
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;
|
||||
|
||||
char *COM_Parse (char *data);
|
||||
|
||||
|
||||
extern int com_argc;
|
||||
extern char **com_argv;
|
||||
|
||||
int COM_CheckParm (char *parm);
|
||||
void COM_Init (char *path);
|
||||
void COM_InitArgv (int argc, char **argv);
|
||||
|
||||
char *COM_SkipPath (char *pathname);
|
||||
void COM_StripExtension (char *in, char *out);
|
||||
void COM_FileBase (char *in, char *out);
|
||||
void COM_DefaultExtension (char *path, char *extension);
|
||||
|
||||
char *va(char *format, ...);
|
||||
// does a varargs printf into a temp buffer
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
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 struct cvar_s *registered;
|
||||
|
||||
extern qboolean standard_quake, rogue, hipnotic;
|
||||
#endif // __sizebuf_h
|
||||
|
|
|
@ -26,14 +26,11 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __mathlib_h
|
||||
#define __mathlib_h
|
||||
|
||||
typedef float vec_t;
|
||||
typedef vec_t vec3_t[3];
|
||||
typedef vec_t vec5_t[5];
|
||||
|
||||
typedef int fixed4_t;
|
||||
typedef int fixed8_t;
|
||||
typedef int fixed16_t;
|
||||
#include <math.h>
|
||||
#include "qtypes.h"
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
|
||||
|
@ -95,3 +92,5 @@ float anglemod(float a);
|
|||
) \
|
||||
: \
|
||||
BoxOnPlaneSide( (emins), (emaxs), (p)))
|
||||
|
||||
#endif // __mathlib_h
|
||||
|
|
|
@ -27,11 +27,15 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef __MODEL__
|
||||
#define __MODEL__
|
||||
#ifndef __model_h
|
||||
#define __model_h
|
||||
|
||||
#include "modelgen.h"
|
||||
#include "qtypes.h"
|
||||
#include "render.h"
|
||||
#include "bspfile.h"
|
||||
#include "spritegn.h"
|
||||
#include "modelgen.h"
|
||||
#include "zone.h"
|
||||
|
||||
/*
|
||||
|
||||
|
@ -388,4 +392,4 @@ void Mod_TouchModel (char *name);
|
|||
mleaf_t *Mod_PointInLeaf (float *p, model_t *model);
|
||||
byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model);
|
||||
|
||||
#endif // __MODEL__
|
||||
#endif // __model_h
|
||||
|
|
|
@ -26,6 +26,12 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __net_h
|
||||
#define __net_h
|
||||
|
||||
#include "gcc_attr.h"
|
||||
#include "sizebuf.h"
|
||||
#include "cvar.h"
|
||||
|
||||
struct qsockaddr
|
||||
{
|
||||
|
@ -352,3 +358,5 @@ extern cvar_t *config_modem_clear;
|
|||
extern cvar_t *config_modem_init;
|
||||
extern cvar_t *config_modem_hangup;
|
||||
extern cvar_t *hostname;
|
||||
|
||||
#endif // __net_h
|
||||
|
|
|
@ -26,6 +26,10 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __net_udp_h
|
||||
#define __net_udp_h
|
||||
|
||||
#include "qtypes.h"
|
||||
|
||||
int UDP_Init (void);
|
||||
void UDP_Shutdown (void);
|
||||
|
@ -45,3 +49,5 @@ int UDP_GetAddrFromName (char *name, struct qsockaddr *addr);
|
|||
int UDP_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2);
|
||||
int UDP_GetSocketPort (struct qsockaddr *addr);
|
||||
int UDP_SetSocketPort (struct qsockaddr *addr, int port);
|
||||
|
||||
#endif // __net_udp_h
|
||||
|
|
|
@ -29,9 +29,6 @@
|
|||
|
||||
// this file is shared by quake and qcc
|
||||
|
||||
typedef int func_t;
|
||||
typedef int string_t;
|
||||
|
||||
typedef enum {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t;
|
||||
|
||||
|
||||
|
|
|
@ -26,9 +26,15 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __progs_h
|
||||
#define __progs_h
|
||||
|
||||
#include "gcc_attr.h"
|
||||
#include "protocol.h"
|
||||
#include "pr_comp.h" // defs shared with qcc
|
||||
#include "progdefs.h" // generated by program cdefs
|
||||
#include "link.h"
|
||||
|
||||
|
||||
typedef union eval_s
|
||||
{
|
||||
|
@ -141,3 +147,4 @@ void ED_PrintNum (int ent);
|
|||
|
||||
eval_t *GetEdictFieldValue(edict_t *ed, char *field);
|
||||
|
||||
#endif // __progs_h
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __protocol_h
|
||||
#define __protocol_h
|
||||
|
||||
#define PROTOCOL_VERSION 15
|
||||
|
||||
|
@ -173,3 +175,16 @@
|
|||
#define TE_IMPLOSION 14
|
||||
#define TE_RAILTRAIL 15
|
||||
#endif
|
||||
|
||||
typedef struct entity_state_s
|
||||
{
|
||||
vec3_t origin;
|
||||
vec3_t angles;
|
||||
int modelindex;
|
||||
int frame;
|
||||
int colormap;
|
||||
int skin;
|
||||
int effects;
|
||||
} entity_state_t;
|
||||
|
||||
#endif // __protocol_h
|
||||
|
|
|
@ -204,25 +204,13 @@ void VID_UnlockBuffer (void);
|
|||
// Use for multiplayer testing only - VERY dangerous!!!
|
||||
// #define IDGODS
|
||||
|
||||
#include "common.h"
|
||||
//#include "common.h"
|
||||
#include "bspfile.h"
|
||||
#include "vid.h"
|
||||
#include "sys.h"
|
||||
#include "zone.h"
|
||||
#include "mathlib.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3_t origin;
|
||||
vec3_t angles;
|
||||
int modelindex;
|
||||
int frame;
|
||||
int colormap;
|
||||
int skin;
|
||||
int effects;
|
||||
} entity_state_t;
|
||||
|
||||
|
||||
#include "wad.h"
|
||||
#include "draw.h"
|
||||
#include "cvar.h"
|
||||
|
@ -257,27 +245,6 @@ typedef struct
|
|||
#include "glquake.h"
|
||||
#endif
|
||||
|
||||
//=============================================================================
|
||||
|
||||
// the host system specifies the base of the directory tree, the
|
||||
// command line parms passed to the program, and the amount of memory
|
||||
// available for the program to use
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *basedir;
|
||||
char *cachedir; // for development over ISDN lines
|
||||
int argc;
|
||||
char **argv;
|
||||
void *membase;
|
||||
int memsize;
|
||||
} quakeparms_t;
|
||||
|
||||
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
extern qboolean noclip_anglehack;
|
||||
|
||||
|
||||
|
|
|
@ -26,6 +26,12 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __render_h
|
||||
#define __render_h
|
||||
|
||||
#include "mathlib.h"
|
||||
#include "cvar.h"
|
||||
#include "vid.h"
|
||||
|
||||
#define MAXCLIPPLANES 11
|
||||
|
||||
|
@ -163,3 +169,4 @@ void D_DeleteSurfaceCache (void);
|
|||
void D_InitCaches (void *buffer, int size);
|
||||
void R_SetVrect (vrect_t *pvrect, vrect_t *pvrectin, int lineadj);
|
||||
|
||||
#endif // __render_h
|
||||
|
|
|
@ -26,6 +26,22 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __server_h
|
||||
#define __server_h
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
#include "gcc_attr.h"
|
||||
#include "commdef.h"
|
||||
#include "net.h"
|
||||
#include "cvar.h"
|
||||
#include "protocol.h"
|
||||
#include "model.h"
|
||||
#include "progs.h"
|
||||
#include "sizebuf.h"
|
||||
#include "info.h"
|
||||
#include "quakeio.h"
|
||||
#include "client.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -277,3 +293,5 @@ void SV_SpawnServer (char *server, char *startspot);
|
|||
#else
|
||||
void SV_SpawnServer (char *server);
|
||||
#endif
|
||||
|
||||
#endif // __server_h
|
||||
|
|
|
@ -27,8 +27,12 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef __SOUND__
|
||||
#define __SOUND__
|
||||
#ifndef __sound_h
|
||||
#define __sound_h
|
||||
|
||||
#include "mathlib.h"
|
||||
#include "cvar.h"
|
||||
#include "zone.h"
|
||||
|
||||
#define DEFAULT_SOUND_PACKET_VOLUME 255
|
||||
#define DEFAULT_SOUND_PACKET_ATTENUATION 1.0
|
||||
|
@ -183,4 +187,4 @@ void SNDDMA_Submit(void);
|
|||
void S_AmbientOff (void);
|
||||
void S_AmbientOn (void);
|
||||
|
||||
#endif
|
||||
#endif // __sound_h
|
||||
|
|
|
@ -26,13 +26,12 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __vid_h
|
||||
#define __vid_h
|
||||
|
||||
#define VID_CBITS 6
|
||||
#define VID_GRADES (1 << VID_CBITS)
|
||||
|
||||
// a pixel can be one, two, or four bytes
|
||||
typedef byte pixel_t;
|
||||
|
||||
typedef struct vrect_s
|
||||
{
|
||||
int x,y,width,height;
|
||||
|
@ -92,3 +91,4 @@ int VID_SetMode (int modenum, unsigned char *palette);
|
|||
void VID_HandlePause (qboolean pause);
|
||||
// called only on Win32, when pause happens, so the mouse can be released
|
||||
|
||||
#endif // __vid_h
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __zone_h
|
||||
#define __zone_h
|
||||
|
||||
/*
|
||||
memory allocation
|
||||
|
||||
|
@ -136,5 +139,4 @@ void *Cache_Alloc (cache_user_t *c, int size, char *name);
|
|||
|
||||
void Cache_Report (void);
|
||||
|
||||
|
||||
|
||||
#endif // __zone_h
|
||||
|
|
|
@ -48,7 +48,7 @@ sound_ASM= snd_mixa.S
|
|||
common_ASM= sys_ia32.S worlda.S $(math_ASM)
|
||||
#endif
|
||||
|
||||
common_SOURCES= crc.c common.c cvar.c cmd.c mathlib.c wad.c world.c \
|
||||
common_SOURCES= crc.c cvar.c cmd.c mathlib.c wad.c world.c \
|
||||
zone.c $(common_ASM)
|
||||
|
||||
#
|
||||
|
|
|
@ -43,7 +43,12 @@
|
|||
|
||||
#include <linux/cdrom.h>
|
||||
|
||||
#include "quakedef.h"
|
||||
#include "qargs.h"
|
||||
#include "cmd.h"
|
||||
#include "cdaudio.h"
|
||||
#include "console.h"
|
||||
#include "sound.h"
|
||||
#include "client.h"
|
||||
|
||||
static qboolean cdValid = false;
|
||||
static qboolean playing = false;
|
||||
|
@ -228,13 +233,13 @@ static void CD_f (void)
|
|||
|
||||
command = Cmd_Argv (1);
|
||||
|
||||
if (Q_strcasecmp(command, "on") == 0)
|
||||
if (strcasecmp(command, "on") == 0)
|
||||
{
|
||||
enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "off") == 0)
|
||||
if (strcasecmp(command, "off") == 0)
|
||||
{
|
||||
if (playing)
|
||||
CDAudio_Stop();
|
||||
|
@ -242,7 +247,7 @@ static void CD_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "reset") == 0)
|
||||
if (strcasecmp(command, "reset") == 0)
|
||||
{
|
||||
enabled = true;
|
||||
if (playing)
|
||||
|
@ -253,7 +258,7 @@ static void CD_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "remap") == 0)
|
||||
if (strcasecmp(command, "remap") == 0)
|
||||
{
|
||||
ret = Cmd_Argc() - 2;
|
||||
if (ret <= 0)
|
||||
|
@ -264,11 +269,11 @@ static void CD_f (void)
|
|||
return;
|
||||
}
|
||||
for (n = 1; n <= ret; n++)
|
||||
remap[n] = Q_atoi(Cmd_Argv (n+1));
|
||||
remap[n] = atoi(Cmd_Argv (n+1));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "close") == 0)
|
||||
if (strcasecmp(command, "close") == 0)
|
||||
{
|
||||
CDAudio_CloseDoor();
|
||||
return;
|
||||
|
@ -284,37 +289,37 @@ static void CD_f (void)
|
|||
}
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "play") == 0)
|
||||
if (strcasecmp(command, "play") == 0)
|
||||
{
|
||||
CDAudio_Play((byte)Q_atoi(Cmd_Argv (2)), false);
|
||||
CDAudio_Play((byte)atoi(Cmd_Argv (2)), false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "loop") == 0)
|
||||
if (strcasecmp(command, "loop") == 0)
|
||||
{
|
||||
CDAudio_Play((byte)Q_atoi(Cmd_Argv (2)), true);
|
||||
CDAudio_Play((byte)atoi(Cmd_Argv (2)), true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "stop") == 0)
|
||||
if (strcasecmp(command, "stop") == 0)
|
||||
{
|
||||
CDAudio_Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "pause") == 0)
|
||||
if (strcasecmp(command, "pause") == 0)
|
||||
{
|
||||
CDAudio_Pause();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "resume") == 0)
|
||||
if (strcasecmp(command, "resume") == 0)
|
||||
{
|
||||
CDAudio_Resume();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "eject") == 0)
|
||||
if (strcasecmp(command, "eject") == 0)
|
||||
{
|
||||
if (playing)
|
||||
CDAudio_Stop();
|
||||
|
@ -323,7 +328,7 @@ static void CD_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "info") == 0)
|
||||
if (strcasecmp(command, "info") == 0)
|
||||
{
|
||||
Con_Printf("%u tracks\n", maxTrack);
|
||||
if (playing)
|
||||
|
|
51
source/cmd.c
51
source/cmd.c
|
@ -30,7 +30,18 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <string.h>
|
||||
|
||||
#include "cmd.h"
|
||||
#include "client.h"
|
||||
#include "msg.h"
|
||||
#include "quakefs.h"
|
||||
#include "qargs.h"
|
||||
#include "zone.h"
|
||||
#include "console.h"
|
||||
#include "sys.h"
|
||||
#include "sizebuf.h"
|
||||
#include "cvar.h"
|
||||
|
||||
void Cmd_ForwardToServer (void);
|
||||
|
||||
|
@ -98,7 +109,7 @@ void Cbuf_AddText (char *text)
|
|||
{
|
||||
int l;
|
||||
|
||||
l = Q_strlen (text);
|
||||
l = strlen (text);
|
||||
|
||||
if (cmd_text.cursize + l >= cmd_text.maxsize)
|
||||
{
|
||||
|
@ -106,7 +117,7 @@ void Cbuf_AddText (char *text)
|
|||
return;
|
||||
}
|
||||
|
||||
SZ_Write (&cmd_text, text, Q_strlen (text));
|
||||
SZ_Write (&cmd_text, text, strlen (text));
|
||||
}
|
||||
|
||||
|
||||
|
@ -129,7 +140,7 @@ void Cbuf_InsertText (char *text)
|
|||
if (templen)
|
||||
{
|
||||
temp = Z_Malloc (templen);
|
||||
Q_memcpy (temp, cmd_text.data, templen);
|
||||
memcpy (temp, cmd_text.data, templen);
|
||||
SZ_Clear (&cmd_text);
|
||||
}
|
||||
else
|
||||
|
@ -188,7 +199,7 @@ void Cbuf_Execute (void)
|
|||
{
|
||||
i++;
|
||||
cmd_text.cursize -= i;
|
||||
Q_memcpy (text, text+i, cmd_text.cursize);
|
||||
memcpy (text, text+i, cmd_text.cursize);
|
||||
}
|
||||
|
||||
// execute the command line
|
||||
|
@ -239,7 +250,7 @@ void Cmd_StuffCmds_f (void)
|
|||
{
|
||||
if (!com_argv[i])
|
||||
continue; // NEXTSTEP nulls out -NXHost
|
||||
s += Q_strlen (com_argv[i]) + 1;
|
||||
s += strlen (com_argv[i]) + 1;
|
||||
}
|
||||
if (!s)
|
||||
return;
|
||||
|
@ -250,9 +261,9 @@ void Cmd_StuffCmds_f (void)
|
|||
{
|
||||
if (!com_argv[i])
|
||||
continue; // NEXTSTEP nulls out -NXHost
|
||||
Q_strcat (text,com_argv[i]);
|
||||
strcat (text,com_argv[i]);
|
||||
if (i != com_argc-1)
|
||||
Q_strcat (text, " ");
|
||||
strcat (text, " ");
|
||||
}
|
||||
|
||||
// pull out the commands
|
||||
|
@ -271,8 +282,8 @@ void Cmd_StuffCmds_f (void)
|
|||
c = text[j];
|
||||
text[j] = 0;
|
||||
|
||||
Q_strcat (build, text+i);
|
||||
Q_strcat (build, "\n");
|
||||
strcat (build, text+i);
|
||||
strcat (build, "\n");
|
||||
text[j] = c;
|
||||
i = j-1;
|
||||
}
|
||||
|
@ -526,8 +537,8 @@ void Cmd_TokenizeString (char *text)
|
|||
|
||||
if (cmd_argc < MAX_ARGS)
|
||||
{
|
||||
cmd_argv[cmd_argc] = Z_Malloc (Q_strlen(com_token)+1);
|
||||
Q_strcpy (cmd_argv[cmd_argc], com_token);
|
||||
cmd_argv[cmd_argc] = Z_Malloc (strlen(com_token)+1);
|
||||
strcpy (cmd_argv[cmd_argc], com_token);
|
||||
cmd_argc++;
|
||||
}
|
||||
}
|
||||
|
@ -557,7 +568,7 @@ void Cmd_AddCommand (char *cmd_name, xcommand_t function)
|
|||
// fail if the command already exists
|
||||
for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
|
||||
{
|
||||
if (!Q_strcmp (cmd_name, cmd->name))
|
||||
if (!strcmp (cmd_name, cmd->name))
|
||||
{
|
||||
Con_Printf ("Cmd_AddCommand: %s already defined\n", cmd_name);
|
||||
return;
|
||||
|
@ -582,7 +593,7 @@ qboolean Cmd_Exists (char *cmd_name)
|
|||
|
||||
for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
|
||||
{
|
||||
if (!Q_strcmp (cmd_name,cmd->name))
|
||||
if (!strcmp (cmd_name,cmd->name))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -601,14 +612,14 @@ char *Cmd_CompleteCommand (char *partial)
|
|||
cmd_function_t *cmd;
|
||||
int len;
|
||||
|
||||
len = Q_strlen(partial);
|
||||
len = strlen(partial);
|
||||
|
||||
if (!len)
|
||||
return NULL;
|
||||
|
||||
// check functions
|
||||
for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
|
||||
if (!Q_strncmp (partial,cmd->name, len))
|
||||
if (!strncmp (partial,cmd->name, len))
|
||||
return cmd->name;
|
||||
|
||||
return NULL;
|
||||
|
@ -637,7 +648,7 @@ void Cmd_ExecuteString (char *text, cmd_source_t src)
|
|||
// check functions
|
||||
for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
|
||||
{
|
||||
if (!Q_strcasecmp (cmd_argv[0],cmd->name))
|
||||
if (!strcasecmp (cmd_argv[0],cmd->name))
|
||||
{
|
||||
cmd->function ();
|
||||
return;
|
||||
|
@ -647,7 +658,7 @@ void Cmd_ExecuteString (char *text, cmd_source_t src)
|
|||
// check alias
|
||||
for (a=cmd_alias ; a ; a=a->next)
|
||||
{
|
||||
if (!Q_strcasecmp (cmd_argv[0], a->name))
|
||||
if (!strcasecmp (cmd_argv[0], a->name))
|
||||
{
|
||||
Cbuf_InsertText (a->value);
|
||||
return;
|
||||
|
@ -680,7 +691,7 @@ void Cmd_ForwardToServer (void)
|
|||
return; // not really connected
|
||||
|
||||
MSG_WriteByte (&cls.message, clc_stringcmd);
|
||||
if (Q_strcasecmp(Cmd_Argv(0), "cmd") != 0)
|
||||
if (strcasecmp(Cmd_Argv(0), "cmd") != 0)
|
||||
{
|
||||
SZ_Print (&cls.message, Cmd_Argv(0));
|
||||
SZ_Print (&cls.message, " ");
|
||||
|
@ -709,7 +720,7 @@ int Cmd_CheckParm (char *parm)
|
|||
Sys_Error ("Cmd_CheckParm: NULL");
|
||||
|
||||
for (i = 1; i < Cmd_Argc (); i++)
|
||||
if (! Q_strcasecmp (parm, Cmd_Argv (i)))
|
||||
if (! strcasecmp (parm, Cmd_Argv (i)))
|
||||
return i;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -30,6 +30,10 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "qendian.h"
|
||||
#include "msg.h"
|
||||
#include "qargs.h"
|
||||
|
||||
// This is enables a simple IP banning mechanism
|
||||
#define BAN_TEST
|
||||
|
||||
|
@ -140,8 +144,8 @@ void NET_Ban_f (void)
|
|||
case 1:
|
||||
if (((struct in_addr *)&banAddr)->s_addr)
|
||||
{
|
||||
Q_strcpy(addrStr, inet_ntoa(*(struct in_addr *)&banAddr));
|
||||
Q_strcpy(maskStr, inet_ntoa(*(struct in_addr *)&banMask));
|
||||
strcpy(addrStr, inet_ntoa(*(struct in_addr *)&banAddr));
|
||||
strcpy(maskStr, inet_ntoa(*(struct in_addr *)&banMask));
|
||||
print("Banning %s [%s]\n", addrStr, maskStr);
|
||||
}
|
||||
else
|
||||
|
@ -149,7 +153,7 @@ void NET_Ban_f (void)
|
|||
break;
|
||||
|
||||
case 2:
|
||||
if (Q_strcasecmp(Cmd_Argv(1), "off") == 0)
|
||||
if (strcasecmp(Cmd_Argv(1), "off") == 0)
|
||||
banAddr = 0x00000000;
|
||||
else
|
||||
banAddr = inet_addr(Cmd_Argv(1));
|
||||
|
@ -186,7 +190,7 @@ int Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data)
|
|||
Sys_Error("SendMessage: called with canSend == false\n");
|
||||
#endif
|
||||
|
||||
Q_memcpy(sock->sendMessage, data->data, data->cursize);
|
||||
memcpy(sock->sendMessage, data->data, data->cursize);
|
||||
sock->sendMessageLength = data->cursize;
|
||||
|
||||
if (data->cursize <= MAX_DATAGRAM)
|
||||
|
@ -203,7 +207,7 @@ int Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data)
|
|||
|
||||
packetBuffer.length = BigLong(packetLen | (NETFLAG_DATA | eom));
|
||||
packetBuffer.sequence = BigLong(sock->sendSequence++);
|
||||
Q_memcpy (packetBuffer.data, sock->sendMessage, dataLen);
|
||||
memcpy (packetBuffer.data, sock->sendMessage, dataLen);
|
||||
|
||||
sock->canSend = false;
|
||||
|
||||
|
@ -236,7 +240,7 @@ int SendMessageNext (qsocket_t *sock)
|
|||
|
||||
packetBuffer.length = BigLong(packetLen | (NETFLAG_DATA | eom));
|
||||
packetBuffer.sequence = BigLong(sock->sendSequence++);
|
||||
Q_memcpy (packetBuffer.data, sock->sendMessage, dataLen);
|
||||
memcpy (packetBuffer.data, sock->sendMessage, dataLen);
|
||||
|
||||
sock->sendNext = false;
|
||||
|
||||
|
@ -269,7 +273,7 @@ int ReSendMessage (qsocket_t *sock)
|
|||
|
||||
packetBuffer.length = BigLong(packetLen | (NETFLAG_DATA | eom));
|
||||
packetBuffer.sequence = BigLong(sock->sendSequence - 1);
|
||||
Q_memcpy (packetBuffer.data, sock->sendMessage, dataLen);
|
||||
memcpy (packetBuffer.data, sock->sendMessage, dataLen);
|
||||
|
||||
sock->sendNext = false;
|
||||
|
||||
|
@ -313,7 +317,7 @@ int Datagram_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data)
|
|||
|
||||
packetBuffer.length = BigLong(packetLen | NETFLAG_UNRELIABLE);
|
||||
packetBuffer.sequence = BigLong(sock->unreliableSendSequence++);
|
||||
Q_memcpy (packetBuffer.data, data->data, data->cursize);
|
||||
memcpy (packetBuffer.data, data->data, data->cursize);
|
||||
|
||||
if (sfunc.Write (sock->socket, (byte *)&packetBuffer, packetLen, &sock->addr) == -1)
|
||||
return -1;
|
||||
|
@ -424,7 +428,7 @@ int Datagram_GetMessage (qsocket_t *sock)
|
|||
sock->sendMessageLength -= MAX_DATAGRAM;
|
||||
if (sock->sendMessageLength > 0)
|
||||
{
|
||||
Q_memcpy(sock->sendMessage, sock->sendMessage+MAX_DATAGRAM, sock->sendMessageLength);
|
||||
memcpy(sock->sendMessage, sock->sendMessage+MAX_DATAGRAM, sock->sendMessageLength);
|
||||
sock->sendNext = true;
|
||||
}
|
||||
else
|
||||
|
@ -461,7 +465,7 @@ int Datagram_GetMessage (qsocket_t *sock)
|
|||
break;
|
||||
}
|
||||
|
||||
Q_memcpy(sock->receiveMessage + sock->receiveMessageLength, packetBuffer.data, length);
|
||||
memcpy(sock->receiveMessage + sock->receiveMessageLength, packetBuffer.data, length);
|
||||
sock->receiveMessageLength += length;
|
||||
continue;
|
||||
}
|
||||
|
@ -499,7 +503,7 @@ void NET_Stats_f (void)
|
|||
Con_Printf("shortPacketCount = %i\n", shortPacketCount);
|
||||
Con_Printf("droppedDatagrams = %i\n", droppedDatagrams);
|
||||
}
|
||||
else if (Q_strcmp(Cmd_Argv(1), "*") == 0)
|
||||
else if (strcmp(Cmd_Argv(1), "*") == 0)
|
||||
{
|
||||
for (s = net_activeSockets; s; s = s->next)
|
||||
PrintStats(s);
|
||||
|
@ -509,11 +513,11 @@ void NET_Stats_f (void)
|
|||
else
|
||||
{
|
||||
for (s = net_activeSockets; s; s = s->next)
|
||||
if (Q_strcasecmp(Cmd_Argv(1), s->address) == 0)
|
||||
if (strcasecmp(Cmd_Argv(1), s->address) == 0)
|
||||
break;
|
||||
if (s == NULL)
|
||||
for (s = net_freeSockets; s; s = s->next)
|
||||
if (Q_strcasecmp(Cmd_Argv(1), s->address) == 0)
|
||||
if (strcasecmp(Cmd_Argv(1), s->address) == 0)
|
||||
break;
|
||||
if (s == NULL)
|
||||
return;
|
||||
|
@ -566,11 +570,11 @@ static void Test_Poll(void)
|
|||
Sys_Error("Unexpected repsonse to Player Info request\n");
|
||||
|
||||
playerNumber = MSG_ReadByte();
|
||||
Q_strcpy(name, MSG_ReadString());
|
||||
strcpy(name, MSG_ReadString());
|
||||
colors = MSG_ReadLong();
|
||||
frags = MSG_ReadLong();
|
||||
connectTime = MSG_ReadLong();
|
||||
Q_strcpy(address, MSG_ReadString());
|
||||
strcpy(address, MSG_ReadString());
|
||||
|
||||
Con_Printf("%s\n frags:%3i colors:%u %u time:%u\n %s\n", name, frags, colors >> 4, colors & 0x0f, connectTime / 60, address);
|
||||
}
|
||||
|
@ -602,13 +606,13 @@ static void Test_f (void)
|
|||
if (host && hostCacheCount)
|
||||
{
|
||||
for (n = 0; n < hostCacheCount; n++)
|
||||
if (Q_strcasecmp (host, hostcache[n].name) == 0)
|
||||
if (strcasecmp (host, hostcache[n].name) == 0)
|
||||
{
|
||||
if (hostcache[n].driver != myDriverLevel)
|
||||
continue;
|
||||
net_landriverlevel = hostcache[n].ldriver;
|
||||
max = hostcache[n].maxusers;
|
||||
Q_memcpy(&sendaddr, &hostcache[n].addr, sizeof(struct qsockaddr));
|
||||
memcpy(&sendaddr, &hostcache[n].addr, sizeof(struct qsockaddr));
|
||||
break;
|
||||
}
|
||||
if (n < hostCacheCount)
|
||||
|
@ -688,10 +692,10 @@ static void Test2_Poll(void)
|
|||
if (MSG_ReadByte() != CCREP_RULE_INFO)
|
||||
goto Error;
|
||||
|
||||
Q_strcpy(name, MSG_ReadString());
|
||||
strcpy(name, MSG_ReadString());
|
||||
if (name[0] == 0)
|
||||
goto Done;
|
||||
Q_strcpy(value, MSG_ReadString());
|
||||
strcpy(value, MSG_ReadString());
|
||||
|
||||
Con_Printf("%-16.16s %-16.16s\n", name, value);
|
||||
|
||||
|
@ -730,12 +734,12 @@ static void Test2_f (void)
|
|||
if (host && hostCacheCount)
|
||||
{
|
||||
for (n = 0; n < hostCacheCount; n++)
|
||||
if (Q_strcasecmp (host, hostcache[n].name) == 0)
|
||||
if (strcasecmp (host, hostcache[n].name) == 0)
|
||||
{
|
||||
if (hostcache[n].driver != myDriverLevel)
|
||||
continue;
|
||||
net_landriverlevel = hostcache[n].ldriver;
|
||||
Q_memcpy(&sendaddr, &hostcache[n].addr, sizeof(struct qsockaddr));
|
||||
memcpy(&sendaddr, &hostcache[n].addr, sizeof(struct qsockaddr));
|
||||
break;
|
||||
}
|
||||
if (n < hostCacheCount)
|
||||
|
@ -875,7 +879,7 @@ static qsocket_t *_Datagram_CheckNewConnections (void)
|
|||
command = MSG_ReadByte();
|
||||
if (command == CCREQ_SERVER_INFO)
|
||||
{
|
||||
if (Q_strcmp(MSG_ReadString(), "QUAKE") != 0)
|
||||
if (strcmp(MSG_ReadString(), "QUAKE") != 0)
|
||||
return NULL;
|
||||
|
||||
SZ_Clear(&net_message);
|
||||
|
@ -979,7 +983,7 @@ static qsocket_t *_Datagram_CheckNewConnections (void)
|
|||
if (command != CCREQ_CONNECT)
|
||||
return NULL;
|
||||
|
||||
if (Q_strcmp(MSG_ReadString(), "QUAKE") != 0)
|
||||
if (strcmp(MSG_ReadString(), "QUAKE") != 0)
|
||||
return NULL;
|
||||
|
||||
if (MSG_ReadByte() != NET_PROTOCOL_VERSION)
|
||||
|
@ -1082,7 +1086,7 @@ static qsocket_t *_Datagram_CheckNewConnections (void)
|
|||
sock->socket = newsock;
|
||||
sock->landriver = net_landriverlevel;
|
||||
sock->addr = clientaddr;
|
||||
Q_strcpy(sock->address, dfunc.AddrToString(&clientaddr));
|
||||
strcpy(sock->address, dfunc.AddrToString(&clientaddr));
|
||||
|
||||
// send him back the info about the server connection he has been allocated
|
||||
SZ_Clear(&net_message);
|
||||
|
@ -1173,30 +1177,30 @@ static void _Datagram_SearchForHosts (qboolean xmit)
|
|||
|
||||
// add it
|
||||
hostCacheCount++;
|
||||
Q_strcpy(hostcache[n].name, MSG_ReadString());
|
||||
Q_strcpy(hostcache[n].map, MSG_ReadString());
|
||||
strcpy(hostcache[n].name, MSG_ReadString());
|
||||
strcpy(hostcache[n].map, MSG_ReadString());
|
||||
hostcache[n].users = MSG_ReadByte();
|
||||
hostcache[n].maxusers = MSG_ReadByte();
|
||||
if (MSG_ReadByte() != NET_PROTOCOL_VERSION)
|
||||
{
|
||||
Q_strcpy(hostcache[n].cname, hostcache[n].name);
|
||||
strcpy(hostcache[n].cname, hostcache[n].name);
|
||||
hostcache[n].cname[14] = 0;
|
||||
Q_strcpy(hostcache[n].name, "*");
|
||||
Q_strcat(hostcache[n].name, hostcache[n].cname);
|
||||
strcpy(hostcache[n].name, "*");
|
||||
strcat(hostcache[n].name, hostcache[n].cname);
|
||||
}
|
||||
Q_memcpy(&hostcache[n].addr, &readaddr, sizeof(struct qsockaddr));
|
||||
memcpy(&hostcache[n].addr, &readaddr, sizeof(struct qsockaddr));
|
||||
hostcache[n].driver = net_driverlevel;
|
||||
hostcache[n].ldriver = net_landriverlevel;
|
||||
Q_strcpy(hostcache[n].cname, dfunc.AddrToString(&readaddr));
|
||||
strcpy(hostcache[n].cname, dfunc.AddrToString(&readaddr));
|
||||
|
||||
// check for a name conflict
|
||||
for (i = 0; i < hostCacheCount; i++)
|
||||
{
|
||||
if (i == n)
|
||||
continue;
|
||||
if (Q_strcasecmp (hostcache[n].name, hostcache[i].name) == 0)
|
||||
if (strcasecmp (hostcache[n].name, hostcache[i].name) == 0)
|
||||
{
|
||||
i = Q_strlen(hostcache[n].name);
|
||||
i = strlen(hostcache[n].name);
|
||||
if (i < 15 && hostcache[n].name[i-1] > '8')
|
||||
{
|
||||
hostcache[n].name[i] = '0';
|
||||
|
@ -1325,7 +1329,7 @@ static qsocket_t *_Datagram_Connect (char *host)
|
|||
{
|
||||
reason = "No Response";
|
||||
Con_Printf("%s\n", reason);
|
||||
Q_strcpy(m_return_reason, reason);
|
||||
strcpy(m_return_reason, reason);
|
||||
goto ErrorReturn;
|
||||
}
|
||||
|
||||
|
@ -1333,7 +1337,7 @@ static qsocket_t *_Datagram_Connect (char *host)
|
|||
{
|
||||
reason = "Network Error";
|
||||
Con_Printf("%s\n", reason);
|
||||
Q_strcpy(m_return_reason, reason);
|
||||
strcpy(m_return_reason, reason);
|
||||
goto ErrorReturn;
|
||||
}
|
||||
|
||||
|
@ -1342,20 +1346,20 @@ static qsocket_t *_Datagram_Connect (char *host)
|
|||
{
|
||||
reason = MSG_ReadString();
|
||||
Con_Printf(reason);
|
||||
Q_strncpy(m_return_reason, reason, 31);
|
||||
strncpy(m_return_reason, reason, 31);
|
||||
goto ErrorReturn;
|
||||
}
|
||||
|
||||
if (ret == CCREP_ACCEPT)
|
||||
{
|
||||
Q_memcpy(&sock->addr, &sendaddr, sizeof(struct qsockaddr));
|
||||
memcpy(&sock->addr, &sendaddr, sizeof(struct qsockaddr));
|
||||
dfunc.SetSocketPort (&sock->addr, MSG_ReadLong());
|
||||
}
|
||||
else
|
||||
{
|
||||
reason = "Bad Response";
|
||||
Con_Printf("%s\n", reason);
|
||||
Q_strcpy(m_return_reason, reason);
|
||||
strcpy(m_return_reason, reason);
|
||||
goto ErrorReturn;
|
||||
}
|
||||
|
||||
|
@ -1369,7 +1373,7 @@ static qsocket_t *_Datagram_Connect (char *host)
|
|||
{
|
||||
reason = "Connect to Game failed";
|
||||
Con_Printf("%s\n", reason);
|
||||
Q_strcpy(m_return_reason, reason);
|
||||
strcpy(m_return_reason, reason);
|
||||
goto ErrorReturn;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,21 +61,21 @@ void Loop_SearchForHosts (qboolean xmit)
|
|||
return;
|
||||
|
||||
hostCacheCount = 1;
|
||||
if (Q_strcmp(hostname->string, "UNNAMED") == 0)
|
||||
Q_strcpy(hostcache[0].name, "local");
|
||||
if (strcmp(hostname->string, "UNNAMED") == 0)
|
||||
strcpy(hostcache[0].name, "local");
|
||||
else
|
||||
Q_strcpy(hostcache[0].name, hostname->string);
|
||||
Q_strcpy(hostcache[0].map, sv.name);
|
||||
strcpy(hostcache[0].name, hostname->string);
|
||||
strcpy(hostcache[0].map, sv.name);
|
||||
hostcache[0].users = net_activeconnections;
|
||||
hostcache[0].maxusers = svs.maxclients;
|
||||
hostcache[0].driver = net_driverlevel;
|
||||
Q_strcpy(hostcache[0].cname, "local");
|
||||
strcpy(hostcache[0].cname, "local");
|
||||
}
|
||||
|
||||
|
||||
qsocket_t *Loop_Connect (char *host)
|
||||
{
|
||||
if (Q_strcmp(host,"local") != 0)
|
||||
if (strcmp(host,"local") != 0)
|
||||
return NULL;
|
||||
|
||||
localconnectpending = true;
|
||||
|
@ -87,7 +87,7 @@ qsocket_t *Loop_Connect (char *host)
|
|||
Con_Printf("Loop_Connect: no qsocket available\n");
|
||||
return NULL;
|
||||
}
|
||||
Q_strcpy (loop_client->address, "localhost");
|
||||
strcpy (loop_client->address, "localhost");
|
||||
}
|
||||
loop_client->receiveMessageLength = 0;
|
||||
loop_client->sendMessageLength = 0;
|
||||
|
@ -100,7 +100,7 @@ qsocket_t *Loop_Connect (char *host)
|
|||
Con_Printf("Loop_Connect: no qsocket available\n");
|
||||
return NULL;
|
||||
}
|
||||
Q_strcpy (loop_server->address, "LOCAL");
|
||||
strcpy (loop_server->address, "LOCAL");
|
||||
}
|
||||
loop_server->receiveMessageLength = 0;
|
||||
loop_server->sendMessageLength = 0;
|
||||
|
@ -153,7 +153,7 @@ int Loop_GetMessage (qsocket_t *sock)
|
|||
sock->receiveMessageLength -= length;
|
||||
|
||||
if (sock->receiveMessageLength)
|
||||
Q_memcpy(sock->receiveMessage, &sock->receiveMessage[length], sock->receiveMessageLength);
|
||||
memcpy(sock->receiveMessage, &sock->receiveMessage[length], sock->receiveMessageLength);
|
||||
|
||||
if (sock->driverdata && ret == 1)
|
||||
((qsocket_t *)sock->driverdata)->canSend = true;
|
||||
|
@ -188,7 +188,7 @@ int Loop_SendMessage (qsocket_t *sock, sizebuf_t *data)
|
|||
buffer++;
|
||||
|
||||
// message
|
||||
Q_memcpy(buffer, data->data, data->cursize);
|
||||
memcpy(buffer, data->data, data->cursize);
|
||||
*bufferLength = IntAlign(*bufferLength + data->cursize + 4);
|
||||
|
||||
sock->canSend = false;
|
||||
|
@ -222,7 +222,7 @@ int Loop_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data)
|
|||
buffer++;
|
||||
|
||||
// message
|
||||
Q_memcpy(buffer, data->data, data->cursize);
|
||||
memcpy(buffer, data->data, data->cursize);
|
||||
*bufferLength = IntAlign(*bufferLength + data->cursize + 4);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "net_vcr.h"
|
||||
#include "qargs.h"
|
||||
#include "sizebuf.h"
|
||||
|
||||
qsocket_t *net_activeSockets = NULL;
|
||||
qsocket_t *net_freeSockets = NULL;
|
||||
|
@ -138,7 +140,7 @@ qsocket_t *NET_NewQSocket (void)
|
|||
|
||||
sock->disconnected = false;
|
||||
sock->connecttime = net_time;
|
||||
Q_strcpy (sock->address,"UNSET ADDRESS");
|
||||
strcpy (sock->address,"UNSET ADDRESS");
|
||||
sock->driver = net_driverlevel;
|
||||
sock->socket = 0;
|
||||
sock->driverdata = NULL;
|
||||
|
@ -191,7 +193,7 @@ static void NET_Listen_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
listening = Q_atoi(Cmd_Argv(1)) ? true : false;
|
||||
listening = atoi(Cmd_Argv(1)) ? true : false;
|
||||
|
||||
for (net_driverlevel=0 ; net_driverlevel<net_numdrivers; net_driverlevel++)
|
||||
{
|
||||
|
@ -218,7 +220,7 @@ static void MaxPlayers_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
n = Q_atoi(Cmd_Argv(1));
|
||||
n = atoi(Cmd_Argv(1));
|
||||
if (n < 1)
|
||||
n = 1;
|
||||
if (n > svs.maxclientslimit)
|
||||
|
@ -251,7 +253,7 @@ static void NET_Port_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
n = Q_atoi(Cmd_Argv(1));
|
||||
n = atoi(Cmd_Argv(1));
|
||||
if (n < 1 || n > 65534)
|
||||
{
|
||||
Con_Printf ("Bad value, must be between 1 and 65534\n");
|
||||
|
@ -389,7 +391,7 @@ qsocket_t *NET_Connect (char *host)
|
|||
|
||||
if (host)
|
||||
{
|
||||
if (Q_strcasecmp (host, "local") == 0)
|
||||
if (strcasecmp (host, "local") == 0)
|
||||
{
|
||||
numdrivers = 1;
|
||||
goto JustDoIt;
|
||||
|
@ -398,7 +400,7 @@ qsocket_t *NET_Connect (char *host)
|
|||
if (hostCacheCount)
|
||||
{
|
||||
for (n = 0; n < hostCacheCount; n++)
|
||||
if (Q_strcasecmp (host, hostcache[n].name) == 0)
|
||||
if (strcasecmp (host, hostcache[n].name) == 0)
|
||||
{
|
||||
host = hostcache[n].cname;
|
||||
break;
|
||||
|
@ -424,7 +426,7 @@ qsocket_t *NET_Connect (char *host)
|
|||
|
||||
if (hostCacheCount)
|
||||
for (n = 0; n < hostCacheCount; n++)
|
||||
if (Q_strcasecmp (host, hostcache[n].name) == 0)
|
||||
if (strcasecmp (host, hostcache[n].name) == 0)
|
||||
{
|
||||
host = hostcache[n].cname;
|
||||
break;
|
||||
|
@ -836,7 +838,7 @@ void NET_Init (void)
|
|||
if (i)
|
||||
{
|
||||
if (i < com_argc-1)
|
||||
DEFAULTnet_hostport = Q_atoi (com_argv[i+1]);
|
||||
DEFAULTnet_hostport = atoi (com_argv[i+1]);
|
||||
else
|
||||
Sys_Error ("NET_Init: you must specify a number after -port");
|
||||
}
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "quakedef.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
@ -40,6 +38,7 @@
|
|||
#include <sys/param.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __sun__
|
||||
#include <sys/filio.h>
|
||||
|
@ -49,6 +48,11 @@
|
|||
#include <libc.h>
|
||||
#endif
|
||||
|
||||
#include "net.h"
|
||||
#include "qargs.h"
|
||||
#include "sys.h"
|
||||
#include "console.h"
|
||||
|
||||
extern int gethostname (char *, int);
|
||||
extern int close (int);
|
||||
|
||||
|
@ -79,7 +83,7 @@ int UDP_Init (void)
|
|||
myAddr = *(int *)local->h_addr_list[0];
|
||||
|
||||
// if the quake hostname isn't set, set it to the machine name
|
||||
if (Q_strcmp(hostname->string, "UNNAMED") == 0)
|
||||
if (strcmp(hostname->string, "UNNAMED") == 0)
|
||||
{
|
||||
buff[15] = 0;
|
||||
Cvar_Set(hostname, buff);
|
||||
|
@ -93,8 +97,8 @@ int UDP_Init (void)
|
|||
((struct sockaddr_in *)&broadcastaddr)->sin_port = htons(net_hostport);
|
||||
|
||||
UDP_GetSocketAddr (net_controlsocket, &addr);
|
||||
Q_strcpy(my_tcpip_address, UDP_AddrToString (&addr));
|
||||
colon = Q_strrchr (my_tcpip_address, ':');
|
||||
strcpy(my_tcpip_address, UDP_AddrToString (&addr));
|
||||
colon = strrchr (my_tcpip_address, ':');
|
||||
if (colon)
|
||||
*colon = 0;
|
||||
|
||||
|
@ -217,7 +221,7 @@ static int PartialIPAddress (char *in, struct qsockaddr *hostaddr)
|
|||
}
|
||||
|
||||
if (*b++ == ':')
|
||||
port = Q_atoi(b);
|
||||
port = atoi(b);
|
||||
else
|
||||
port = net_hostport;
|
||||
|
||||
|
@ -345,7 +349,7 @@ int UDP_GetSocketAddr (int socket, struct qsockaddr *addr)
|
|||
int addrlen = sizeof(struct qsockaddr);
|
||||
unsigned int a;
|
||||
|
||||
Q_memset(addr, 0, sizeof(struct qsockaddr));
|
||||
memset(addr, 0, sizeof(struct qsockaddr));
|
||||
getsockname(socket, (struct sockaddr *)addr, &addrlen);
|
||||
a = ((struct sockaddr_in *)addr)->sin_addr.s_addr;
|
||||
if (a == 0 || a == inet_addr("127.0.0.1"))
|
||||
|
@ -363,11 +367,11 @@ int UDP_GetNameFromAddr (struct qsockaddr *addr, char *name)
|
|||
hostentry = gethostbyaddr ((char *)&((struct sockaddr_in *)addr)->sin_addr, sizeof(struct in_addr), AF_INET);
|
||||
if (hostentry)
|
||||
{
|
||||
Q_strncpy (name, (char *)hostentry->h_name, NET_NAMELEN - 1);
|
||||
strncpy (name, (char *)hostentry->h_name, NET_NAMELEN - 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Q_strcpy (name, UDP_AddrToString (addr));
|
||||
strcpy (name, UDP_AddrToString (addr));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,10 +31,9 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <quakedef.h>
|
||||
//#include <qtypes.h>
|
||||
#include <qtypes.h>
|
||||
#include <sound.h>
|
||||
//#include <qargs.h>
|
||||
#include <qargs.h>
|
||||
#include <console.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -30,6 +30,15 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "sys.h"
|
||||
#include "sound.h"
|
||||
#include "cmd.h"
|
||||
#include "console.h"
|
||||
#include "client.h"
|
||||
#include "qargs.h"
|
||||
#include "quakedef.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -293,12 +302,12 @@ sfx_t *S_FindName (char *name)
|
|||
if (!name)
|
||||
Sys_Error ("S_FindName: NULL\n");
|
||||
|
||||
if (Q_strlen(name) >= MAX_QPATH)
|
||||
if (strlen(name) >= MAX_QPATH)
|
||||
Sys_Error ("Sound name too long: %s", name);
|
||||
|
||||
// see if already loaded
|
||||
for (i=0 ; i < num_sfx ; i++)
|
||||
if (!Q_strcmp(known_sfx[i].name, name))
|
||||
if (!strcmp(known_sfx[i].name, name))
|
||||
{
|
||||
return &known_sfx[i];
|
||||
}
|
||||
|
@ -556,7 +565,7 @@ void S_StopAllSounds(qboolean clear)
|
|||
if (channels[i].sfx)
|
||||
channels[i].sfx = NULL;
|
||||
|
||||
Q_memset(channels, 0, MAX_CHANNELS * sizeof(channel_t));
|
||||
memset(channels, 0, MAX_CHANNELS * sizeof(channel_t));
|
||||
|
||||
if (clear)
|
||||
S_ClearBuffer ();
|
||||
|
@ -610,7 +619,7 @@ void S_ClearBuffer (void)
|
|||
}
|
||||
}
|
||||
|
||||
Q_memset(pData, clear, shm->samples * shm->samplebits/8);
|
||||
memset(pData, clear, shm->samples * shm->samplebits/8);
|
||||
|
||||
pDSBuf->lpVtbl->Unlock(pDSBuf, pData, dwSize, NULL, 0);
|
||||
|
||||
|
@ -618,7 +627,7 @@ void S_ClearBuffer (void)
|
|||
else
|
||||
#endif
|
||||
{
|
||||
Q_memset(shm->buffer, clear, shm->samples * shm->samplebits/8);
|
||||
memset(shm->buffer, clear, shm->samples * shm->samplebits/8);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -930,13 +939,13 @@ void S_Play(void)
|
|||
i = 1;
|
||||
while (i<Cmd_Argc())
|
||||
{
|
||||
if (!Q_strrchr(Cmd_Argv(i), '.'))
|
||||
if (!strrchr(Cmd_Argv(i), '.'))
|
||||
{
|
||||
Q_strcpy(name, Cmd_Argv(i));
|
||||
Q_strcat(name, ".wav");
|
||||
strcpy(name, Cmd_Argv(i));
|
||||
strcat(name, ".wav");
|
||||
}
|
||||
else
|
||||
Q_strcpy(name, Cmd_Argv(i));
|
||||
strcpy(name, Cmd_Argv(i));
|
||||
sfx = S_PrecacheSound(name);
|
||||
S_StartSound(hash++, 0, sfx, listener_origin, 1.0, 1.0);
|
||||
i++;
|
||||
|
@ -954,15 +963,15 @@ void S_PlayVol(void)
|
|||
i = 1;
|
||||
while (i<Cmd_Argc())
|
||||
{
|
||||
if (!Q_strrchr(Cmd_Argv(i), '.'))
|
||||
if (!strrchr(Cmd_Argv(i), '.'))
|
||||
{
|
||||
Q_strcpy(name, Cmd_Argv(i));
|
||||
Q_strcat(name, ".wav");
|
||||
strcpy(name, Cmd_Argv(i));
|
||||
strcat(name, ".wav");
|
||||
}
|
||||
else
|
||||
Q_strcpy(name, Cmd_Argv(i));
|
||||
strcpy(name, Cmd_Argv(i));
|
||||
sfx = S_PrecacheSound(name);
|
||||
vol = Q_atof(Cmd_Argv(i+1));
|
||||
vol = atof(Cmd_Argv(i+1));
|
||||
S_StartSound(hash++, 0, sfx, listener_origin, vol, 1.0);
|
||||
i+=2;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,13 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <string.h>
|
||||
|
||||
#include "sys.h"
|
||||
#include "sound.h"
|
||||
#include "qendian.h"
|
||||
#include "quakefs.h"
|
||||
#include "console.h"
|
||||
|
||||
int cache_full_cycle;
|
||||
|
||||
|
@ -122,8 +128,8 @@ sfxcache_t *S_LoadSound (sfx_t *s)
|
|||
|
||||
//Con_Printf ("S_LoadSound: %x\n", (int)stackbuf);
|
||||
// load it in
|
||||
Q_strcpy(namebuffer, "sound/");
|
||||
Q_strcat(namebuffer, s->name);
|
||||
strcpy(namebuffer, "sound/");
|
||||
strcat(namebuffer, s->name);
|
||||
|
||||
// Con_Printf ("loading %s\n",namebuffer);
|
||||
|
||||
|
@ -223,7 +229,7 @@ void FindNextChunk(char *name)
|
|||
// Sys_Error ("FindNextChunk: %i length is past the 1 meg sanity limit", iff_chunk_len);
|
||||
data_p -= 8;
|
||||
last_chunk = data_p + 8 + ( (iff_chunk_len + 1) & ~1 );
|
||||
if (!Q_strncmp(data_p, name, 4))
|
||||
if (!strncmp(data_p, name, 4))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -273,7 +279,7 @@ wavinfo_t GetWavinfo (char *name, byte *wav, int wavlength)
|
|||
|
||||
// find "RIFF" chunk
|
||||
FindChunk("RIFF");
|
||||
if (!(data_p && !Q_strncmp(data_p+8, "WAVE", 4)))
|
||||
if (!(data_p && !strncmp(data_p+8, "WAVE", 4)))
|
||||
{
|
||||
Con_Printf("Missing RIFF/WAVE chunks\n");
|
||||
return info;
|
||||
|
|
|
@ -285,7 +285,7 @@ void S_PaintChannels(int endtime)
|
|||
end = paintedtime + PAINTBUFFER_SIZE;
|
||||
|
||||
// clear the paint buffer
|
||||
Q_memset(paintbuffer, 0, (end - paintedtime) * sizeof(portable_samplepair_t));
|
||||
memset(paintbuffer, 0, (end - paintedtime) * sizeof(portable_samplepair_t));
|
||||
|
||||
// paint in the channels.
|
||||
ch = channels;
|
||||
|
|
|
@ -31,27 +31,24 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/mman.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "sys.h"
|
||||
#include "qargs.h"
|
||||
#include "cvar.h"
|
||||
#include "server.h"
|
||||
|
||||
#include "quakedef.h"
|
||||
|
||||
|
||||
qboolean isDedicated;
|
||||
|
||||
int nostdout = 0;
|
||||
|
@ -437,7 +434,7 @@ int main (int c, char **v)
|
|||
|
||||
j = COM_CheckParm("-mem");
|
||||
if (j)
|
||||
parms.memsize = (int) (Q_atof(com_argv[j+1]) * 1024 * 1024);
|
||||
parms.memsize = (int) (atof(com_argv[j+1]) * 1024 * 1024);
|
||||
parms.membase = malloc (parms.memsize);
|
||||
|
||||
parms.basedir = basedir;
|
||||
|
|
Loading…
Reference in a new issue