My attempt at handling GCC warnings, everything but incorrect pointer types, #pragma warnings, " is deprecated etc.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3787 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Lance 2011-05-15 13:23:13 +00:00
parent 2091c2f83e
commit f6741d8dde
44 changed files with 942 additions and 769 deletions

View File

@ -56,11 +56,11 @@ void CDAudio_Play(int track, qboolean looping)
{
if (!enabled)
return;
if (!cdValid)
{
CDAudio_GetAudioDiskInfo();
if (!cdValid)
if (!cdValid)
return;
}
@ -74,8 +74,8 @@ void CDAudio_Play(int track, qboolean looping)
if (playing)
{
if (playTrack == track)
return;
if (playTrack == track)
return;
CDAudio_Stop();
}
@ -100,7 +100,7 @@ void CDAudio_Stop(void)
{
if (!enabled)
return;
if (!playing)
return;
@ -132,7 +132,7 @@ void CDAudio_Resume(void)
{
if (!enabled)
return;
if (!cdValid)
return;
@ -268,7 +268,7 @@ static void CD_f (void)
}
}
/*
LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (lParam != wDeviceID)
@ -302,7 +302,7 @@ LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
}
*/
void BGMVolume_Callback(struct cvar_s *var, char *oldvalue)
{

View File

@ -1409,7 +1409,7 @@ void SCR_DrawLoading (void)
char *s;
int qdepth;
int h2depth;
int mtype = M_GameType();
//int mtype = M_GameType(); //unused variable
y = vid.height/2;
qdepth = COM_FDepthFile("gfx/loading.lmp", true);
@ -1636,7 +1636,7 @@ SCR_SetUpToDrawConsole
void SCR_SetUpToDrawConsole (void)
{
#ifdef TEXTEDITOR
extern qboolean editoractive;
//extern qboolean editoractive; //unused variable
#endif
if (scr_drawloading)
return; // never a console with loading plaque

View File

@ -194,8 +194,8 @@ static void CLQ3_ParsePacketEntities( clientSnap_t *oldframe, clientSnap_t *newf
{
oldstate = &ccs.parseEntities[(oldframe->firstEntity + numentities) & PARSE_ENTITIES_MASK];
oldnum = oldstate->number;
}
}
}
}
if( oldnum == newnum )
{
@ -267,7 +267,7 @@ void CLQ3_ParseSnapshot(void)
// If the frame is delta compressed from data that we
// no longer have available, we must suck up the rest of
// the frame, but not use it, then ask for a non-compressed message
// the frame, but not use it, then ask for a non-compressed message
delta = MSG_ReadByte();
if(delta)
{
@ -601,7 +601,7 @@ void CLQ3_ParseGameState(void)
char buffer[2048];
strcpy(buffer, va("cp %i ", cl.servercount));
FSQ3_GenerateClientPacksList(buffer, sizeof(buffer), ccs.fs_key);
CLQ3_SendClientCommand(buffer);
CLQ3_SendClientCommand("%s", buffer); // warning: format not a string literal and no format arguments
}
// load cgame, etc
@ -658,7 +658,7 @@ void CLQ3_ParseServerMessage (void)
}
SHOWNET(va("%i", cmd));
// other commands
switch(cmd)
{
@ -708,13 +708,13 @@ qboolean CLQ3_Netchan_Process(void)
net_message.packing = SZ_HUFFMAN;
net_message.currentbit = 32;
lastClientCommandNum = MSG_ReadLong();
lastClientCommandNum = MSG_ReadLong();
sequence = LittleLong(*(int *)net_message.data);
// restore buffer state
net_message.currentbit = bit;
msg_readcount = readcount;
// calculate bitmask
bitmask = sequence ^ cls.challenge;
string = ccs.clientCommands[lastClientCommandNum & TEXTCMD_MASK];
@ -802,7 +802,7 @@ static void MSG_WriteDeltaKey( sizebuf_t *msg, int key, int from, int to, int bi
MSG_WriteBits( msg, 0, 1 );
return; // unchanged
}
MSG_WriteBits( msg, 1, 1 );
MSG_WriteBits( msg, to ^ key, bits );
}
@ -943,7 +943,7 @@ void CLQ3_SendCmd(usercmd_t *cmd)
ccs.snap.serverMessageNum != ccs.serverMessageNum)
MSG_WriteBits(&msg, clcq3_nodeltaMove, 8); // no compression
else
MSG_WriteBits(&msg, clcq3_move, 8);
MSG_WriteBits(&msg, clcq3_move, 8);
// write cmdcount
MSG_WriteBits(&msg, cmdcount, 8);

View File

@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
@ -273,7 +273,7 @@ void QT_Create(char *command)
int ret;
qt = Z_Malloc(sizeof(*qt));
memset(&sa,0,sizeof(sa));
sa.nLength=sizeof(sa);
sa.bInheritHandle=true;
@ -291,20 +291,20 @@ void QT_Create(char *command)
qt->pipeoutih = StdOut[1];
qt->pipeinih = StdIn[1];
if (!DuplicateHandle(GetCurrentProcess(), StdIn[0],
GetCurrentProcess(), &qt->pipein, 0,
FALSE, // not inherited
if (!DuplicateHandle(GetCurrentProcess(), StdIn[0],
GetCurrentProcess(), &qt->pipein, 0,
FALSE, // not inherited
DUPLICATE_SAME_ACCESS))
qt->pipein = StdIn[0];
else
CloseHandle(StdIn[0]);
if (!DuplicateHandle(GetCurrentProcess(), StdOut[0],
GetCurrentProcess(), &qt->pipeout, 0,
FALSE, // not inherited
CloseHandle(StdIn[0]);
if (!DuplicateHandle(GetCurrentProcess(), StdOut[0],
GetCurrentProcess(), &qt->pipeout, 0,
FALSE, // not inherited
DUPLICATE_SAME_ACCESS))
qt->pipeout = StdOut[0];
else
CloseHandle(StdOut[0]);
CloseHandle(StdOut[0]);
SUInf.hStdInput = qt->pipeinih;
SUInf.hStdOutput = qt->pipeoutih;
@ -371,7 +371,7 @@ void Con_ToggleConsole_f (void)
}
else
key_dest = key_console;
Con_ClearNotify ();
}
@ -391,7 +391,7 @@ void Con_ToggleChat_f (void)
}
else
key_dest = key_console;
Con_ClearNotify ();
}
@ -459,7 +459,7 @@ void Cmd_ConActivate_f(void)
if (con)
Con_SetActive(con);
}
/*
================
Con_ClearNotify
@ -468,12 +468,12 @@ Con_ClearNotify
void Con_ClearNotify (void)
{
int i;
for (i=0 ; i<NUM_CON_TIMES ; i++)
con_times[i] = 0;
}
/*
================
Con_MessageMode_f
@ -676,10 +676,10 @@ void SV_FlushRedirect (void);
#define MAXPRINTMSG 4096
// FIXME: make a buffer size safe vsprintf?
void VARGS Con_Printf (const char *fmt, ...)
{
{
va_list argptr;
char msg[MAXPRINTMSG];
va_start (argptr,fmt);
vsnprintf (msg,sizeof(msg), fmt,argptr);
va_end (argptr);
@ -710,7 +710,7 @@ void VARGS Con_Printf (const char *fmt, ...)
}
void VARGS Con_SafePrintf (char *fmt, ...)
{
{
va_list argptr;
char msg[MAXPRINTMSG];
@ -719,15 +719,15 @@ void VARGS Con_SafePrintf (char *fmt, ...)
va_end (argptr);
// write it to the scrollable buffer
Con_Printf ("%s", msg);
Con_Printf ("%s", msg);
}
void VARGS Con_TPrintf (translation_t text, ...)
{
{
va_list argptr;
char msg[MAXPRINTMSG];
char *fmt = languagetext[text][cls.language];
va_start (argptr,text);
vsnprintf (msg,sizeof(msg), fmt,argptr);
va_end (argptr);
@ -737,11 +737,11 @@ void VARGS Con_TPrintf (translation_t text, ...)
}
void VARGS Con_SafeTPrintf (translation_t text, ...)
{
{
va_list argptr;
char msg[MAXPRINTMSG];
char *fmt = languagetext[text][cls.language];
va_start (argptr,text);
vsnprintf (msg,sizeof(msg), fmt,argptr);
va_end (argptr);
@ -884,7 +884,7 @@ void Con_DrawInput (int left, int right, int y)
//if the left hand side is on the right of the left point (overrides right alignment)
if (x - lhs > 0)
x = lhs;
lhs = x - lhs + left;
for (cchar = maskedtext; cchar < cursor; cchar++)
{
@ -1013,9 +1013,9 @@ void Con_DrawNotify (void)
Font_EndString(font_conchar);
}
//send all the stuff that was con_printed to sys_print.
//send all the stuff that was con_printed to sys_print.
//This is so that system consoles in windows can scroll up and have all the text.
void Con_PrintToSys(void)
void Con_PrintToSys(void)
{
console_t *curcon = &con_main;
conline_t *l;
@ -1048,7 +1048,7 @@ static int Con_DrawProgress(int left, int right, int y)
int barwidth, barleft;
float progresspercent = 0;
*progresspercenttext = 0;
// draw the download bar
// figure out width
if (cls.downloadmethod)
@ -1100,7 +1100,7 @@ static int Con_DrawProgress(int left, int right, int y)
txt = progresstext;
x = 0;
COM_ParseFunString(CON_WHITEMASK, txt, dlbar, sizeof(dlbar), false);
COM_ParseFunString(CON_WHITEMASK, txt, dlbar, sizeof(dlbar), false);
for (i = 0; dlbar[i]; )
{
x += Font_CharWidth(dlbar[i]);
@ -1454,7 +1454,7 @@ char *Con_CopyConsole(void)
l = selstartline;
cur = (conchar_t*)(l+1) + selstartoffset;
finalendoffset = selendoffset;
if (selstartline == selendline)
{
if (selstartoffset+1 == finalendoffset)
@ -1527,7 +1527,7 @@ void Con_NotifyBox (char *text)
// during startup for sound / cd warnings
Con_Printf("\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n");
Con_Printf (text);
Con_Printf ("%s", text);
Con_Printf ("Press a key.\n");
Con_Printf("\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n");

View File

@ -294,6 +294,10 @@ void IN_ReInit (void)
void IN_Init (void)
{
#ifdef IN_XFLIP
cvar_t in_xflip = SCVAR("in_xflip", "0");
#endif
#ifdef IN_XFLIP
Cvar_Register (&in_xflip, "Input Controls");
#endif
@ -349,4 +353,24 @@ void IN_Commands (void) //used to Cbuf_AddText joystick button events in windows
}
/*
===========
IN_UpdateClipCursor
===========
*/
void IN_UpdateClipCursor (void)
{
if (mouseinitialized && mouseactive && !dinput)
{
ClipCursor (&window_rect);
}
}
void IN_RawInput_Read(HANDLE in_device_handle)
{
}
static int MapKey (int vkey)
{
}

View File

@ -260,7 +260,7 @@ void M_Menu_Audio_f (void)
{
menu_t *menu;
int cursorpositionY;
extern cvar_t nosound, precache, snd_leftisright, snd_khz, snd_eax, snd_speakers, ambient_level, bgmvolume, snd_playersoundvolume, ambient_fade, cl_staticsounds, snd_inactive, _snd_mixahead, snd_usemultipledevices, snd_noextraupdate, snd_show, bgmbuffer;
extern cvar_t nosound, precache, snd_leftisright, snd_khz, snd_eax, snd_speakers, ambient_level, bgmvolume, snd_playersoundvolume, ambient_fade, cl_staticsounds, snd_inactive, _snd_mixahead, snd_usemultipledevices, snd_noextraupdate, bgmbuffer;
extern cvar_t cl_voip_play, cl_voip_send;
static const char *soundqualityoptions[] = {
@ -1128,6 +1128,7 @@ void M_Menu_Shadow_Lighting_f (void)
MC_AddWhiteText(menu, 16, y, "<><E282AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ", false); y+=8;
y+=8;
MC_AddSlider(menu, 16, y, " Shadows", &r_shadows,0,2,1); y+=8;
//MC_AddSlider(menu, 16, y, " Light Map Mode", &gl_lightmapmode,0,2,1); y+=8;
MC_AddSlider(menu, 16, y, " Light Map Saturation", &r_lightmap_saturation,0,1,0.1); y+=8;
MC_AddCheckBox(menu, 16, y, " Dynamic Lighting", &r_dynamic,0); y+=8;

View File

@ -220,6 +220,16 @@ qboolean Master_ServerIsGreater(serverinfo_t *a, serverinfo_t *b)
return Master_CompareInteger(a->tl, b->tl, SLIST_TEST_LESS);
case SLKEY_TOOMANY:
break;
// warning: enumeration value SLKEY_* not handled in switch
case SLKEY_MOD:
case SLKEY_PROTOCOL:
case SLKEY_NUMBOTS:
case SLKEY_NUMHUMANS:
case SLKEY_QCSTATUS:
case SLKEY_ISFAVORITE:
break;
}
return false;
}
@ -560,7 +570,7 @@ int Master_KeyForName(char *keyname)
}
}
Q_strncpyz(slist_keyname[slist_customkeys], keyname, MAX_INFO_KEY);
slist_customkeys++;
return slist_customkeys-1 + SLKEY_CUSTOM;
@ -771,7 +781,7 @@ qboolean Master_LoadMasterList (char *filename, int defaulttype, int depth)
default:
Master_AddMaster(line, servertype, name);
}
}
}
VFS_CLOSE(f);
@ -979,7 +989,7 @@ int NET_CheckPollSockets(void)
}
if (c == M2C_MASTER_REPLY) //qw master reply.
{
{
CL_MasterListParse(NA_IP, SS_GENERICQUAKEWORLD, false);
continue;
}
@ -1021,7 +1031,7 @@ int NET_CheckPollSockets(void)
CL_ReadServerInfo(va("\\hostname\\%s\\map\\%s\\maxclients\\%i\\clients\\%i", name, map, maxusers, users), MT_SINGLENQ, false);
}
#endif
continue;
continue;
}
return 0;
}
@ -1072,7 +1082,7 @@ void SListOptionChanged(serverinfo_t *newserver)
}
//we don't know all the info, so send a request for it.
selectedserver.detail = newserver->moreinfo = Z_Malloc(sizeof(serverdetailedinfo_t));
newserver->moreinfo->numplayers = newserver->players;
strcpy(newserver->moreinfo->info, "");
Info_SetValueForKey(newserver->moreinfo->info, "hostname", newserver->name, sizeof(newserver->moreinfo->info));
@ -1149,7 +1159,7 @@ void MasterInfo_ProcessHTTPQW(struct dl_download *dl)
//don't try sending to servers we don't support
void MasterInfo_Request(master_t *mast, qboolean evenifwedonthavethefiles)
{
static int mastersequence;
//static int mastersequence; // warning: unused variable âmastersequenceâ
if (!mast)
return;
switch(mast->type)
@ -1233,14 +1243,14 @@ void MasterInfo_WriteServers(void)
serverinfo_t *server;
vfsfile_t *mf, *qws;
char adr[MAX_ADR_SIZE];
mf = FS_OpenVFS("masters.txt", "wt", FS_ROOT);
if (!mf)
{
Con_Printf("Couldn't write masters.txt");
return;
}
for (mast = master; mast; mast=mast->next)
{
switch(mast->type)
@ -1298,14 +1308,14 @@ void MasterInfo_WriteServers(void)
else
VFS_PUTS(mf, va("%s\t%s\t%s\n", NET_AdrToString(adr, sizeof(adr), mast->adr), typename, mast->name));
}
if (slist_writeserverstxt.value)
qws = FS_OpenVFS("servers.txt", "wt", FS_ROOT);
else
qws = NULL;
if (qws)
VFS_PUTS(mf, va("\n%s\t%s\t%s\n\n", "file servers.txt", "favorite:qw", "personal server list"));
for (server = firstserver; server; server = server->next)
{
if (server->special & SS_FAVORITE)
@ -1322,11 +1332,11 @@ void MasterInfo_WriteServers(void)
VFS_PUTS(mf, va("%s\t%s\t%s\n", NET_AdrToString(adr, sizeof(adr), server->adr), "favorite:qw", server->name));
}
}
if (qws)
VFS_CLOSE(qws);
VFS_CLOSE(mf);
}
@ -1429,7 +1439,7 @@ void CL_QueryServers(void)
{
static int poll;
int op;
serverinfo_t *server;
serverinfo_t *server;
extern cvar_t sb_hidequake2;
extern cvar_t sb_hidequake3;
@ -1437,7 +1447,7 @@ void CL_QueryServers(void)
extern cvar_t sb_hidequakeworld;
op = poll;
for (server = firstserver; op>0 && server; server=server->next, op--);
@ -1489,7 +1499,7 @@ void CL_QueryServers(void)
poll++;
return;
}
poll = 0;
}
@ -1574,7 +1584,7 @@ int CL_ReadServerInfo(char *msg, int servertype, qboolean favorite)
char *token;
char *nl;
char *name;
char *name;
int ping;
int len;
serverinfo_t *info;
@ -1844,6 +1854,17 @@ void CL_MasterListParse(netadrtype_t adrtype, int type, qboolean slashpad)
for (i = 0; i < adrlen; i++)
((qbyte *)&info->adr.address)[i] = MSG_ReadByte();
break;
// warning: enumeration value NA_* not handled in switch
case NA_INVALID:
case NA_LOOPBACK:
case NA_BROADCAST_IP:
case NA_BROADCAST_IP6:
case NA_BROADCAST_IPX:
case NA_TCP:
case NA_TCPV6:
case NA_IRC:
break;
}
p1 = MSG_ReadByte();
@ -1871,7 +1892,7 @@ void CL_MasterListParse(netadrtype_t adrtype, int type, qboolean slashpad)
last = info;
Master_ResortServer(info);
}
}
}
firstserver = last;

View File

