port in some improvements from OT (namely fs_basepath, etc, though commandline parsing isn't finished yet)

split up the headerfiles and such. common.[ch] and qwsvdef.h no longer exist. More work still needs to be done (esp for windows) but this should be a major improvement.
This commit is contained in:
Bill Currie 2000-05-21 08:24:45 +00:00
parent e471c785d8
commit af032b8d55
121 changed files with 1055 additions and 3086 deletions

View file

@ -43,7 +43,9 @@ endif
EXTRA_libqfcd_a_SOURCES = cd_win.c cd_linux.c cd_null.c
common_SOURCES= net_chan.c net_com.c net_udp.c pmove.c pmovetst.c zone.c \
mdfour.c mathlib.c math.S cvar.c crc.c common.c model.c cmd.c
mdfour.c mathlib.c math.S cvar.c crc.c model.c cmd.c \
qargs.c qendian.c quakefs.c quakeio.c msg.c sizebuf.c info.c \
checksum.c link.c build.c va.c com.c
server_SOURCES= pr_cmds.c pr_edict.c pr_exec.c sv_init.c sv_main.c sv_misc.c \
sv_model.c sv_nchan.c sv_ents.c sv_send.c sv_move.c sv_phys.c \
sv_user.c sv_ccmds.c world.c worlda.S sv_cvar.c

View file

@ -42,7 +42,11 @@
#include <linux/cdrom.h>
#include "quakedef.h"
#include "qargs.h"
#include "cmd.h"
#include "cdaudio.h"
#include "console.h"
#include "sound.h"
static qboolean cdValid = false;
static qboolean playing = false;
@ -227,13 +231,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();
@ -241,7 +245,7 @@ static void CD_f (void)
return;
}
if (Q_strcasecmp(command, "reset") == 0)
if (strcasecmp(command, "reset") == 0)
{
enabled = true;
if (playing)
@ -252,7 +256,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)
@ -263,11 +267,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;
@ -283,37 +287,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();
@ -322,7 +326,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)

View file

@ -37,8 +37,15 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "winquake.h"
#include "cvar.h"
#include "client.h"
#include "pmove.h"
#include "msg.h"
#include "sbar.h"
#include "console.h"
#include "commdef.h"
#include <math.h>
#define PM_SPECTATORMAXSPEED 500
#define PM_STOPSPEED 100

View file

@ -31,7 +31,12 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "client.h"
#include "console.h"
#include "cmd.h"
#include "msg.h"
#include <string.h>
/*
===================
@ -71,7 +76,7 @@ void Cmd_ForwardToServer_f (void)
return;
}
if (Q_strcasecmp(Cmd_Argv(1), "snap") == 0) {
if (strcasecmp(Cmd_Argv(1), "snap") == 0) {
Cbuf_InsertText ("snap\n");
return;
}

View file

@ -29,18 +29,20 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "cvar.h"
#include "sizebuf.h"
#include "msg.h"
#include "client.h"
#include "commdef.h"
void
Cvar_Info(cvar_t *var)
{
if (var->flags & CVAR_USERINFO)
{
Info_SetValueForKey (cls.userinfo, var->name, var->string, MAX_INFO_STRING);
if (cls.state >= ca_connected)
{
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
SZ_Print (&cls.netchan.message, va("setinfo \"%s\" \"%s\"\n", var->name, var->string));
}
}
if (var->flags & CVAR_USERINFO) {
Info_SetValueForKey (cls.userinfo, var->name, var->string, MAX_INFO_STRING);
if (cls.state >= ca_connected) {
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
SZ_Print (&cls.netchan.message, va("setinfo \"%s\" \"%s\"\n", var->name, var->string));
}
}
}

View file

@ -30,7 +30,17 @@
# include <config.h>
#endif
#include "sys.h"
#include "cvar.h"
#include "sizebuf.h"
#include "msg.h"
#include "client.h"
#include "commdef.h"
#include "cmd.h"
#include "console.h"
#include "qendian.h"
#include "quakefs.h"
#include "quakedef.h"
#include "pmove.h"
void CL_FinishTimeDemo (void);
@ -59,7 +69,7 @@ void CL_StopPlayback (void)
if (!cls.demoplayback)
return;
fclose (cls.demofile);
Qclose (cls.demofile);
cls.demofile = NULL;
cls.state = ca_disconnected;
cls.demoplayback = 0;
@ -89,10 +99,10 @@ void CL_WriteDemoCmd (usercmd_t *pcmd)
//Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
fl = LittleFloat((float)realtime);
fwrite (&fl, sizeof(fl), 1, cls.demofile);
Qwrite (cls.demofile, &fl, sizeof(fl));
c = dem_cmd;
fwrite (&c, sizeof(c), 1, cls.demofile);
Qwrite (cls.demofile, &c, sizeof(c));
// correct for byte order, bytes don't matter
cmd = *pcmd;
@ -103,15 +113,15 @@ void CL_WriteDemoCmd (usercmd_t *pcmd)
cmd.sidemove = LittleShort(cmd.sidemove);
cmd.upmove = LittleShort(cmd.upmove);
fwrite(&cmd, sizeof(cmd), 1, cls.demofile);
Qwrite(cls.demofile, &cmd, sizeof(cmd));
for (i=0 ; i<3 ; i++)
{
fl = LittleFloat (cl.viewangles[i]);
fwrite (&fl, 4, 1, cls.demofile);
Qwrite (cls.demofile, &fl, 4);
}
fflush (cls.demofile);
Qflush (cls.demofile);
}
/*
@ -133,16 +143,16 @@ void CL_WriteDemoMessage (sizebuf_t *msg)
return;
fl = LittleFloat((float)realtime);
fwrite (&fl, sizeof(fl), 1, cls.demofile);
Qwrite (cls.demofile, &fl, sizeof(fl));
c = dem_read;
fwrite (&c, sizeof(c), 1, cls.demofile);
Qwrite (cls.demofile, &c, sizeof(c));
len = LittleLong (msg->cursize);
fwrite (&len, 4, 1, cls.demofile);
fwrite (msg->data, msg->cursize, 1, cls.demofile);
Qwrite (cls.demofile, &len, 4);
Qwrite (cls.demofile, msg->data, msg->cursize);
fflush (cls.demofile);
Qflush (cls.demofile);
}
/*
@ -161,7 +171,7 @@ qboolean CL_GetDemoMessage (void)
usercmd_t *pcmd;
// read the time from the packet
fread(&demotime, sizeof(demotime), 1, cls.demofile);
Qread(cls.demofile, &demotime, sizeof(demotime));
demotime = LittleFloat(demotime);
// decide if it is time to grab the next message
@ -171,7 +181,7 @@ qboolean CL_GetDemoMessage (void)
else if (demotime > cls.td_lastframe) {
cls.td_lastframe = demotime;
// rewind back to time
fseek(cls.demofile, ftell(cls.demofile) - sizeof(demotime),
Qseek(cls.demofile, Qtell(cls.demofile) - sizeof(demotime),
SEEK_SET);
return 0; // allready read this frame's message
}
@ -185,12 +195,12 @@ qboolean CL_GetDemoMessage (void)
// too far back
realtime = demotime - 1.0;
// rewind back to time
fseek(cls.demofile, ftell(cls.demofile) - sizeof(demotime),
Qseek(cls.demofile, Qtell(cls.demofile) - sizeof(demotime),
SEEK_SET);
return 0;
} else if (realtime < demotime) {
// rewind back to time
fseek(cls.demofile, ftell(cls.demofile) - sizeof(demotime),
Qseek(cls.demofile, Qtell(cls.demofile) - sizeof(demotime),
SEEK_SET);
return 0; // don't need another message yet
}
@ -201,14 +211,14 @@ qboolean CL_GetDemoMessage (void)
Host_Error ("CL_GetDemoMessage: cls.state != ca_active");
// get the msg type
fread (&c, sizeof(c), 1, cls.demofile);
Qread (cls.demofile, &c, sizeof(c));
switch (c) {
case dem_cmd :
// user sent input
i = cls.netchan.outgoing_sequence & UPDATE_MASK;
pcmd = &cl.frames[i].cmd;
r = fread (pcmd, sizeof(*pcmd), 1, cls.demofile);
r = Qread (cls.demofile, pcmd, sizeof(*pcmd));
if (r != 1)
{
CL_StopPlayback ();
@ -225,19 +235,19 @@ qboolean CL_GetDemoMessage (void)
cls.netchan.outgoing_sequence++;
for (i=0 ; i<3 ; i++)
{
r = fread (&f, 4, 1, cls.demofile);
r = Qread (cls.demofile, &f, 4);
cl.viewangles[i] = LittleFloat (f);
}
break;
case dem_read:
// get the next message
fread (&net_message.cursize, 4, 1, cls.demofile);
Qread (cls.demofile, &net_message.cursize, 4);
net_message.cursize = LittleLong (net_message.cursize);
//Con_Printf("read: %ld bytes\n", net_message.cursize);
if (net_message.cursize > MAX_MSGLEN)
Sys_Error ("Demo message > MAX_MSGLEN");
r = fread (net_message.data, net_message.cursize, 1, cls.demofile);
r = Qread (cls.demofile, net_message.data, net_message.cursize);
if (r != 1)
{
CL_StopPlayback ();
@ -246,9 +256,9 @@ qboolean CL_GetDemoMessage (void)
break;
case dem_set :
fread (&i, 4, 1, cls.demofile);
Qread (cls.demofile, &i, 4);
cls.netchan.outgoing_sequence = LittleLong(i);
fread (&i, 4, 1, cls.demofile);
Qread (cls.demofile, &i, 4);
cls.netchan.incoming_sequence = LittleLong(i);
break;
@ -305,7 +315,7 @@ void CL_Stop_f (void)
CL_WriteDemoMessage (&net_message);
// finish up
fclose (cls.demofile);
Qclose (cls.demofile);
cls.demofile = NULL;
cls.demorecording = false;
Con_Printf ("Completed demo\n");
@ -332,21 +342,21 @@ void CL_WriteRecordDemoMessage (sizebuf_t *msg, int seq)
return;
fl = LittleFloat((float)realtime);
fwrite (&fl, sizeof(fl), 1, cls.demofile);
Qwrite (cls.demofile, &fl, sizeof(fl));
c = dem_read;
fwrite (&c, sizeof(c), 1, cls.demofile);
Qwrite (cls.demofile, &c, sizeof(c));
len = LittleLong (msg->cursize + 8);
fwrite (&len, 4, 1, cls.demofile);
Qwrite (cls.demofile, &len, 4);
i = LittleLong(seq);
fwrite (&i, 4, 1, cls.demofile);
fwrite (&i, 4, 1, cls.demofile);
Qwrite (cls.demofile, &i, 4);
Qwrite (cls.demofile, &i, 4);
fwrite (msg->data, msg->cursize, 1, cls.demofile);
Qwrite (cls.demofile, msg->data, msg->cursize);
fflush (cls.demofile);
Qflush (cls.demofile);
}
@ -362,17 +372,17 @@ void CL_WriteSetDemoMessage (void)
return;
fl = LittleFloat((float)realtime);
fwrite (&fl, sizeof(fl), 1, cls.demofile);
Qwrite (cls.demofile, &fl, sizeof(fl));
c = dem_set;
fwrite (&c, sizeof(c), 1, cls.demofile);
Qwrite (cls.demofile, &c, sizeof(c));
len = LittleLong(cls.netchan.outgoing_sequence);
fwrite (&len, 4, 1, cls.demofile);
Qwrite (cls.demofile, &len, 4);
len = LittleLong(cls.netchan.incoming_sequence);
fwrite (&len, 4, 1, cls.demofile);
Qwrite (cls.demofile, &len, 4);
fflush (cls.demofile);
Qflush (cls.demofile);
}
@ -421,7 +431,7 @@ void CL_Record_f (void)
//
COM_DefaultExtension (name, ".qwd");
cls.demofile = fopen (name, "wb");
cls.demofile = Qopen (name, "wb");
if (!cls.demofile)
{
Con_Printf ("ERROR: couldn't open.\n");
@ -707,7 +717,7 @@ void CL_ReRecord_f (void)
//
COM_DefaultExtension (name, ".qwd");
cls.demofile = fopen (name, "wb");
cls.demofile = Qopen (name, "wb");
if (!cls.demofile)
{
Con_Printf ("ERROR: couldn't open.\n");

View file

@ -31,7 +31,19 @@
# include <config.h>
#endif
#include "sys.h"
#include "sys.h"
#include "cvar.h"
#include "sizebuf.h"
#include "msg.h"
#include "client.h"
#include "commdef.h"
#include "cmd.h"
#include "console.h"
#include "qendian.h"
#include "quakefs.h"
#include "quakedef.h"
#include "pmove.h"
#include "view.h"
/* extern cvar_t cl_predict_players;
CVAR_FIXME */

View file

@ -30,8 +30,22 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "in_win.h"
#include "sys.h"
#include "sys.h"
#include "cvar.h"
#include "sizebuf.h"
#include "msg.h"
#include "client.h"
#include "commdef.h"
#include "cmd.h"
#include "console.h"
#include "qendian.h"
#include "quakefs.h"
#include "quakedef.h"
#include "pmove.h"
#include "view.h"
#include "checksum.h"
/* cvar_t cl_nodelta = {"cl_nodelta","0"};
CVAR_FIXME */
@ -171,7 +185,7 @@ void IN_UseUp (void) {KeyUp(&in_use);}
void IN_JumpDown (void) {KeyDown(&in_jump);}
void IN_JumpUp (void) {KeyUp(&in_jump);}
void IN_Impulse (void) {in_impulse=Q_atoi(Cmd_Argv(1));}
void IN_Impulse (void) {in_impulse=atoi(Cmd_Argv(1));}
/*
===============

View file

@ -31,10 +31,33 @@
# include "config.h"
#endif
#include <ctype.h>
#include "bothdefs.h"
#include "in_win.h"
#include "sys.h"
#include "sys.h"
#include "cvar.h"
#include "sizebuf.h"
#include "msg.h"
#include "client.h"
#include "commdef.h"
#include "cmd.h"
#include "console.h"
#include "qendian.h"
#include "quakefs.h"
#include "quakedef.h"
#include "pmove.h"
#include "view.h"
#include "checksum.h"
#include "sys.h"
#include "menu.h"
#include "compat.h"
#include "build.h"
#include "keys.h"
#include "screen.h"
#include "sbar.h"
#include "draw.h"
#include "qargs.h"
#include "cdaudio.h"
#ifdef _WIN32
#include "winquake.h"
#include "winsock.h"
@ -522,7 +545,7 @@ void CL_Disconnect (void)
Cam_Reset();
if (cls.download) {
fclose(cls.download);
Qclose(cls.download);
cls.download = NULL;
}
@ -1132,7 +1155,7 @@ void CL_Download_f (void)
}
strncpy (cls.downloadtempname, cls.downloadname, sizeof(cls.downloadtempname));
cls.download = fopen (cls.downloadname, "wb");
cls.download = Qopen (cls.downloadname, "wb");
cls.downloadtype = dl_single;
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
@ -1161,7 +1184,7 @@ CL_Init
*/
void CL_Init (void)
{
FILE *servlist;
QFile *servlist;
char st[80];
cls.state = ca_disconnected;
@ -1182,9 +1205,9 @@ void CL_Init (void)
Pmove_Init ();
Server_List_Init (); //Init server list
if ((servlist = fopen("./servers.txt","r"))) {
if ((servlist = Qopen("./servers.txt","r"))) {
Server_List_Load(servlist);
fclose(servlist);
Qclose(servlist);
}
@ -1459,11 +1482,11 @@ Writes key bindings and archived cvars to config.cfg
*/
void Host_WriteConfiguration (void)
{
FILE *f;
QFile *f;
if (host_initialized)
{
f = fopen (va("%s/config.cfg",com_gamedir), "w");
f = Qopen (va("%s/config.cfg",com_gamedir), "w");
if (!f)
{
Con_Printf ("Couldn't write config.cfg.\n");
@ -1473,7 +1496,7 @@ void Host_WriteConfiguration (void)
Key_WriteBindings (f);
Cvar_WriteVariables (f);
fclose (f);
Qclose (f);
}
}

View file

@ -33,7 +33,11 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "model.h"
#include "crc.h"
#include "msg.h"
#include "console.h"
#include "qendian.h"
#include "r_local.h"
void SV_Error (char *error, ...);
@ -239,7 +243,7 @@ void * Mod_LoadAliasSkin (void * pin, int *pskinindex, int skinsize,
if (r_pixbytes == 1)
{
Q_memcpy (pskin, pinskin, skinsize);
memcpy (pskin, pinskin, skinsize);
}
else if (r_pixbytes == 2)
{
@ -590,7 +594,7 @@ void * Mod_LoadSpriteFrame (void * pin, mspriteframe_t **ppframe)
pspriteframe = Hunk_AllocName (sizeof (mspriteframe_t) + size*r_pixbytes,
loadname);
Q_memset (pspriteframe, 0, sizeof (mspriteframe_t) + size);
memset (pspriteframe, 0, sizeof (mspriteframe_t) + size);
*ppframe = pspriteframe;
pspriteframe->width = width;
@ -605,7 +609,7 @@ void * Mod_LoadSpriteFrame (void * pin, mspriteframe_t **ppframe)
if (r_pixbytes == 1)
{
Q_memcpy (&pspriteframe->pixels[0], (byte *)(pinframe + 1), size);
memcpy (&pspriteframe->pixels[0], (byte *)(pinframe + 1), size);
}
else if (r_pixbytes == 2)
{

View file

@ -31,7 +31,16 @@
# include <config.h>
#endif
#include "sys.h"
#include "client.h"
#include "cmd.h"
#include "screen.h"
#include "cdaudio.h"
#include "quakedef.h"
#include "bothdefs.h"
#include "console.h"
#include "msg.h"
#include "pmove.h"
#include "sbar.h"
/* extern cvar_t gl_flashblend;
CVAR_FIXME */
@ -170,7 +179,7 @@ to start a download from the server.
*/
qboolean CL_CheckOrDownloadFile (char *filename)
{
FILE *f;
QFile *f;
if (strstr (filename, ".."))
{
@ -181,7 +190,7 @@ qboolean CL_CheckOrDownloadFile (char *filename)
COM_FOpenFile (filename, &f);
if (f)
{ // it exists, no need to download
fclose (f);
Qclose (f);
return true;
}
@ -369,7 +378,7 @@ void CL_ParseDownload (void)
if (cls.download)
{
Con_Printf ("cls.download shouldn't have been set\n");
fclose (cls.download);
Qclose (cls.download);
cls.download = NULL;
}
CL_RequestNextDownload ();
@ -386,7 +395,7 @@ void CL_ParseDownload (void)
COM_CreatePath (name);
cls.download = fopen (name, "wb");
cls.download = Qopen (name, "wb");
if (!cls.download)
{
msg_readcount += size;
@ -396,7 +405,7 @@ void CL_ParseDownload (void)
}
}
fwrite (net_message.data + msg_readcount, 1, size, cls.download);
Qwrite (cls.download, net_message.data + msg_readcount, size);
msg_readcount += size;
if (percent != 100)
@ -425,7 +434,7 @@ void CL_ParseDownload (void)
Con_Printf ("100%%\n");
#endif
fclose (cls.download);
Qclose (cls.download);
// rename the temp file to it's final name
if (strcmp(cls.downloadtempname, cls.downloadname)) {
@ -540,7 +549,7 @@ CL_ParseServerData
void CL_ParseServerData (void)
{
char *str;
FILE *f;
QFile *f;
char fn[MAX_OSPATH];
qboolean cflag = false;
extern char gamedirfile[MAX_OSPATH];
@ -576,8 +585,8 @@ void CL_ParseServerData (void)
//if it exists
if (cflag) {
snprintf (fn, sizeof(fn), "%s/%s", com_gamedir, "config.cfg");
if ((f = fopen(fn, "r")) != NULL) {
fclose(f);
if ((f = Qopen(fn, "r")) != NULL) {
Qclose(f);
Cbuf_AddText ("cl_warncmd 0\n");
Cbuf_AddText("exec config.cfg\n");
Cbuf_AddText("exec frontend.cfg\n");
@ -1152,8 +1161,8 @@ void CL_ParseServerMessage (void)
i = MSG_ReadByte ();
if (i >= MAX_LIGHTSTYLES)
Sys_Error ("svc_lightstyle > MAX_LIGHTSTYLES");
Q_strcpy (cl_lightstyle[i].map, MSG_ReadString());
cl_lightstyle[i].length = Q_strlen(cl_lightstyle[i].map);
strcpy (cl_lightstyle[i].map, MSG_ReadString());
cl_lightstyle[i].length = strlen(cl_lightstyle[i].map);
break;
case svc_sound:

View file

@ -29,8 +29,14 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "winquake.h"
#include "cvar.h"
#include "client.h"
#include "pmove.h"
#include "bothdefs.h"
#include "console.h"
#include "commdef.h"
#include <math.h>
/* cvar_t cl_nopred = {"cl_nopred","0"};
CVAR_FIXME */

View file

@ -30,13 +30,16 @@
$Id$
*/
#include <cl_slist.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "cl_slist.h"
#include "bothdefs.h"
#include "console.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <bothdefs.h>
#include <common.h>
#include <console.h>
//Better watch out for buffer overflows
server_entry_t slist[MAX_SERVER_LIST];
@ -53,13 +56,13 @@ void Server_List_Init(void) { // Do this or everything else will sig11
void Server_List_Shutdown(void) { // I am the liberator of memory.
int i;
FILE *f;
if (!(f = fopen("./servers.txt","w"))) {
QFile *f;
if (!(f = Qopen("./servers.txt","w"))) {
Con_Printf("Couldn't open servers.txt.\n");
return;
}
Server_List_Save(f);
fclose(f);
Qclose(f);
for(i=0;i < MAX_SERVER_LIST;i++) {
if (slist[i].server)
free(slist[i].server);
@ -123,7 +126,7 @@ int Server_List_Len (void) {
return i;
}
int Server_List_Load (FILE *f) { // This could get messy
int Server_List_Load (QFile *f) { // This could get messy
int serv = 0;
char line[256]; /* Long lines get truncated. */
int c = ' '; /* int so it can be compared to EOF properly*/
@ -140,7 +143,7 @@ int Server_List_Load (FILE *f) { // This could get messy
i = 0;
c = ' ';
while (c != '\n' && c != EOF) {
c = getc(f);
c = Qgetc(f);
if (i < 255) {
line[i] = c;
i++;
@ -166,11 +169,11 @@ int Server_List_Load (FILE *f) { // This could get messy
return 0;
}
int Server_List_Save(FILE *f) {
int Server_List_Save(QFile *f) {
int i;
for(i=0;i < MAX_SERVER_LIST;i++) {
if (slist[i].server)
fprintf(f,"%s %s\n",
Qprintf(f,"%s %s\n",
slist[i].server,
slist[i].description);
}

View file

@ -45,6 +45,7 @@
#include <sys/mman.h>
#include "sys.h"
#include "qargs.h"
#include "quakedef.h"
int noconinput = 0;
@ -233,7 +234,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);
if (!parms.membase) {
printf("Can't allocate memroy for zone.\n");

View file

@ -31,8 +31,15 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "ctype.h"
#include "render.h"
#include "protocol.h"
#include "client.h"
#include "msg.h"
#include "console.h"
#include <math.h>
#include <stdlib.h>
#define MAX_BEAMS 8
typedef struct

View file

@ -31,7 +31,10 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "vid.h"
#include "client.h"
#include <string.h>
/*
=====================

View file

@ -31,7 +31,16 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "cmd.h"
#include "cvar.h"
#include "sizebuf.h"
#include "zone.h"
#include "console.h"
#include "qargs.h"
#include "quakefs.h"
#include "commdef.h"
#include <string.h>
void Cmd_ForwardToServer (void);
@ -101,14 +110,14 @@ void Cbuf_AddText (char *text)
{
int l;
l = Q_strlen (text);
l = strlen (text);
if (cmd_text.cursize + l >= cmd_text.maxsize)
{
Con_Printf ("Cbuf_AddText: overflow\n");
return;
}
SZ_Write (&cmd_text, text, Q_strlen (text));
SZ_Write (&cmd_text, text, strlen (text));
}
@ -131,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
@ -190,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
@ -235,7 +244,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;
@ -246,9 +255,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
@ -267,8 +276,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;
}
@ -511,8 +520,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++;
}
}
@ -542,7 +551,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;
@ -567,7 +576,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;
}
@ -587,7 +596,7 @@ char *Cmd_CompleteCommand (char *partial)
int len;
cmdalias_t *a;
len = Q_strlen(partial);
len = strlen(partial);
if (!len)
return NULL;
@ -633,7 +642,7 @@ void Cmd_ExecuteString (char *text)
// 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))
{
if (!cmd->function)
Cmd_ForwardToServer ();
@ -646,7 +655,7 @@ void Cmd_ExecuteString (char *text)
// 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;
@ -679,7 +688,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;
@ -716,3 +725,71 @@ void Cmd_Init (void)
Cmd_AddCommand ("cmdlist", Cmd_CmdList_f);
}
char com_token[1024];
/*
==============
COM_Parse
Parse a token out of a string
==============
*/
char *COM_Parse (char *data)
{
int c;
int len;
len = 0;
com_token[0] = 0;
if (!data)
return NULL;
// skip whitespace
skipwhite:
while ( (c = *data) <= ' ')
{
if (c == 0)
return NULL; // end of file;
data++;
}
// skip // comments
if (c=='/' && data[1] == '/')
{
while (*data && *data != '\n')
data++;
goto skipwhite;
}
// handle quoted strings specially
if (c == '\"')
{
data++;
while (1)
{
c = *data++;
if (c=='\"' || !c)
{
com_token[len] = 0;
return data;
}
com_token[len] = c;
len++;
}
}
// parse a regular word
do
{
com_token[len] = c;
data++;
len++;
c = *data;
} while (c>32);
com_token[len] = 0;
return data;
}

File diff suppressed because it is too large Load diff

View file

@ -30,7 +30,17 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "console.h"
#include "keys.h"
#include "client.h"
#include "draw.h"
#include "commdef.h"
#include "qargs.h"
#include "cmd.h"
#include "screen.h"
#include <stdarg.h>
#include <string.h>
int con_ormask;
console_t con_main;
@ -118,8 +128,8 @@ Con_Clear_f
*/
void Con_Clear_f (void)
{
Q_memset (con_main.text, ' ', CON_TEXTSIZE);
Q_memset (con_chat.text, ' ', CON_TEXTSIZE);
memset (con_main.text, ' ', CON_TEXTSIZE);
memset (con_chat.text, ' ', CON_TEXTSIZE);
}
@ -180,7 +190,7 @@ void Con_Resize (console_t *con)
width = 38;
con_linewidth = width;
con_totallines = CON_TEXTSIZE / con_linewidth;
Q_memset (con->text, ' ', CON_TEXTSIZE);
memset (con->text, ' ', CON_TEXTSIZE);
}
else
{
@ -198,8 +208,8 @@ void Con_Resize (console_t *con)
if (con_linewidth < numchars)
numchars = con_linewidth;
Q_memcpy (tbuf, con->text, CON_TEXTSIZE);
Q_memset (con->text, ' ', CON_TEXTSIZE);
memcpy (tbuf, con->text, CON_TEXTSIZE);
memset (con->text, ' ', CON_TEXTSIZE);
for (i=0 ; i<numlines ; i++)
{
@ -275,7 +285,7 @@ void Con_Linefeed (void)
if (con->display == con->current)
con->display++;
con->current++;
Q_memset (&con->text[(con->current%con_totallines)*con_linewidth]
memset (&con->text[(con->current%con_totallines)*con_linewidth]
, ' ', con_linewidth);
}

View file

@ -29,7 +29,6 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "crc.h"
// this is a 16 bit, non-reflected CRC using the polynomial 0x1021

View file

@ -32,7 +32,15 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "cvar.h"
#include "zone.h"
#include "console.h"
#include "qargs.h"
#include "cmd.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
cvar_t *cvar_vars;
char *cvar_null_string = "";
@ -49,7 +57,7 @@ cvar_t *Cvar_FindVar (char *var_name)
cvar_t *var;
for (var=cvar_vars ; var ; var=var->next)
if (!Q_strcmp (var_name, var->name))
if (!strcmp (var_name, var->name))
return var;
return NULL;
@ -60,7 +68,7 @@ cvar_t *Cvar_FindAlias (char *alias_name)
cvar_alias_t *alias;
for (alias = calias_vars ; alias ; alias=alias->next)
if (!Q_strcmp (alias_name, alias->name))
if (!strcmp (alias_name, alias->name))
return alias->cvar;
return NULL;
}
@ -105,7 +113,7 @@ float Cvar_VariableValue (char *var_name)
var = Cvar_FindAlias(var_name);
if (!var)
return 0;
return Q_atof (var->string);
return atof (var->string);
}
@ -138,7 +146,7 @@ char *Cvar_CompleteVariable (char *partial)
cvar_alias_t *alias;
int len;
len = Q_strlen(partial);
len = strlen(partial);
if (!len)
return NULL;
@ -155,12 +163,12 @@ char *Cvar_CompleteVariable (char *partial)
// check partial match
for (cvar=cvar_vars ; cvar ; cvar=cvar->next)
if (!Q_strncmp (partial,cvar->name, len))
if (!strncmp (partial,cvar->name, len))
return cvar->name;
// check aliases too :)
for (alias=calias_vars ; alias ; alias=alias->next)
if (!Q_strncmp (partial, alias->name, len))
if (!strncmp (partial, alias->name, len))
return alias->name;
return NULL;
@ -181,9 +189,9 @@ void Cvar_Set (cvar_t *var, char *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);
var->string = Z_Malloc (strlen(value)+1);
strcpy (var->string, value);
var->value = atof (var->string);
Cvar_Info(var);
}
@ -239,13 +247,13 @@ Writes lines containing "set variable value" for all variables
with the archive flag set to true.
============
*/
void Cvar_WriteVariables (FILE *f)
void Cvar_WriteVariables (QFile *f)
{
cvar_t *var;
for (var = cvar_vars ; var ; var = var->next)
if (var->flags&CVAR_ARCHIVE)
fprintf (f, "%s \"%s\"\n", var->name, var->string);
Qprintf (f, "%s \"%s\"\n", var->name, var->string);
}
void Cvar_Set_f(void)
@ -388,18 +396,18 @@ cvar_t *Cvar_Get(char *name, char *string, int cvarflags, char *description)
v->next = cvar_vars;
cvar_vars = v;
v->name = strdup(name);
v->string = Z_Malloc (Q_strlen(string)+1);
Q_strcpy (v->string, string);
v->string = Z_Malloc (strlen(string)+1);
strcpy (v->string, string);
v->flags = cvarflags;
v->description = strdup(description);
v->value = Q_atof (v->string);
v->value = atof (v->string);
return v;
}
// Cvar does exist, so we update the flags and return.
v->flags ^= CVAR_USER_CREATED;
v->flags ^= CVAR_HEAP;
v->flags |= cvarflags;
if (!Q_strcmp (v->description,"User created cvar"))
if (!strcmp (v->description,"User created cvar"))
{
// Set with the real description
free(v->description);

View file

@ -30,7 +30,7 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "d_iface.h"
/*

View file

@ -30,7 +30,7 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "bothdefs.h"
#include "d_local.h"
#define NUM_MIPS 4

View file

@ -31,10 +31,12 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "qargs.h"
#include "d_local.h"
#include "r_local.h"
#include <stdlib.h>
float surfscale;
qboolean r_cache_thrash; // set if surface cache is thrashing
@ -50,7 +52,7 @@ int D_SurfaceCacheForRes (int width, int height)
if (COM_CheckParm ("-surfcachesize"))
{
size = Q_atoi(com_argv[COM_CheckParm("-surfcachesize")+1]) * 1024;
size = atoi(com_argv[COM_CheckParm("-surfcachesize")+1]) * 1024;
return size;
}

View file

@ -32,7 +32,12 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "draw.h"
#include "vid.h"
#include "d_iface.h"
#include "console.h"
#include "quakefs.h"
#include "sound.h"
typedef struct {
vrect_t rect;
@ -398,7 +403,7 @@ void Draw_Pic (int x, int y, qpic_t *pic)
for (v=0 ; v<pic->height ; v++)
{
Q_memcpy (dest, source, pic->width);
memcpy (dest, source, pic->width);
dest += vid.rowbytes;
source += pic->width;
}
@ -449,7 +454,7 @@ void Draw_SubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int h
for (v=0 ; v<height ; v++)
{
Q_memcpy (dest, source, width);
memcpy (dest, source, width);
dest += vid.rowbytes;
source += pic->width;
}

View file

@ -34,7 +34,6 @@
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "common.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"
@ -388,7 +387,7 @@ void Draw_TextureMode_f (void)
for (i=0 ; i< 6 ; i++)
{
if (!Q_strcasecmp (modes[i].name, Cmd_Argv(1) ) )
if (!strcasecmp (modes[i].name, Cmd_Argv(1) ) )
break;
}
if (i == 6)
@ -441,8 +440,8 @@ void Draw_Init (void)
cl_verstring = Cvar_Get("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, "None");
// 3dfx can only handle 256 wide textures
if (!Q_strncasecmp ((char *)gl_renderer, "3dfx",4) ||
!Q_strncasecmp ((char *)gl_renderer, "Mesa",4))
if (!strncasecmp ((char *)gl_renderer, "3dfx",4) ||
!strncasecmp ((char *)gl_renderer, "Mesa",4))
Cvar_Set (gl_max_size, "256");
Cmd_AddCommand ("gl_texturemode", &Draw_TextureMode_f);

View file

@ -33,8 +33,8 @@
#include <stdio.h>
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "common.h"
#include "qendian.h"
#include "quakefs.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"
@ -320,7 +320,7 @@ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
int *cmds;
trivertx_t *verts;
char cache[MAX_QPATH], fullpath[MAX_OSPATH];
FILE *f;
QFile *f;
aliasmodel = m;
paliashdr = hdr; // (aliashdr_t *)Mod_Extradata (m);
@ -335,11 +335,11 @@ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
COM_FOpenFile (cache, &f);
if (f)
{
fread (&numcommands, 4, 1, f);
fread (&numorder, 4, 1, f);
fread (&commands, numcommands * sizeof(commands[0]), 1, f);
fread (&vertexorder, numorder * sizeof(vertexorder[0]), 1, f);
fclose (f);
Qread (f, &numcommands, 4);
Qread (f, &numorder, 4);
Qread (f, &commands, numcommands * sizeof(commands[0]));
Qread (f, &vertexorder, numorder * sizeof(vertexorder[0]));
Qclose (f);
}
else
{
@ -354,22 +354,22 @@ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
// save out the cached version
//
snprintf (fullpath, sizeof(fullpath), "%s/%s", com_gamedir, cache);
f = fopen (fullpath, "wb");
f = Qopen (fullpath, "wb");
if (!f) {
char gldir[MAX_OSPATH];
snprintf (gldir, sizeof(gldir), "%s/glquake", com_gamedir);
Sys_mkdir (gldir);
f = fopen (fullpath, "wb");
f = Qopen (fullpath, "wb");
}
if (f)
{
fwrite (&numcommands, 4, 1, f);
fwrite (&numorder, 4, 1, f);
fwrite (&commands, numcommands * sizeof(commands[0]), 1, f);
fwrite (&vertexorder, numorder * sizeof(vertexorder[0]), 1, f);
fclose (f);
Qwrite (f, &numcommands, 4);
Qwrite (f, &numorder, 4);
Qwrite (f, &commands, numcommands * sizeof(commands[0]));
Qwrite (f, &vertexorder, numorder * sizeof(vertexorder[0]));
Qclose (f);
}
}

View file

@ -37,8 +37,8 @@
#include <stdio.h>
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "common.h"
#include "qendian.h"
#include "msg.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"
@ -584,7 +584,7 @@ void * Mod_LoadSpriteFrame (void * pin, mspriteframe_t **ppframe, int framenum)
pspriteframe = Hunk_AllocName (sizeof (mspriteframe_t),loadname);
Q_memset (pspriteframe, 0, sizeof (mspriteframe_t));
memset (pspriteframe, 0, sizeof (mspriteframe_t));
*ppframe = pspriteframe;

View file

@ -33,7 +33,6 @@
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "common.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"

View file

@ -29,8 +29,32 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "qargs.h"
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "d_iface.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"
#include "zone.h" // needed by: client.h, gl_model.h
#include "mathlib.h" // needed by: protocol.h, render.h, client.h,
// modelgen.h, glmodel.h
#include "wad.h"
#include "draw.h"
#include "cvar.h"
#include "menu.h"
#include "net.h" // needed by: client.h
#include "protocol.h" // needed by: client.h
#include "cmd.h"
#include "sbar.h"
#include "render.h" // needed by: client.h, gl_model.h, glquake.h
#include "client.h" // need cls in this file
#include "model.h" // needed by: glquake.h
#include "console.h"
#include "glquake.h"
#include "quakefs.h"
#include "quakedef.h"
#include <stdlib.h>
#define MAX_PARTICLES 2048 // default max # of particles at one
// time
@ -62,7 +86,7 @@ void R_InitParticles (void)
if (i)
{
r_numparticles = (int)(Q_atoi(com_argv[i+1]));
r_numparticles = (int)(atoi(com_argv[i+1]));
if (r_numparticles < ABSOLUTE_MIN_PARTICLES)
r_numparticles = ABSOLUTE_MIN_PARTICLES;
}
@ -96,13 +120,14 @@ void R_ClearParticles (void)
void R_ReadPointFile_f (void)
{
FILE *f;
QFile *f;
vec3_t org;
int r;
int c;
particle_t *p;
char name[MAX_OSPATH];
char buf[256];
// FIXME sprintf (name,"maps/%s.pts", sv.name);
COM_FOpenFile (name, &f);
@ -116,7 +141,9 @@ void R_ReadPointFile_f (void)
c = 0;
for ( ;; )
{
r = fscanf (f,"%f %f %f\n", &org[0], &org[1], &org[2]);
if (!Qgets(f,buf,sizeof(buf)))
break;
r = sscanf (buf,"%f %f %f\n", &org[0], &org[1], &org[2]);
if (r != 3)
break;
c++;
@ -138,7 +165,7 @@ void R_ReadPointFile_f (void)
VectorCopy (org, p->org);
}
fclose (f);
Qclose (f);
Con_Printf ("%i points read\n", c);
}

View file

@ -30,6 +30,29 @@
# include <config.h>
#endif
#include "sys.h"
#include "qargs.h"
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "d_iface.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"
#include "zone.h" // needed by: client.h, gl_model.h
#include "mathlib.h" // needed by: protocol.h, render.h, client.h,
// modelgen.h, glmodel.h
#include "wad.h"
#include "draw.h"
#include "cvar.h"
#include "menu.h"
#include "net.h" // needed by: client.h
#include "protocol.h" // needed by: client.h
#include "cmd.h"
#include "sbar.h"
#include "render.h" // needed by: client.h, gl_model.h, glquake.h
#include "client.h" // need cls in this file
#include "model.h" // needed by: glquake.h
#include "console.h"
#include "glquake.h"
#include "quakefs.h"
#include "quakedef.h"
mnode_t *r_pefragtopnode;

View file

@ -34,7 +34,6 @@
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "common.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"

View file

@ -35,7 +35,6 @@
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "common.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"

View file

@ -33,7 +33,6 @@
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "common.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"
@ -537,9 +536,9 @@ void R_NewMap (void)
{
if (!cl.worldmodel->textures[i])
continue;
if (!Q_strncmp(cl.worldmodel->textures[i]->name,"sky",3) )
if (!strncmp(cl.worldmodel->textures[i]->name,"sky",3) )
skytexturenum = i;
if (!Q_strncmp(cl.worldmodel->textures[i]->name,"window02_1",10) )
if (!strncmp(cl.worldmodel->textures[i]->name,"window02_1",10) )
mirrortexturenum = i;
cl.worldmodel->textures[i]->texturechain = NULL;
}

View file

@ -34,8 +34,7 @@
#include <math.h>
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "common.h"
#include "qargs.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"

View file

@ -36,8 +36,7 @@
#include <time.h>
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "common.h"
#include "qendian.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"
@ -810,11 +809,11 @@ void WritePCXfile (char *filename, byte *data, int width, int height,
pcx->ymax = LittleShort((short)(height-1));
pcx->hres = LittleShort((short)width);
pcx->vres = LittleShort((short)height);
Q_memset (pcx->palette,0,sizeof(pcx->palette));
memset (pcx->palette,0,sizeof(pcx->palette));
pcx->color_planes = 1; // chunky image
pcx->bytes_per_line = LittleShort((short)width);
pcx->palette_type = LittleShort(2); // not a grey scale
Q_memset (pcx->filler,0,sizeof(pcx->filler));
memset (pcx->filler,0,sizeof(pcx->filler));
// pack the image
pack = &pcx->data;

View file

@ -32,6 +32,7 @@
#endif
#include "sys.h"
#include "quakedef.h"
#include "protocol.h"
#include "glquake.h"
/*

View file

@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "common.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"

View file

@ -35,8 +35,7 @@
#include <stdlib.h>
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include "common.h"
#include "quakefs.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"
@ -358,7 +357,7 @@ byte *pcx_rgb;
LoadPCX
============
*/
void LoadPCX (FILE *f)
void LoadPCX (QFile *f)
{
pcx_t *pcx, pcxbuf;
byte palette[768];
@ -370,7 +369,7 @@ void LoadPCX (FILE *f)
//
// parse the PCX file
//
fread (&pcxbuf, 1, sizeof(pcxbuf), f);
Qread (f, &pcxbuf, sizeof(pcxbuf));
pcx = &pcxbuf;
@ -386,10 +385,10 @@ void LoadPCX (FILE *f)
}
// seek to palette
fseek (f, -768, SEEK_END);
fread (palette, 1, 768, f);
Qseek (f, -768, SEEK_END);
Qread (f, palette, 768);
fseek (f, sizeof(pcxbuf) - 4, SEEK_SET);
Qseek (f, sizeof(pcxbuf) - 4, SEEK_SET);
count = (pcx->xmax+1) * (pcx->ymax+1);
pcx_rgb = malloc( count * 4);
@ -399,12 +398,12 @@ void LoadPCX (FILE *f)
pix = pcx_rgb + 4*y*(pcx->xmax+1);
for (x=0 ; x<=pcx->ymax ; )
{
dataByte = fgetc(f);
dataByte = Qgetc(f);
if((dataByte & 0xC0) == 0xC0)
{
runLength = dataByte & 0x3F;
dataByte = fgetc(f);
dataByte = Qgetc(f);
}
else
runLength = 1;
@ -442,24 +441,24 @@ typedef struct _TargaHeader {
TargaHeader targa_header;
byte *targa_rgba;
int fgetLittleShort (FILE *f)
int fgetLittleShort (QFile *f)
{
byte b1, b2;
b1 = fgetc(f);
b2 = fgetc(f);
b1 = Qgetc(f);
b2 = Qgetc(f);
return (short)(b1 + b2*256);
}
int fgetLittleLong (FILE *f)
int fgetLittleLong (QFile *f)
{
byte b1, b2, b3, b4;
b1 = fgetc(f);
b2 = fgetc(f);
b3 = fgetc(f);
b4 = fgetc(f);
b1 = Qgetc(f);
b2 = Qgetc(f);
b3 = Qgetc(f);
b4 = Qgetc(f);
return b1 + (b2<<8) + (b3<<16) + (b4<<24);
}
@ -470,26 +469,26 @@ int fgetLittleLong (FILE *f)
LoadTGA
=============
*/
void LoadTGA (FILE *fin)
void LoadTGA (QFile *fin)
{
int columns, rows, numPixels;
byte *pixbuf;
int row, column;
unsigned char red = 0, green = 0, blue = 0, alphabyte = 0;
targa_header.id_length = fgetc(fin);
targa_header.colormap_type = fgetc(fin);
targa_header.image_type = fgetc(fin);
targa_header.id_length = Qgetc(fin);
targa_header.colormap_type = Qgetc(fin);
targa_header.image_type = Qgetc(fin);
targa_header.colormap_index = fgetLittleShort(fin);
targa_header.colormap_length = fgetLittleShort(fin);
targa_header.colormap_size = fgetc(fin);
targa_header.colormap_size = Qgetc(fin);
targa_header.x_origin = fgetLittleShort(fin);
targa_header.y_origin = fgetLittleShort(fin);
targa_header.width = fgetLittleShort(fin);
targa_header.height = fgetLittleShort(fin);
targa_header.pixel_size = fgetc(fin);
targa_header.attributes = fgetc(fin);
targa_header.pixel_size = Qgetc(fin);
targa_header.attributes = Qgetc(fin);
if (targa_header.image_type!=2
&& targa_header.image_type!=10)
@ -506,7 +505,7 @@ void LoadTGA (FILE *fin)
targa_rgba = malloc (numPixels*4);
if (targa_header.id_length != 0)
fseek(fin, targa_header.id_length, SEEK_CUR); // skip TARGA image comment
Qseek(fin, targa_header.id_length, SEEK_CUR); // skip TARGA image comment
if (targa_header.image_type==2) { // Uncompressed, RGB images
for(row=rows-1; row>=0; row--) {
@ -515,19 +514,19 @@ void LoadTGA (FILE *fin)
switch (targa_header.pixel_size) {
case 24:
blue = getc(fin);
green = getc(fin);
red = getc(fin);
blue = Qgetc(fin);
green = Qgetc(fin);
red = Qgetc(fin);
*pixbuf++ = red;
*pixbuf++ = green;
*pixbuf++ = blue;
*pixbuf++ = 255;
break;
case 32:
blue = getc(fin);
green = getc(fin);
red = getc(fin);
alphabyte = getc(fin);
blue = Qgetc(fin);
green = Qgetc(fin);
red = Qgetc(fin);
alphabyte = Qgetc(fin);
*pixbuf++ = red;
*pixbuf++ = green;
*pixbuf++ = blue;
@ -542,21 +541,21 @@ void LoadTGA (FILE *fin)
for(row=rows-1; row>=0; row--) {
pixbuf = targa_rgba + row*columns*4;
for(column=0; column<columns; ) {
packetHeader=getc(fin);
packetHeader=Qgetc(fin);
packetSize = 1 + (packetHeader & 0x7f);
if (packetHeader & 0x80) { // run-length packet
switch (targa_header.pixel_size) {
case 24:
blue = getc(fin);
green = getc(fin);
red = getc(fin);
blue = Qgetc(fin);
green = Qgetc(fin);
red = Qgetc(fin);
alphabyte = 255;
break;
case 32:
blue = getc(fin);
green = getc(fin);
red = getc(fin);
alphabyte = getc(fin);
blue = Qgetc(fin);
green = Qgetc(fin);
red = Qgetc(fin);
alphabyte = Qgetc(fin);
break;
}
@ -580,19 +579,19 @@ void LoadTGA (FILE *fin)
for(j=0;j<packetSize;j++) {
switch (targa_header.pixel_size) {
case 24:
blue = getc(fin);
green = getc(fin);
red = getc(fin);
blue = Qgetc(fin);
green = Qgetc(fin);
red = Qgetc(fin);
*pixbuf++ = red;
*pixbuf++ = green;
*pixbuf++ = blue;
*pixbuf++ = 255;
break;
case 32:
blue = getc(fin);
green = getc(fin);
red = getc(fin);
alphabyte = getc(fin);
blue = Qgetc(fin);
green = Qgetc(fin);
red = Qgetc(fin);
alphabyte = Qgetc(fin);
*pixbuf++ = red;
*pixbuf++ = green;
*pixbuf++ = blue;
@ -615,7 +614,7 @@ void LoadTGA (FILE *fin)
}
}
fclose(fin);
Qclose(fin);
}
/*
@ -627,7 +626,7 @@ char *suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"};
void R_LoadSkys (char * skyname)
{
int i;
FILE *f;
QFile *f;
char name[64];
if (stricmp (skyname, "none") == 0)

View file

@ -33,8 +33,18 @@
#include <windows.h>
#endif
#include "qtypes.h"
#include "sys.h"
#include "quakedef.h"
#include "keys.h"
#include "menu.h"
#include "cmd.h"
#include "zone.h"
#include "console.h"
#include "cvar.h"
#include "screen.h"
#include "client.h"
#include <string.h>
/*
@ -235,8 +245,8 @@ void CompleteCommand (void)
if (cmd)
{
key_lines[edit_line][1] = '/';
Q_strcpy (key_lines[edit_line]+2, cmd);
key_linepos = Q_strlen(cmd)+2;
strcpy (key_lines[edit_line]+2, cmd);
key_linepos = strlen(cmd)+2;
key_lines[edit_line][key_linepos] = ' ';
key_linepos++;
key_lines[edit_line][key_linepos] = 0;
@ -307,8 +317,8 @@ void Key_Console (int key)
&& !key_lines[history_line][1]);
if (history_line == edit_line)
history_line = (edit_line+1)&31;
Q_strcpy(key_lines[edit_line], key_lines[history_line]);
key_linepos = Q_strlen(key_lines[edit_line]);
strcpy(key_lines[edit_line], key_lines[history_line]);
key_linepos = strlen(key_lines[edit_line]);
return;
}
@ -328,8 +338,8 @@ void Key_Console (int key)
}
else
{
Q_strcpy(key_lines[edit_line], key_lines[history_line]);
key_linepos = Q_strlen(key_lines[edit_line]);
strcpy(key_lines[edit_line], key_lines[history_line]);
key_linepos = strlen(key_lines[edit_line]);
}
return;
}
@ -475,7 +485,7 @@ int Key_StringToKeynum (char *str)
for (kn=keynames ; kn->name ; kn++)
{
if (!Q_strcasecmp(str,kn->name))
if (!strcasecmp(str,kn->name))
return kn->keynum;
}
return -1;
@ -533,9 +543,9 @@ void Key_SetBinding (int keynum, char *binding)
}
// allocate memory for new binding
l = Q_strlen (binding);
l = strlen (binding);
new = Z_Malloc (l+1);
Q_strcpy (new, binding);
strcpy (new, binding);
new[l] = 0;
keybindings[keynum] = new;
}
@ -627,13 +637,13 @@ Key_WriteBindings
Writes lines containing "bind key value"
============
*/
void Key_WriteBindings (FILE *f)
void Key_WriteBindings (QFile *f)
{
int i;
for (i=0 ; i<256 ; i++)
if (keybindings[i])
fprintf (f, "bind %s \"%s\"\n", Key_KeynumToString(i), keybindings[i]);
Qprintf (f, "bind %s \"%s\"\n", Key_KeynumToString(i), keybindings[i]);
}

View file

@ -31,7 +31,8 @@
# include <config.h>
#endif
#include <math.h>
#include "quakedef.h"
#include "qtypes.h"
#include "mathlib.h"
void Sys_Error (char *error, ...);

View file

@ -34,7 +34,16 @@
#ifdef _WIN32
#include "winquake.h"
#endif
#include <cl_slist.h>
#include "cl_slist.h"
#include "keys.h"
#include "menu.h"
#include "vid.h"
#include "draw.h"
#include "cmd.h"
#include "screen.h"
#include "client.h"
#include "console.h"
#include "view.h"
void (*vid_menudrawfn)(void);
void (*vid_menukeyfn)(int key);

View file

@ -33,7 +33,15 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "model.h"
#include "quakefs.h"
#include "qendian.h"
#include "checksum.h"
#include <math.h>
#include <string.h>
void SV_Error (char *error, ...);
extern int texture_mode;
@ -355,7 +363,7 @@ void Mod_LoadTextures (lump_t *l)
// the pixels immediately follow the structures
memcpy ( tx+1, mt+1, pixels);
if (!Q_strncmp(mt->name,"sky",3))
if (!strncmp(mt->name,"sky",3))
R_InitSky (tx);
else
{
@ -766,7 +774,7 @@ void Mod_LoadFaces (lump_t *l)
// set the drawing flags flag
if (!Q_strncmp(out->texinfo->texture->name,"sky",3)) // sky
if (!strncmp(out->texinfo->texture->name,"sky",3)) // sky
{
out->flags |= (SURF_DRAWSKY | SURF_DRAWTILED);
#ifndef QUAKE2
@ -775,7 +783,7 @@ void Mod_LoadFaces (lump_t *l)
continue;
}
if (!Q_strncmp(out->texinfo->texture->name,"*",1)) // turbulent
if (!strncmp(out->texinfo->texture->name,"*",1)) // turbulent
{
out->flags |= (SURF_DRAWTURB | SURF_DRAWTILED);
for (i=0 ; i<2 ; i++)

View file

@ -28,14 +28,24 @@
#ifndef _WIN32
#ifdef HAVE_CONFIG_H
# include <config.h>
# include "config.h"
#endif
# include <unistd.h>
#else
# include <windows.h>
#endif
#include "quakedef.h"
#include <time.h>
#include <stdarg.h>
#include "qtypes.h"
#include "console.h"
#include "msg.h"
#include "sizebuf.h"
#include "cvar.h"
#include "net.h"
#include "client.h"
#include "commdef.h"
#define PACKET_HEADER 8
@ -89,14 +99,8 @@ to the new value before sending out any replies.
*/
int net_drop;
/* cvar_t showpackets = {"showpackets", "0"};
CVAR_FIXME */
cvar_t *showpackets;
/* cvar_t showdrop = {"showdrop", "0"};
CVAR_FIXME */
cvar_t *showdrop;
/* cvar_t qport = {"qport", "0"};
CVAR_FIXME */
cvar_t *qport;
extern qboolean is_server;
@ -117,14 +121,8 @@ void Netchan_Init (void)
port = ((int)(getpid()+getuid()*1000) * time(NULL)) & 0xffff;
#endif
/* Cvar_RegisterVariable (&showpackets);
CVAR_FIXME */
showpackets = Cvar_Get("showpackets", "0", CVAR_NONE, "None");
/* Cvar_RegisterVariable (&showdrop);
CVAR_FIXME */
showdrop = Cvar_Get("showdrop", "0", CVAR_NONE, "None");
/* Cvar_RegisterVariable (&qport);
CVAR_FIXME */
qport = Cvar_Get("qport", "0", CVAR_NONE, "None");
qport->value = port;
}
@ -331,8 +329,6 @@ void Netchan_Transmit (netchan_t *chan, int length, byte *data)
if (ServerPaused())
chan->cleartime = realtime;
/* if (showpackets.value)
CVAR_FIXME */
if (showpackets->value)
Con_Printf ("--> s=%i(%i) a=%i(%i) %i\n"
, chan->outgoing_sequence
@ -384,8 +380,6 @@ qboolean Netchan_Process (netchan_t *chan)
sequence &= ~(1<<31);
sequence_ack &= ~(1<<31);
/* if (showpackets.value)
CVAR_FIXME */
if (showpackets->value)
Con_Printf ("<-- s=%i(%i) a=%i(%i) %i\n"
, sequence
@ -429,8 +423,6 @@ qboolean Netchan_Process (netchan_t *chan)
//
if (sequence <= (unsigned)chan->incoming_sequence)
{
/* if (showdrop.value)
CVAR_FIXME */
if (showdrop->value)
Con_Printf ("%s:Out of order packet %i at %i\n"
, NET_AdrToString (chan->remote_address)
@ -447,8 +439,6 @@ qboolean Netchan_Process (netchan_t *chan)
{
chan->drop_count += 1;
/* if (showdrop.value)
CVAR_FIXME */
if (showdrop->value)
Con_Printf ("%s:Dropped %i packets at %i\n"
, NET_AdrToString (chan->remote_address)

View file

@ -31,8 +31,12 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "net.h"
#include "qargs.h"
#include "console.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>

View file

@ -29,7 +29,12 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "compat.h"
#include "qtypes.h"
#include "client.h"
#include "pmove.h"
#include <math.h>
movevars_t movevars;

View file

@ -30,7 +30,10 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "qtypes.h"
#include "pmove.h"
#include "model.h"
#include "console.h"
static hull_t box_hull;
static dclipnode_t box_clipnodes[6];

View file

@ -29,7 +29,21 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "pr_comp.h"
#include "progs.h"
#include "console.h"
#include "server.h"
#include "world.h"
#include "msg.h"
#include "cmd.h"
#include "commdef.h"
#include "info.h"
#include <stdlib.h>
#include <math.h>
#include <string.h>
void SV_Error (char *error, ...);
#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))
@ -1562,8 +1576,8 @@ void PF_logfrag (void)
SZ_Print (&svs.log[svs.logsequence&1], s);
if (sv_fraglogfile) {
fprintf (sv_fraglogfile, s);
fflush (sv_fraglogfile);
Qprintf (sv_fraglogfile, s);
Qflush (sv_fraglogfile);
}
}

View file

@ -30,7 +30,23 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "pr_comp.h"
#include "progs.h"
#include "console.h"
#include "server.h"
#include "world.h"
#include "msg.h"
#include "cmd.h"
#include "commdef.h"
#include "crc.h"
#include "qendian.h"
#include "quakefs.h"
#include <stdlib.h>
#include <math.h>
#include <string.h>
void SV_Error (char *error, ...);
dprograms_t *progs;
dfunction_t *pr_functions;
@ -561,7 +577,7 @@ void ED_PrintEdict_f (void)
{
int i;
i = Q_atoi (Cmd_Argv(1));
i = atoi (Cmd_Argv(1));
Con_Printf ("\n EDICT %i:\n",i);
ED_PrintNum (i);
}

View file

@ -29,8 +29,22 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "pr_comp.h"
#include "progs.h"
#include "console.h"
#include "server.h"
#include "world.h"
#include "msg.h"
#include "cmd.h"
#include "commdef.h"
#include "sys.h"
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
void SV_Error (char *error, ...);
/*

View file

@ -31,7 +31,8 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "console.h"
#include "d_ifacea.h"
#include "r_local.h"
#include "d_local.h" // FIXME: shouldn't be needed (is needed for patch
// right now, but that should move)

View file

@ -30,9 +30,11 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "console.h"
#include "r_local.h"
#include <math.h>
//
// current entity info
//

View file

@ -29,7 +29,7 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "d_ifacea.h"
#include "r_local.h"
#if 0

View file

@ -30,7 +30,8 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "console.h"
#include "bothdefs.h"
#include "r_local.h"
mnode_t *r_pefragtopnode;

View file

@ -30,9 +30,14 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "cmd.h"
#include "bothdefs.h"
#include "screen.h"
#include "console.h"
#include "r_local.h"
#include <math.h>
//define PASSAGES
void *colormap;

View file

@ -30,8 +30,13 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "console.h"
#include "cmd.h"
#include "sbar.h"
#include "r_local.h"
#include "draw.h"
#include "menu.h"
#include "quakedef.h"
qboolean allowskybox; // whether or not to allow skyboxes --KB

View file

@ -29,8 +29,13 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "qargs.h"
#include "r_local.h"
#include "console.h"
#include "quakefs.h"
#include "quakedef.h"
#include <stdlib.h>
#define MAX_PARTICLES 2048 // default max # of particles at one
// time
@ -62,7 +67,7 @@ void R_InitParticles (void)
if (i)
{
r_numparticles = (int)(Q_atoi(com_argv[i+1]));
r_numparticles = (int)(atoi(com_argv[i+1]));
if (r_numparticles < ABSOLUTE_MIN_PARTICLES)
r_numparticles = ABSOLUTE_MIN_PARTICLES;
}
@ -96,12 +101,13 @@ void R_ClearParticles (void)
void R_ReadPointFile_f (void)
{
FILE *f;
QFile *f;
vec3_t org;
int r;
int c;
particle_t *p;
char name[MAX_OSPATH];
char buf[256];
// FIXME sprintf (name,"maps/%s.pts", sv.name);
@ -116,7 +122,9 @@ void R_ReadPointFile_f (void)
c = 0;
for ( ;; )
{
r = fscanf (f,"%f %f %f\n", &org[0], &org[1], &org[2]);
if (!Qgets(f,buf,sizeof(buf)))
break;
r = sscanf (buf,"%f %f %f\n", &org[0], &org[1], &org[2]);
if (r != 3)
break;
c++;
@ -138,7 +146,7 @@ void R_ReadPointFile_f (void)
VectorCopy (org, p->org);
}
fclose (f);
Qclose (f);
Con_Printf ("%i points read\n", c);
}

View file

@ -30,9 +30,11 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "console.h"
#include "r_local.h"
#include <math.h>
static int clip_current;
static vec5_t clip_verts[2][MAXWORKINGVERTS];
static int sprite_width, sprite_height;
@ -98,7 +100,7 @@ int R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
// handle wraparound case
dists[nump] = dists[0];
Q_memcpy (instep, in, sizeof (vec5_t));
memcpy (instep, in, sizeof (vec5_t));
// clip the winding
@ -109,7 +111,7 @@ int R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
{
if (dists[i] >= 0)
{
Q_memcpy (outstep, instep, sizeof (vec5_t));
memcpy (outstep, instep, sizeof (vec5_t));
outstep += sizeof (vec5_t) / sizeof (float);
outcount++;
}

View file

@ -30,8 +30,16 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "view.h"
#include "bothdefs.h"
#include "screen.h"
#include "cmd.h"
#include "r_local.h"
#include "msg.h"
#include "commdef.h"
#include <stdlib.h>
#include <math.h>
/*

View file

@ -30,8 +30,19 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "sbar.h"
#include "screen.h"
#include "vid.h"
#include "wad.h"
#include "commdef.h"
#include "draw.h"
#include "cmd.h"
#include "client.h"
#include "bothdefs.h"
#include "msg.h"
#include <stdlib.h>
#include <string.h>
int sb_updates; // if >= vid.numpages, no update needed

View file

@ -31,10 +31,22 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "screen.h"
#include "r_local.h"
#include "wad.h"
#include "compat.h"
#include "draw.h"
#include "quakedef.h"
#include "keys.h"
#include "console.h"
#include "msg.h"
#include "sbar.h"
#include "menu.h"
#include "qendian.h"
#include "cmd.h"
#include <time.h>
#include <string.h>
/*
@ -700,11 +712,11 @@ void WritePCXfile (char *filename, byte *data, int width, int height,
pcx->ymax = LittleShort((short)(height-1));
pcx->hres = LittleShort((short)width);
pcx->vres = LittleShort((short)height);
Q_memset (pcx->palette,0,sizeof(pcx->palette));
memset (pcx->palette,0,sizeof(pcx->palette));
pcx->color_planes = 1; // chunky image
pcx->bytes_per_line = LittleShort((short)width);
pcx->palette_type = LittleShort(2); // not a grey scale
Q_memset (pcx->filler,0,sizeof(pcx->filler));
memset (pcx->filler,0,sizeof(pcx->filler));
// pack the image
pack = &pcx->data;

View file

@ -30,7 +30,13 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "cmd.h"
#include "msg.h"
#include "client.h"
#include "console.h"
#include "commdef.h"
#include <string.h>
/* cvar_t baseskin = {"baseskin", "base"};
CVAR_FIXME */

View file

@ -31,6 +31,11 @@
# include <config.h>
#endif
#include "sys.h"
#include "sound.h"
#include "cmd.h"
#include "console.h"
#include "client.h"
#include "qargs.h"
#include "quakedef.h"
#ifdef _WIN32
@ -38,6 +43,9 @@
#include "in_win.h"
#endif
#include <string.h>
#include <stdlib.h>
void S_Play(void);
void S_PlayVol(void);
void S_SoundList(void);
@ -320,12 +328,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];
}
@ -589,7 +597,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 ();
@ -645,7 +653,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);
@ -653,7 +661,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);
}
}
@ -976,13 +984,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++;
@ -1000,15 +1008,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;
}

View file

@ -31,7 +31,12 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "sound.h"
#include "qendian.h"
#include "quakefs.h"
#include "console.h"
#include <string.h>
int cache_full_cycle;
@ -125,8 +130,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);
@ -226,7 +231,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;
}
}
@ -278,7 +283,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;

View file

@ -30,7 +30,7 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quakedef.h"
#include "sound.h"
#ifdef _WIN32
#include "winquake.h"
@ -289,7 +289,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;

View file

@ -39,7 +39,11 @@
#include <sys/wait.h>
#include <linux/soundcard.h>
#include <stdio.h>
#include "quakedef.h"
#include "console.h"
#include "qargs.h"
#include "sound.h"
#include "cmd.h"
#ifndef MAP_FAILED
# define MAP_FAILED ((void *) -1)

View file

@ -29,7 +29,22 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "server.h"
#include "crc.h"
#include "msg.h"
#include "world.h"
#include "commdef.h"
#include "cmd.h"
#include "sys.h"
#include "pmove.h"
#include "compat.h"
#include "quakefs.h"
#include "bothdefs.h"
#include "qendian.h"
#include "qargs.h"
#include <stdlib.h>
#include <string.h>
qboolean sv_allow_cheats;
@ -112,14 +127,14 @@ void SV_Logfile_f (void)
if (sv_logfile)
{
Con_Printf ("File logging off.\n");
fclose (sv_logfile);
Qclose (sv_logfile);
sv_logfile = NULL;
return;
}
snprintf (name, sizeof(name), "%s/qconsole.log", com_gamedir);
Con_Printf ("Logging text to %s.\n", name);
sv_logfile = fopen (name, "w");
sv_logfile = Qopen (name, "w");
if (!sv_logfile)
Con_Printf ("failed.\n");
}
@ -138,7 +153,7 @@ void SV_Fraglogfile_f (void)
if (sv_fraglogfile)
{
Con_Printf ("Frag file logging off.\n");
fclose (sv_fraglogfile);
Qclose (sv_fraglogfile);
sv_fraglogfile = NULL;
return;
}
@ -147,15 +162,15 @@ void SV_Fraglogfile_f (void)
for (i=0 ; i<1000 ; i++)
{
snprintf (name, sizeof(name), "%s/frag_%i.log", com_gamedir, i);
sv_fraglogfile = fopen (name, "r");
sv_fraglogfile = Qopen (name, "r");
if (!sv_fraglogfile)
{ // can't read it, so create this one
sv_fraglogfile = fopen (name, "w");
sv_fraglogfile = Qopen (name, "w");
if (!sv_fraglogfile)
i=1000; // give error
break;
}
fclose (sv_fraglogfile);
Qclose (sv_fraglogfile);
}
if (i==1000)
{
@ -317,7 +332,7 @@ void SV_Map_f (void)
{
char level[MAX_QPATH];
char expanded[MAX_QPATH];
FILE *f;
QFile *f;
if (Cmd_Argc() != 2)
{
@ -339,7 +354,7 @@ void SV_Map_f (void)
Cbuf_AddText (va("map %s", curlevel));
return;
}
fclose (f);
Qclose (f);
SV_BroadcastCommand ("changing\n");
SV_SendMessagesToAll ();
@ -506,16 +521,16 @@ void SV_ConSay_f(void)
if (Cmd_Argc () < 2)
return;
Q_strcpy (text, "console: ");
strcpy (text, "console: ");
p = Cmd_Args();
if (*p == '"')
{
p++;
p[Q_strlen(p)-1] = 0;
p[strlen(p)-1] = 0;
}
Q_strcat(text, p);
strcat(text, p);
for (j = 0, client = svs.clients; j < MAX_CLIENTS; j++, client++)
{
@ -584,7 +599,7 @@ void SV_Serverinfo_f (void)
{
Z_Free (var->string); // free the old value string
var->string = CopyString (Cmd_Argv(2));
var->value = Q_atof (var->string);
var->value = atof (var->string);
}
SV_SendServerInfoChange(Cmd_Argv(1), Cmd_Argv(2));

View file

@ -29,12 +29,11 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "cvar.h"
#include "server.h"
void SV_SendServerInfoChange(char *key, char *value);
/* extern cvar_t sv_highchars;
CVAR_FIXME */
extern cvar_t *sv_highchars;
/*

View file

@ -29,7 +29,14 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "server.h"
#include "crc.h"
#include "msg.h"
#include "world.h"
#include "commdef.h"
#include "cmd.h"
#include "sys.h"
#include "pmove.h"
/*
=============================================================================
@ -91,7 +98,7 @@ given point.
byte *SV_FatPVS (vec3_t org)
{
fatbytes = (sv.worldmodel->numleafs+31)>>3;
Q_memset (fatpvs, 0, fatbytes);
memset (fatpvs, 0, fatbytes);
SV_AddToFatPVS (org, sv.worldmodel->nodes);
return fatpvs;
}

View file

@ -29,7 +29,14 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "server.h"
#include "crc.h"
#include "msg.h"
#include "world.h"
#include "commdef.h"
#include "quakefs.h"
#include <string.h>
server_static_t svs; // persistant server info
server_t sv; // local server

View file

@ -29,7 +29,22 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "server.h"
#include "crc.h"
#include "msg.h"
#include "world.h"
#include "commdef.h"
#include "cmd.h"
#include "sys.h"
#include "pmove.h"
#include "quakefs.h"
#include "qargs.h"
#include "bothdefs.h"
#include "build.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
quakeparms_t host_parms;
@ -146,8 +161,8 @@ cvar_t *watervis;
CVAR_FIXME */
cvar_t *hostname;
FILE *sv_logfile;
FILE *sv_fraglogfile;
QFile *sv_logfile;
QFile *sv_fraglogfile;
void SV_AcceptClient (netadr_t adr, int userid, char *userinfo);
void Master_Shutdown (void);
@ -171,12 +186,12 @@ void SV_Shutdown (void)
Master_Shutdown ();
if (sv_logfile)
{
fclose (sv_logfile);
Qclose (sv_logfile);
sv_logfile = NULL;
}
if (sv_fraglogfile)
{
fclose (sv_fraglogfile);
Qclose (sv_fraglogfile);
sv_logfile = NULL;
}
NET_Shutdown ();
@ -281,12 +296,12 @@ void SV_DropClient (client_t *drop)
if (drop->download)
{
fclose (drop->download);
Qclose (drop->download);
drop->download = NULL;
}
if (drop->upload)
{
fclose (drop->upload);
Qclose (drop->upload);
drop->upload = NULL;
}
*drop->uploadfn = 0;
@ -1093,7 +1108,7 @@ SV_WriteIP_f
*/
void SV_WriteIP_f (void)
{
FILE *f;
QFile *f;
char name[MAX_OSPATH];
byte b[4];
int i;
@ -1102,7 +1117,7 @@ void SV_WriteIP_f (void)
Con_Printf ("Writing %s.\n", name);
f = fopen (name, "wb");
f = Qopen (name, "wb");
if (!f)
{
Con_Printf ("Couldn't open %s\n", name);
@ -1112,10 +1127,10 @@ void SV_WriteIP_f (void)
for (i=0 ; i<numipfilters ; i++)
{
*(unsigned *)b = ipfilters[i].compare;
fprintf (f, "addip %i.%i.%i.%i\n", b[0], b[1], b[2], b[3]);
Qprintf (f, "addip %i.%i.%i.%i\n", b[0], b[1], b[2], b[3]);
}
fclose (f);
Qclose (f);
}
/*

View file

@ -28,7 +28,14 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "server.h"
#include "crc.h"
#include "msg.h"
#include "world.h"
#include "commdef.h"
#include "cmd.h"
#include "sys.h"
#include "pmove.h"
client_state_t cls;

View file

@ -1,7 +1,14 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "server.h"
#include "crc.h"
#include "msg.h"
#include "world.h"
#include "commdef.h"
#include "cmd.h"
#include "sys.h"
#include "pmove.h"
void Mod_LoadBrushModel (model_t *mod, void *buffer);

View file

@ -30,7 +30,17 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "server.h"
#include "crc.h"
#include "msg.h"
#include "world.h"
#include "commdef.h"
#include "cmd.h"
#include "sys.h"
#include "pmove.h"
#include <stdlib.h>
#include <math.h>
#define STEPSIZE 18

View file

@ -30,7 +30,14 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "server.h"
#include "crc.h"
#include "msg.h"
#include "world.h"
#include "commdef.h"
#include "cmd.h"
#include "sys.h"
#include "pmove.h"
// check to see if client block will fit, if not, rotate buffers
void ClientReliableCheckBlock(client_t *cl, int maxsize)

View file

@ -29,7 +29,14 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "server.h"
#include "crc.h"
#include "msg.h"
#include "world.h"
#include "commdef.h"
#include "cmd.h"
#include "sys.h"
#include "pmove.h"
/*

View file

@ -29,7 +29,19 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "server.h"
#include "crc.h"
#include "msg.h"
#include "world.h"
#include "commdef.h"
#include "cmd.h"
#include "sys.h"
#include "pmove.h"
#include "bothdefs.h"
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#define CHAN_AUTO 0
#define CHAN_WEAPON 1
@ -135,7 +147,7 @@ void Con_Printf (char *fmt, ...)
Sys_Printf ("%s", msg); // also echo to debugging console
if (sv_logfile)
fprintf (sv_logfile, "%s", msg);
Qprintf (sv_logfile, "%s", msg);
}
/*

View file

@ -31,12 +31,16 @@
# include <config.h>
#endif
#include <sys/types.h>
#include "qwsvdef.h"
#include "qargs.h"
#include "cvar.h"
#include "server.h"
#include "sys.h"
#ifdef NeXT
#include <libc.h>
#endif
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@ -165,7 +169,7 @@ int main(int argc, char *argv[])
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);
if ((parms.membase = malloc (parms.memsize)) == NULL)
Sys_Error("Can't allocate %ld\n", parms.memsize);

View file

@ -29,8 +29,25 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "server.h"
#include "crc.h"
#include "console.h"
#include "msg.h"
#include "world.h"
#include "commdef.h"
#include "cmd.h"
#include "sys.h"
#include "pmove.h"
#include "compat.h"
#include "bothdefs.h"
#include "quakefs.h"
#include "checksum.h"
#include <math.h>
#include "qwsvdef.h"
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <ctype.h>
edict_t *sv_player;
@ -578,7 +595,7 @@ void SV_NextDownload_f (void)
r = host_client->downloadsize - host_client->downloadcount;
if (r > 768)
r = 768;
r = fread (buffer, 1, r, host_client->download);
r = Qread (host_client->download, buffer, r);
ClientReliableWrite_Begin (host_client, svc_download, 6+r);
ClientReliableWrite_Short (host_client, r);
@ -593,7 +610,7 @@ void SV_NextDownload_f (void)
if (host_client->downloadcount != host_client->downloadsize)
return;
fclose (host_client->download);
Qclose (host_client->download);
host_client->download = NULL;
}
@ -641,7 +658,7 @@ void SV_NextUpload (void)
if (!host_client->upload)
{
host_client->upload = fopen(host_client->uploadfn, "wb");
host_client->upload = Qopen(host_client->uploadfn, "wb");
if (!host_client->upload) {
Sys_Printf("Can't create %s\n", host_client->uploadfn);
ClientReliableWrite_Begin (host_client, svc_stufftext, 8);
@ -654,7 +671,7 @@ void SV_NextUpload (void)
OutofBandPrintf(host_client->snap_from, "Server receiving %s from %d...\n", host_client->uploadfn, host_client->userid);
}
fwrite (net_message.data + msg_readcount, 1, size, host_client->upload);
Qwrite (host_client->upload, net_message.data + msg_readcount, size);
msg_readcount += size;
Con_DPrintf ("UPLOAD: %d received\n", size);
@ -663,7 +680,7 @@ Con_DPrintf ("UPLOAD: %d received\n", size);
ClientReliableWrite_Begin (host_client, svc_stufftext, 8);
ClientReliableWrite_String (host_client, "nextul\n");
} else {
fclose (host_client->upload);
Qclose (host_client->upload);
host_client->upload = NULL;
Sys_Printf("%s upload completed.\n", host_client->uploadfn);
@ -743,7 +760,7 @@ void SV_BeginDownload_f(void)
}
if (host_client->download) {
fclose (host_client->download);
Qclose (host_client->download);
host_client->download = NULL;
}
@ -755,7 +772,6 @@ void SV_BeginDownload_f(void)
*p = tolower((int)*p);
}
host_client->downloadsize = COM_FOpenFile (name, &host_client->download);
host_client->downloadcount = 0;
@ -765,7 +781,7 @@ void SV_BeginDownload_f(void)
|| (strncmp(name, "maps/", 5) == 0 && file_from_pak))
{
if (host_client->download) {
fclose(host_client->download);
Qclose(host_client->download);
host_client->download = NULL;
}
@ -846,11 +862,11 @@ void SV_Say (qboolean team)
if (*p == '"')
{
p++;
p[Q_strlen(p)-1] = 0;
p[strlen(p)-1] = 0;
}
Q_strcat(text, p);
Q_strcat(text, "\n");
strcat(text, p);
strcat(text, "\n");
Sys_Printf ("%s", text);

View file

@ -30,6 +30,10 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "sys.h"
#include "qargs.h"
#include "cvar.h"
#include "server.h"
#include <stdio.h>
#include <stdlib.h>
@ -46,7 +50,6 @@
CVAR_FIXME */
cvar_t *sys_nostdout;
/* The translation table between the graphical font and plain ASCII --KB */
static char qfont_table[256] =
{

View file

@ -38,9 +38,8 @@
#include "bothdefs.h" // needed by: common.h, net.h, client.h
#include <quakedef.h>
#include "quakedef.h"
#include "common.h"
#include "bspfile.h" // needed by: glquake.h
#include "vid.h"
#include "sys.h"
@ -61,6 +60,9 @@
#include "model.h" // needed by: glquake.h
#include "console.h"
#include "glquake.h"
#include "qendian.h"
#include "qargs.h"
#include "compat.h"
#include <GL/glx.h>
@ -477,7 +479,7 @@ void VID_SetPalette (unsigned char *palette)
int k;
unsigned short i;
unsigned *table;
FILE *f;
QFile *f;
char s[255];
float dist, bestdist;
static qboolean palflag = false;
@ -511,8 +513,8 @@ void VID_SetPalette (unsigned char *palette)
COM_FOpenFile("glquake/15to8.pal", &f);
if (f) {
fread(d_15to8table, 1<<15, 1, f);
fclose(f);
Qread(f, d_15to8table, 1<<15);
Qclose(f);
} else {
for (i=0; i < (1<<15); i++) {
/* Maps
@ -540,9 +542,9 @@ void VID_SetPalette (unsigned char *palette)
snprintf (s, sizeof(s), "%s/glquake", com_gamedir);
Sys_mkdir (s);
snprintf (s, sizeof(s), "%s/glquake/15to8.pal", com_gamedir);
if ((f = fopen(s, "wb")) != NULL) {
fwrite(d_15to8table, 1<<15, 1, f);
fclose(f);
if ((f = Qopen(s, "wb")) != NULL) {
Qwrite(f, d_15to8table, 1<<15);
Qclose(f);
}
}
}
@ -722,7 +724,7 @@ void VID_Init(unsigned char *palette)
height = atoi(com_argv[i+1]);
if ((i = COM_CheckParm("-conwidth")) != 0)
vid.conwidth = Q_atoi(com_argv[i+1]);
vid.conwidth = atoi(com_argv[i+1]);
else
vid.conwidth = width;
@ -734,7 +736,7 @@ void VID_Init(unsigned char *palette)
vid.conheight = vid.conwidth*3 / 4;
if ((i = COM_CheckParm("-conheight")) != 0)
vid.conheight = max(Q_atoi(com_argv[i+1]), 200);
vid.conheight = max(atoi(com_argv[i+1]), 200);
if (!(x_disp = XOpenDisplay(NULL))) {
fprintf(stderr, "Error couldn't open the X display\n");

View file

@ -36,6 +36,8 @@
#include <stdarg.h>
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <math.h>
#include <asm/io.h>
@ -44,8 +46,15 @@
#include "vgakeyboard.h"
#include "vgamouse.h"
#include "quakedef.h"
#include "vid.h"
#include "cmd.h"
#include "keys.h"
#include "client.h"
#include "d_local.h"
#include "quakedef.h"
#include "qendian.h"
#include "console.h"
#include "qargs.h"
#define stringify(m) { #m, m }
@ -269,7 +278,7 @@ void VID_Gamma_f (void)
if (Cmd_Argc () == 2)
{
gamma = Q_atof (Cmd_Argv(1));
gamma = atof (Cmd_Argv(1));
for (i=0 ; i<768 ; i++)
{
@ -292,7 +301,7 @@ void VID_DescribeMode_f (void)
{
int modenum;
modenum = Q_atoi (Cmd_Argv(1));
modenum = atoi (Cmd_Argv(1));
if ((modenum >= num_modes) || (modenum < 0 ) || !modes[modenum].width)
Con_Printf("Invalid video mode: %d!\n",modenum);
Con_Printf("%d: %d x %d - ",modenum,modes[modenum].width,modes[modenum].height);
@ -357,7 +366,7 @@ void VID_InitModes(void)
for (i=0 ; i<num_modes ; i++)
{
if (vga_hasmode(i))
Q_memcpy(&modes[i], vga_getmodeinfo(i), sizeof (vga_modeinfo));
memcpy(&modes[i], vga_getmodeinfo(i), sizeof (vga_modeinfo));
else
modes[i].width = 0; // means not available
}
@ -630,11 +639,11 @@ void VID_Init(unsigned char *palette)
|| COM_CheckParm("-d"))
{
if (COM_CheckParm("-w"))
w = Q_atoi(com_argv[COM_CheckParm("-w")+1]);
w = atoi(com_argv[COM_CheckParm("-w")+1]);
if (COM_CheckParm("-h"))
h = Q_atoi(com_argv[COM_CheckParm("-h")+1]);
h = atoi(com_argv[COM_CheckParm("-h")+1]);
if (COM_CheckParm("-d"))
d = Q_atoi(com_argv[COM_CheckParm("-d")+1]);
d = atoi(com_argv[COM_CheckParm("-d")+1]);
current_mode = get_mode(0, w, h, d);
}
else

View file

@ -34,8 +34,16 @@ typedef unsigned short PIXEL;
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "d_local.h"
#include "vid.h"
#include "cmd.h"
#include "keys.h"
#include "client.h"
#include "d_local.h"
#include "quakedef.h"
#include "qendian.h"
#include "console.h"
#include "qargs.h"
#include <stdio.h>
#include <stdlib.h>
@ -444,22 +452,22 @@ void VID_Init (unsigned char *palette)
{
if (pnum >= com_argc-2)
Sys_Error("VID: -winsize <width> <height>\n");
vid.width = Q_atoi(com_argv[pnum+1]);
vid.height = Q_atoi(com_argv[pnum+2]);
vid.width = atoi(com_argv[pnum+1]);
vid.height = atoi(com_argv[pnum+2]);
if (!vid.width || !vid.height)
Sys_Error("VID: Bad window width/height\n");
}
if ((pnum=COM_CheckParm("-width"))) {
if (pnum >= com_argc-1)
Sys_Error("VID: -width <width>\n");
vid.width = Q_atoi(com_argv[pnum+1]);
vid.width = atoi(com_argv[pnum+1]);
if (!vid.width)
Sys_Error("VID: Bad window width\n");
}
if ((pnum=COM_CheckParm("-height"))) {
if (pnum >= com_argc-1)
Sys_Error("VID: -height <height>\n");
vid.height = Q_atoi(com_argv[pnum+1]);
vid.height = atoi(com_argv[pnum+1]);
if (!vid.height)
Sys_Error("VID: Bad window height\n");
}
@ -471,7 +479,7 @@ void VID_Init (unsigned char *palette)
{
if (pnum >= com_argc-1)
Sys_Error("VID: -visualid <id#>\n");
template.visualid = Q_atoi(com_argv[pnum+1]);
template.visualid = atoi(com_argv[pnum+1]);
template_mask = VisualIDMask;
}

View file

@ -30,7 +30,9 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "wad.h"
#include "quakefs.h"
#include "qendian.h"
int wad_numlumps;
lumpinfo_t *wad_lumps;

View file

@ -30,7 +30,13 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qwsvdef.h"
#include "world.h"
#include "server.h"
#include "crc.h"
#include "commdef.h"
#include "console.h"
#include <stdio.h>
/*

View file

@ -30,7 +30,14 @@
# include <config.h>
#endif
#include "sys.h"
#include "quakedef.h"
#include "qtypes.h"
#include "zone.h"
#include "console.h"
#include "cmd.h"
#include "qargs.h"
#include <string.h>
#include <stdlib.h>
#define DYNAMIC_SIZE 0x20000
@ -158,7 +165,7 @@ Z_CheckHeap (); // DEBUG
buf = Z_TagMalloc (size, 1);
if (!buf)
Sys_Error ("Z_Malloc: failed on allocation of %i bytes",size);
Q_memset (buf, 0, size);
memset (buf, 0, size);
return buf;
}
@ -437,7 +444,7 @@ void *Hunk_AllocName (int size, char *name)
h->size = size;
h->sentinal = HUNK_SENTINAL;
Q_strncpy (h->name, name, 8);
strncpy (h->name, name, 8);
return (void *)(h+1);
}
@ -528,7 +535,7 @@ void *Hunk_HighAllocName (int size, char *name)
memset (h, 0, size);
h->size = size;
h->sentinal = HUNK_SENTINAL;
Q_strncpy (h->name, name, 8);
strncpy (h->name, name, 8);
return (void *)(h+1);
}
@ -598,9 +605,9 @@ void Cache_Move ( cache_system_t *c)
{
// Con_Printf ("cache_move ok\n");
Q_memcpy ( new+1, c+1, c->size - sizeof(cache_system_t) );
memcpy ( new+1, c+1, c->size - sizeof(cache_system_t) );
new->user = c->user;
Q_memcpy (new->name, c->name, sizeof(new->name));
memcpy (new->name, c->name, sizeof(new->name));
Cache_Free (c->user);
new->user->data = (void *)(new+1);
}
@ -941,7 +948,7 @@ void Memory_Init (void *buf, int size)
if (p)
{
if (p < com_argc-1)
zonesize = Q_atoi (com_argv[p+1]) * 1024;
zonesize = atoi (com_argv[p+1]) * 1024;
else
Sys_Error ("Memory_Init: you must specify a size in KB after -zone");
}