@ -120,7 +120,7 @@ typedef struct beamseg_s
{
struct beamseg_s *next; // next in beamseg list
particle_t *p;
particle_t *p;
int flags; // flags for beamseg
vec3_t dir;
@ -188,7 +188,7 @@ typedef struct part_type_s {
float veladd; //scale the incoming velocity by this much
float orgadd; //spawn the particle this far along its velocity direction
float spawnvel, spawnvelvert; //spawn the particle with a velocity based upon its spawn type (generally so it flies outwards)
float s1, t1, s2, t2; //texture coords
float texsstride; //addition for s for each random slot.
int randsmax; //max times the stride can be added
@ -280,9 +280,9 @@ static void PScript_DrawParticleTypes (void (*texturedparticles)(int count, part
#ifndef TYPESONLY
//triangle fan sparks use these.
static double sint[7] = {0.000000, 0.781832, 0.974928, 0.433884, -0.433884, -0.974928, -0.781832};
static double cost[7] = {1.000000, 0.623490, -0.222521, -0.900969, -0.900969, -0.222521, 0.623490};
//triangle fan sparks use these. // defined but not used
//static double sint[7] = {0.000000, 0.781832, 0.974928, 0.433884, -0.433884, -0.974928, -0.781832};
//static double cost[7] = {1.000000, 0.623490, -0.222521, -0.900969, -0.900969, -0.222521, 0.623490};
#define crand() (rand()%32767/16383.5f-1)
@ -352,7 +352,7 @@ static part_type_t *part_run_list;
static struct {
char *oldn;
char *newn;
} legacynames[] =
} legacynames[] =
{
{"t_rocket", "TR_ROCKET"},
{"te_explosion", "TE_EXPLOSION"},
@ -520,7 +520,7 @@ static void P_LoadTexture(part_type_t *ptype, qboolean warn)
}
else
ptype->looks.shader = NULL;
if (!ptype->looks.shader)
{
/*okay, so no shader, generate a shader that matches the legacy/shaderless mode*/
@ -1887,7 +1887,7 @@ static void P_LoadParticleSet(char *name, qboolean first)
{
char *file;
int i;
int restrictlevel = Cmd_FromGamecode() ? RESTRICT_SERVER : RESTRICT_LOCAL;
int restrictlevel = Cmd_FromGamecode() ? RESTRICT_SERVER : RESTRICT_LOCAL;
/*set up a default*/
if (first && !*name)
@ -2307,7 +2307,7 @@ static void PScript_EffectSpawned(part_type_t *ptype, vec3_t org, vec3_t dir)
dl->channelfade[2] = ptype->dl_decay[2];
}
if (ptype->stain_radius)
R_AddStain(org, ptype->stain_rgb[0], ptype->stain_rgb[1], ptype->stain_rgb[2], ptype->stain_radius);
R_AddStain(org, ptype->stain_rgb[0], ptype->stain_rgb[1], ptype->stain_rgb[2], ptype->stain_radius);
}
int Q1BSP_ClipDecal(vec3_t center, vec3_t normal, vec3_t tangent, vec3_t tangent2, float size, float **out);
@ -3669,7 +3669,7 @@ static void GL_DrawTexturedParticle(int count, particle_t **plist, plooks_t *typ
else
scale = 0.25 + scale * 0.001;
}
Vector4Copy(p->rgba, pscriptcolours[pscriptmesh.numvertexes+0]);
Vector4Copy(p->rgba, pscriptcolours[pscriptmesh.numvertexes+1]);
Vector4Copy(p->rgba, pscriptcolours[pscriptmesh.numvertexes+2]);
@ -3780,7 +3780,7 @@ static void GL_DrawLineSparkParticle(int count, particle_t **plist, plooks_t *ty
APPLYBLEND(type->blendmode);
qglShadeModel(GL_SMOOTH);
qglBegin(GL_LINES);
while (count--)
{
p = *plist++;
@ -3827,7 +3827,7 @@ static void GL_DrawTexturedSparkParticle(int count, particle_t **plist, plooks_t
Vector2Set(pscripttexcoords[pscriptmesh.numvertexes+2], p->s2, p->t2);
Vector2Set(pscripttexcoords[pscriptmesh.numvertexes+3], p->s2, p->t1);
if (type->stretch)
{
VectorMA(p->org, type->stretch, p->vel, o2);

View File

@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
@ -84,7 +84,7 @@ void Surf_RebuildLightmap_Callback (struct cvar_s *var, char *oldvalue)
//radius, x y z, r g b
void Surf_StainSurf (msurface_t *surf, float *parms)
{
{
int sd, td;
float dist, rad, minlight;
float change;
@ -130,8 +130,8 @@ void Surf_StainSurf (msurface_t *surf, float *parms)
local[1] = DotProduct (impact, tex->vecs[1]) + tex->vecs[1][3];
local[0] -= surf->texturemins[0];
local[1] -= surf->texturemins[1];
local[1] -= surf->texturemins[1];
for (t = 0 ; t<tmax ; t++)
{
td = local[1] - t*16;
@ -171,13 +171,13 @@ static void Surf_StainNode (mnode_t *node, float *parms)
float dist;
msurface_t *surf;
int i;
if (node->contents < 0)
return;
return;
splitplane = node->plane;
dist = DotProduct ((parms+1), splitplane->normal) - splitplane->dist;
if (dist > (*parms))
{
Surf_StainNode (node->children[0], parms);
@ -226,7 +226,7 @@ void Surf_AddStain(vec3_t org, float red, float green, float blue, float radius)
for (i=1 ; i< pmove.numphysent ; i++) //0 is world...
{
pe = &pmove.physents[i];
pe = &pmove.physents[i];
if (pe->model && pe->model->surfaces == cl.worldmodel->surfaces)
{
parms[1] = org[0] - pe->origin[0];
@ -293,7 +293,7 @@ void Surf_LessenStains(void)
surf->cached_dlight=-1;//nice hack here...
smax = (surf->extents[0]>>4)+1;
tmax = (surf->extents[1]>>4)+1;
tmax = (surf->extents[1]>>4)+1;
stain = lightmap[surf->lightmaptexturenum]->stainmaps;
stain += (surf->light_t * LMBLOCK_WIDTH + surf->light_s) * 3;
@ -317,7 +317,7 @@ void Surf_LessenStains(void)
*stain = 255;
stain++;
}
}
}
}
}
@ -399,6 +399,8 @@ static void Surf_AddDynamicLights (msurface_t *surf)
}
}
// warning: Surf_AddDynamicLightNorms defined but not used
/*
static void Surf_AddDynamicLightNorms (msurface_t *surf)
{
int lnum;
@ -470,6 +472,7 @@ static void Surf_AddDynamicLightNorms (msurface_t *surf)
}
}
}
*/
#ifdef PEXT_LIGHTSTYLECOL
static void Surf_AddDynamicLightsColours (msurface_t *surf)
@ -539,8 +542,8 @@ static void Surf_AddDynamicLightsColours (msurface_t *surf)
else
dist = td + (sd>>1);
if (dist < minlight)
{
blocklights[t*smax + s] += 2*sin(dist/10+cl.time*20)*(rad - dist)*256 * cl_dlights[lnum].colour[0]*3;
{
blocklights[t*smax + s] += 2*sin(dist/10+cl.time*20)*(rad - dist)*256 * cl_dlights[lnum].colour[0]*3;
greenblklights[t*smax + s] += 2*sin(M_PI/3+dist/10+cl.time*20)*(rad - dist)*256 * cl_dlights[lnum].colour[1]*3;
blueblklights[t*smax + s] += 2*sin(2*M_PI/3+dist/10+cl.time*20)*(rad - dist)*256 * cl_dlights[lnum].colour[2]*3;
}
@ -565,8 +568,8 @@ static void Surf_AddDynamicLightsColours (msurface_t *surf)
else
dist = td + (sd>>1);
if (dist < minlight)
{
bl[0] += (rad - dist)*r;
{
bl[0] += (rad - dist)*r;
bl[1] += (rad - dist)*g;
bl[2] += (rad - dist)*b;
}
@ -693,7 +696,7 @@ store:
dest += 3;
bnorm+=3;
}
}
}
}
enum lm_mode
@ -751,11 +754,11 @@ static void Surf_StoreLightmap(qbyte *dest, int smax, int tmax, unsigned int shi
dest[2] = r;
dest[3] = 255;
dest += 4;
dest += 4;
}
if (stainsrc)
stainsrc += (LMBLOCK_WIDTH - smax)*3;
}
}
break;
/*
case bgra4:
@ -800,24 +803,24 @@ static void Surf_StoreLightmap(qbyte *dest, int smax, int tmax, unsigned int shi
dest[0] = b;
dest[3] = 255;
dest += 4;
dest += 4;
}
if (stainsrc)
stainsrc += (LMBLOCK_WIDTH - smax)*3;
}
}
break;
*/
case rgb3_os:
stride = LMBLOCK_WIDTH*3 - (smax*3);
bl = blocklights;
for (i=0 ; i<tmax ; i++, dest += stride)
{
for (j=0 ; j<smax ; j++)
{
r = *bl++ >> shift;
g = *bl++ >> shift;
b = *bl++ >> shift;
b = *bl++ >> shift;
if (stainsrc) // merge in stain
{
@ -839,11 +842,11 @@ static void Surf_StoreLightmap(qbyte *dest, int smax, int tmax, unsigned int shi
dest[0] = r;
dest[1] = g;
dest[2] = b;
dest += 3;
dest += 3;
}
if (stainsrc)
stainsrc += (LMBLOCK_WIDTH - smax)*3;
}
}
break;
case lum:
stride = LMBLOCK_WIDTH;
@ -882,7 +885,7 @@ static void Surf_BuildLightMap (msurface_t *surf, qbyte *dest, qbyte *deluxdest,
int maps;
unsigned *bl;
int stride = LMBLOCK_WIDTH*lightmap_bytes;
//int stride = LMBLOCK_WIDTH*lightmap_bytes; //warning: unused variable stride
shift += 7; // increase to base value
surf->cached_dlight = (surf->dlightframe == r_framecount);
@ -897,7 +900,7 @@ static void Surf_BuildLightMap (msurface_t *surf, qbyte *dest, qbyte *deluxdest,
Con_Printf("Lightmap too large\n");
return;
}
if (currentmodel->deluxdata)
Surf_BuildDeluxMap(surf, deluxdest);
@ -979,7 +982,7 @@ static void Surf_BuildLightMap (msurface_t *surf, qbyte *dest, qbyte *deluxdest,
}
}
else if (currentmodel->engineflags & MDLF_RGBLIGHTING) //rgb
{
{
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
maps++)
{
@ -1084,7 +1087,7 @@ static void Surf_BuildLightMap (msurface_t *surf, qbyte *dest, qbyte *deluxdest,
Surf_StoreLightmap(dest, smax, tmax, shift, bgr3, stainsrc);
*/
}
else
else
{
Surf_StoreLightmap(dest, smax, tmax, shift, rgb3_os, stainsrc);
}
@ -1183,7 +1186,7 @@ void Surf_RenderDynamicLightmaps (msurface_t *fa)
//surfaces with lightmaps that do not animate, supposedly
if (fa->texinfo->flags & (TI_SKY|TI_TRANS33|TI_TRANS66|TI_WARP))
return;
// check for lightmap modification
if (!fa->samples)
{
@ -1368,7 +1371,7 @@ static qbyte *R_MarkLeafSurfaces_Q1 (void)
int shift;
vis = R_CalcVis_Q1();
for (i=0 ; i<cl.worldmodel->numleafs ; i++)
{
if (vis[i>>3] & (1<<(i&7)))
@ -1547,7 +1550,7 @@ static void Surf_RecursiveQ2WorldNode (mnode_t *node)
return;
if (R_CullBox (node->minmaxs, node->minmaxs+3))
return;
// if a leaf node, draw stuff
if (node->contents != -1)
{
@ -1817,7 +1820,7 @@ void Surf_SetupFrame(void)
{
}
else if (r_viewleaf->contents == Q1CONTENTS_EMPTY)
{ //look down a bit
{ //look down a bit
VectorCopy (r_origin, temp);
temp[2] -= 16;
leaf = RMod_PointInLeaf (cl.worldmodel, temp);
@ -1828,7 +1831,7 @@ void Surf_SetupFrame(void)
}
else if (r_viewleaf->contents <= Q1CONTENTS_WATER && r_viewleaf->contents >= Q1CONTENTS_LAVA)
{ //in water, look up a bit.
VectorCopy (r_origin, temp);
temp[2] += 16;
leaf = RMod_PointInLeaf (cl.worldmodel, temp);
@ -1839,7 +1842,7 @@ void Surf_SetupFrame(void)
}
else
r_viewleaf2 = NULL;
if (r_viewleaf)
V_SetContentsColor (r_viewleaf->contents);
}
@ -2139,7 +2142,7 @@ static int Surf_LM_AllocBlock (int w, int h, int *x, int *y, shader_t *shader)
{
if (texnum == numlightmaps) //allocate 4 more lightmap slots. not much memory usage, but we don't want any caps here.
{
lightmap = BZ_Realloc(lightmap, sizeof(*lightmap)*(numlightmaps+4));
lightmap = BZ_Realloc(lightmap, sizeof(*lightmap)*(numlightmaps+4));
lightmap[numlightmaps+0] = NULL;
lightmap[numlightmaps+1] = NULL;
lightmap[numlightmaps+2] = NULL;
@ -2220,19 +2223,19 @@ static int Surf_LM_FillBlock (int texnum, int w, int h, int x, int y)
int i, l;
while (texnum >= numlightmaps) //allocate 4 more lightmap slots. not much memory usage, but we don't want any caps here.
{
lightmap = BZ_Realloc(lightmap, sizeof(*lightmap)*(numlightmaps+4));
lightmap = BZ_Realloc(lightmap, sizeof(*lightmap)*(numlightmaps+4));
lightmap[numlightmaps+0] = NULL;
lightmap[numlightmaps+1] = NULL;
lightmap[numlightmaps+2] = NULL;
lightmap[numlightmaps+3] = NULL;
lightmap_textures = BZ_Realloc(lightmap_textures, sizeof(*lightmap_textures)*(numlightmaps+4));
lightmap_textures = BZ_Realloc(lightmap_textures, sizeof(*lightmap_textures)*(numlightmaps+4));
lightmap_textures[numlightmaps+0] = R_AllocNewTexture(LMBLOCK_WIDTH, LMBLOCK_HEIGHT);
lightmap_textures[numlightmaps+1] = R_AllocNewTexture(LMBLOCK_WIDTH, LMBLOCK_HEIGHT);
lightmap_textures[numlightmaps+2] = R_AllocNewTexture(LMBLOCK_WIDTH, LMBLOCK_HEIGHT);
lightmap_textures[numlightmaps+3] = R_AllocNewTexture(LMBLOCK_WIDTH, LMBLOCK_HEIGHT);
deluxmap_textures = BZ_Realloc(deluxmap_textures, sizeof(*deluxmap_textures)*(numlightmaps+4));
deluxmap_textures = BZ_Realloc(deluxmap_textures, sizeof(*deluxmap_textures)*(numlightmaps+4));
deluxmap_textures[numlightmaps+0] = R_AllocNewTexture(LMBLOCK_WIDTH, LMBLOCK_HEIGHT);
deluxmap_textures[numlightmaps+1] = R_AllocNewTexture(LMBLOCK_WIDTH, LMBLOCK_HEIGHT);
deluxmap_textures[numlightmaps+2] = R_AllocNewTexture(LMBLOCK_WIDTH, LMBLOCK_HEIGHT);
@ -2519,13 +2522,13 @@ void Surf_BuildLightmaps (void)
switch(qrenderer)
{
#ifdef D3DQUAKE
case QR_DIRECT3D:
#ifdef D3DQUAKE
/*always bgra, hope your card supports it*/
lightmap_bytes = 4;
lightmap_bgra = true;
break;
#endif
break;
#ifdef GLQUAKE
case QR_OPENGL:
/*favour bgra if the gpu supports it, otherwise use rgb only if it'll be used*/
@ -2550,6 +2553,8 @@ void Surf_BuildLightmaps (void)
lightmap_bytes = 1;
break;
#endif
case QR_NONE:
break;
}
for (j=1 ; j<MAX_MODELS ; j++)

View File

@ -222,7 +222,7 @@ cvar_t gl_blend2d = CVAR ("gl_blend2d", "1");
cvar_t gl_blendsprites = CVAR ("gl_blendsprites", "1");
cvar_t gl_bump = CVARF ("gl_bump", "0",
CVAR_ARCHIVE | CVAR_RENDERERLATCH);
cvar_t r_deluxemapping = CVARAF ("r_deluxemapping", "0", "r_glsl_deluxemapping",
cvar_t r_deluxemapping = CVARAF ("r_deluxemapping", "0", "r_glsl_deluxemapping",
CVAR_ARCHIVE | CVAR_RENDERERLATCH);
cvar_t gl_compress = CVARF ("gl_compress", "0",
CVAR_ARCHIVE);
@ -1026,13 +1026,14 @@ void M_Menu_Video_f (void)
"32",
NULL
};
static const char *texturefilternames[] =
//unused
/*static const char *texturefilternames[] =
{
"Nearest",
"Bilinear",
"Trilinear",
NULL
};
};*/
static const char *refreshrates[] =
{

View File

@ -1971,12 +1971,12 @@ void Sbar_Hexen2DrawExtra (int pnum)
unsigned int i, slot;
unsigned int pclass;
int ringpos[] = {6, 44, 81, 119};
char *ringimages[] = {"gfx/ring_f.lmp", "gfx/ring_w.lmp", "gfx/ring_t.lmp", "gfx/ring_r.lmp"};
//char *ringimages[] = {"gfx/ring_f.lmp", "gfx/ring_w.lmp", "gfx/ring_t.lmp", "gfx/ring_r.lmp"}; //unused variable
float val;
char *pclassname[] = {
"Unknown",
"Paladin",
"Crusader",
"Crusader",
"Necromancer",
"Assasin",
"Demoness"
@ -2022,7 +2022,7 @@ void Sbar_Hexen2DrawExtra (int pnum)
Sbar_DrawTinyString (11, 70, va("dex"));
Sbar_DrawTinyString (33, 70, va("%02d", cl.stats[pnum][STAT_H2_DEXTERITY]));
Sbar_DrawTinyString (58, 58, va("str"));
Sbar_DrawTinyString (80, 58, va("%02d", cl.stats[pnum][STAT_H2_STRENGTH]));

View File

@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
@ -448,7 +448,7 @@ void SND_ResampleStream (void *in, int inrate, int inwidth, int inchannels, int
STANDARDRESCALESTEREO(in16, inrate, insamps, out16, outrate, 0, 0)
}
}
else
else
{
if (inrate == outrate) // quick convert
{
@ -518,7 +518,7 @@ void SND_ResampleStream (void *in, int inrate, int inwidth, int inchannels, int
else // downsample
STANDARDRESCALESTEREOTOMONO(in16, inrate, insamps, out16, outrate, 0, 0)
}
else
else
{
if (inrate == outrate) // quick convert
QUICKCONVERTSTEREOTOMONO(in16, insamps, out8, 0, 8)
@ -576,15 +576,15 @@ void ResampleSfx (sfx_t *sfx, int inrate, int inchannels, int inwidth, int insam
else
sc->loopstart = inloopstart * scale;
SND_ResampleStream (data,
inrate,
inwidth,
inchannels,
insamps,
sc->data,
sc->speed,
sc->width,
sc->numchannels,
SND_ResampleStream (data,
inrate,
inwidth,
inchannels,
insamps,
sc->data,
sc->speed,
sc->width,
sc->numchannels,
snd_linearresample.ival);
}
@ -768,6 +768,7 @@ sfxcache_t *S_LoadSound (sfx_t *s)
qbyte *data;
sfxcache_t *sc;
int i;
size_t result;
char *name = s->name;
@ -796,7 +797,7 @@ sfxcache_t *S_LoadSound (sfx_t *s)
if (*name == '\\')
*name = '/';
name++;
}
}
name = unixname;
#endif
@ -804,7 +805,7 @@ sfxcache_t *S_LoadSound (sfx_t *s)
{
com_filesize = COM_filelength(f);
data = Hunk_TempAlloc (com_filesize);
fread(data, 1, com_filesize, f);
result = fread(data, 1, com_filesize, f); //do something with result
fclose(f);
}
else
@ -977,7 +978,7 @@ unsigned int FindChunk(char *name)
void DumpChunks(void)
{
char str[5];
str[4] = 0;
data_p=iff_data;
do
@ -1008,7 +1009,7 @@ wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength)
if (!wav)
return info;
iff_data = wav;
iff_end = wav + wavlength;
wavname = name;
@ -1069,7 +1070,7 @@ wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength)
info.loopstart = -1;
// find data chunk
chunklen = FindChunk("data");
chunklen = FindChunk("data");
if (!chunklen)
{
Con_Printf("Missing data chunk in %s\n", name);
@ -1097,6 +1098,6 @@ wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength)
}
info.dataofs = data_p - wav;
return info;
}

View File

@ -14,6 +14,30 @@
//FIXME: One thing I saw in quakeforge was that quakeforge basically leaves the audio locked except for a really short period of time.
//An interesting idea, which ensures the driver can only paint in a small time-frame. this would possibly allow lower latency painting.
/*
==================
S_BlockSound
==================
*/
//all devices
void S_BlockSound (void)
{
soundcardinfo_t *sc;
wavhandle_t *wh;
snd_blocked++;
for (sc = sndcardinfo; sc; sc=sc->next)
{
if (sc->Submit == WAV_Submit && !sc->inactive_sound)
{
wh = sc->handle;
if (snd_blocked == 1)
waveOutReset (wh->hWaveOut);
}
}
}
static void SSDL_Shutdown(soundcardinfo_t *sc)
{
Con_Printf("Shutdown SDL sound\n");

View File

@ -341,6 +341,7 @@ int Sys_DebugLog(char *file, char *fmt, ...)
va_list argptr;
static char data[1024];
int fd;
size_t result;
va_start(argptr, fmt);
_vsnprintf (data,sizeof(data)-1, fmt, argptr);
@ -353,7 +354,7 @@ int Sys_DebugLog(char *file, char *fmt, ...)
fd = open(file, O_WRONLY | O_CREAT | O_APPEND, 0666);
if (fd)
{
write(fd, data, strlen(data));
result = write(fd, data, strlen(data)); // do something with result
close(fd);
return 0;
}
@ -462,7 +463,7 @@ static void *game_library;
void Sys_UnloadGame(void)
{
if (game_library)
if (game_library)
{
dlclose(game_library);
game_library = 0;
@ -477,13 +478,14 @@ void *Sys_GetGameAPI(void *parms)
char curpath[MAX_OSPATH];
char *searchpath;
const char *gamename = "gamei386.so";
size_t result;
void *ret;
getcwd(curpath, sizeof(curpath));
result = getcwd(curpath, sizeof(curpath)); // do something with result?
Con_DPrintf("Searching for %s\n", gamename);
searchpath = 0;
while((searchpath = COM_NextPath(searchpath)))
{
@ -682,7 +684,7 @@ qboolean Sys_GetDesktopParameters(int *width, int *height, int *bpp, int *refres
Display *xtemp;
int scr;
xtemp = XOpenDisplay(NULL);
if (!xtemp)
@ -724,11 +726,11 @@ void *Sys_CreateThread(int (*func)(void *), void *args, int stacksize)
{
pthread_t *thread;
pthread_attr_t attr;
thread = (pthread_t *)malloc(sizeof(pthread_t));
if (!thread)
return NULL;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
if (stacksize < PTHREAD_STACK_MIN)
@ -746,7 +748,7 @@ void *Sys_CreateThread(int (*func)(void *), void *args, int stacksize)
void Sys_WaitOnThread(void *thread)
{
pthread_join((pthread_t *)thread, NULL);
pthread_join((pthread_t *)thread, NULL);
free(thread);
}
@ -754,7 +756,7 @@ void Sys_WaitOnThread(void *thread)
void *Sys_CreateMutex(void)
{
pthread_mutex_t *mutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
if (mutex && !pthread_mutex_init(mutex, NULL))
return mutex;
return NULL;
@ -793,36 +795,36 @@ void *Sys_CreateConditional(void)
condvar_t *condv;
pthread_mutex_t *mutex;
pthread_cond_t *cond;
condv = (condvar_t *)malloc(sizeof(condvar_t));
if (!condv)
return NULL;
mutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
if (!mutex)
return NULL;
cond = (pthread_cond_t *)malloc(sizeof(pthread_cond_t));
if (!cond)
return NULL;
if (!pthread_mutex_init(mutex, NULL))
{
if (!pthread_cond_init(cond, NULL))
{
condv->cond = cond;
condv->mutex = mutex;
return (void *)condv;
}
else
pthread_mutex_destroy(mutex);
}
free(cond);
free(mutex);
free(condv);
return NULL;
return NULL;
}
qboolean Sys_LockConditional(void *condv)
@ -853,7 +855,7 @@ qboolean Sys_ConditionBroadcast(void *condv)
void Sys_DestroyConditional(void *condv)
{
condvar_t *cv = (condvar_t *)condv;
pthread_cond_destroy(cv->cond);
pthread_mutex_destroy(cv->mutex);
free(cv->cond);

View File

@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "winquake.h"
#include <ctype.h> // for isdigit();
#ifdef FISH
void R_RenderView_fisheye(void);
cvar_t ffov = SCVAR("ffov", "0");
@ -117,21 +119,21 @@ float V_CalcRoll (vec3_t angles, vec3_t velocity)
float sign;
float side;
float value;
AngleVectors (angles, forward, right, up);
side = DotProduct (velocity, right);
sign = side < 0 ? -1 : 1;
side = fabs(side);
value = cl_rollangle.value;
if (side < cl_rollspeed.value)
side = side * value / cl_rollspeed.value;
else
side = value;
return side*sign;
}
@ -146,7 +148,7 @@ float V_CalcBob (int pnum)
static double bobtime[MAX_SPLITS];
static float bob[MAX_SPLITS];
float cycle;
if (cl.spectator)
return 0;
@ -174,7 +176,7 @@ float V_CalcBob (int pnum)
else if (bob[pnum] < -7)
bob[pnum] = -7;
return bob[pnum];
}
@ -218,7 +220,7 @@ If the user is adjusting pitch manually, either with lookup/lookdown,
mlook and mouse, or klook and keyboard, pitch drifting is constantly stopped.
Drifting is enabled when the center view key is hit, mlook is released and
lookspring is non 0, or when
lookspring is non 0, or when
===============
*/
void V_DriftPitch (int pnum)
@ -239,14 +241,14 @@ void V_DriftPitch (int pnum)
cl.driftmove[pnum] = 0;
else
cl.driftmove[pnum] += host_frametime;
if ( cl.driftmove[pnum] > v_centermove.value)
{
V_StartPitchDrift (pnum);
}
return;
}
delta = 0 - cl.viewangles[pnum][PITCH];
if (!delta)
@ -257,7 +259,7 @@ void V_DriftPitch (int pnum)
move = host_frametime * cl.pitchvel[pnum];
cl.pitchvel[pnum] += host_frametime * v_centerspeed.value;
//Con_Printf ("move: %f (%f)\n", move, host_frametime);
if (delta > 0)
@ -285,14 +287,14 @@ void V_DriftPitch (int pnum)
/*
==============================================================================
PALETTE FLASHES
==============================================================================
*/
==============================================================================
PALETTE FLASHES
==============================================================================
*/
cshift_t cshift_empty = { {130,80,50}, 0 };
cshift_t cshift_water = { {130,80,50}, 128 };
cshift_t cshift_slime = { {0,25,5}, 150 };
@ -314,14 +316,14 @@ float hw_blend[4]; // rgba 0.0 - 1.0
void BuildGammaTable (float g)
{
int i, inf;
if (g == 1.0)
{
for (i=0 ; i<256 ; i++)
gammatable[i] = i;
return;
}
for (i=0 ; i<256 ; i++)
{
inf = 255 * pow ( (i+0.5)/255.5 , g ) + 0.5;
@ -352,7 +354,7 @@ void BuildGammaTable (float g, float c)
if (inf < 0)
inf = 0;
else if (inf > 255)
inf = 255;
inf = 255;
gammatable[i] = inf;
}
}
@ -384,7 +386,7 @@ void V_ParseDamage (int pnum)
vec3_t forward, right, up;
float side;
float count;
armor = MSG_ReadByte ();
blood = MSG_ReadByte ();
for (i=0 ; i<3 ; i++)
@ -405,7 +407,7 @@ void V_ParseDamage (int pnum)
if (cl.cshifts[CSHIFT_DAMAGE].percent > 150)
cl.cshifts[CSHIFT_DAMAGE].percent = 150;
if (armor > blood)
if (armor > blood)
{
cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 200;
cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 100;
@ -429,12 +431,12 @@ void V_ParseDamage (int pnum)
//
VectorSubtract (from, cl.simorg[pnum], from);
VectorNormalize (from);
AngleVectors (cl.simangles[pnum], forward, right, up);
side = DotProduct (from, right);
v_dmg_roll[pnum] = count*side*v_kickroll.value;
side = DotProduct (from, forward);
v_dmg_pitch[pnum] = count*side*v_kickpitch.value;
@ -638,7 +640,7 @@ void GLV_CalcBlend (float *hw_blend)
memset(sw_blend, 0, sizeof(float)*4);
//don't apply it to the server, we'll blend the two later if the user has no hardware gamma (if they do have it, we use just the server specified value) This way we avoid winnt users having a cheat with flashbangs and stuff.
for (j=0 ; j<NUM_CSHIFTS ; j++)
for (j=0 ; j<NUM_CSHIFTS ; j++)
{
if (j != CSHIFT_SERVER)
{
@ -760,13 +762,13 @@ void V_ClearCShifts (void)
cl.cshifts[i].percent = 0;
}
/*
==============================================================================
VIEW RENDERING
==============================================================================
*/
/*
==============================================================================
VIEW RENDERING
==============================================================================
*/
float angledelta (float a)
{
@ -782,11 +784,11 @@ CalcGunAngle
==================
*/
void CalcGunAngle (int pnum)
{
{
float yaw, pitch, move;
static float oldyaw = 0;
static float oldpitch = 0;
yaw = r_refdef.viewangles[YAW];
pitch = -r_refdef.viewangles[PITCH];
@ -811,7 +813,7 @@ void CalcGunAngle (int pnum)
if (oldyaw - move > yaw)
yaw = oldyaw - move;
}
if (pitch > oldpitch)
{
if (oldpitch + move < pitch)
@ -822,7 +824,7 @@ void CalcGunAngle (int pnum)
if (oldpitch - move > pitch)
pitch = oldpitch - move;
}
oldyaw = yaw;
oldpitch = pitch;
@ -1005,7 +1007,7 @@ void V_CalcRefdef (int pnum)
bob=v_viewheight.value;
else
bob = V_CalcBob (pnum);
// refresh position from simulated origin
VectorCopy (cl.simorg[pnum], r_refdef.vieworg);
@ -1077,7 +1079,7 @@ void V_CalcRefdef (int pnum)
// v_viewheight only affects the view if the player is alive
r_refdef.vieworg[2] += bob;
}
// set up gun position
AngleVectors (view->angles, forward, right, up);
CalcGunAngle (pnum);
@ -1306,13 +1308,13 @@ void V_RenderPlayerViews(int plnum)
if (cls.protocol == CP_NETQUAKE)
view_message->weaponframe = cl.stats[0][STAT_WEAPONFRAME];
#endif
cl.simangles[plnum][ROLL] = 0; // FIXME @@@
cl.simangles[plnum][ROLL] = 0; // FIXME @@@
DropPunchAngle (plnum);
if (cl.intermission)
{ // intermission / finale rendering
V_CalcIntermissionRefdef (plnum);
V_CalcIntermissionRefdef (plnum);
}
else
{
@ -1353,7 +1355,7 @@ void V_RenderPlayerViews(int plnum)
#ifdef SIDEVIEWS
/* //adjust main view height to strip off the rearviews at the top
if (vsecwidth >= 1)
{
{
r_refdef.vrect.y -= vsecheight;
r_refdef.vrect.height += vsecheight;
}
@ -1405,8 +1407,8 @@ void V_RenderPlayerViews(int plnum)
if (e)
{
float s;
memcpy(r_refdef.viewangles, e->angles, sizeof(vec3_t));
memcpy(r_refdef.vieworg, e->origin, sizeof(vec3_t));
memcpy(r_refdef.viewangles, e->angles, sizeof(vec3_t));
memcpy(r_refdef.vieworg, e->origin, sizeof(vec3_t));
// cl.viewentity = cl.viewentity2;
// s = (realtime - e->lerptime)*10;
@ -1440,7 +1442,7 @@ void V_RenderPlayerViews(int plnum)
}
r_refdef.vrect = oldrect;
memcpy(r_refdef.viewangles, oldangles, sizeof(vec3_t));
memcpy(r_refdef.viewangles, oldangles, sizeof(vec3_t));
memcpy(r_refdef.vieworg, oldposition, sizeof(vec3_t));
r_refdef.fov_x = ofx;
r_refdef.fov_y = ofy;
@ -1512,7 +1514,7 @@ void V_Init (void)
#ifdef SIDEVIEWS
int i;
#endif
Cmd_AddCommand ("v_cshift", V_cshift_f);
Cmd_AddCommand ("v_cshift", V_cshift_f);
Cmd_AddCommand ("bf", V_BonusFlash_f);
// Cmd_AddCommand ("centerview", V_StartPitchDrift);

View File

@ -202,7 +202,7 @@ typedef struct tvars_s {
vec3_t pointorg;
char pointloc[MAX_LOC_NAME];
int droppedweapon;
char lastdroploc[MAX_LOC_NAME];
char lastdroploc[MAX_LOC_NAME];
int last_numenemies;
int numenemies;
@ -234,8 +234,8 @@ typedef struct item_vis_s {
vec3_t up;
vec3_t entorg;
float radius;
vec3_t dir;
float dist;
vec3_t dir;
float dist;
} item_vis_t;
@ -389,7 +389,7 @@ static char *Macro_DroppedWeapon (void)
return Weapon_NumToString(vars.droppedweapon);
}
static char *Macro_Weapons (void) {
static char *Macro_Weapons (void) {
macro_buf[0] = 0;
if (cl.stats[SP][STAT_ITEMS] & IT_LIGHTNING)
@ -408,7 +408,7 @@ static char *Macro_Weapons (void) {
MacroBuf_strcat_with_separator (tp_name_sg.string);
if (cl.stats[SP][STAT_ITEMS] & IT_AXE)
MacroBuf_strcat_with_separator (tp_name_axe.string);
// if (!macro_buf[0])
// if (!macro_buf[0])
// strlcpy(macro_buf, tp_name_none.string, sizeof(macro_buf));
return macro_buf;
@ -442,7 +442,7 @@ static char *Macro_WeaponNum (void)
static int _Macro_BestWeapon (void)
{
int i;
char *t[] = {tp_weapon_order.string, "78654321", NULL}, **s;
char *t[] = {tp_weapon_order.string, "78654321", NULL}, **s;
for (s = t; *s; s++)
{
@ -472,7 +472,7 @@ static char *Macro_BestAmmo (void)
{
switch (_Macro_BestWeapon())
{
case IT_SHOTGUN: case IT_SUPER_SHOTGUN:
case IT_SHOTGUN: case IT_SUPER_SHOTGUN:
sprintf(macro_buf, "%i", cl.stats[0][STAT_SHELLS]);
return macro_buf;
@ -765,6 +765,8 @@ static char *Macro_demoplayback (void)
{
switch (cls.demoplayback)
{
case DPB_EZTV: // warning: enumeration value DPB_EZTV not handled in switch
break;
case DPB_NONE:
return "0";
case DPB_QUAKEWORLD:
@ -808,7 +810,7 @@ static char *Macro_Match_Name (void)
else if (i > 2)
{ // FFA
return va ("%s ffa - %s",
TP_PlayerName(),
TP_PlayerName(),
TP_MapName());
}
else
@ -886,14 +888,14 @@ static char *Macro_MyStatus_LED(void)
for (count = 1; *s; s++)
if (*s == separator[0])
count++;
}
}
if (count == 0)
Q_snprintfz(macro_buf, sizeof(macro_buf), "%s", tp_name_status_green.string);
else if (count <= 1)
Q_snprintfz(macro_buf, sizeof(macro_buf), "%s", tp_name_status_yellow.string);
else
Q_snprintfz(macro_buf, sizeof(macro_buf), "%s", tp_name_status_red.string);
Q_snprintfz(macro_buf, sizeof(macro_buf), "%s", tp_name_status_red.string);
return macro_buf;
}
@ -919,7 +921,7 @@ static void CountNearbyPlayers(qboolean dead)
state = cl.frames[cl.oldparsecount & UPDATE_MASK].playerstate;
info = cl.players;
for (i = 0; i < MAX_CLIENTS; i++, info++, state++) {
for (i = 0; i < MAX_CLIENTS; i++, info++, state++) {
if (i != cl.playernum[0] && state->messagenum == cl.oldparsecount && !info->spectator && !ISDEAD(state->frame)) {
if (cl.teamplay && !strcmp(info->team, TP_PlayerTeam()))
vars.numfriendlies++;
@ -1005,7 +1007,7 @@ static char *Macro_LastPointAtLoc (void)
if (!vars.pointtime || realtime - vars.pointtime > TP_POINT_EXPIRE_TIME)
Q_strncpyz (macro_buf, tp_name_nothing.string, sizeof(macro_buf));
else
Q_snprintfz (macro_buf, sizeof(macro_buf), "%s %s %s", vars.pointname, tp_name_at.string, vars.pointloc[0] ? vars.pointloc : Macro_Location());
Q_snprintfz (macro_buf, sizeof(macro_buf), "%s %s %s", vars.pointname, tp_name_at.string, vars.pointloc[0] ? vars.pointloc : Macro_Location());
return macro_buf;
}
@ -1037,13 +1039,13 @@ static char *Macro_LastSeenPowerup(void)
Q_strncatz2(macro_buf, tp_name_quad.string);
if (vars.enemy_powerups & TP_PENT)
{
if (macro_buf[0])
if (macro_buf[0])
Q_strncatz2(macro_buf, tp_name_separator.string);
Q_strncatz2(macro_buf, tp_name_pent.string);
}
if (vars.enemy_powerups & TP_RING)
{
if (macro_buf[0])
if (macro_buf[0])
Q_strncatz2(macro_buf, tp_name_separator.string);
Q_strncatz2(macro_buf, tp_name_ring.string);
}
@ -1220,7 +1222,7 @@ static char *TP_ParseMacroString (char *s)
sprintf (mbuf, "%s:%i", macro_string, cl.stats[SP][STAT_ARMOR]);
macro_string = mbuf;
break;
case 'h':
if (cl.stats[SP][STAT_HEALTH] >= 50)
sprintf (macro_buf, "%i", cl.stats[SP][STAT_HEALTH]);
@ -1228,7 +1230,7 @@ static char *TP_ParseMacroString (char *s)
sprintf (macro_buf, "\x10%i\x11", cl.stats[SP][STAT_HEALTH]);
macro_string = macro_buf;
break;
case 'p':
case 'P':
macro_string = Macro_Powerups();
@ -1238,9 +1240,9 @@ static char *TP_ParseMacroString (char *s)
mbuf[0] = 0;
macro_string = mbuf;
break;
// todo: %[w], %[b]
default:
buf[i++] = *s++;
continue;
@ -1252,7 +1254,7 @@ static char *TP_ParseMacroString (char *s)
s += 4; // skip %[<char>]
continue;
}
// check %a, etc
if (*s == '%')
{
@ -1270,18 +1272,18 @@ static char *TP_ParseMacroString (char *s)
case 'l': macro_string = Macro_Location(); break;
case 'L': macro_string = Macro_Last_Location(); break;
case 'm': macro_string = Macro_LastTookOrPointed(); break;
case 'o': macro_string = Macro_CountNearbyFriendlyPlayers(); break;
case 'e': macro_string = Macro_CountNearbyEnemyPlayers(); break;
case 'O': macro_string = Macro_Count_Last_NearbyFriendlyPlayers(); break;
case 'E': macro_string = Macro_Count_Last_NearbyEnemyPlayers(); break;
case 'P':
case 'P':
case 'p': macro_string = Macro_Powerups(); break;
case 'q': macro_string = Macro_LastSeenPowerup(); break;
case 'q': macro_string = Macro_LastSeenPowerup(); break;
// case 'r': macro_string = Macro_LastReportedLoc(); break;
case 's': macro_string = Macro_EnemyStatus_LED(); break;
case 'S': macro_string = Macro_TF_Skin(); break;
case 's': macro_string = Macro_EnemyStatus_LED(); break;
case 'S': macro_string = Macro_TF_Skin(); break;
case 't': macro_string = Macro_PointNameAtLocation(); break;
case 'u': macro_string = Macro_Need(); break;
case 'w': macro_string = Macro_WeaponAndAmmo(); break;
@ -1289,7 +1291,7 @@ static char *TP_ParseMacroString (char *s)
case 'X': macro_string = Macro_Took(); break;
case 'y': macro_string = Macro_PointLocation(); break;
case 'Y': macro_string = Macro_TookLoc(); break;
default:
default:
buf[i++] = *s++;
continue;
}
@ -1386,7 +1388,7 @@ static char *TP_ParseFunChars (char *s, qbool chat)
s += 2;
continue;
}
skip:
skip:
*out++ = *s++;
}
*out = 0;
@ -1511,7 +1513,7 @@ char *TP_LocationName (vec3_t location)
vec3_t vec;
static qbool recursive;
static char buf[MAX_LOC_NAME];
if (!loc_numentries || (cls.state != ca_active))
return tp_name_someplace.string;
@ -1611,7 +1613,7 @@ static void TP_MsgTrigger_f (void)
Com_Printf ("trigger string too long\n");
return;
}
trig = TP_FindTrigger (name);
if (!trig) {
@ -1933,7 +1935,7 @@ static void TP_TeamColor_f (void)
else {
bottom = TP_ForceColour(Cmd_Argv(2));
}
// if (top != cl_teamtopcolor || bottom != cl_teambottomcolor)
{
cl_teamtopcolor = top;
@ -2073,7 +2075,7 @@ int TP_CategorizeMessage (char *s, int *offset, player_info_t **plr)
{
// no team messages in teamplay 0, except for our own
if (cl.spectator)
{
{
unsigned int track = Cam_TrackNum(0);
if (i == track || ( cl.teamplay &&
!strcmp(cl.players[track].team, player->team)) )
@ -2117,7 +2119,7 @@ int TP_CategorizeMessage (char *s, int *offset, player_info_t **plr)
// symbolic names used in tp_took, tp_pickup, tp_point commands
char *pknames[] = {"quad", "pent", "ring", "suit", "ra", "ya", "ga",
"mh", "health", "lg", "rl", "gl", "sng", "ng", "ssg", "pack",
"cells", "rockets", "nails", "shells", "flag",
"cells", "rockets", "nails", "shells", "flag",
"teammate", "enemy", "eyes", "sentry", "disp", "runes"};
#define it_quad (1 << 0)
@ -2229,7 +2231,7 @@ static void FlagCommand (int *flags, int defaultflags) {
flag = (1<<NUM_ITEMFLAGS)-1;
}
if (flags != &pointflags)
flag &= ~(it_sentry|it_disp|it_players);
@ -2464,7 +2466,7 @@ static int FindNearestItem (int flags, item_t **pitem)
VectorCopy (cl.frames[cl.validsequence&UPDATE_MASK]
.playerstate[cl.playernum[SP]].origin, org);
// look in previous frame
// look in previous frame
frame = &cl.frames[cl.oldvalidsequence&UPDATE_MASK];
pak = &frame->packet_entities;
bestdist = 100.0f;
@ -2553,7 +2555,7 @@ static void ExecTookTrigger (char *s, int flag, vec3_t org)
pkflags_dmm = pkflags;
tookflags_dmm = tookflags;
if (!cl.teamfortress && cl.deathmatch >= 1 && cl.deathmatch <= 4) {
if (cl.deathmatch == 4) {
pkflags_dmm &= ~(it_ammo|it_weapons);
@ -3131,7 +3133,7 @@ void TP_StatChanged (int stat, int value)
cl.frames[cl.validsequence&UPDATE_MASK].playerstate[cl.playernum[SP]].origin);
}
}
if (!cl.spectator && cl.teamfortress && ~value & vars.items & (IT_KEY1|IT_KEY2))
{
vars.lastdrop_time = realtime;
@ -3271,7 +3273,7 @@ qbool TP_FilterMessage (char *s)
// strip the filter from message
if (i && s[i-1] == ' ')
{ // there's a space just before the filter, remove it
// so that soundtriggers like ^blah #att work
// so that soundtriggers like ^blah #att work
s[i-1] = '\n';
s[i] = 0;
} else {
@ -3458,7 +3460,7 @@ void CL_Say (qboolean team, char *extra)
CL_PrintChat(&cl.players[cl.playernum[SP]], NULL, text, plrflags);
}
//strip out the extra markup
for (s = sendtext, d = sendtext; *s; s++, d++)
{
@ -3477,7 +3479,7 @@ void CL_Say (qboolean team, char *extra)
break;
d--;
}
else
*d = *s;
}
@ -3486,7 +3488,7 @@ void CL_Say (qboolean team, char *extra)
//mark the message so that we ignore it when we get the echo.
strlcat (sendtext, va("\x7f!%c", 'A'+cl.playernum[0]), sizeof(sendtext));
}
#ifdef Q3CLIENT
if (cls.protocol == CP_QUAKE3)
CLQ3_SendClientCommand("%s %s%s", team ? "say_team" : "say", extra?extra:"", sendtext);

View File

@ -1100,6 +1100,7 @@ char *Cmd_ExpandCvar(char *cvarname, int maxaccesslevel, int *len)
char *fixup = NULL, fixval=0;
cvar_t *var;
static char temp[12];
size_t result;
namestart = cvarname;
if (*cvarname == '{')
@ -1117,7 +1118,7 @@ char *Cmd_ExpandCvar(char *cvarname, int maxaccesslevel, int *len)
fixval = *fixup;
}
strtol(cvarname, &end, 10);
result = strtol(cvarname, &end, 10); // do something with result
if (fixval && *end == '\0') //only expand $0 if its actually ${0} - this avoids conflicting with the $0 macro
{ //purely numerical
ret = Cmd_Argv(atoi(cvarname));
@ -1303,7 +1304,7 @@ char *Cmd_ExpandStringArguments (char *data, char *dest, int destlen)
str = NULL;
old_len = 0;
}
if (str)
{
// check buffer size
@ -2815,7 +2816,7 @@ void Cmd_Condump_f(void)
filename = va("%s", filename);
COM_DefaultExtension(filename, ".txt", MAX_QPATH);
f = FS_OpenVFS (filename, "wb", FS_GAME);
if (!f)
{

View File

@ -493,7 +493,7 @@ static float Alias_CalculateSkeletalNormals(galiasinfo_t *model)
VectorSubtract(xyz[idx[2]], xyz[idx[1]], d2);
angle = acos(DotProduct(d1, d2)/(Length(d1)*Length(d2)));
VectorMA(normals[mvert[idx[1]]], angle, tn, normals[mvert[idx[1]]]);
VectorSubtract(xyz[idx[0]], xyz[idx[2]], d1);
VectorSubtract(xyz[idx[1]], xyz[idx[2]], d2);
angle = acos(DotProduct(d1, d2)/(Length(d1)*Length(d2)));
@ -767,7 +767,7 @@ float *Alias_GetBonePositions(galiasinfo_t *inf, framestate_t *fstate, float *bu
galiasgroup_t *g1, *g2;
galiasbone_t *bones = (galiasbone_t *)((char*)inf+inf->ofsbones);
//galiasbone_t *bones = (galiasbone_t *)((char*)inf+inf->ofsbones); //unsed variable
if (buffersize < inf->numbones)
return NULL;
@ -897,7 +897,7 @@ vec3_t *tempNormals;
void R_LightArraysByte_BGR(vecV_t *coords, byte_vec4_t *colours, int vertcount, vec3_t *normals)
{
extern cvar_t r_vertexdlights;
//extern cvar_t r_vertexdlights; //unused
int i;
int c;
float l;
@ -948,7 +948,7 @@ void R_LightArrays(vecV_t *coords, avec4_t *colours, int vertcount, vec3_t *norm
int i;
float l;
float *lightdir = currententity->light_dir;
//float *lightdir = currententity->light_dir; //unused variable
if (!currententity->light_range[0] && !currententity->light_range[1] && !currententity->light_range[2])
{
@ -1031,7 +1031,7 @@ void R_LightArrays(vecV_t *coords, avec4_t *colours, int vertcount, vec3_t *norm
static void R_LerpFrames(mesh_t *mesh, galiaspose_t *p1, galiaspose_t *p2, float lerp, qbyte alpha, float expand, qboolean nolightdir)
{
extern cvar_t r_nolerp, r_nolightdir;
extern cvar_t r_nolerp; // r_nolightdir is unused
float blerp = 1-lerp;
int i;
vecV_t *p1v, *p2v;
@ -1880,7 +1880,9 @@ static void *Alias_LoadFrameGroup (daliasframetype_t *pframetype, int *seamremap
daliasinterval_t *intervals;
float sinter;
#ifndef SERVERONLY
vec3_t *normals, *svec, *tvec;
#endif
vecV_t *verts;
int aliasframesize;
@ -3603,7 +3605,7 @@ qboolean Mod_LoadQ3Model(model_t *mod, void *buffer)
externalskins = LittleLong(surf->numShaders);
if (externalskins)
{
extern int gl_bumpmappingpossible;
//extern int gl_bumpmappingpossible; // unused variable
char shadname[1024];
skin = Hunk_Alloc((LittleLong(surf->numShaders)+externalskins)*((sizeof(galiasskin_t)+sizeof(texnums_t))));
@ -4200,7 +4202,7 @@ qboolean Mod_LoadPSKModel(model_t *mod, void *buffer)
unsigned int num_animinfo=0, num_animkeys=0;
int hunkstart, hunkend, hunktotal;
extern cvar_t temp1;
//extern cvar_t temp1; //unused variable
/*load the psk*/
while (pos < com_filesize && !fail)
@ -4430,7 +4432,7 @@ qboolean Mod_LoadPSKModel(model_t *mod, void *buffer)
}
hunkstart = Hunk_LowMark ();
gmdl = Hunk_Alloc(sizeof(*gmdl)*num_matt);
/*bones!*/
@ -5199,7 +5201,7 @@ galiasinfo_t *Mod_ParseMD5MeshModel(char *buffer)
float *vpos = NULL, *tcoord = NULL, *vnorm = NULL, *vtang = NULL;
unsigned char *vbone = NULL, *vweight = NULL;
unsigned int type, fmt, size, offset;
varray = (struct iqmvertexarray*)(buffer + h->ofs_vertexarrays);
for (i = 0; i < h->num_vertexarrays; i++)
{

View File

@ -3015,6 +3015,7 @@ void COM_InitArgv (int argc, const char **argv) //not allowed to tprint
{
qboolean safe;
int i;
size_t result;
FILE *f;
@ -3028,7 +3029,7 @@ void COM_InitArgv (int argc, const char **argv) //not allowed to tprint
fseek(f, 0, SEEK_SET);
buffer = (char*)malloc(len+1);
fread(buffer, 1, len, f);
result = fread(buffer, 1, len, f); // do something with result
buffer[len] = '\0';
while (*buffer && (argc < MAX_NUM_ARGVS))

View File

@ -172,7 +172,23 @@ void Cvar_List_f (void)
int gnum, i, num = 0;
int listflags = 0, cvarflags = 0;
char strtmp[512];
static char *cvarlist_help =
"cvarlist list all cvars matching given parameters\n"
"Syntax: cvarlist [-FLdhlrv] [-f flag] [-g group] [cvar]\n"
" -F shows cvar flags\n"
" -L shows latched values\n"
" -a shows cvar alternate names\n"
" -d shows default cvar values\n"
" -f shows only cvars with a matching flag, more than one -f can be used\n"
" -g shows only cvar groups using wildcards in group\n"
" -h shows this help message\n"
" -l shows cvar restriction levels\n"
" -r removes group and list headers\n"
" -v shows current values\n"
" cvar indicates the cvar to show, wildcards (*,?) accepted\n"
"Cvar flags are:"
;
gsearch = search = NULL;
for (i = 1; i < Cmd_Argc(); i++)
{
@ -253,20 +269,7 @@ void Cvar_List_f (void)
break;
case 'h':
// list options
Con_Printf("cvarlist list all cvars matching given parameters\n"
"Syntax: cvarlist [-FLdhlrv] [-f flag] [-g group] [cvar]\n"
" -F shows cvar flags\n"
" -L shows latched values\n"
" -a shows cvar alternate names\n"
" -d shows default cvar values\n"
" -f shows only cvars with a matching flag, more than one -f can be used\n"
" -g shows only cvar groups using wildcards in group\n"
" -h shows this help message\n"
" -l shows cvar restriction levels\n"
" -r removes group and list headers\n"
" -v shows current values\n"
" cvar indicates the cvar to show, wildcards (*,?) accepted\n"
"Cvar flags are:");
Con_Printf("%s", cvarlist_help);
for (num = 1; num <= CVAR_LASTFLAG; num <<= 1)
{
@ -329,7 +332,7 @@ void Cvar_List_f (void)
Q_strncpyz(strtmp, cmd->name2, 512);
Q_strlwr(strtmp);
if (!wildcmp(search, strtmp))
continue;
continue;
}
else
continue;
@ -353,8 +356,8 @@ void Cvar_List_f (void)
Con_Printf("(%i) ", cmd->restriction);
// print cvar name
Con_Printf(cmd->name);
Con_Printf("%s", cmd->name);
// print current value
if (listflags & CLF_VALUES)
{
@ -373,9 +376,9 @@ void Cvar_List_f (void)
// print cvar flags
if (listflags & CLF_FLAGS)
{
for (i = 1; i <= CVAR_LASTFLAG; i <<= 1)
for (i = 1; i <= CVAR_LASTFLAG; i <<= 1)
{
if (i & cmd->flags)
if (i & cmd->flags)
{
var = Cvar_FlagToName(i);
if (var)
@ -458,7 +461,7 @@ void Cvar_Reset_f (void)
Con_Printf("Invalid option for cvarreset\nUse cvarreset -h for help\n");
return;
}
}
}
}
else
search = var;
@ -509,7 +512,7 @@ void Cvar_Reset_f (void)
Q_strncpyz(strtmp, cmd->name2, 512);
Q_strlwr(strtmp);
if (!wildcmp(search, strtmp))
continue;
continue;
}
else
continue;

View File

@ -214,11 +214,13 @@ static qboolean FSSTDIO_FLocate(void *handle, flocation_t *loc, const char *file
static void FSSTDIO_ReadFile(void *handle, flocation_t *loc, char *buffer)
{
FILE *f;
size_t result;
f = fopen(loc->rawname, "rb");
if (!f) //err...
return;
fseek(f, loc->offset, SEEK_SET);
fread(buffer, 1, loc->len, f);
result = fread(buffer, 1, loc->len, f); // do soemthing with result
fclose(f);
}
static int FSSTDIO_EnumerateFiles (void *handle, const char *match, int (*func)(const char *, int, void *), void *parm)

View File

@ -2,7 +2,10 @@
#include "fs.h"
#ifdef AVAIL_ZLIB
#define ZEXPORT VARGS
#ifndef ZEXPORT
#define ZEXPORT VARGS
#endif
#include <zlib.h>
typedef struct {

View File

@ -815,7 +815,7 @@ static void CM_CreatePatch( q3cpatch_t *patch, q2mapsurface_t *shaderref, const
if( size[0] <= 0 || size[1] <= 0 )
return;
data = BZ_Malloc( size[0] * size[1] * sizeof( vecV_t ) +
data = BZ_Malloc( size[0] * size[1] * sizeof( vecV_t ) +
( size[0]-1 ) * ( size[1]-1 ) * 2 * ( sizeof( q2cbrush_t ) + 32 * sizeof( mplane_t ) ) );
points = ( vecV_t * )data; data += size[0] * size[1] * sizeof( vecV_t );
@ -4384,7 +4384,7 @@ unsigned int CM_NativeContents(struct model_s *model, int hulloverride, int fram
if ( (contents & brush->contents) == brush->contents ) {
continue;
}
brushside = brush->brushside;
for ( j = 0; j < brush->numsides; j++, brushside++ )
{
@ -4392,7 +4392,7 @@ unsigned int CM_NativeContents(struct model_s *model, int hulloverride, int fram
break;
}
if (j == brush->numsides)
if (j == brush->numsides)
contents |= brush->contents;
}
}
@ -5660,7 +5660,9 @@ and recalculates the area connections
*/
void CM_ReadPortalState (FILE *f)
{
fread (portalopen, 1, sizeof(portalopen), f);
size_t result;
result = fread (portalopen, 1, sizeof(portalopen), f); // do something with result
FloodAreaConnections ();
}

View File

@ -277,8 +277,8 @@ void SV_LogPlayer(client_t *cl, char *msg)
return; //don't log botclients
snprintf(line, sizeof(line),
"%s\\%s\\%i\\%s\\%s\\%i%s\n",
msg, cl->name, cl->userid,
"%s\\%s\\%i\\%s\\%s\\%i%s\n",
msg, cl->name, cl->userid,
NET_BaseAdrToString(remote_adr, sizeof(remote_adr), cl->netchan.remote_address), (cl->realip_status > 0 ? NET_BaseAdrToString(realip_adr, sizeof(realip_adr), cl->realip) : "??"),
cl->netchan.remote_address.port, cl->userinfo);
@ -311,7 +311,7 @@ void Log_Logfile_f (void)
if (log_name[LOG_CONSOLE].string[0])
f = log_name[LOG_CONSOLE].string;
Con_Printf(va("Logging to %s/%s.log.\n", d, f));
Con_Printf("%s", va("Logging to %s/%s.log.\n", d, f));
Cvar_SetValue(&log_enable[LOG_CONSOLE], 1);
}

View File

@ -329,7 +329,7 @@ qboolean NET_AddressSmellsFunny(netadr_t a)
case NA_IPX:
return false;
#endif
case NA_LOOPBACK:
return false;
@ -360,19 +360,19 @@ char *NET_AdrToString (char *s, int len, netadr_t a)
case NA_IP:
if (a.port)
{
snprintf (s, len, "%i.%i.%i.%i:%i",
a.address.ip[0],
a.address.ip[1],
a.address.ip[2],
a.address.ip[3],
snprintf (s, len, "%i.%i.%i.%i:%i",
a.address.ip[0],
a.address.ip[1],
a.address.ip[2],
a.address.ip[3],
ntohs(a.port));
}
else
{
snprintf (s, len, "%i.%i.%i.%i",
a.address.ip[0],
a.address.ip[1],
a.address.ip[2],
snprintf (s, len, "%i.%i.%i.%i",
a.address.ip[0],
a.address.ip[1],
a.address.ip[2],
a.address.ip[3]);
}
break;
@ -429,7 +429,7 @@ char *NET_AdrToString (char *s, int len, netadr_t a)
}
}
snprintf (p, len-strlen(s), "]:%i",
snprintf (p, len-strlen(s), "]:%i",
ntohs(a.port));
break;
#endif
@ -480,8 +480,8 @@ char *NET_BaseAdrToString (char *s, int len, netadr_t a)
{
case NA_BROADCAST_IP:
case NA_IP:
snprintf (s, len, "%i.%i.%i.%i",
a.address.ip[0],
snprintf (s, len, "%i.%i.%i.%i",
a.address.ip[0],
a.address.ip[1],
a.address.ip[2],
a.address.ip[3]);
@ -531,7 +531,7 @@ char *NET_BaseAdrToString (char *s, int len, netadr_t a)
#ifdef USEIPX
case NA_BROADCAST_IPX:
case NA_IPX:
snprintf (s, len, "%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x",
snprintf (s, len, "%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x",
a.address.ipx[0],
a.address.ipx[1],
a.address.ipx[2],
@ -620,7 +620,7 @@ qboolean NET_StringToSockaddr (const char *s, struct sockaddr_qstorage *sadr)
char *port;
char dupbase[256];
int len;
memset(&udp6hint, 0, sizeof(udp6hint));
udp6hint.ai_family = 0;//Any... we check for AF_INET6 or 4
udp6hint.ai_socktype = SOCK_DGRAM;
@ -693,7 +693,7 @@ dblbreak:
if (strlen(s) >= sizeof(copy)-1)
return false;
strcpy (copy, s);
// strip off a trailing :port if present
for (colon = copy ; *colon ; colon++)
@ -802,7 +802,7 @@ qboolean NET_StringToAdr (const char *s, netadr_t *a)
}
// NET_IntegerToMask: given a source address pointer, a mask address pointer, and
// desired number of bits, fills the mask pointer with given bits
// desired number of bits, fills the mask pointer with given bits
// (bits < 0 will always fill all bits)
void NET_IntegerToMask (netadr_t *a, netadr_t *amask, int bits)
{
@ -861,9 +861,9 @@ void NET_IntegerToMask (netadr_t *a, netadr_t *amask, int bits)
}
#endif
break;
#ifdef USEIPX
case NA_IPX:
case NA_BROADCAST_IPX:
#ifdef USEIPX
n = amask->address.ipx;
if (i > 80)
i = 80;
@ -884,6 +884,12 @@ void NET_IntegerToMask (netadr_t *a, netadr_t *amask, int bits)
break;
case NA_LOOPBACK:
break;
// warning: enumeration value âNA_*â not handled in switch
case NA_TCP:
case NA_TCPV6:
case NA_IRC:
break;
}
}
@ -912,8 +918,8 @@ int ParsePartialIPv4(const char *s, netadr_t *a)
if (colon) // no colons before periods (probably invalid anyway)
return 0;
else if (bits >= 32) // only 32 bits in ipv4
return 0;
else if (*(s+1) == '.')
return 0;
else if (*(s+1) == '.')
return 0;
else if (*(s+1) == '\0')
break; // don't add more bits to the mask for x.x., etc
@ -958,7 +964,7 @@ qboolean NET_StringToAdrMasked (const char *s, netadr_t *a, netadr_t *amask)
if (!ParsePartialIPv4(t, a) && !NET_StringToAdr(t, a))
return false;
spoint++;
c = spoint;
if (!*c)
return false;
@ -1091,7 +1097,7 @@ qboolean NET_CompareAdrMasked(netadr_t a, netadr_t b, netadr_t mask)
#ifdef IRCCONNECT
case NA_IRC:
//masks are not supported, match explicitly
//masks are not supported, match explicitly
if (strcmp(a.address.irc.user, b.address.irc.user))
return false;
break;
@ -1363,7 +1369,7 @@ qboolean FTENET_AddToCollection(ftenet_connections_t *col, const char *name, con
if (col->conn[i]->ChangeLocalAddress(col->conn[i], address))
return true;
}
col->conn[i]->Close(col->conn[i]);
col->conn[i] = NULL;
break;
@ -2134,7 +2140,7 @@ qboolean FTENET_IRCConnect_GetPacket(ftenet_generic_connection_t *gcon)
cvar_t *ircuser = Cvar_Get("ircuser", "none", 0, "IRC Connect");
cvar_t *irchost = Cvar_Get("irchost", "none", 0, "IRC Connect");
cvar_t *ircnick = Cvar_Get("ircnick", "ftesv", 0, "IRC Connect");
cvar_t *ircchannel = Cvar_Get("ircchannel", "#ftetest", 0, "IRC Connect");
//cvar_t *ircchannel = Cvar_Get("ircchannel", "#ftetest", 0, "IRC Connect"); //warning: unused variable ircchannel
cvar_t *ircsomething = Cvar_Get("ircsomething", "moo", 0, "IRC Connect");
cvar_t *ircclientaddr = Cvar_Get("ircclientaddr", "127.0.0.1", 0, "IRC Connect");
@ -2266,7 +2272,7 @@ qboolean FTENET_IRCConnect_GetPacket(ftenet_generic_connection_t *gcon)
net_from.address.irc.channel[0] = 0;
}
}
while(*s == ' ')
s++;
@ -2339,7 +2345,7 @@ qboolean FTENET_IRCConnect_GetPacket(ftenet_generic_connection_t *gcon)
else if (*s >= '0' && *s <= '9')
psize += *s - '0';
s++;
psize*=16;
if (*s >= 'a' && *s <= 'f')
psize += *s - 'a' + 10;
@ -2385,7 +2391,7 @@ qboolean FTENET_IRCConnect_GetPacket(ftenet_generic_connection_t *gcon)
break;
//ignore these
case '\n':
case '\n':
case '\r':
case '\0': //this one doesn't have to be ignored.
break;
@ -2397,7 +2403,7 @@ qboolean FTENET_IRCConnect_GetPacket(ftenet_generic_connection_t *gcon)
}
s++;
}
if (st->inlen > psize || psize >= sizeof(net_message_buffer) )
{
st->inlen = 0;
@ -2462,7 +2468,7 @@ qboolean FTENET_IRCConnect_GetPacket(ftenet_generic_connection_t *gcon)
}
send(con->generic.thesocket, "\r\n", 2, 0);
break;
case 0:
case 0:
//non-numerical event.
break;
}
@ -2631,7 +2637,7 @@ struct ftenet_generic_connection_s *FTENET_IRCConnect_EstablishConnection(qboole
if (!NET_StringToAdr(address, &adr))
return NULL; //couldn't resolve the name
newcon = Z_Malloc(sizeof(*newcon));
if (newcon)
@ -2706,7 +2712,7 @@ int NET_LocalAddressForRemote(ftenet_connections_t *collection, netadr_t *remote
if (!remote->connum)
return 0;
if (!collection->conn[remote->connum-1])
if (!collection->conn[remote->connum-1])
return 0;
if (!collection->conn[remote->connum-1]->GetLocalAddress)
@ -3203,11 +3209,11 @@ void SVNET_AddPort(void)
FTENET_AddToCollection(svs.sockets, NULL, s, FTENET_UDP6_EstablishConnection, true);
break;
#endif
#ifdef USEIPX
case NA_IPX:
#ifdef USEIPX
FTENET_AddToCollection(svs.sockets, NULL, s, FTENET_IPX_EstablishConnection, true);
break;
#endif
break;
#ifdef IRCCONNECT
case NA_IRC:
FTENET_AddToCollection(svs.sockets, NULL, s, FTENET_IRCConnect_EstablishConnection, true);
@ -3223,6 +3229,13 @@ void SVNET_AddPort(void)
break;
#endif
#endif
// warning: enumeration value NA_* not handled in switch
case NA_INVALID:
case NA_LOOPBACK:
case NA_BROADCAST_IP:
case NA_BROADCAST_IP6:
case NA_BROADCAST_IPX:
break;
}
}
#endif

View File

@ -129,7 +129,7 @@ dllhandle_t *QVM_LoadDLL(const char *name, void **vmMain, sys_calldll_t syscall)
{
break;
}
snprintf (fname, sizeof(fname), "%s/%s", gpath, dllname_anycpu);
Con_DPrintf("Loading native: %s\n", fname);

View File

@ -3,7 +3,7 @@
#undef malloc
#undef free
static char *defaultlanguagetext =
static char *defaultlanguagetext =
"STL_LANGUAGENAME \"English\"\n"
"TL_NL \"\\n\"\n"
"TL_STNL \"%s\\n\"\n"
@ -312,7 +312,7 @@ void TranslateReset(void)
s++;
}
fputc('"', F);
fputc('"', F);
}
else
fprintf(F, "\"%s\"", trans->english);
@ -454,7 +454,7 @@ void TranslateReset(void)
s2++;
}
// strcpy(trans->foreign, fore);
goto next;
goto next;
}
else if (*s == '\\') //skip
s++;
@ -464,7 +464,7 @@ void TranslateReset(void)
else if (*s == '\\') //skip
s++;
s++;
}
}
}
else if (*s == '\\') //skip
s++;
@ -540,7 +540,7 @@ char *languagetext[STL_MAXSTL][MAX_LANGUAGES];
void TL_ParseLanguage (char *name, char *data, int num) //this is one of the first functions to be called. so it mustn't use any quake subsystem routines
{
int i;
int i;
char *s;
s = data;
@ -554,8 +554,8 @@ void TL_ParseLanguage (char *name, char *data, int num) //this is one of the fir
{
if (!strcmp(com_token, langtext(i, 0))) //lang 0 is actually the string names.
break;
}
}
s = COM_ParseCString(s);
if (i == STL_MAXSTL) //silently ignore - allow other servers or clients to add stuff
continue;
@ -571,6 +571,7 @@ void TL_LoadLanguage (char *name, char *shortname, int num) //this is one of the
FILE *f;
int size;
char *buffer;
size_t result;
f = fopen(va("%s.trl", shortname), "rb");
if (!f)
@ -580,7 +581,7 @@ void TL_LoadLanguage (char *name, char *shortname, int num) //this is one of the
fseek(f, 0, SEEK_SET);
buffer = malloc(size+1);
buffer[size] = '\0';
fread(buffer, 1, size, f);
result = fread(buffer, 1, size, f); // do something with result
fclose(f);
TL_ParseLanguage(name, buffer, num);
@ -630,7 +631,7 @@ char *TL_ExpandToCString(char *in)
in++;
}
*out = '\0';
return buffer;
}
char *TL_ExpandToDoubleCString(char *in) //TL_ExpandToCString twice
@ -659,7 +660,7 @@ char *TL_ExpandToDoubleCString(char *in) //TL_ExpandToCString twice
in++;
}
*out = '\0';
return TL_ExpandToCString(buffer);
}
void TL_WriteTLHeader(void)
@ -691,7 +692,7 @@ void TL_InitLanguages(void)
#include "translate.h"
#undef NAME
/*
#define ENGLISH(i, s) (languagetext[i][1] = s)
#define ENGLISH(i, s) (languagetext[i][1] = s)
#undef ENGLISH
*/
TL_ParseLanguage("English", defaultlanguagetext, 1);

View File

@ -209,7 +209,7 @@ static LPDIRECT3DBASETEXTURE9 D3D9_LoadTexture_32(d3dtexture_t *tex, unsigned in
return NULL;
}
*/
nwidth = width;
nheight = height;
D3D9_RoundDimensions(&nwidth, &nheight, !(flags & IF_NOMIPMAP));
@ -370,6 +370,24 @@ texid_t D3D9_LoadTexture (char *identifier, int width, int height, enum uploadfm
return r_nulltex;
}
break;
case TF_INVALID:
case TF_RGBA32:
case TF_BGRA32:
case TF_RGBX32:
case TF_RGB24:
case TF_BGR24_FLIP:
case TF_SOLID8:
case TF_TRANS8:
case TF_HEIGHT8:
case TF_HEIGHT8PAL:
case TF_H2_T7G1:
case TF_H2_TRANS8_0:
case TF_H2_T4A4:
case TF_PALETTES:
case TF_8PAL24:
case TF_8PAL32:
break;
}
tex = d3d_lookup_texture(identifier);

View File

@ -325,7 +325,7 @@ static LRESULT WINAPI D3D9_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
// JACK: This is the mouse wheel with the Intellimouse
// Its delta is either positive or neg, and we generate the proper
// Event.
case WM_MOUSEWHEEL:
case WM_MOUSEWHEEL:
if (!vid_initializing)
{
if ((short) HIWORD(wParam) > 0)
@ -413,7 +413,7 @@ static LRESULT WINAPI D3D9_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
case MM_MCINOTIFY:
lRet = CDAudio_MessageHandler (hWnd, uMsg, wParam, lParam);
break;
default:
/* pass all unhandled messages to DefWindowProc */
lRet = DefWindowProc (hWnd, uMsg, wParam, lParam);
@ -440,8 +440,8 @@ static void resetD3D9(void)
//IDirect3DDevice9_SetRenderState(pD3DDev9, D3DRENDERSTATE_DITHERENABLE, FALSE);
@ -527,7 +527,7 @@ static qboolean initD3D9Device(HWND hWnd, rendererstate_t *info, unsigned int de
pD3DDev9 = NULL;
// create a device class using this information and information from the d3dpp stuct
err = IDirect3D9_CreateDevice(pD3D,
err = IDirect3D9_CreateDevice(pD3D,
devno,
devtype,
hWnd,
@ -674,7 +674,7 @@ static qboolean D3D9_VID_Init(rendererstate_t *info, unsigned char *palette)
wstyle = 0;
else
wstyle = WS_OVERLAPPEDWINDOW;
rect.left = rect.top = 0;
rect.right = info->width;
rect.bottom = info->height;
@ -689,10 +689,10 @@ static qboolean D3D9_VID_Init(rendererstate_t *info, unsigned char *palette)
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
ShowWindow(mainwindow, SW_NORMAL);
@ -813,7 +813,7 @@ static char *(D3D9_VID_GetRGBInfo) (int prepad, int *truevidwidth, int *truevi
{
if (!FAILED(IDirect3DSurface9_GetDesc(backbuf, &desc)))
if (desc.Format == D3DFMT_X8R8G8B8 || desc.Format == D3DFMT_A8R8G8B8)
if (!FAILED(IDirect3DDevice9_CreateOffscreenPlainSurface(pD3DDev9,
if (!FAILED(IDirect3DDevice9_CreateOffscreenPlainSurface(pD3DDev9,
desc.Width, desc.Height, desc.Format,
D3DPOOL_SYSTEMMEM, &surf, NULL))
)
@ -850,7 +850,7 @@ static char *(D3D9_VID_GetRGBInfo) (int prepad, int *truevidwidth, int *truevi
}
IDirect3DSurface9_Release(backbuf);
}
return ret;
}
static void (D3D9_VID_SetWindowCaption) (char *msg)
@ -934,7 +934,7 @@ static void (D3D9_SCR_UpdateScreen) (void)
scr_disabled_for_loading = false;
}
else
{
{
IDirect3DDevice9_BeginScene(pD3DDev9);
scr_drawloading = true;
SCR_DrawLoading ();
@ -975,7 +975,7 @@ static void (D3D9_SCR_UpdateScreen) (void)
if (key_dest == key_console)
Con_DrawConsole(vid_conheight.value/2, false);
GL_EndRendering ();
GL_EndRendering ();
GL_DoSwap();
RSpeedEnd(RSPEED_TOTALREFRESH);
return;

View File

@ -225,7 +225,7 @@ static texnums_t *GL_ChooseSkin(galiasinfo_t *inf, model_t *model, int surfnum,
galiascolourmapped_t *cm;
char hashname[512];
// if (e->scoreboard->skin->cachedbpp
// if (e->scoreboard->skin->cachedbpp
/* if (cls.protocol == CP_QUAKE2)
{
@ -343,7 +343,7 @@ static texnums_t *GL_ChooseSkin(galiasinfo_t *inf, model_t *model, int surfnum,
texnums->base = e->scoreboard->skin->tex_base;
return texnums;
}
cm->texnum.base = R_LoadHiResTexture(e->scoreboard->skin->name, "skins", IF_NOALPHA);
return &cm->texnum;
}
@ -450,9 +450,9 @@ static texnums_t *GL_ChooseSkin(galiasinfo_t *inf, model_t *model, int surfnum,
for(i=0;i<256;i++)
{
translate32[i] = d_8to24rgbtable[i];
if (tc > 0 && (colorA[i] != 255))
if (tc > 0 && (colorA[i] != 255))
translate32[i] = d_8to24rgbtable[sourceA[i]];
if (bc > 0 && (colorB[i] != 255))
if (bc > 0 && (colorB[i] != 255))
translate32[i] = d_8to24rgbtable[sourceB[i]];
}
translate32[0] = 0;
@ -843,7 +843,7 @@ static qboolean R_CalcModelLighting(entity_t *e, model_t *clmodel)
if ((e->model->flags & EF_ROTATE) && cl.hexen2pickups)
{
shadelight[0] = shadelight[1] = shadelight[2] =
shadelight[0] = shadelight[1] = shadelight[2] =
ambientlight[0] = ambientlight[1] = ambientlight[2] = 128+sin(cl.servertime*4)*64;
}
if ((e->drawflags & MLS_MASKIN) == MLS_ABSLIGHT)
@ -1938,6 +1938,11 @@ void BE_GenModelBatches(batch_t **batches)
case mod_sprite:
R_Sprite_GenerateBatch(ent, batches, R_DB_Sprite);
break;
// warning: enumeration value mod_* not handled in switch
case mod_dummy:
case mod_halflife:
case mod_heightmap:
break;
}
break;
case RT_SPRITE:

View File

@ -844,7 +844,7 @@ struct sbuiltin_s
int apiver;
char name[MAX_QPATH];
char *body;
} sbuiltins[] =
} sbuiltins[] =
{
#ifdef GLQUAKE
/*a quick note on glsl versions:
@ -1187,7 +1187,7 @@ struct sbuiltin_s
" vec4 fb = texture2D(s_t3, tc);\n"
" col.rgb = mix(col.rgb, fb.rgb, fb.a);\n"
"#endif\n"
" gl_FragColor = col * e_colourident;\n"
" gl_FragColor = col * e_colourident;\n"
"}\n"
"#endif\n"
},
@ -1251,7 +1251,7 @@ struct sbuiltin_s
" vec4 fb = texture2D(s_t3, tc);\n"
" col.rgb = mix(col.rgb, fb.rgb, fb.a);\n"
"#endif\n"
" gl_FragColor = col * e_colourident;\n"
" gl_FragColor = col * e_colourident;\n"
"}\n"
"#endif\n"
},
@ -1441,7 +1441,7 @@ static void Shader_ProgAutoFields(program_t *prog, char **cvarfnames)
cvar = Cvar_FindVar(tmpname);
if (!cvar)
continue;
cvar->flags |= CVAR_SHADERSYSTEM;
cvar->flags |= CVAR_SHADERSYSTEM;
for (p = 0; p < PERMUTATIONS; p++)
{
if (!prog->handle[p].glsl)
@ -2276,7 +2276,7 @@ static void Shaderpass_Scale ( shader_t *shader, shaderpass_t *pass, char **ptr
{
tcmod->args[0] = atof(token);
}
while (**ptr == ' ' || **ptr == '\t')
*ptr+=1;
if (**ptr == ',')
@ -2543,7 +2543,7 @@ static void Shader_MakeCache ( char *path )
cache->hash_next = shader_hash[key];
cache->path = path;
cache->offset = ptr - buf;
Com_sprintf ( cache->name, MAX_QPATH, token );
Com_sprintf ( cache->name, MAX_QPATH, "%s", token ); // warning: format not a string literal and no format arguments
shader_hash[key] = cache;
ptr = Shader_Skip ( ptr );
@ -4012,7 +4012,7 @@ static qboolean Shader_ParseShader(char *shortname, char *usename, shader_t *s)
Shader_Free(s);
memset ( s, 0, sizeof( shader_t ) );
Com_sprintf ( s->name, MAX_QPATH, usename );
Com_sprintf ( s->name, MAX_QPATH, "%s",usename ); // warning: format not a string literal and no format arguments
Hash_Add(&shader_active_hash, s->name, s, &s->bucket);
Shader_ReadShader(s, file);
@ -4131,9 +4131,9 @@ static int R_LoadShader ( char *name, shader_gen_t *defaultgen, const char *gena
if (defaultgen)
{
memset(s, 0, sizeof(shader_t));
Com_sprintf(s->name, MAX_QPATH, shortname);
Com_sprintf(s->name, MAX_QPATH, "%s", shortname); // warning: format not a string literal and no format arguments
if (!strcmp(shortname, "textures/common/clip"))
Shader_DefaultScript(shortname, s,
Shader_DefaultScript(shortname, s,
"{\n"
"surfaceparm nodraw\n"
"surfaceparm nodlight\n"
@ -4218,7 +4218,7 @@ void Shader_DoReload(void)
s->generator = defaultgen;
s->genargs = genargs;
Com_sprintf ( s->name, MAX_QPATH, shortname );
Com_sprintf ( s->name, MAX_QPATH, "%s", shortname ); // warning: format not a string literal and no format arguments
Hash_Add(&shader_active_hash, s->name, s, &s->bucket);
R_BuildDefaultTexnums(&oldtn, s);
}

View File

@ -72,7 +72,7 @@ static void SHM_End (void)
if (sh_shmesh->maxindicies != i)
{
sh_shmesh->maxindicies = i;
sh_shmesh->indicies = BZ_Realloc(sh_shmesh->indicies, i * sizeof(*sh_shmesh->indicies));
sh_shmesh->indicies = BZ_Realloc(sh_shmesh->indicies, i * sizeof(*sh_shmesh->indicies));
}
//add the extra triangles
for (i = 0; i < sh_vertnum; i+=4)
@ -310,7 +310,7 @@ static void SHM_RecursiveWorldNodeQ1_r (dlight_t *dl, mnode_t *node)
if (dl->origin[c] - dl->radius > node->minmaxs[3+c])
return;
}
// if a leaf node, draw stuff
if (node->contents < 0)
{
@ -497,7 +497,7 @@ static void SHM_RecursiveWorldNodeQ2_r (dlight_t *dl, mnode_t *node)
if (dl->origin[c] - dl->radius > node->minmaxs[3+c])
return;
}
// if a leaf node, draw stuff
if (node->contents != -1)
{
@ -1564,7 +1564,8 @@ static void Sh_DrawShadowMapLight(dlight_t *l, vec3_t colour, qbyte *vvis)
// warning: Sh_WorldLightingPass defined but not used
/*
static void Sh_WorldLightingPass(void)
{
msurface_t *s;
@ -1590,6 +1591,7 @@ static void Sh_WorldLightingPass(void)
RQuantAdd(RQUANT_LITFACES, s->mesh->numindexes);
}
}
*/
/*
draws faces facing the light
@ -1701,7 +1703,7 @@ static void Sh_DrawBrushModelShadow(dlight_t *dl, entity_t *e)
qglVertex3f (v2[0]+v4[0], v2[1]+v4[1], v2[2]+v4[2]);
qglEnd();
}
//back
//the same applies as earlier
qglBegin(GL_POLYGON);
@ -1890,7 +1892,7 @@ static qboolean Sh_DrawStencilLight(dlight_t *dl, vec3_t colour, qbyte *vvis)
qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}*/
#endif
if (qglStencilOpSeparateATI)
{
qglClearStencil(0);

View File

@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
@ -121,7 +121,7 @@ static vec3_t skyclip[6] = {
{0,-1,1},
{0,1,1},
{1,0,1},
{-1,0,1}
{-1,0,1}
};
// 1 = s, 2 = t, 3 = 2048
@ -459,7 +459,7 @@ static void R_DrawSkyMesh(batch_t *batch, mesh_t *m, shader_t *shader)
{
static entity_t skyent;
batch_t b;
float time = cl.gametime+realtime-cl.gametimemark;
//float time = cl.gametime+realtime-cl.gametimemark; //warning: unused variable time
float skydist = gl_skyboxdist.value;
if (skydist<1)

View File

@ -1055,7 +1055,7 @@ pbool ED_ParseEpair (progfuncs_t *progfuncs, void *base, ddefXX_t *key, char *s,
string_t st;
dfunction_t *func;
int type;
int type = 0; // warning about beign used without initializing it
switch(structtype)
{
@ -1215,7 +1215,7 @@ char *ED_ParseEdict (progfuncs_t *progfuncs, char *data, edictrun_t *ent)
if (!data)
{
printf ("ED_ParseEntity: EOF without closing brace\n");
return NULL;
return NULL;
}
if (qcc_token[0] == '}')
@ -2678,7 +2678,7 @@ retry:
{
int j;
qtest_function_t qtfunc = ((qtest_function_t*)fnc)[i];
fnc[i].first_statement = PRLittleLong (qtfunc.first_statement);
fnc[i].parm_start = PRLittleLong (qtfunc.parm_start);
fnc[i].s_name = (string_t)PRLittleLong (qtfunc.s_name);

View File

@ -624,7 +624,7 @@ int PR_ToggleBreakpoint(progfuncs_t *progfuncs, char *filename, int linenum, int
unsigned int i;
int pn = pr_typecurrent;
dfunction_t *f;
int op;
int op = 0; //warning about not being initialized before use
for (pn = 0; (unsigned)pn < maxprogs; pn++)
{
@ -843,7 +843,7 @@ void PR_ExecuteCode (progfuncs_t *progfuncs, int s)
{
eval_t *t, *swtch=NULL;
int swtchtype;
int swtchtype = 0; //warning about not being initialized before use
dstatement16_t *st16;
dstatement32_t *st32;
dfunction_t *newf;

File diff suppressed because it is too large Load Diff

View File

@ -231,8 +231,8 @@ pbool QCC_PR_SimpleGetToken (void);
int ParsePrecompilerIf(void)
{
CompilerConstant_t *c;
int eval;
char *start = pr_file_p;
int eval = 0;
//char *start = pr_file_p; //warning: unused variable âstartâ
if (!QCC_PR_SimpleGetToken())
{
if (*pr_file_p == '(')
@ -830,7 +830,7 @@ pbool QCC_PR_Precompiler(void)
{
#define MAXSOURCEFILESLIST 8
extern char sourcefileslist[MAXSOURCEFILESLIST][1024];
extern int currentsourcefile;
//extern int currentsourcefile; // warning: unused variable âcurrentsourcefileâ
extern int numsourcefiles;
int i;

View File

@ -278,6 +278,7 @@ void QCC_BspModels (void)
char *m;
char cmd[1024];
char name[256];
size_t result;
p = QCC_CheckParm ("-bspmodels");
if (!p)
@ -285,7 +286,7 @@ void QCC_BspModels (void)
if (p == myargc-1)
QCC_Error (ERR_BADPARMS, "-bspmodels must preceed a game directory");
gamedir = myargv[p+1];
for (i=0 ; i<nummodels ; i++)
{
m = precache_models[i];
@ -294,7 +295,7 @@ void QCC_BspModels (void)
strcpy (name, m);
name[strlen(m)-4] = 0;
sprintf (cmd, "qbsp %s/%s ; light -extra %s/%s", gamedir, name, gamedir, name);
system (cmd);
result = system (cmd); // do something with the result
}
}
@ -331,7 +332,7 @@ int QCC_CopyDupBackString (char *str)
for (s = strings+strofs-1; s>strings ; s--)
if (!strcmp(s, str))
return s-strings;
old = strofs;
strcpy (strings+strofs, str);
strofs += strlen(str)+1;
@ -341,7 +342,7 @@ int QCC_CopyDupBackString (char *str)
void QCC_PrintStrings (void)
{
int i, l, j;
for (i=0 ; i<strofs ; i += l)
{
l = strlen(strings+i) + 1;
@ -365,7 +366,7 @@ void QCC_PrintStrings (void)
{
int i,j;
QCC_dfunction_t *d;
for (i=0 ; i<numfunctions ; i++)
{
d = &functions[i];
@ -380,7 +381,7 @@ void QCC_PrintFields (void)
{
int i;
QCC_ddef_t *d;
for (i=0 ; i<numfielddefs ; i++)
{
d = &fields[i];
@ -392,7 +393,7 @@ void QCC_PrintGlobals (void)
{
int i;
QCC_ddef_t *d;
for (i=0 ; i<numglobaldefs ; i++)
{
d = &qcc_globals[i];
@ -455,7 +456,7 @@ int WriteSourceFiles(int h, dprograms_t *progs, pbool sourceaswell)
num++;
}
ofs = SafeSeek(h, 0, SEEK_CUR);
ofs = SafeSeek(h, 0, SEEK_CUR);
SafeWrite(h, &num, sizeof(int));
SafeWrite(h, idf, sizeof(includeddatafile_t)*num);
@ -471,7 +472,7 @@ void QCC_InitData (void)
int i;
qcc_sourcefile = NULL;
numstatements = 1;
strofs = 1;
numfunctions = 1;
@ -479,7 +480,7 @@ void QCC_InitData (void)
numfielddefs = 1;
memset(&ret_temp, 0, sizeof(ret_temp));
def_ret.ofs = OFS_RETURN;
def_ret.name = "return";
def_ret.temp = &ret_temp;
@ -704,8 +705,8 @@ pbool QCC_WriteData (int crc)
h=0;
def->references = h;
if (!h)
h = 1;
if (comp_x)
@ -882,7 +883,7 @@ strofs = (strofs+3)&~3;
printf ("%6i numfielddefs (%i unique) (of %i)\n", numfielddefs, pr.size_fields, MAX_FIELDS);
printf ("%6i numpr_globals (of %i)\n", numpr_globals, MAX_REGS);
}
if (!*destfile)
strcpy(destfile, "progs.dat");
if (verbose)
@ -901,7 +902,7 @@ strofs = (strofs+3)&~3;
progs.numstrings = strofs;
if (progs.blockscompressed&16)
{
{
SafeWrite (h, &len, sizeof(int)); //save for later
len = QC_encode(progfuncs, strofs*sizeof(char), 2, (char *)strings, h); //write
i = SafeSeek (h, 0, SEEK_CUR);
@ -940,9 +941,9 @@ strofs = (strofs+3)&~3;
statements[i].b = PRLittleLong/*PRLittleShort*/(statements[i].b);
statements[i].c = PRLittleLong/*PRLittleShort*/(statements[i].c);
}
if (progs.blockscompressed&1)
{
{
SafeWrite (h, &len, sizeof(int)); //save for later
len = QC_encode(progfuncs, numstatements*sizeof(QCC_dstatement32_t), 2, (char *)statements, h); //write
i = SafeSeek (h, 0, SEEK_CUR);
@ -997,9 +998,9 @@ strofs = (strofs+3)&~3;
else
statements16[i].c = (unsigned short)PRLittleShort((unsigned short)statements[i].c);
}
if (progs.blockscompressed&1)
{
{
SafeWrite (h, &len, sizeof(int)); //save for later
len = QC_encode(progfuncs, numstatements*sizeof(QCC_dstatement16_t), 2, (char *)statements16, h); //write
i = SafeSeek (h, 0, SEEK_CUR);
@ -1058,7 +1059,7 @@ strofs = (strofs+3)&~3;
}
if (progs.blockscompressed&8)
{
{
SafeWrite (h, &len, sizeof(int)); //save for later
len = QC_encode(progfuncs, numfunctions*sizeof(QCC_dfunction_t), 2, (char *)functions, h); //write
i = SafeSeek (h, 0, SEEK_CUR);
@ -1104,7 +1105,7 @@ strofs = (strofs+3)&~3;
}
if (progs.blockscompressed&2)
{
{
SafeWrite (h, &len, sizeof(int)); //save for later
len = QC_encode(progfuncs, numglobaldefs*sizeof(QCC_ddef_t), 2, (char *)qcc_globals, h); //write
i = SafeSeek (h, 0, SEEK_CUR);
@ -1127,7 +1128,7 @@ strofs = (strofs+3)&~3;
}
if (progs.blockscompressed&4)
{
{
SafeWrite (h, &len, sizeof(int)); //save for later
len = QC_encode(progfuncs, numfielddefs*sizeof(QCC_ddef_t), 2, (char *)fields, h); //write
i = SafeSeek (h, 0, SEEK_CUR);
@ -1153,7 +1154,7 @@ strofs = (strofs+3)&~3;
}
if (progs.blockscompressed&2)
{
{
SafeWrite (h, &len, sizeof(int)); //save for later
len = QC_encode(progfuncs, numglobaldefs*sizeof(QCC_ddef16_t), 2, (char *)qcc_globals16, h); //write
i = SafeSeek (h, 0, SEEK_CUR);
@ -1176,7 +1177,7 @@ strofs = (strofs+3)&~3;
}
if (progs.blockscompressed&4)
{
{
SafeWrite (h, &len, sizeof(int)); //save for later
len = QC_encode(progfuncs, numfielddefs*sizeof(QCC_ddef16_t), 2, (char *)fields16, h); //write
i = SafeSeek (h, 0, SEEK_CUR);
@ -1199,7 +1200,7 @@ strofs = (strofs+3)&~3;
((int *)qcc_pr_globals)[i] = PRLittleLong (((int *)qcc_pr_globals)[i]);
if (progs.blockscompressed&32)
{
{
SafeWrite (h, &len, sizeof(int)); //save for later
len = QC_encode(progfuncs, numpr_globals*4, 2, (char *)qcc_pr_globals, h); //write
i = SafeSeek (h, 0, SEEK_CUR);
@ -1209,7 +1210,7 @@ strofs = (strofs+3)&~3;
SafeSeek(h, i, SEEK_SET);
}
else
SafeWrite (h, qcc_pr_globals, numpr_globals*4);
SafeWrite (h, qcc_pr_globals, numpr_globals*4);
if (types)
for (i=0 ; i<numtypeinfos ; i++)
@ -1252,13 +1253,13 @@ strofs = (strofs+3)&~3;
progs.secondaryversion = PROG_SECONDARYVERSION16;
progs.ofsbodylessfuncs = SafeSeek (h, 0, SEEK_CUR);
progs.numbodylessfuncs = WriteBodylessFuncs(h);
progs.numbodylessfuncs = WriteBodylessFuncs(h);
if (debugtarget)
{
progs.ofslinenums = SafeSeek (h, 0, SEEK_CUR);
if (progs.blockscompressed&64)
{
{
SafeWrite (h, &len, sizeof(int)); //save for later
len = QC_encode(progfuncs, numstatements*sizeof(int), 2, (char *)statement_linenums, h); //write
i = SafeSeek (h, 0, SEEK_CUR);
@ -1277,7 +1278,7 @@ strofs = (strofs+3)&~3;
{
progs.ofs_types = SafeSeek (h, 0, SEEK_CUR);
if (progs.blockscompressed&128)
{
{
SafeWrite (h, &len, sizeof(int)); //save for later
len = QC_encode(progfuncs, sizeof(QCC_type_t)*numtypeinfos, 2, (char *)qcc_typeinfo, h); //write
i = SafeSeek (h, 0, SEEK_CUR);
@ -1288,7 +1289,7 @@ strofs = (strofs+3)&~3;
}
else
SafeWrite (h, qcc_typeinfo, sizeof(QCC_type_t)*numtypeinfos);
progs.numtypes = numtypeinfos;
progs.numtypes = numtypeinfos;
}
else
{
@ -1310,9 +1311,9 @@ strofs = (strofs+3)&~3;
// qbyte swap the header and write it out
for (i=0 ; i<sizeof(progs)/4 ; i++)
((int *)&progs)[i] = PRLittleLong ( ((int *)&progs)[i] );
((int *)&progs)[i] = PRLittleLong ( ((int *)&progs)[i] );
SafeSeek (h, 0, SEEK_SET);
SafeWrite (h, &progs, sizeof(progs));
SafeClose (h);
@ -1359,7 +1360,7 @@ char *QCC_PR_String (char *string)
{
static char buf[80];
char *s;
s = buf;
*s++ = '"';
while (string && *string)
@ -1397,7 +1398,7 @@ char *QCC_PR_String (char *string)
QCC_def_t *QCC_PR_DefForFieldOfs (gofs_t ofs)
{
QCC_def_t *d;
for (d=pr.def_head.next ; d ; d=d->next)
{
if (d->type->type != ev_field)
@ -1421,13 +1422,13 @@ char *QCC_PR_ValueString (etype_t type, void *val)
static char line[256];
QCC_def_t *def;
QCC_dfunction_t *f;
switch (type)
{
case ev_string:
sprintf (line, "%s", QCC_PR_String(strings + *(int *)val));
break;
case ev_entity:
case ev_entity:
sprintf (line, "entity %i", *(int *)val);
break;
case ev_function:
@ -1460,7 +1461,7 @@ char *QCC_PR_ValueString (etype_t type, void *val)
sprintf (line, "bad type %i", type);
break;
}
return line;
}
@ -1478,7 +1479,7 @@ padded to 20 field width
QCC_def_t *def;
void *val;
static char line[128];
val = (void *)&qcc_pr_globals[ofs];
def = pr_global_defs[ofs];
if (!def)
@ -1486,12 +1487,12 @@ padded to 20 field width
sprintf (line,"%i(?""?""?)", ofs);
else
sprintf (line,"%i(%s)", ofs, def->name);
i = strlen(line);
for ( ; i<16 ; i++)
strcat (line," ");
strcat (line," ");
return line;
}
@ -1502,7 +1503,7 @@ char *QCC_PR_GlobalString (gofs_t ofs)
QCC_def_t *def;
void *val;
static char line[128];
val = (void *)&qcc_pr_globals[ofs];
def = pr_global_defs[ofs];
if (!def)
@ -1514,12 +1515,12 @@ char *QCC_PR_GlobalString (gofs_t ofs)
}
else
sprintf (line,"%i(%s)", ofs, def->name);
i = strlen(line);
for ( ; i<16 ; i++)
strcat (line," ");
strcat (line," ");
return line;
}*/
@ -1541,12 +1542,12 @@ PR_PrintStatement
/*void QCC_PR_PrintStatement (QCC_dstatement_t *s)
{
int i;
printf ("%4i : %4i : %s ", (int)(s - statements), statement_linenums[s-statements], pr_opcodes[s->op].opname);
i = strlen(pr_opcodes[s->op].opname);
for ( ; i<10 ; i++)
printf (" ");
if (s->op == OP_IF || s->op == OP_IFNOT)
printf ("%sbranch %i",QCC_PR_GlobalString(s->a),s->b);
else if (s->op == OP_GOTO)
@ -1579,7 +1580,7 @@ PR_PrintDefs
/*void QCC_PR_PrintDefs (void)
{
QCC_def_t *d;
for (d=pr.def_head.next ; d ; d=d->next)
QCC_PR_PrintOfs (d->ofs);
}*/
@ -1593,7 +1594,7 @@ QCC_type_t *QCC_PR_NewType (char *name, int basictype)
qcc_typeinfo[numtypeinfos].name = name;
qcc_typeinfo[numtypeinfos].num_parms = 0;
qcc_typeinfo[numtypeinfos].param = NULL;
qcc_typeinfo[numtypeinfos].size = type_size[basictype];
qcc_typeinfo[numtypeinfos].size = type_size[basictype];
numtypeinfos++;
@ -1614,7 +1615,7 @@ void QCC_PR_BeginCompilation (void *memory, int memsize)
extern struct freeoffset_s *freeofs;
int i;
char name[16];
pr.memory = memory;
pr.max_memory = memsize;
@ -1623,20 +1624,20 @@ void QCC_PR_BeginCompilation (void *memory, int memsize)
QCC_PR_ResetErrorScope();
pr_scope = NULL;
/* numpr_globals = RESERVED_OFS;
/* numpr_globals = RESERVED_OFS;
for (i=0 ; i<RESERVED_OFS ; i++)
pr_global_defs[i] = &def_void;
*/
type_void = QCC_PR_NewType("void", ev_void);
type_string = QCC_PR_NewType("string", ev_string);
type_float = QCC_PR_NewType("float", ev_float);
type_vector = QCC_PR_NewType("vector", ev_vector);
type_entity = QCC_PR_NewType("entity", ev_entity);
type_field = QCC_PR_NewType("field", ev_field);
type_field = QCC_PR_NewType("field", ev_field);
type_function = QCC_PR_NewType("function", ev_function);
type_pointer = QCC_PR_NewType("pointer", ev_pointer);
type_pointer = QCC_PR_NewType("pointer", ev_pointer);
type_integer = QCC_PR_NewType("__integer", ev_integer);
type_variant = QCC_PR_NewType("__variant", ev_variant);
@ -1652,7 +1653,7 @@ void QCC_PR_BeginCompilation (void *memory, int memsize)
type_integer = QCC_PR_NewType("integer", ev_integer);
if (keyword_int)
type_integer = QCC_PR_NewType("int", ev_integer);
if (output_parms)
@ -1694,9 +1695,9 @@ int QCC_PR_FinishCompilation (void)
{
QCC_def_t *d;
int errors;
errors = false;
// check to make sure all functions prototyped have code
for (d=pr.def_head.next ; d ; d=d->next)
{
@ -1848,7 +1849,7 @@ static void Add3(char *p, unsigned short *crc, char *file)
{
char *s;
for(s=p;*s;s++)
QCC_CRC_ProcessByte(crc, *s);
QCC_CRC_ProcessByte(crc, *s);
}
#define ADD3(p) Add3(p, &crc, file)
@ -1864,7 +1865,7 @@ unsigned short QCC_PR_WriteProgdefs (char *filename)
file[0] = '\0';
QCC_CRC_Init (&crc);
// print global vars until the first field is defined
//ADD: crc and dump
@ -1879,7 +1880,7 @@ unsigned short QCC_PR_WriteProgdefs (char *filename)
ADD2("File generated by FTEQCC, relevent for engine modding only, the generated crc must be the same as your engine expects.");
ADD(" */\n\ntypedef struct");
ADD2(" globalvars_s");
ADD(qcva("\n{"));
ADD(qcva("\n{"));
ADD2("\tint pad;\n"
"\tint ofs_return[3];\n" //makes it easier with the get globals func
"\tint ofs_parm0[3];\n"
@ -1897,7 +1898,7 @@ unsigned short QCC_PR_WriteProgdefs (char *filename)
break;
if (d->ofs<RESERVED_OFS)
continue;
switch (d->type->type)
{
case ev_float:
@ -1934,10 +1935,10 @@ unsigned short QCC_PR_WriteProgdefs (char *filename)
{
if (!strcmp (d->name, "end_sys_fields"))
break;
if (d->type->type != ev_field)
continue;
switch (d->type->aux_type->type)
{
case ev_float:
@ -1977,7 +1978,7 @@ unsigned short QCC_PR_WriteProgdefs (char *filename)
if (d->type->type != ev_field)
continue;
if (f)
ADD2(",\n");
ADD2(",\n");
ADD2(qcva("\t{%i,\t%i,\t\"%s\"}",G_INT(d->ofs), d->type->aux_type->type, d->name));
f = 1;
}
@ -2063,14 +2064,14 @@ unsigned short QCC_PR_WriteProgdefs (char *filename)
int i;
QCC_dstatement_t *ds;
QCC_dfunction_t *df;
for (i=0 ; i<numfunctions ; i++)
if (!strcmp (name, strings + functions[i].s_name))
break;
if (i==numfunctions)
QCC_Error (ERR_NOFUNC, "No function named \"%s\"", name);
df = functions + i;
df = functions + i;
printf ("Statements for function %s:\n", name);
ds = statements + df->first_statement;
while (1)
@ -2149,7 +2150,7 @@ void QCC_CreatePath (char *path)
{
/*
char *ofs;
for (ofs = path+1 ; *ofs ; ofs++)
{
if (*ofs == '/')
@ -2180,12 +2181,12 @@ void QCC_PackFile (char *src, char *name)
#if 1
char *f;
#else
int in;
int in;
int count;
char buf[4096];
#endif
if ( (qbyte *)pf - (qbyte *)pfiles > sizeof(pfiles) )
QCC_Error (ERR_TOOMANYPAKFILES, "Too many files in pak file");
@ -2218,7 +2219,7 @@ void QCC_PackFile (char *src, char *name)
printf ("%64s : %7i\n", pf->name, remaining);
packbytes += remaining;
while (remaining)
{
if (remaining < sizeof(buf))
@ -2249,15 +2250,15 @@ void QCC_CopyFile (char *src, char *dest)
int in, out;
int remaining, count;
char buf[4096];
print ("%s to %s\n", src, dest);
in = SafeOpenRead (src);
remaining = filelength (in);
QCC_CreatePath (dest);
out = SafeOpenWrite (dest, remaining+10);
while (remaining)
{
if (remaining < sizeof(buf))
@ -2270,7 +2271,7 @@ void QCC_CopyFile (char *src, char *dest)
}
close (in);
SafeClose (out);
SafeClose (out);
*/
}
@ -2302,7 +2303,7 @@ void _QCC_CopyFiles (int blocknum, int copytype, char *srcdir, char *destdir)
for (i=0 ; i<numsounds ; i++)
{
if (precache_sounds_block[i] != blocknum)
continue;
continue;
sprintf (srcfile,"%s%s",srcdir, precache_sounds[i]);
sprintf (destfile,"%s%s",destdir, precache_sounds[i]);
if (copytype == 1)
@ -2365,7 +2366,7 @@ void _QCC_CopyFiles (int blocknum, int copytype, char *srcdir, char *destdir)
else
QCC_PackFile (srcfile, precache_files[i]);
}
if (copytype == 2)
{
header.id[0] = 'P';
@ -2375,18 +2376,18 @@ void _QCC_CopyFiles (int blocknum, int copytype, char *srcdir, char *destdir)
dirlen = (qbyte *)pf - (qbyte *)pfiles;
header.dirofs = PRLittleLong(SafeSeek (packhandle, 0, SEEK_CUR));
header.dirlen = PRLittleLong(dirlen);
SafeWrite (packhandle, pfiles, dirlen);
SafeSeek (packhandle, 0, SEEK_SET);
SafeWrite (packhandle, &header, sizeof(header));
SafeClose (packhandle);
SafeClose (packhandle);
// do a crc of the file
QCC_CRC_Init (&crc);
for (i=0 ; i<dirlen ; i++)
QCC_CRC_ProcessByte (&crc, ((qbyte *)pfiles)[i]);
i = pf - pfiles;
printf ("%i files packed in %i bytes (%i crc)\n",i, packbytes, crc);
}
@ -2396,7 +2397,7 @@ void QCC_CopyFiles (void)
{
char *s;
char srcdir[1024], destdir[1024];
int p;
int p;
if (verbose)
{
@ -2427,7 +2428,7 @@ void QCC_CopyFiles (void)
for ( p = 0; p < 5; p++)
{
s = QCC_Packname[p];
s = QCC_Packname[p];
if (!*s)
continue;
strcpy(destdir, s);
@ -2451,7 +2452,7 @@ void QCC_CopyFiles (void)
strcat (srcdir, "/");
DefaultExtension (destdir, ".pak");
copytype = 2;
_QCC_CopyFiles(blocknum, copytype, srcdir, destdir);
@ -2522,7 +2523,7 @@ void QCC_PR_CommandLinePrecompilerOptions (void)
if (!optimisations[p].enabled)
QCC_PR_Warning(0, NULL, WARN_BADPARAMS, "Unrecognised optimisation parameter (%s)", myargv[i]);
}
else if ( !strnicmp(myargv[i], "-K", 2) || !strnicmp(myargv[i], "/K", 2) )
{
p = 0;
@ -2898,10 +2899,10 @@ void QCC_main (int argc, char **argv) //as part of the quake engine
MAX_FUNCTIONS = atoi(qcc_token);
} else if (!strcmp(qcc_token, "MAX_TYPES")) {
s = QCC_COM_Parse(s);
maxtypeinfos = atoi(qcc_token);
maxtypeinfos = atoi(qcc_token);
} else if (!strcmp(qcc_token, "MAX_TEMPS")) {
s = QCC_COM_Parse(s);
max_temps = atoi(qcc_token);
max_temps = atoi(qcc_token);
} else if (!strcmp(qcc_token, "CONSTANTS")) {
s = QCC_COM_Parse(s);
MAX_CONSTANTS = atoi(qcc_token);
@ -2984,11 +2985,11 @@ void QCC_main (int argc, char **argv) //as part of the quake engine
Hash_InitTable(&localstable, MAX_REGS, qccHunkAlloc(Hash_BytesForBuckets(MAX_REGS)));
Hash_InitTable(&floatconstdefstable, MAX_REGS+1, qccHunkAlloc(Hash_BytesForBuckets(MAX_REGS+1)));
Hash_InitTable(&stringconstdefstable, MAX_REGS, qccHunkAlloc(Hash_BytesForBuckets(MAX_REGS)));
// pr_global_defs = (QCC_def_t **)qccHunkAlloc(sizeof(QCC_def_t *) * MAX_REGS);
qcc_globals = (void *)qccHunkAlloc(sizeof(QCC_ddef_t) * MAX_GLOBALS);
numglobaldefs=0;
numglobaldefs=0;
fields = (void *)qccHunkAlloc(sizeof(QCC_ddef_t) * MAX_FIELDS);
numfielddefs=0;
@ -3025,7 +3026,7 @@ memset(pr_immediate_string, 0, sizeof(pr_immediate_string));
#ifdef MAX_EXTRA_PARMS
memset(&extra_parms, 0, sizeof(extra_parms));
#endif
if ( QCC_CheckParm ("/?") || QCC_CheckParm ("?") || QCC_CheckParm ("-?") || QCC_CheckParm ("-help") || QCC_CheckParm ("--help"))
{
printf ("qcc looks for progs.src in the current directory.\n");
@ -3062,7 +3063,7 @@ memset(pr_immediate_string, 0, sizeof(pr_immediate_string));
if (opt_locals_marshalling)
printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nLocals marshalling might be buggy. Use with caution\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
p = QCC_CheckParm ("-src");
if (p && p < argc-1 )
{
@ -3090,7 +3091,7 @@ memset(pr_immediate_string, 0, sizeof(pr_immediate_string));
if (!p || p >= argc-1 || argv[p+1][0] == '-')
p = QCC_CheckParm ("-srcfile");
if (p && p < argc-1 )
sprintf (qccmprogsdat, "%s", argv[p+1]);
sprintf (qccmprogsdat, "%s", argv[p+1]);
else
{ //look for a preprogs.src... :o)
sprintf (qccmprogsdat, "preprogs.src");
@ -3118,7 +3119,7 @@ memset(pr_immediate_string, 0, sizeof(pr_immediate_string));
printf ("Source file: %s\n", qccmprogsdat);
if (QCC_LoadFile (qccmprogsdat, (void *)&qccmsrc) == -1)
{
{
return;
}
}
@ -3151,7 +3152,7 @@ memset(pr_immediate_string, 0, sizeof(pr_immediate_string));
}
if (*qcc_token == '#')
{
{
void StartNewStyleCompile(void);
newstyle:
newstylesource = true;
@ -3175,7 +3176,7 @@ newstyle:
#ifndef QCCONLY
p=0;
s2 = strcpy(destfile2, destfile);
s2 = strcpy(destfile2, destfile);
if (!strncmp(s2, "./", 2))
s2+=2;
else
@ -3237,7 +3238,7 @@ newstyle:
}
printf ("outputfile: %s\n", destfile);
pr_dumpasm = false;
currentchunk = NULL;
@ -3323,7 +3324,7 @@ void QCC_ContinueCompile(void)
QCC_Error (ERR_PARSEERRORS, "Errors have occured\n");
}
void QCC_FinishCompile(void)
{
{
pbool donesomething;
int crc;
// int p;
@ -3331,7 +3332,7 @@ void QCC_FinishCompile(void)
if (setjmp(pr_parse_abort))
QCC_Error(ERR_INTERNAL, "");
if (!QCC_PR_FinishCompilation ())
{
QCC_Error (ERR_PARSEERRORS, "compilation errors");
@ -3364,10 +3365,10 @@ void QCC_FinishCompile(void)
// write progdefs.h
crc = QCC_PR_WriteProgdefs ("progdefs.h");
// write data file
donesomething = QCC_WriteData (crc);
// regenerate bmodels if -bspmodels
QCC_BspModels ();
@ -3426,7 +3427,7 @@ void QCC_FinishCompile(void)
printf("optres_test1 %i\n", optres_test1);
if (optres_test2)
printf("optres_test2 %i\n", optres_test2);
printf("numtemps %i\n", numtemps);
}
if (!flag_msvcstyle)
@ -3507,7 +3508,7 @@ void new_QCC_ContinueCompile(void)
}
pr_scope = NULL; // outside all functions
QCC_PR_ParseDefs (NULL);
}
@ -3570,12 +3571,12 @@ void new_QCC_ContinueCompile(void)
QCC_PR_ClearGrabMacros (); // clear the frame macros
compilingfile = filename;
pr_file_p = qccmsrc2;
s_file = QCC_CopyString (filename);
pr_source_line = 0;
QCC_PR_NewLine ();
QCC_PR_Lex (); // read first token
@ -3588,16 +3589,16 @@ void new_QCC_ContinueCompile(void)
return false;
QCC_PR_SkipToSemicolon ();
if (pr_token_type == tt_eof)
return false;
return false;
}
pr_scope = NULL; // outside all functions
QCC_PR_ParseDefs ();
}
}
return (pr_error_count == 0);
}*/

View File

@ -205,7 +205,7 @@ pbool ED_CanFree (edict_t *ed)
ed->v->classname = 0;
if (pr_imitatemvdsv.value)
if (pr_imitatemvdsv.value)
{
ed->v->health = 0;
ed->v->nextthink = -1;
@ -520,7 +520,7 @@ void PR_LoadGlabalStruct(void)
static float writeonly;
static float dimension_send_default;
static float zero_default;
static vec3_t vecwriteonly;
//static vec3_t vecwriteonly; // 523:16: warning: unused variable vecwriteonly
int i;
int *v;
nqglobalvars_t *pr_globals = pr_nqglobal_struct;
@ -576,7 +576,7 @@ void PR_LoadGlabalStruct(void)
globalfloat (false, cycle_wrapped);
globalfloat (false, dimension_send);
globalfloat (false, clientcommandframe);
globalfloat (false, input_timelength);
globalvec_ (false, input_angles);
@ -600,19 +600,19 @@ void PR_LoadGlabalStruct(void)
if (!((nqglobalvars_t*)pr_globals)->V_trace_plane_normal)
{
((nqglobalvars_t*)pr_globals)->V_trace_plane_normal = (vec3_t *)PR_FindGlobal(svprogfuncs, "trace_normal", 0);
if (!((nqglobalvars_t*)pr_globals)->V_trace_plane_normal)
if (!((nqglobalvars_t*)pr_globals)->V_trace_plane_normal)
SV_Error("Could not find export trace_plane_normal in progs\n");
}
if (!((nqglobalvars_t*)pr_globals)->V_trace_endpos)
{
((nqglobalvars_t*)pr_globals)->V_trace_endpos = (vec3_t *)PR_FindGlobal(svprogfuncs, "trace_impact", 0);
if (!((nqglobalvars_t*)pr_globals)->V_trace_endpos)
if (!((nqglobalvars_t*)pr_globals)->V_trace_endpos)
SV_Error("Could not find export trace_endpos in progs\n");
}
if (!((nqglobalvars_t*)pr_globals)->trace_fraction)
{
((nqglobalvars_t*)pr_globals)->trace_fraction = (float *)PR_FindGlobal(svprogfuncs, "trace_frac", 0);
if (!((nqglobalvars_t*)pr_globals)->trace_fraction)
if (!((nqglobalvars_t*)pr_globals)->trace_fraction)
SV_Error("Could not find export trace_fraction in progs\n");
}
ensurefloat(serverflags, zero_default);
@ -1620,7 +1620,7 @@ qboolean PR_UserCmd(char *s)
//ktpro bug warning:
//admin + judge. I don't know the exact rules behind this bug, so I just ban the entire command
//I can't be arsed detecting ktpro specifically, so assume we're always running ktpro
if (!strncmp(s, "admin", 5) || !strncmp(s, "judge", 5))
{
Con_Printf("Blocking potentially unsafe ktpro command: %s\n", s);
@ -3515,7 +3515,7 @@ static void QCBUILTIN PF_precache_model (progfuncs_t *prinst, struct globalvars_
char *s;
s = PR_GetStringOfs(prinst, OFS_PARM0);
G_INT(OFS_RETURN) = G_INT(OFS_PARM0);
PF_precache_model_Internal(prinst, s);
@ -3580,6 +3580,8 @@ void QCBUILTIN PF_precache_vwep_model (progfuncs_t *prinst, struct globalvars_s
}
}
// warning: PF_svcoredump defined but not used
/*
static void QCBUILTIN PF_svcoredump (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
int size = 1024*1024*8;
@ -3588,6 +3590,7 @@ static void QCBUILTIN PF_svcoredump (progfuncs_t *prinst, struct globalvars_s *p
COM_WriteFile("ssqccore.txt", buffer, size);
BZ_Free(buffer);
}
*/
static void QCBUILTIN PF_sv_movetogoal (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
@ -5044,6 +5047,8 @@ static void QCBUILTIN PF_newstring(progfuncs_t *prinst, struct globalvars_s *pr_
RETURN_SSTRING(s+8);
}
// warning: PF_strcatp defined but not used
/*
static void QCBUILTIN PF_strcatp(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
char *buf = PR_GetStringOfs(prinst, OFS_PARM0); char *add = PR_GetStringOfs(prinst, OFS_PARM1);
@ -5066,7 +5071,10 @@ static void QCBUILTIN PF_strcatp(progfuncs_t *prinst, struct globalvars_s *pr_gl
G_INT(OFS_RETURN) = G_INT(OFS_PARM0);
}
*/
// warning: PF_redstring defined but not used
/*
static void QCBUILTIN PF_redstring(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
char *string = PR_GetStringOfs(prinst, OFS_PARM0), *s;
@ -5078,6 +5086,7 @@ static void QCBUILTIN PF_redstring(progfuncs_t *prinst, struct globalvars_s *pr_
RETURN_TSTRING(buf);
}
*/
#ifdef SVCHAT
void SV_Chat(char *filename, float starttag, edict_t *edict);
@ -5134,7 +5143,7 @@ void PF_sqlconnect (progfuncs_t *prinst, struct globalvars_s *pr_globals)
if (!driver[0])
driver = sql_driver.string;
G_FLOAT(OFS_RETURN) = SQL_NewServer(driver, paramstr);
}
@ -5191,14 +5200,14 @@ void PF_sqlclosequery (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
sqlserver_t *server;
queryresult_t *qres;
if (SQL_Available())
{
server = SQL_GetServer(G_FLOAT(OFS_PARM0), false);
if (server)
{
qres = SQL_GetQueryResult(server, G_FLOAT(OFS_PARM1));
if (qres)
if (qres)
{
// TODO: partial resultset logic not implemented yet
SQL_CloseResult(server, qres);
@ -5216,7 +5225,7 @@ void PF_sqlreadfield (progfuncs_t *prinst, struct globalvars_s *pr_globals)
char *data;
if (SQL_Available())
{
{
server = SQL_GetServer(G_FLOAT(OFS_PARM0), false);
if (server)
{
@ -5243,7 +5252,7 @@ void PF_sqlreadfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals)
char *data;
if (SQL_Available())
{
{
server = SQL_GetServer(G_FLOAT(OFS_PARM0), false);
if (server)
{
@ -5276,7 +5285,7 @@ void PF_sqlerror (progfuncs_t *prinst, struct globalvars_s *pr_globals)
if (*svprogfuncs->callargc == 2)
{ // query-specific error request
if (server->active) // didn't check this earlier so check it now
{
{
queryresult_t *qres = SQL_GetQueryResult(server, G_FLOAT(OFS_PARM1));
if (qres)
{
@ -5323,7 +5332,7 @@ void PF_sqlescape (progfuncs_t *prinst, struct globalvars_s *pr_globals)
void PF_sqlversion (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
sqlserver_t *server;
if (SQL_Available())
{
server = SQL_GetServer(G_FLOAT(OFS_PARM0), false);
@ -5776,39 +5785,39 @@ static void QCBUILTIN PF_strstr (progfuncs_t *prinst, struct globalvars_s *pr_gl
RETURN_TSTRING(p);
}
char readable2[256] =
char readable2[256] =
{
'.', '_', '_', '_', '_', '.', '_', '_',
'_', '_', '\n', '_', '\n', '>', '.', '.',
'[', ']', '0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', '.', '_', '_', '_',
' ', '!', '\"', '#', '$', '%', '&', '\'',
'(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', ':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '{', '|', '}', '~', '_',
'_', '_', '_', '_', '_', '.', '_', '_',
'_', '_', '_', '_', '_', '>', '.', '.',
'[', ']', '0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', '.', '_', '_', '_',
' ', '!', '\"', '#', '$', '%', '&', '\'',
'(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', ':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'.', '_', '_', '_', '_', '.', '_', '_',
'_', '_', '\n', '_', '\n', '>', '.', '.',
'[', ']', '0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', '.', '_', '_', '_',
' ', '!', '\"', '#', '$', '%', '&', '\'',
'(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', ':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '{', '|', '}', '~', '_',
'_', '_', '_', '_', '_', '.', '_', '_',
'_', '_', '_', '_', '_', '>', '.', '.',
'[', ']', '0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', '.', '_', '_', '_',
' ', '!', '\"', '#', '$', '%', '&', '\'',
'(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', ':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '{', '|', '}', '~', '_'
};
@ -6463,7 +6472,7 @@ enum
/*internal effects, here for indexes*/
ce_teleporterbody_1, /*de-sheeped*/
ce_white_smoke_05,
ce_white_smoke_10,
@ -6799,7 +6808,7 @@ static void QCBUILTIN PF_h2starteffect(progfuncs_t *prinst, struct globalvars_s
}
Con_Printf("FTE-H2 FIXME: Effect %i doesn't have an effect registered\nTell Spike!\n", efnum);
#if 0
switch((int)G_FLOAT(OFS_PARM0))
@ -8221,7 +8230,7 @@ static void QCBUILTIN PF_globalstat(progfuncs_t *prinst, struct globalvars_s *pr
//EXT_CSQC_1
static void QCBUILTIN PF_runclientphys(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
{
unsigned int i, n;
extern vec3_t player_maxs, player_mins;
extern qbyte playertouch[];
@ -8709,7 +8718,7 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
{"setorigin", PF_setorigin, 2, 2, 2}, // void(entity e, vector o) setorigin = #2;
{"setmodel", PF_setmodel, 3, 3, 3}, // void(entity e, string m) setmodel = #3;
{"setsize", PF_setsize, 4, 4, 4}, // void(entity e, vector min, vector max) setsize = #4;
{"qtest_setabssize",PF_setsize, 5}, // void(entity e, vector min, vector max) setabssize = #5;
{"qtest_setabssize",PF_setsize, 5}, // void(entity e, vector min, vector max) setabssize = #5;
{"lightstylestatic",PF_lightstylestatic,0, 0, 5, 5},
{"break", PF_break, 6, 6, 6}, // void() break = #6;
{"random", PF_random, 7, 7, 7}, // float() random = #7;

View File

@ -75,11 +75,12 @@ extern cvar_t sv_nomsec;
static void SV_Physics_Toss (edict_t *ent);
// warning: SV_CheckAllEnts defined but not used
/*
================
SV_CheckAllEnts
================
*/
static void SV_CheckAllEnts (void)
{
int e;
@ -102,6 +103,7 @@ static void SV_CheckAllEnts (void)
Con_Printf ("entity in invalid position\n");
}
}
*/
/*
================
@ -1376,6 +1378,7 @@ static void SV_WallFriction (edict_t *ent, trace_t *trace)
ent->v->velocity[1] = side[1] * (1 + d);
}
// warning: SV_TryUnstick defined but not used
/*
=====================
SV_TryUnstick
@ -1387,7 +1390,7 @@ Try fixing by pushing one pixel in each direction.
This is a hack, but in the interest of good gameplay...
======================
*/
static int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
{
int i;
@ -1436,6 +1439,7 @@ static int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
VectorClear (ent->v->velocity);
return 7; // still not moving
}
*/
/*
=====================
@ -1797,7 +1801,7 @@ SV_RunEntity
void SV_RunEntity (edict_t *ent)
{
edict_t *movechain;
vec3_t initial_origin,initial_angle;
vec3_t initial_origin = {0},initial_angle = {0}; // warning: initial_?[?] may be used uninitialized in this function
if (ent->entnum > 0 && ent->entnum <= sv.allocated_client_slots)
{ //a client woo.
@ -2177,7 +2181,7 @@ qboolean SV_Physics (void)
SV_RunEntity (ent);
SV_RunNewmis ();
if (ent->solidtype != ent->v->solid && !ent->isfree)
{
Con_DPrintf("Entity \"%s\" improperly changed solid type\n", PR_GetString(svprogfuncs, ent->v->classname));

View File

@ -36,9 +36,14 @@ char rank_cvargroup[] = "server rankings";
void inline READ_PLAYERSTATS(int x, rankstats_t *os)
{
int i;
size_t result;
fseek(rankfile, sizeof(rankfileheader_t)+sizeof(rankheader_t)+((x-1)*sizeof(rankinfo_t)), SEEK_SET);
fread(os, sizeof(rankstats_t), 1, rankfile);
result = fread(os, sizeof(rankstats_t), 1, rankfile);
// ignoring return value of fread, declared with attribute warn_unused_result
if (result != 1)
fprintf(stderr, "fread() error in READ_PLAYERSTATS\n");
os->kills = swaplong(os->kills);
os->deaths = swaplong(os->deaths);
@ -73,9 +78,15 @@ void inline WRITE_PLAYERSTATS(int x, rankstats_t *os)
void inline READ_PLAYERHEADER(int x, rankheader_t *oh)
{
size_t result;
fseek(rankfile, sizeof(rankfileheader_t)+((x-1)*sizeof(rankinfo_t)), SEEK_SET);
fread(oh, sizeof(rankheader_t), 1, rankfile);
result = fread(oh, sizeof(rankheader_t), 1, rankfile);
// ignoring return value of fread, declared with attribute warn_unused_result
if (result != 1)
fprintf(stderr, "fread() error in WRITE_PLAYERSTATS\n");
oh->prev = swaplong(oh->prev); //score is held for convineance.
oh->next = swaplong(oh->next);
@ -125,6 +136,7 @@ void inline WRITEHEADER(void)
qboolean Rank_OpenRankings(void)
{
char syspath[MAX_OSPATH];
size_t result;
qboolean created;
if (!rankfile)
{
@ -150,7 +162,11 @@ qboolean Rank_OpenRankings(void)
memset(&rankfileheader, 0, sizeof(rankfileheader));
fseek(rankfile, 0, SEEK_SET);
fread(&rankfileheader, sizeof(rankfileheader_t), 1, rankfile);
result = fread(&rankfileheader, sizeof(rankfileheader_t), 1, rankfile);
// ignoring return value of fread, declared with attribute warn_unused_result
if (result != 1)
fprintf(stderr, "fread() error in Rank_OpenRankings\n");
rankfileheader.version = swaplong(rankfileheader.version);
rankfileheader.usedslots = swaplong(rankfileheader.usedslots);

View File

@ -104,6 +104,7 @@ int Sys_DebugLog(char *file, char *fmt, ...)
va_list argptr;
char data[1024];
int fd;
size_t result;
va_start(argptr, fmt);
_vsnprintf (data,sizeof(data)-1, fmt, argptr);
@ -115,7 +116,7 @@ int Sys_DebugLog(char *file, char *fmt, ...)
fd = open(file, O_WRONLY | O_CREAT | O_APPEND, 0666);
if (fd)
{
write(fd, data, strlen(data));
result = write(fd, data, strlen(data)); // do something with the result
close(fd);
return 0;
}
@ -204,7 +205,7 @@ void ApplyColour(unsigned int chr)
bg = (chr & CON_BGMASK) >> CON_BGSHIFT;
fg = (chr & CON_FGMASK) >> CON_FGSHIFT;
// don't handle intensive bit for background
// as terminals differ too much in displaying \e[1;7;3?m
bg &= 0x7;
@ -272,7 +273,7 @@ char coninput_text[256];
int coninput_len;
void Sys_Printf (char *fmt, ...)
{
va_list argptr;
va_list argptr;
if (sys_nostdout.value)
return;
@ -289,7 +290,7 @@ void Sys_Printf (char *fmt, ...)
if (!sys_linebuffer.value)
{
int i;
for (i = 0; i < coninput_len; i++)
putch('\b');
putch('\b');
@ -810,7 +811,7 @@ static void *game_library;
void Sys_UnloadGame(void)
{
if (game_library)
if (game_library)
{
dlclose(game_library);
game_library = 0;
@ -825,10 +826,11 @@ void *Sys_GetGameAPI(void *parms)
char curpath[MAX_OSPATH];
char *searchpath;
const char *gamename = "gamei386.so";
size_t result;
void *ret;
getcwd(curpath, sizeof(curpath));
result = getcwd(curpath, sizeof(curpath)); // do soemthing with the result
searchpath = 0;
while((searchpath = COM_NextPath(searchpath)))
@ -863,11 +865,11 @@ void *Sys_CreateThread(int (*func)(void *), void *args, int stacksize)
{
pthread_t *thread;
pthread_attr_t attr;
thread = (pthread_t *)malloc(sizeof(pthread_t));
if (!thread)
return NULL;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
if (stacksize < PTHREAD_STACK_MIN)
@ -885,7 +887,7 @@ void *Sys_CreateThread(int (*func)(void *), void *args, int stacksize)
void Sys_WaitOnThread(void *thread)
{
pthread_join((pthread_t *)thread, NULL);
pthread_join((pthread_t *)thread, NULL);
free(thread);
}
@ -893,7 +895,7 @@ void Sys_WaitOnThread(void *thread)
void *Sys_CreateMutex(void)
{
pthread_mutex_t *mutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
if (mutex && !pthread_mutex_init(mutex, NULL))
return mutex;
return NULL;
@ -932,36 +934,36 @@ void *Sys_CreateConditional(void)
condvar_t *condv;
pthread_mutex_t *mutex;
pthread_cond_t *cond;
condv = (condvar_t *)malloc(sizeof(condvar_t));
if (!condv)
return NULL;
mutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
if (!mutex)
return NULL;
cond = (pthread_cond_t *)malloc(sizeof(pthread_cond_t));
if (!cond)
return NULL;
if (!pthread_mutex_init(mutex, NULL))
{
if (!pthread_cond_init(cond, NULL))
{
condv->cond = cond;
condv->mutex = mutex;
return (void *)condv;
}
else
pthread_mutex_destroy(mutex);
}
free(cond);
free(mutex);
free(condv);
return NULL;
return NULL;
}
qboolean Sys_LockConditional(void *condv)
@ -992,7 +994,7 @@ qboolean Sys_ConditionBroadcast(void *condv)
void Sys_DestroyConditional(void *condv)
{
condvar_t *cv = (condvar_t *)condv;
pthread_cond_destroy(cv->cond);
pthread_mutex_destroy(cv->mutex);
free(cv->cond);

View File

@ -968,7 +968,7 @@ void SV_Modellist_f (void)
{
char mname[MAX_QPATH];
char vweaplist[1024] = "//vwep";
int pos = strlen(vweaplist);
//int pos = strlen(vweaplist); // warning: unused variable pos
for (i = 0; sv.strings.vw_model_precache[i]; i++)
{
@ -1613,7 +1613,7 @@ void SV_Begin_Core(client_t *split)
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, split->edict);
G_FLOAT(OFS_PARM0) = split->csqcactive; //this arg is part of EXT_CSQC_1, but doesn't have to be supported by the mod
PR_ExecuteProgram (svprogfuncs, pr_global_struct->ClientConnect);
// actually spawn the player
pr_global_struct->time = sv.world.physicstime;
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, split->edict);
@ -1758,12 +1758,12 @@ void SV_DarkPlacesDownloadChunk(client_t *cl, sizebuf_t *msg)
if (cl->num_backbuf)
return;
size = 1024; //fixme
if (size > cl->datagram.maxsize - cl->datagram.cursize)
size = cl->datagram.maxsize - cl->datagram.cursize - 16;
if (size > MAXDPDOWNLOADCHUNK) //don't clog it too much
size = MAXDPDOWNLOADCHUNK;
@ -2253,7 +2253,7 @@ void SV_VoiceSendPacket(client_t *client, sizebuf_t *buf)
send = false;
if (ring->receiver[clno>>3] & (1<<(clno&3)))
send = true;
/*if you're spectating, you can hear whatever your tracked player can hear*/
if (host_client->spectator && host_client->spec_track)
if (ring->receiver[(host_client->spec_track-1)>>3] & (1<<((host_client->spec_track-1)&3)))
@ -2312,7 +2312,7 @@ void SV_Voice_Ignore_f(void)
case -1:
host_client->voice_mute[other>>3] &= ~(1<<(other&3));
break;
case 0:
case 0:
host_client->voice_mute[other>>3] ^= (1<<(other&3));
break;
case 1:
@ -2534,7 +2534,7 @@ static int SV_LocateDownload(char *name, flocation_t *loc, char **replacementnam
Con_Printf("Failed to read %s\n", pakname);
}
}
if (protectedpak)
{ //if its in a pak file, don't allow downloads if we don't allow the contents of paks to be sent.
if (!allow_download_pakcontents.value)
@ -2669,7 +2669,7 @@ void SV_BeginDownload_f(void)
if (redirection)
{
//tell the client to download the new one.
ClientReliableWrite_Begin (host_client, ISQ2CLIENT(host_client)?svcq2_stufftext:svc_stufftext, 2+strlen(redirection));
ClientReliableWrite_Begin (host_client, ISQ2CLIENT(host_client)?svcq2_stufftext:svc_stufftext, 2+strlen(redirection));
ClientReliableWrite_String (host_client, va("\ndownload \"%s\"\n", redirection));
}
return;
@ -2853,7 +2853,7 @@ void SV_PushFloodProt(client_t *client)
if (client->lastspoke)
{
client->floodprotmessage -= (realtime - client->lastspoke)
client->floodprotmessage -= (realtime - client->lastspoke)
* sv_floodprotect_messages.value
/ sv_floodprotect_interval.value;
client->floodprotmessage = max(0, client->floodprotmessage);
@ -3118,7 +3118,7 @@ SV_Kill_f
void SV_Kill_f (void)
{
float floodtime;
#ifdef HLSERVER
if (svs.gametype == GT_HALFLIFE)
{
@ -3385,7 +3385,7 @@ void SV_SetInfo_f (void)
Q_strncpyz(oldval, Info_ValueForKey(host_client->userinfo, Cmd_Argv(1)), MAX_INFO_STRING);
#ifdef VM_Q1
if (Q1QVM_UserInfoChanged(sv_player))
if (Q1QVM_UserInfoChanged(sv_player))
return;
#endif
@ -3995,7 +3995,7 @@ void Cmd_Observe_f (void)
return;
if (host_client->spectator)
return; // already a spectator
if (svs.gametype != GT_PROGS)
{
SV_PrintToClient(host_client, PRINT_HIGH, "Sorry, not implemented in this gamecode type. Try moaning at the dev team\n");
@ -5394,7 +5394,7 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean recurse)
}
else
jumpable = false;
#ifdef VM_Q1
if (svs.gametype == GT_Q1QVM)
Q1QVM_PlayerPreThink();

View File

@ -231,7 +231,7 @@ static void Q3G_LinkEntity(q3sharedEntity_t *ent)
else
{
// normal
VectorAdd(origin, ent->r.mins, ent->r.absmin);
VectorAdd(origin, ent->r.mins, ent->r.absmin);
VectorAdd(origin, ent->r.maxs, ent->r.absmax);
}
@ -341,7 +341,7 @@ static void Q3G_LinkEntity(q3sharedEntity_t *ent)
else
break; // crosses the node
}
// link it in
// link it in
InsertLinkBefore((link_t *)&sent->area, &node->solid_edicts);
}
@ -371,7 +371,7 @@ static int SVQ3_EntitiesInBoxNode(areanode_t *node, vec3_t mins, vec3_t maxs, in
if (node->axis >= 0)
{
if ( maxs[node->axis] > node->dist )
linkcount += SVQ3_EntitiesInBoxNode(node->children[0], mins, maxs, list+linkcount, maxcount-linkcount);
if ( mins[node->axis] < node->dist )
@ -439,7 +439,7 @@ static void SVQ3_Trace(q3trace_t *result, vec3_t start, vec3_t mins, vec3_t maxs
if (ourowner == ENTITYNUM_WORLD)
ourowner = -1;
}
else
else
ourowner = -1;
@ -516,7 +516,7 @@ static int SVQ3_PointContents(vec3_t pos, int entnum)
if (ourowner == ENTITYNUM_WORLD)
ourowner = -1;
}
else
else
ourowner = -1;
for (i = SVQ3_EntitiesInBox(pos, pos, contactlist, sizeof(contactlist)/sizeof(contactlist[0]))-1; i >= 0; i--)
@ -598,7 +598,7 @@ typedef struct {
int serverTime;
int angles[3];
int buttons;
qbyte weapon; // weapon
qbyte weapon; // weapon
signed char forwardmove, rightmove, upmove;
} q3usercmd_t;
#define CMD_MASK Q3UPDATE_MASK
@ -637,7 +637,7 @@ void SVQ3_SendServerCommand(client_t *cl, char *str)
}
return;
}
cl->num_server_commands++;
Q_strncpyz(cl->server_commands[cl->num_server_commands & TEXTCMD_MASK], str, sizeof(cl->server_commands[0]));
}
@ -776,7 +776,7 @@ static qintptr_t Q3G_SystemCalls(void *offset, unsigned int mask, qintptr_t fn,
Cbuf_AddText(VM_POINTER(arg[1]), RESTRICT_SERVER);
return 0;
case G_FS_FOPEN_FILE: //fopen
if ((int)arg[1] + 4 >= mask || VM_POINTER(arg[1]) < offset)
break; //out of bounds.
@ -1250,7 +1250,7 @@ static qintptr_t Q3G_SystemCalls(void *offset, unsigned int mask, qintptr_t fn,
return botlib->ai.BotChooseLTGItem(VM_LONG(arg[0]), VM_POINTER(arg[1]), VM_POINTER(arg[2]), VM_LONG(arg[3]));
case BOTLIB_AI_CHOOSE_NBG_ITEM:
//FIXME: validatepointer ?
return botlib->ai.BotChooseNBGItem(VM_LONG(arg[0]), VM_POINTER(arg[1]), VM_POINTER(arg[2]), VM_LONG(arg[3]), VM_POINTER(arg[4]), VM_FLOAT(arg[5]));
return botlib->ai.BotChooseNBGItem(VM_LONG(arg[0]), VM_POINTER(arg[1]), VM_POINTER(arg[2]), VM_LONG(arg[3]), VM_POINTER(arg[4]), VM_FLOAT(arg[5]));
case BOTLIB_AI_TOUCHING_GOAL:
return botlib->ai.BotTouchingGoal(VM_POINTER(arg[0]), VM_POINTER(arg[1]));
case BOTLIB_AI_ITEM_GOAL_IN_VIS_BUT_NOT_VISIBLE:
@ -1359,7 +1359,7 @@ static qintptr_t Q3G_SystemCalls(void *offset, unsigned int mask, qintptr_t fn,
case BOTLIB_AI_SET_AVOID_GOAL_TIME:
botlib->ai.BotSetAvoidGoalTime(VM_LONG(arg[0]), VM_LONG(arg[1]), VM_FLOAT(arg[2]));
return 0;
case BOTLIB_AI_ADD_AVOID_SPOT:
botlib->ai.BotAddAvoidSpot(VM_LONG(arg[0]), VM_POINTER(arg[1]), VM_FLOAT(arg[2]), VM_LONG(arg[3]));
return 0;
@ -1525,7 +1525,7 @@ static int QDECL BL_FRead( void *buffer, int len, fileHandle_t f )
//int BL_FWrite( const void *buffer, int len, fileHandle_t f )
//{
// return VM_FWrite(buffer, len, f, Z_TAG_BOTLIB);
//}
//}
static void QDECL BL_FCloseFile( fileHandle_t f )
{
VM_fclose((int)f, Z_TAG_BOTLIB);
@ -1712,26 +1712,26 @@ qboolean SVQ3_InitGame(void)
q3_sentities = Z_Malloc(sizeof(q3serverEntity_t)*MAX_GENTITIES);
strcpy(buffer, svs.info);
Info_SetValueForKey(buffer, "map", "", sizeof(buffer));
Info_SetValueForKey(buffer, "maxclients", "", sizeof(buffer));
Info_SetValueForKey(buffer, "mapname", sv.name, sizeof(buffer));
Info_SetValueForKey(buffer, "sv_maxclients", "32", sizeof(buffer));
Info_SetValueForKey(buffer, "map", "", sizeof(buffer));
Info_SetValueForKey(buffer, "maxclients", "", sizeof(buffer));
Info_SetValueForKey(buffer, "mapname", sv.name, sizeof(buffer));
Info_SetValueForKey(buffer, "sv_maxclients", "32", sizeof(buffer));
SVQ3_SetConfigString(0, buffer);
Cvar_Set(Cvar_Get("sv_running", "0", 0, "Q3 compatability"), "1");
sysinfo[0] = '\0';
Info_SetValueForKey(sysinfo, "sv_serverid", va("%i", svs.spawncount), MAX_SERVERINFO_STRING);
Info_SetValueForKey(sysinfo, "sv_serverid", va("%i", svs.spawncount), MAX_SERVERINFO_STRING);
str = FS_GetPackHashes(buffer, sizeof(buffer), false);
Info_SetValueForKey(sysinfo, "sv_paks", str, MAX_SERVERINFO_STRING);
str = FS_GetPackNames(buffer, sizeof(buffer), false);
Info_SetValueForKey(sysinfo, "sv_pakNames", str, MAX_SERVERINFO_STRING);
str = FS_GetPackHashes(buffer, sizeof(buffer), true);
Info_SetValueForKey(sysinfo, "sv_referencedPaks", str, MAX_SERVERINFO_STRING);
str = FS_GetPackNames(buffer, sizeof(buffer), true);
Info_SetValueForKey(sysinfo, "sv_referencedPakNames", str, MAX_SERVERINFO_STRING);
@ -1808,7 +1808,7 @@ void SVQ3_Netchan_Transmit( client_t *client, int length, qbyte *data );
void SVQ3_CreateBaseline(void)
{
q3sharedEntity_t *ent;
int entnum;
int entnum;
if (q3_baselines)
Z_Free(q3_baselines);
@ -1914,7 +1914,7 @@ void SVQ3_EmitPacketEntities(client_t *client, q3client_frame_t *from, q3client_
continue;
}
}
MSG_WriteBits(msg, ENTITYNUM_NONE, GENTITYNUM_BITS); // end of packetentities
}
@ -1967,12 +1967,12 @@ void SVQ3_WriteSnapshotToClient(client_t *client, sizebuf_t *msg)
// snap->snapFlags |= SNAPFLAG_RATE_DELAYED;
// client->surpressCount = 0;
// }
// write snapshot header
MSG_WriteBits(msg, svcq3_snapshot, 8);
MSG_WriteBits(msg, snap->serverTime, 32);
MSG_WriteBits(msg, delta, 8); // what we are delta'ing from
// write snapFlags
MSG_WriteBits(msg, snap->flags, 8);
@ -2019,7 +2019,7 @@ static int VARGS SVQ3_QsortEntityStates( const void *arg1, const void *arg2 )
SV_Error("SV_QsortEntityStates: duplicated entity");
return 0;
}
static qboolean SVQ3_EntityIsVisible( q3sharedEntity_t *ent )
@ -2078,7 +2078,7 @@ static qboolean SVQ3_EntityIsVisible( q3sharedEntity_t *ent )
// ignore if not touching a PV leaf
//
sent = SENTITY_FOR_GENTITY( ent );
// check area
if (sent->areanum < 0 || !(areabits[sent->areanum >> 3] & (1 << (sent->areanum & 7))))
{
@ -2103,7 +2103,7 @@ static qboolean SVQ3_EntityIsVisible( q3sharedEntity_t *ent )
}
*/
if (sent->num_clusters == -1)
{
// too many leafs for individual check, go by headnode
@ -2128,7 +2128,7 @@ static qboolean SVQ3_EntityIsVisible( q3sharedEntity_t *ent )
return false; // not visible
}
}
return true;
}
@ -2272,7 +2272,7 @@ void SVQ3_BuildClientSnapshot( client_t *client )
if( !SVQ3_EntityIsVisible( ent ) )
continue;
// merge PVS if portal
// merge PVS if portal
portalarea = CM_PointLeafnum(sv.world.worldmodel, ent->s.origin2);
portalarea = CM_LeafArea(sv.world.worldmodel, portalarea);
@ -2290,7 +2290,7 @@ void SVQ3_BuildClientSnapshot( client_t *client )
continue;
if( !SVQ3_EntityIsVisible( ent ) )
continue;
if (ent->s.number != i)
{
Con_DPrintf( "FIXING ENT->S.NUMBER!!!\n" );
@ -2339,13 +2339,13 @@ void SVQ3_BuildClientSnapshot( client_t *client )
q3_next_snapshot_entities++;
}
for (i = 0; i < snap->areabytes;i++)
{ //fix areabits, q2->q3 style..
snap->areabits[i]^=255;
}
}
void SVQ3Q1_ConvertEntStateQ1ToQ3(entity_state_t *q1, q3entityState_t *q3)
@ -2448,24 +2448,24 @@ void SVQ3Q1_SendGamestateConfigstrings(sizebuf_t *msg)
memset(cfgstr, 0, sizeof(cfgstr));
sysinfo[0] = 0;
Info_SetValueForKey(sysinfo, "sv_serverid", va("%i", svs.spawncount), sizeof(sysinfo));
Info_SetValueForKey(sysinfo, "sv_serverid", va("%i", svs.spawncount), sizeof(sysinfo));
str = refpackcrcs;//FS_GetPackHashes(buffer, sizeof(buffer), false);
Info_SetValueForKey(sysinfo, "sv_paks", str, sizeof(sysinfo));
str = refpacknames;//FS_GetPackNames(buffer, sizeof(buffer), false);
Info_SetValueForKey(sysinfo, "sv_pakNames", str, sizeof(sysinfo));
str = refpackcrcs;//FS_GetPackHashes(buffer, sizeof(buffer), true);
Info_SetValueForKey(sysinfo, "sv_referencedPaks", str, sizeof(sysinfo));
str = refpacknames;//FS_GetPackNames(buffer, sizeof(buffer), true);
Info_SetValueForKey(sysinfo, "sv_referencedPakNames", str, sizeof(sysinfo));
Con_Printf("Sysinfo: %s\n", sysinfo);
str = "0";
Info_SetValueForKey(sysinfo, "sv_pure", str, sizeof(sysinfo));
str = "qwoverq3";
Info_SetValueForKey(sysinfo, "fs_game", str, sizeof(sysinfo));
@ -2573,6 +2573,11 @@ void SVQ3_SendGameState(client_t *client)
}
}
break;
// warning: enumeration value GT_? not handled in switch
case GT_HALFLIFE:
case GT_QUAKE2:
case GT_MAX:
break;
}
// write svc_eom command
@ -2782,7 +2787,7 @@ void SVQ3_ParseUsercmd(client_t *client, qboolean delta)
int key;
int cmdCount;
char *string;
if(delta)
{
client->delta_sequence = client->last_sequence;
@ -2793,7 +2798,7 @@ void SVQ3_ParseUsercmd(client_t *client, qboolean delta)
client->delta_sequence = -1; // client is asking for retransmit
// client->snapLatency[client->last_sequence & (LATENCY_COUNTS-1)] = -1;
}
// read number of usercmds in a packet
cmdCount = MSG_ReadBits(8);
if(cmdCount < 1)
@ -3037,7 +3042,7 @@ void SVQ3_ParseClientMessage(client_t *client)
{
break;
}
switch(c)
{
default: