Zweite Stufe des Reformat

This commit is contained in:
Yamagi Burmeister 2010-08-31 08:20:43 +00:00
parent 0811be484c
commit b7e402c9a7
5 changed files with 1128 additions and 722 deletions

View File

@ -29,7 +29,6 @@ char *com_argv[MAX_NUM_ARGVS+1];
int realtime; int realtime;
jmp_buf abortframe; /* an ERR_DROP occured, exit the entire frame */ jmp_buf abortframe; /* an ERR_DROP occured, exit the entire frame */
FILE *log_stats_file; FILE *log_stats_file;
cvar_t *host_speeds; cvar_t *host_speeds;
@ -71,6 +70,7 @@ void Com_BeginRedirect (int target, char *buffer, int buffersize, void (*flush))
{ {
if (!target || !buffer || !buffersize || !flush) if (!target || !buffer || !buffersize || !flush)
return; return;
rd_target = target; rd_target = target;
rd_buffer = buffer; rd_buffer = buffer;
rd_buffersize = buffersize; rd_buffersize = buffersize;
@ -109,6 +109,7 @@ void Com_Printf (char *fmt, ...)
rd_flush(rd_target, rd_buffer); rd_flush(rd_target, rd_buffer);
*rd_buffer = 0; *rd_buffer = 0;
} }
strcat (rd_buffer, msg); strcat (rd_buffer, msg);
return; return;
} }
@ -128,13 +129,17 @@ void Com_Printf (char *fmt, ...)
if (!logfile) if (!logfile)
{ {
Com_sprintf (name, sizeof(name), "%s/qconsole.log", FS_Gamedir ()); Com_sprintf (name, sizeof(name), "%s/qconsole.log", FS_Gamedir ());
if (logfile_active->value > 2) if (logfile_active->value > 2)
logfile = fopen (name, "a"); logfile = fopen (name, "a");
else else
logfile = fopen (name, "w"); logfile = fopen (name, "w");
} }
if (logfile) if (logfile)
fprintf (logfile, "%s", msg); fprintf (logfile, "%s", msg);
if (logfile_active->value > 1) if (logfile_active->value > 1)
fflush (logfile); /* force it to save every time */ fflush (logfile); /* force it to save every time */
} }
@ -189,6 +194,7 @@ void Com_Error (int code, char *fmt, ...)
if (recursive) if (recursive)
Sys_Error ("recursive error after: %s", msg); Sys_Error ("recursive error after: %s", msg);
recursive = true; recursive = true;
va_start (argptr,fmt); va_start (argptr,fmt);
@ -203,6 +209,7 @@ void Com_Error (int code, char *fmt, ...)
recursive = false; recursive = false;
longjmp (abortframe, -1); longjmp (abortframe, -1);
} }
else if (code == ERR_DROP) else if (code == ERR_DROP)
{ {
Com_Printf ("********************\nERROR: %s\n********************\n", msg); Com_Printf ("********************\nERROR: %s\n********************\n", msg);
@ -213,6 +220,7 @@ void Com_Error (int code, char *fmt, ...)
recursive = false; recursive = false;
longjmp (abortframe, -1); longjmp (abortframe, -1);
} }
else else
{ {
SV_Shutdown (va("Server fatal crashed: %s\n", msg), false); SV_Shutdown (va("Server fatal crashed: %s\n", msg), false);
@ -241,6 +249,7 @@ void Com_Quit (void)
#ifndef DEDICATED_ONLY #ifndef DEDICATED_ONLY
CL_Shutdown (); CL_Shutdown ();
#endif #endif
if (logfile) if (logfile)
{ {
fclose (logfile); fclose (logfile);
@ -491,6 +500,7 @@ void MSG_WriteString (sizebuf_t *sb, char *s)
{ {
if (!s) if (!s)
SZ_Write (sb, "", 1); SZ_Write (sb, "", 1);
else else
SZ_Write (sb, s, (int)strlen(s)+1); SZ_Write (sb, s, (int)strlen(s)+1);
} }
@ -517,27 +527,34 @@ void MSG_WriteAngle16 (sizebuf_t *sb, float f)
MSG_WriteShort (sb, ANGLE2SHORT(f)); MSG_WriteShort (sb, ANGLE2SHORT(f));
} }
void MSG_WriteDeltaUsercmd (sizebuf_t *buf, usercmd_t *from, usercmd_t *cmd) void MSG_WriteDeltaUsercmd (sizebuf_t *buf, usercmd_t *from, usercmd_t *cmd)
{ {
int bits; int bits;
/* Movement messages */ /* Movement messages */
bits = 0; bits = 0;
if (cmd->angles[0] != from->angles[0]) if (cmd->angles[0] != from->angles[0])
bits |= CM_ANGLE1; bits |= CM_ANGLE1;
if (cmd->angles[1] != from->angles[1]) if (cmd->angles[1] != from->angles[1])
bits |= CM_ANGLE2; bits |= CM_ANGLE2;
if (cmd->angles[2] != from->angles[2]) if (cmd->angles[2] != from->angles[2])
bits |= CM_ANGLE3; bits |= CM_ANGLE3;
if (cmd->forwardmove != from->forwardmove) if (cmd->forwardmove != from->forwardmove)
bits |= CM_FORWARD; bits |= CM_FORWARD;
if (cmd->sidemove != from->sidemove) if (cmd->sidemove != from->sidemove)
bits |= CM_SIDE; bits |= CM_SIDE;
if (cmd->upmove != from->upmove) if (cmd->upmove != from->upmove)
bits |= CM_UP; bits |= CM_UP;
if (cmd->buttons != from->buttons) if (cmd->buttons != from->buttons)
bits |= CM_BUTTONS; bits |= CM_BUTTONS;
if (cmd->impulse != from->impulse) if (cmd->impulse != from->impulse)
bits |= CM_IMPULSE; bits |= CM_IMPULSE;
@ -545,20 +562,25 @@ void MSG_WriteDeltaUsercmd (sizebuf_t *buf, usercmd_t *from, usercmd_t *cmd)
if (bits & CM_ANGLE1) if (bits & CM_ANGLE1)
MSG_WriteShort (buf, cmd->angles[0]); MSG_WriteShort (buf, cmd->angles[0]);
if (bits & CM_ANGLE2) if (bits & CM_ANGLE2)
MSG_WriteShort (buf, cmd->angles[1]); MSG_WriteShort (buf, cmd->angles[1]);
if (bits & CM_ANGLE3) if (bits & CM_ANGLE3)
MSG_WriteShort (buf, cmd->angles[2]); MSG_WriteShort (buf, cmd->angles[2]);
if (bits & CM_FORWARD) if (bits & CM_FORWARD)
MSG_WriteShort (buf, cmd->forwardmove); MSG_WriteShort (buf, cmd->forwardmove);
if (bits & CM_SIDE) if (bits & CM_SIDE)
MSG_WriteShort (buf, cmd->sidemove); MSG_WriteShort (buf, cmd->sidemove);
if (bits & CM_UP) if (bits & CM_UP)
MSG_WriteShort (buf, cmd->upmove); MSG_WriteShort (buf, cmd->upmove);
if (bits & CM_BUTTONS) if (bits & CM_BUTTONS)
MSG_WriteByte (buf, cmd->buttons); MSG_WriteByte (buf, cmd->buttons);
if (bits & CM_IMPULSE) if (bits & CM_IMPULSE)
MSG_WriteByte (buf, cmd->impulse); MSG_WriteByte (buf, cmd->impulse);
@ -579,15 +601,18 @@ void MSG_WriteDir (sizebuf_t *sb, vec3_t dir)
bestd = 0; bestd = 0;
best = 0; best = 0;
for (i=0 ; i<NUMVERTEXNORMALS ; i++) for (i=0 ; i<NUMVERTEXNORMALS ; i++)
{ {
d = DotProduct (dir, bytedirs[i]); d = DotProduct (dir, bytedirs[i]);
if (d > bestd) if (d > bestd)
{ {
bestd = d; bestd = d;
best = i; best = i;
} }
} }
MSG_WriteByte (sb, best); MSG_WriteByte (sb, best);
} }
@ -596,22 +621,24 @@ void MSG_ReadDir (sizebuf_t *sb, vec3_t dir)
int b; int b;
b = MSG_ReadByte (sb); b = MSG_ReadByte (sb);
if (b >= NUMVERTEXNORMALS) if (b >= NUMVERTEXNORMALS)
Com_Error (ERR_DROP, "MSF_ReadDir: out of range"); Com_Error (ERR_DROP, "MSF_ReadDir: out of range");
VectorCopy (bytedirs[b], dir); VectorCopy (bytedirs[b], dir);
} }
/* /*
* Writes part of a packetentities message. * Writes part of a packetentities message.
* Can delta from either a baseline or a previous packet_entity * Can delta from either a baseline or a previous packet_entity
*/ */
void MSG_WriteDeltaEntity (entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qboolean force, qboolean newentity) void MSG_WriteDeltaEntity (entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qboolean force, qboolean newentity)
{ {
int bits; int bits;
if (!to->number) if (!to->number)
Com_Error (ERR_FATAL, "Unset entity number"); Com_Error (ERR_FATAL, "Unset entity number");
if (to->number >= MAX_EDICTS) if (to->number >= MAX_EDICTS)
Com_Error (ERR_FATAL, "Entity number >= MAX_EDICTS"); Com_Error (ERR_FATAL, "Entity number >= MAX_EDICTS");
@ -623,15 +650,19 @@ void MSG_WriteDeltaEntity (entity_state_t *from, entity_state_t *to, sizebuf_t *
if (to->origin[0] != from->origin[0]) if (to->origin[0] != from->origin[0])
bits |= U_ORIGIN1; bits |= U_ORIGIN1;
if (to->origin[1] != from->origin[1]) if (to->origin[1] != from->origin[1])
bits |= U_ORIGIN2; bits |= U_ORIGIN2;
if (to->origin[2] != from->origin[2]) if (to->origin[2] != from->origin[2])
bits |= U_ORIGIN3; bits |= U_ORIGIN3;
if ( to->angles[0] != from->angles[0] ) if ( to->angles[0] != from->angles[0] )
bits |= U_ANGLE1; bits |= U_ANGLE1;
if ( to->angles[1] != from->angles[1] ) if ( to->angles[1] != from->angles[1] )
bits |= U_ANGLE2; bits |= U_ANGLE2;
if ( to->angles[2] != from->angles[2] ) if ( to->angles[2] != from->angles[2] )
bits |= U_ANGLE3; bits |= U_ANGLE3;
@ -639,8 +670,10 @@ void MSG_WriteDeltaEntity (entity_state_t *from, entity_state_t *to, sizebuf_t *
{ {
if ((unsigned)to->skinnum < 256) if ((unsigned)to->skinnum < 256)
bits |= U_SKIN8; bits |= U_SKIN8;
else if ((unsigned)to->skinnum < 0x10000) else if ((unsigned)to->skinnum < 0x10000)
bits |= U_SKIN16; bits |= U_SKIN16;
else else
bits |= (U_SKIN8|U_SKIN16); bits |= (U_SKIN8|U_SKIN16);
} }
@ -649,6 +682,7 @@ void MSG_WriteDeltaEntity (entity_state_t *from, entity_state_t *to, sizebuf_t *
{ {
if (to->frame < 256) if (to->frame < 256)
bits |= U_FRAME8; bits |= U_FRAME8;
else else
bits |= U_FRAME16; bits |= U_FRAME16;
} }
@ -657,8 +691,10 @@ void MSG_WriteDeltaEntity (entity_state_t *from, entity_state_t *to, sizebuf_t *
{ {
if (to->effects < 256) if (to->effects < 256)
bits |= U_EFFECTS8; bits |= U_EFFECTS8;
else if (to->effects < 0x8000) else if (to->effects < 0x8000)
bits |= U_EFFECTS16; bits |= U_EFFECTS16;
else else
bits |= U_EFFECTS8|U_EFFECTS16; bits |= U_EFFECTS8|U_EFFECTS16;
} }
@ -667,8 +703,10 @@ void MSG_WriteDeltaEntity (entity_state_t *from, entity_state_t *to, sizebuf_t *
{ {
if (to->renderfx < 256) if (to->renderfx < 256)
bits |= U_RENDERFX8; bits |= U_RENDERFX8;
else if (to->renderfx < 0x8000) else if (to->renderfx < 0x8000)
bits |= U_RENDERFX16; bits |= U_RENDERFX16;
else else
bits |= U_RENDERFX8|U_RENDERFX16; bits |= U_RENDERFX8|U_RENDERFX16;
} }
@ -682,10 +720,13 @@ void MSG_WriteDeltaEntity (entity_state_t *from, entity_state_t *to, sizebuf_t *
if ( to->modelindex != from->modelindex ) if ( to->modelindex != from->modelindex )
bits |= U_MODEL; bits |= U_MODEL;
if ( to->modelindex2 != from->modelindex2 ) if ( to->modelindex2 != from->modelindex2 )
bits |= U_MODEL2; bits |= U_MODEL2;
if ( to->modelindex3 != from->modelindex3 ) if ( to->modelindex3 != from->modelindex3 )
bits |= U_MODEL3; bits |= U_MODEL3;
if ( to->modelindex4 != from->modelindex4 ) if ( to->modelindex4 != from->modelindex4 )
bits |= U_MODEL4; bits |= U_MODEL4;
@ -701,8 +742,10 @@ void MSG_WriteDeltaEntity (entity_state_t *from, entity_state_t *to, sizebuf_t *
if (bits & 0xff000000) if (bits & 0xff000000)
bits |= U_MOREBITS3 | U_MOREBITS2 | U_MOREBITS1; bits |= U_MOREBITS3 | U_MOREBITS2 | U_MOREBITS1;
else if (bits & 0x00ff0000) else if (bits & 0x00ff0000)
bits |= U_MOREBITS2 | U_MOREBITS1; bits |= U_MOREBITS2 | U_MOREBITS1;
else if (bits & 0x0000ff00) else if (bits & 0x0000ff00)
bits |= U_MOREBITS1; bits |= U_MOREBITS1;
@ -714,11 +757,13 @@ void MSG_WriteDeltaEntity (entity_state_t *from, entity_state_t *to, sizebuf_t *
MSG_WriteByte (msg, (bits>>16)&255 ); MSG_WriteByte (msg, (bits>>16)&255 );
MSG_WriteByte (msg, (bits>>24)&255 ); MSG_WriteByte (msg, (bits>>24)&255 );
} }
else if (bits & 0x00ff0000) else if (bits & 0x00ff0000)
{ {
MSG_WriteByte (msg, (bits>>8)&255 ); MSG_WriteByte (msg, (bits>>8)&255 );
MSG_WriteByte (msg, (bits>>16)&255 ); MSG_WriteByte (msg, (bits>>16)&255 );
} }
else if (bits & 0x0000ff00) else if (bits & 0x0000ff00)
{ {
MSG_WriteByte (msg, (bits>>8)&255 ); MSG_WriteByte (msg, (bits>>8)&255 );
@ -726,55 +771,70 @@ void MSG_WriteDeltaEntity (entity_state_t *from, entity_state_t *to, sizebuf_t *
if (bits & U_NUMBER16) if (bits & U_NUMBER16)
MSG_WriteShort (msg, to->number); MSG_WriteShort (msg, to->number);
else else
MSG_WriteByte (msg, to->number); MSG_WriteByte (msg, to->number);
if (bits & U_MODEL) if (bits & U_MODEL)
MSG_WriteByte (msg, to->modelindex); MSG_WriteByte (msg, to->modelindex);
if (bits & U_MODEL2) if (bits & U_MODEL2)
MSG_WriteByte (msg, to->modelindex2); MSG_WriteByte (msg, to->modelindex2);
if (bits & U_MODEL3) if (bits & U_MODEL3)
MSG_WriteByte (msg, to->modelindex3); MSG_WriteByte (msg, to->modelindex3);
if (bits & U_MODEL4) if (bits & U_MODEL4)
MSG_WriteByte (msg, to->modelindex4); MSG_WriteByte (msg, to->modelindex4);
if (bits & U_FRAME8) if (bits & U_FRAME8)
MSG_WriteByte (msg, to->frame); MSG_WriteByte (msg, to->frame);
if (bits & U_FRAME16) if (bits & U_FRAME16)
MSG_WriteShort (msg, to->frame); MSG_WriteShort (msg, to->frame);
if ((bits & U_SKIN8) && (bits & U_SKIN16)) /*used for laser colors */ if ((bits & U_SKIN8) && (bits & U_SKIN16)) /*used for laser colors */
MSG_WriteLong (msg, to->skinnum); MSG_WriteLong (msg, to->skinnum);
else if (bits & U_SKIN8) else if (bits & U_SKIN8)
MSG_WriteByte (msg, to->skinnum); MSG_WriteByte (msg, to->skinnum);
else if (bits & U_SKIN16) else if (bits & U_SKIN16)
MSG_WriteShort (msg, to->skinnum); MSG_WriteShort (msg, to->skinnum);
if ( (bits & (U_EFFECTS8|U_EFFECTS16)) == (U_EFFECTS8|U_EFFECTS16) ) if ( (bits & (U_EFFECTS8|U_EFFECTS16)) == (U_EFFECTS8|U_EFFECTS16) )
MSG_WriteLong (msg, to->effects); MSG_WriteLong (msg, to->effects);
else if (bits & U_EFFECTS8) else if (bits & U_EFFECTS8)
MSG_WriteByte (msg, to->effects); MSG_WriteByte (msg, to->effects);
else if (bits & U_EFFECTS16) else if (bits & U_EFFECTS16)
MSG_WriteShort (msg, to->effects); MSG_WriteShort (msg, to->effects);
if ( (bits & (U_RENDERFX8|U_RENDERFX16)) == (U_RENDERFX8|U_RENDERFX16) ) if ( (bits & (U_RENDERFX8|U_RENDERFX16)) == (U_RENDERFX8|U_RENDERFX16) )
MSG_WriteLong (msg, to->renderfx); MSG_WriteLong (msg, to->renderfx);
else if (bits & U_RENDERFX8) else if (bits & U_RENDERFX8)
MSG_WriteByte (msg, to->renderfx); MSG_WriteByte (msg, to->renderfx);
else if (bits & U_RENDERFX16) else if (bits & U_RENDERFX16)
MSG_WriteShort (msg, to->renderfx); MSG_WriteShort (msg, to->renderfx);
if (bits & U_ORIGIN1) if (bits & U_ORIGIN1)
MSG_WriteCoord (msg, to->origin[0]); MSG_WriteCoord (msg, to->origin[0]);
if (bits & U_ORIGIN2) if (bits & U_ORIGIN2)
MSG_WriteCoord (msg, to->origin[1]); MSG_WriteCoord (msg, to->origin[1]);
if (bits & U_ORIGIN3) if (bits & U_ORIGIN3)
MSG_WriteCoord (msg, to->origin[2]); MSG_WriteCoord (msg, to->origin[2]);
if (bits & U_ANGLE1) if (bits & U_ANGLE1)
MSG_WriteAngle(msg, to->angles[0]); MSG_WriteAngle(msg, to->angles[0]);
if (bits & U_ANGLE2) if (bits & U_ANGLE2)
MSG_WriteAngle(msg, to->angles[1]); MSG_WriteAngle(msg, to->angles[1]);
if (bits & U_ANGLE3) if (bits & U_ANGLE3)
MSG_WriteAngle(msg, to->angles[2]); MSG_WriteAngle(msg, to->angles[2]);
@ -787,8 +847,10 @@ void MSG_WriteDeltaEntity (entity_state_t *from, entity_state_t *to, sizebuf_t *
if (bits & U_SOUND) if (bits & U_SOUND)
MSG_WriteByte (msg, to->sound); MSG_WriteByte (msg, to->sound);
if (bits & U_EVENT) if (bits & U_EVENT)
MSG_WriteByte (msg, to->event); MSG_WriteByte (msg, to->event);
if (bits & U_SOLID) if (bits & U_SOLID)
MSG_WriteShort (msg, to->solid); MSG_WriteShort (msg, to->solid);
} }
@ -810,8 +872,10 @@ int MSG_ReadChar (sizebuf_t *msg_read)
if (msg_read->readcount+1 > msg_read->cursize) if (msg_read->readcount+1 > msg_read->cursize)
c = -1; c = -1;
else else
c = (signed char)msg_read->data[msg_read->readcount]; c = (signed char)msg_read->data[msg_read->readcount];
msg_read->readcount++; msg_read->readcount++;
return c; return c;
@ -823,8 +887,10 @@ int MSG_ReadByte (sizebuf_t *msg_read)
if (msg_read->readcount+1 > msg_read->cursize) if (msg_read->readcount+1 > msg_read->cursize)
c = -1; c = -1;
else else
c = (unsigned char)msg_read->data[msg_read->readcount]; c = (unsigned char)msg_read->data[msg_read->readcount];
msg_read->readcount++; msg_read->readcount++;
return c; return c;
@ -836,6 +902,7 @@ int MSG_ReadShort (sizebuf_t *msg_read)
if (msg_read->readcount+2 > msg_read->cursize) if (msg_read->readcount+2 > msg_read->cursize)
c = -1; c = -1;
else else
c = (short)(msg_read->data[msg_read->readcount] c = (short)(msg_read->data[msg_read->readcount]
+ (msg_read->data[msg_read->readcount+1]<<8)); + (msg_read->data[msg_read->readcount+1]<<8));
@ -851,6 +918,7 @@ int MSG_ReadLong (sizebuf_t *msg_read)
if (msg_read->readcount+4 > msg_read->cursize) if (msg_read->readcount+4 > msg_read->cursize)
c = -1; c = -1;
else else
c = msg_read->data[msg_read->readcount] c = msg_read->data[msg_read->readcount]
+ (msg_read->data[msg_read->readcount+1]<<8) + (msg_read->data[msg_read->readcount+1]<<8)
@ -873,6 +941,7 @@ float MSG_ReadFloat (sizebuf_t *msg_read)
if (msg_read->readcount+4 > msg_read->cursize) if (msg_read->readcount+4 > msg_read->cursize)
dat.f = -1; dat.f = -1;
else else
{ {
dat.b[0] = msg_read->data[msg_read->readcount]; dat.b[0] = msg_read->data[msg_read->readcount];
@ -880,6 +949,7 @@ float MSG_ReadFloat (sizebuf_t *msg_read)
dat.b[2] = msg_read->data[msg_read->readcount+2]; dat.b[2] = msg_read->data[msg_read->readcount+2];
dat.b[3] = msg_read->data[msg_read->readcount+3]; dat.b[3] = msg_read->data[msg_read->readcount+3];
} }
msg_read->readcount += 4; msg_read->readcount += 4;
dat.l = LittleLong (dat.l); dat.l = LittleLong (dat.l);
@ -893,14 +963,18 @@ char *MSG_ReadString (sizebuf_t *msg_read)
int l,c; int l,c;
l = 0; l = 0;
do do
{ {
c = MSG_ReadChar (msg_read); c = MSG_ReadChar (msg_read);
if (c == -1 || c == 0) if (c == -1 || c == 0)
break; break;
string[l] = c; string[l] = c;
l++; l++;
} while (l < sizeof(string)-1); }
while (l < sizeof(string)-1);
string[l] = 0; string[l] = 0;
@ -913,14 +987,18 @@ char *MSG_ReadStringLine (sizebuf_t *msg_read)
int l,c; int l,c;
l = 0; l = 0;
do do
{ {
c = MSG_ReadChar (msg_read); c = MSG_ReadChar (msg_read);
if (c == -1 || c == 0 || c == '\n') if (c == -1 || c == 0 || c == '\n')
break; break;
string[l] = c; string[l] = c;
l++; l++;
} while (l < sizeof(string)-1); }
while (l < sizeof(string)-1);
string[l] = 0; string[l] = 0;
@ -960,16 +1038,20 @@ void MSG_ReadDeltaUsercmd (sizebuf_t *msg_read, usercmd_t *from, usercmd_t *move
/* read current angles */ /* read current angles */
if (bits & CM_ANGLE1) if (bits & CM_ANGLE1)
move->angles[0] = MSG_ReadShort (msg_read); move->angles[0] = MSG_ReadShort (msg_read);
if (bits & CM_ANGLE2) if (bits & CM_ANGLE2)
move->angles[1] = MSG_ReadShort (msg_read); move->angles[1] = MSG_ReadShort (msg_read);
if (bits & CM_ANGLE3) if (bits & CM_ANGLE3)
move->angles[2] = MSG_ReadShort (msg_read); move->angles[2] = MSG_ReadShort (msg_read);
/* read movement */ /* read movement */
if (bits & CM_FORWARD) if (bits & CM_FORWARD)
move->forwardmove = MSG_ReadShort (msg_read); move->forwardmove = MSG_ReadShort (msg_read);
if (bits & CM_SIDE) if (bits & CM_SIDE)
move->sidemove = MSG_ReadShort (msg_read); move->sidemove = MSG_ReadShort (msg_read);
if (bits & CM_UP) if (bits & CM_UP)
move->upmove = MSG_ReadShort (msg_read); move->upmove = MSG_ReadShort (msg_read);
@ -1049,9 +1131,11 @@ void SZ_Print (sizebuf_t *buf, char *data)
{ {
if (buf->data[buf->cursize-1]) if (buf->data[buf->cursize-1])
memcpy ((byte *)SZ_GetSpace(buf, len),data,len); /* no trailing 0 */ memcpy ((byte *)SZ_GetSpace(buf, len),data,len); /* no trailing 0 */
else else
memcpy ((byte *)SZ_GetSpace(buf, len-1)-1,data,len); /* write over trailing 0 */ memcpy ((byte *)SZ_GetSpace(buf, len-1)-1,data,len); /* write over trailing 0 */
} }
else else
memcpy ((byte *)SZ_GetSpace(buf, len),data,len); memcpy ((byte *)SZ_GetSpace(buf, len),data,len);
} }
@ -1086,6 +1170,7 @@ char *COM_Argv (int arg)
{ {
if (arg < 0 || arg >= com_argc || !com_argv[arg]) if (arg < 0 || arg >= com_argc || !com_argv[arg])
return ""; return "";
return com_argv[arg]; return com_argv[arg];
} }
@ -1093,6 +1178,7 @@ void COM_ClearArgv (int arg)
{ {
if (arg < 0 || arg >= com_argc || !com_argv[arg]) if (arg < 0 || arg >= com_argc || !com_argv[arg])
return; return;
com_argv[arg] = ""; com_argv[arg] = "";
} }
@ -1102,11 +1188,14 @@ void COM_InitArgv (int argc, char **argv)
if (argc > MAX_NUM_ARGVS) if (argc > MAX_NUM_ARGVS)
Com_Error (ERR_FATAL, "argc > MAX_NUM_ARGVS"); Com_Error (ERR_FATAL, "argc > MAX_NUM_ARGVS");
com_argc = argc; com_argc = argc;
for (i=0 ; i<argc ; i++) for (i=0 ; i<argc ; i++)
{ {
if (!argv[i] || strlen(argv[i]) >= MAX_TOKEN_CHARS ) if (!argv[i] || strlen(argv[i]) >= MAX_TOKEN_CHARS )
com_argv[i] = ""; com_argv[i] = "";
else else
com_argv[i] = argv[i]; com_argv[i] = argv[i];
} }
@ -1119,6 +1208,7 @@ void COM_AddParm (char *parm)
{ {
if (com_argc == MAX_NUM_ARGVS) if (com_argc == MAX_NUM_ARGVS)
Com_Error (ERR_FATAL, "COM_AddParm: MAX_NUM)ARGS"); Com_Error (ERR_FATAL, "COM_AddParm: MAX_NUM)ARGS");
com_argv[com_argc++] = parm; com_argv[com_argc++] = parm;
} }
@ -1129,10 +1219,10 @@ int memsearch (byte *start, int count, int search)
for (i=0 ; i<count ; i++) for (i=0 ; i<count ; i++)
if (start[i] == search) if (start[i] == search)
return i; return i;
return -1; return -1;
} }
char *CopyString (char *in) char *CopyString (char *in)
{ {
char *out; char *out;
@ -1151,20 +1241,25 @@ void Info_Print (char *s)
if (*s == '\\') if (*s == '\\')
s++; s++;
while (*s) while (*s)
{ {
o = key; o = key;
while (*s && *s != '\\') while (*s && *s != '\\')
*o++ = *s++; *o++ = *s++;
l = o - key; l = o - key;
if (l < 20) if (l < 20)
{ {
memset (o, ' ', 20-l); memset (o, ' ', 20-l);
key[20] = 0; key[20] = 0;
} }
else else
*o = 0; *o = 0;
Com_Printf ("%s", key); Com_Printf ("%s", key);
if (!*s) if (!*s)
@ -1175,12 +1270,15 @@ void Info_Print (char *s)
o = value; o = value;
s++; s++;
while (*s && *s != '\\') while (*s && *s != '\\')
*o++ = *s++; *o++ = *s++;
*o = 0; *o = 0;
if (*s) if (*s)
s++; s++;
Com_Printf ("%s\n", value); Com_Printf ("%s\n", value);
} }
} }
@ -1198,7 +1296,6 @@ just cleared malloc with counters now...
#define Z_MAGIC 0x1d1d #define Z_MAGIC 0x1d1d
typedef struct zhead_s typedef struct zhead_s
{ {
struct zhead_s *prev, *next; struct zhead_s *prev, *next;
@ -1216,7 +1313,8 @@ void Z_Free (void *ptr)
z = ((zhead_t *)ptr) - 1; z = ((zhead_t *)ptr) - 1;
if (z->magic != Z_MAGIC) { if (z->magic != Z_MAGIC)
{
printf( "free: %p failed\n", ptr ); printf( "free: %p failed\n", ptr );
abort(); abort();
Com_Error (ERR_FATAL, "Z_Free: bad magic"); Com_Error (ERR_FATAL, "Z_Free: bad magic");
@ -1242,6 +1340,7 @@ void Z_FreeTags (int tag)
for (z=z_chain.next ; z != &z_chain ; z=next) for (z=z_chain.next ; z != &z_chain ; z=next)
{ {
next = z->next; next = z->next;
if (z->tag == tag) if (z->tag == tag)
Z_Free ((void *)(z+1)); Z_Free ((void *)(z+1));
} }
@ -1253,8 +1352,10 @@ void *Z_TagMalloc (int size, int tag)
size = size + sizeof(zhead_t); size = size + sizeof(zhead_t);
z = malloc(size); z = malloc(size);
if (!z) if (!z)
Com_Error (ERR_FATAL, "Z_Malloc: failed on allocation of %i bytes",size); Com_Error (ERR_FATAL, "Z_Malloc: failed on allocation of %i bytes",size);
memset (z, 0, size); memset (z, 0, size);
z_count++; z_count++;
z_bytes += size; z_bytes += size;
@ -1275,71 +1376,72 @@ void *Z_Malloc (int size)
return Z_TagMalloc (size, 0); return Z_TagMalloc (size, 0);
} }
static byte chktbl[1024] = { static byte chktbl[1024] =
0x84, 0x47, 0x51, 0xc1, 0x93, 0x22, 0x21, 0x24, 0x2f, 0x66, 0x60, 0x4d, 0xb0, 0x7c, 0xda, {
0x88, 0x54, 0x15, 0x2b, 0xc6, 0x6c, 0x89, 0xc5, 0x9d, 0x48, 0xee, 0xe6, 0x8a, 0xb5, 0xf4, 0x84, 0x47, 0x51, 0xc1, 0x93, 0x22, 0x21, 0x24, 0x2f, 0x66, 0x60, 0x4d, 0xb0, 0x7c, 0xda,
0xcb, 0xfb, 0xf1, 0x0c, 0x2e, 0xa0, 0xd7, 0xc9, 0x1f, 0xd6, 0x06, 0x9a, 0x09, 0x41, 0x54, 0x88, 0x54, 0x15, 0x2b, 0xc6, 0x6c, 0x89, 0xc5, 0x9d, 0x48, 0xee, 0xe6, 0x8a, 0xb5, 0xf4,
0x67, 0x46, 0xc7, 0x74, 0xe3, 0xc8, 0xb6, 0x5d, 0xa6, 0x36, 0xc4, 0xab, 0x2c, 0x7e, 0x85, 0xcb, 0xfb, 0xf1, 0x0c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*base, int length, int sequence)
if (length > 60) if (length > 60)
length = 60; length = 60;
memcpy (chkb, base, length); memcpy (chkb, base, length);
chkb[length] = p[0]; chkb[length] = p[0];
@ -1465,7 +1568,6 @@ void Qcommon_Init (int argc, char **argv)
s = va("%4.2f %s %s %s", VERSION, CPUSTRING, __DATE__, BUILDSTRING); s = va("%4.2f %s %s %s", VERSION, CPUSTRING, __DATE__, BUILDSTRING);
Cvar_Get ("version", s, CVAR_SERVERINFO|CVAR_NOSET); Cvar_Get ("version", s, CVAR_SERVERINFO|CVAR_NOSET);
if (dedicated->value) if (dedicated->value)
Cmd_AddCommand ("quit", Com_Quit); Cmd_AddCommand ("quit", Com_Quit);
@ -1481,19 +1583,26 @@ void Qcommon_Init (int argc, char **argv)
/* add + commands from command line */ /* add + commands from command line */
if (!Cbuf_AddLateCommands ()) if (!Cbuf_AddLateCommands ())
{ /* if the user didn't give any commands, run default action */ {
/* if the user didn't give any commands, run default action */
if (!dedicated->value) if (!dedicated->value)
Cbuf_AddText ("d1\n"); Cbuf_AddText ("d1\n");
else else
Cbuf_AddText ("dedicated_start\n"); Cbuf_AddText ("dedicated_start\n");
Cbuf_Execute (); Cbuf_Execute ();
} }
#ifndef DEDICATED_ONLY #ifndef DEDICATED_ONLY
else else
{ /* the user asked for something explicit {
/* the user asked for something explicit
so drop the loading plaque */ so drop the loading plaque */
SCR_EndLoadingPlaque (); SCR_EndLoadingPlaque ();
} }
#endif #endif
Com_Printf ("====== Quake2 Initialized ======\n\n"); Com_Printf ("====== Quake2 Initialized ======\n\n");
@ -1515,6 +1624,7 @@ void Qcommon_Frame (int msec)
if ( log_stats->modified ) if ( log_stats->modified )
{ {
log_stats->modified = false; log_stats->modified = false;
if ( log_stats->value ) if ( log_stats->value )
{ {
if ( log_stats_file ) if ( log_stats_file )
@ -1522,10 +1632,13 @@ void Qcommon_Frame (int msec)
fclose( log_stats_file ); fclose( log_stats_file );
log_stats_file = 0; log_stats_file = 0;
} }
log_stats_file = fopen( "stats.log", "w" ); log_stats_file = fopen( "stats.log", "w" );
if ( log_stats_file ) if ( log_stats_file )
fprintf( log_stats_file, "entities,dlights,parts,frame time\n" ); fprintf( log_stats_file, "entities,dlights,parts,frame time\n" );
} }
else else
{ {
if ( log_stats_file ) if ( log_stats_file )
@ -1538,14 +1651,17 @@ void Qcommon_Frame (int msec)
if (fixedtime->value) if (fixedtime->value)
msec = fixedtime->value; msec = fixedtime->value;
else if (timescale->value) else if (timescale->value)
{ {
msec *= timescale->value; msec *= timescale->value;
if (msec < 1) if (msec < 1)
msec = 1; msec = 1;
} }
#ifndef DEDICATED_ONLY #ifndef DEDICATED_ONLY
if (showtrace->value) if (showtrace->value)
{ {
extern int c_traces, c_brush_traces; extern int c_traces, c_brush_traces;
@ -1556,24 +1672,31 @@ void Qcommon_Frame (int msec)
c_brush_traces = 0; c_brush_traces = 0;
c_pointcontents = 0; c_pointcontents = 0;
} }
#endif #endif
do do
{ {
s = Sys_ConsoleInput (); s = Sys_ConsoleInput ();
if (s) if (s)
Cbuf_AddText (va("%s\n",s)); Cbuf_AddText (va("%s\n",s));
} while (s); }
while (s);
Cbuf_Execute (); Cbuf_Execute ();
#ifndef DEDICATED_ONLY #ifndef DEDICATED_ONLY
if (host_speeds->value) if (host_speeds->value)
time_before = Sys_Milliseconds (); time_before = Sys_Milliseconds ();
#endif #endif
SV_Frame (msec); SV_Frame (msec);
#ifndef DEDICATED_ONLY #ifndef DEDICATED_ONLY
if (host_speeds->value) if (host_speeds->value)
time_between = Sys_Milliseconds (); time_between = Sys_Milliseconds ();
@ -1597,6 +1720,7 @@ void Qcommon_Frame (int msec)
Com_Printf ("all:%3i sv:%3i gm:%3i cl:%3i rf:%3i\n", Com_Printf ("all:%3i sv:%3i gm:%3i cl:%3i rf:%3i\n",
all, sv, gm, cl, rf); all, sv, gm, cl, rf);
} }
#endif #endif
} }

View File

@ -1,30 +1,33 @@
/* /*
Copyright (C) 1997-2001 Id Software, Inc. * Copyright (C) 1997-2001 Id Software, Inc.
*
This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or modify
modify it under the terms of the GNU General Public License * it under the terms of the GNU General Public License as published by
as published by the Free Software Foundation; either version 2 * the Free Software Foundation; either version 2 of the License, or (at
of the License, or (at your option) any later version. * your option) any later version.
*
This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful, but
but WITHOUT ANY WARRANTY; without even the implied warranty of * 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. * See the GNU General Public License for more details.
*
You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/ *
/* crc.c */ * =======================================================================
*
* This is a 16 bit, non-reflected CRC using the polynomial 0x1021
* and the initial and final xor values shown below... In other words,
* the CCITT standard CRC used by XMODEM.
*
* =======================================================================
*/
#include "qcommon.h" #include "qcommon.h"
/* this is a 16 bit, non-reflected CRC using the polynomial 0x1021
and the initial and final xor values shown below... in other words, the
CCITT standard CRC used by XMODEM */
#define CRC_INIT_VALUE 0xffff #define CRC_INIT_VALUE 0xffff
#define CRC_XOR_VALUE 0x0000 #define CRC_XOR_VALUE 0x0000
@ -84,9 +87,9 @@ unsigned short CRC_Block (byte *start, int count)
unsigned short crc; unsigned short crc;
CRC_Init (&crc); CRC_Init (&crc);
while (count--) while (count--)
crc = (crc << 8) ^ crctable[(crc >> 8) ^ *start++]; crc = (crc << 8) ^ crctable[(crc >> 8) ^ *start++];
return crc; return crc;
} }

View File

@ -1,23 +1,28 @@
/* /*
Copyright (C) 1997-2001 Id Software, Inc. * Copyright (C) 1997-2001 Id Software, Inc.
*
This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or modify
modify it under the terms of the GNU General Public License * it under the terms of the GNU General Public License as published by
as published by the Free Software Foundation; either version 2 * the Free Software Foundation; either version 2 of the License, or (at
of the License, or (at your option) any later version. * your option) any later version.
*
This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful, but
but WITHOUT ANY WARRANTY; without even the implied warranty of * 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. * See the GNU General Public License for more details.
*
You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/ *
/* crc.h */ * =======================================================================
*
* Corresponding header for crc.c
*
* =======================================================================
*/
void CRC_Init(unsigned short *crcvalue); void CRC_Init(unsigned short *crcvalue);
void CRC_ProcessByte(unsigned short *crcvalue, byte data); void CRC_ProcessByte(unsigned short *crcvalue, byte data);

View File

@ -1,23 +1,28 @@
/* /*
Copyright (C) 1997-2001 Id Software, Inc. * Copyright (C) 1997-2001 Id Software, Inc.
*
This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or modify
modify it under the terms of the GNU General Public License * it under the terms of the GNU General Public License as published by
as published by the Free Software Foundation; either version 2 * the Free Software Foundation; either version 2 of the License, or (at
of the License, or (at your option) any later version. * your option) any later version.
*
This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful, but
but WITHOUT ANY WARRANTY; without even the implied warranty of * 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. * See the GNU General Public License for more details.
*
You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/ *
// cvar.c -- dynamic variable tracking * =======================================================================
*
* The Quake II CVAR subsystem. Implements dynamic variable tracking.
*
* =======================================================================
*/
#include "qcommon.h" #include "qcommon.h"
@ -27,10 +32,13 @@ static qboolean Cvar_InfoValidate (char *s)
{ {
if (strstr (s, "\\")) if (strstr (s, "\\"))
return false; return false;
if (strstr (s, "\"")) if (strstr (s, "\""))
return false; return false;
if (strstr (s, ";")) if (strstr (s, ";"))
return false; return false;
return true; return true;
} }
@ -50,8 +58,10 @@ float Cvar_VariableValue (char *var_name)
cvar_t *var; cvar_t *var;
var = Cvar_FindVar (var_name); var = Cvar_FindVar (var_name);
if (!var) if (!var)
return 0; return 0;
return atof (var->string); return atof (var->string);
} }
@ -60,8 +70,10 @@ const char *Cvar_VariableString (const char *var_name)
cvar_t *var; cvar_t *var;
var = Cvar_FindVar (var_name); var = Cvar_FindVar (var_name);
if (!var) if (!var)
return ""; return "";
return var->string; return var->string;
} }
@ -106,6 +118,7 @@ cvar_t *Cvar_Get (char *var_name, char *var_value, int flags)
} }
var = Cvar_FindVar (var_name); var = Cvar_FindVar (var_name);
if (var) if (var)
{ {
var->flags |= flags; var->flags |= flags;
@ -144,6 +157,7 @@ cvar_t *Cvar_Set2 (char *var_name, char *value, qboolean force)
cvar_t *var; cvar_t *var;
var = Cvar_FindVar (var_name); var = Cvar_FindVar (var_name);
if (!var) if (!var)
{ {
return Cvar_Get (var_name, value, 0); return Cvar_Get (var_name, value, 0);
@ -172,8 +186,10 @@ cvar_t *Cvar_Set2 (char *var_name, char *value, qboolean force)
{ {
if (strcmp(value, var->latched_string) == 0) if (strcmp(value, var->latched_string) == 0)
return var; return var;
Z_Free (var->latched_string); Z_Free (var->latched_string);
} }
else else
{ {
if (strcmp(value, var->string) == 0) if (strcmp(value, var->string) == 0)
@ -185,6 +201,7 @@ cvar_t *Cvar_Set2 (char *var_name, char *value, qboolean force)
Com_Printf ("%s will be changed for next game.\n", var_name); Com_Printf ("%s will be changed for next game.\n", var_name);
var->latched_string = CopyString(value); var->latched_string = CopyString(value);
} }
else else
{ {
var->string = CopyString(value); var->string = CopyString(value);
@ -196,9 +213,11 @@ cvar_t *Cvar_Set2 (char *var_name, char *value, qboolean force)
FS_ExecAutoexec (); FS_ExecAutoexec ();
} }
} }
return var; return var;
} }
} }
else else
{ {
if (var->latched_string) if (var->latched_string)
@ -239,6 +258,7 @@ cvar_t *Cvar_FullSet (char *var_name, char *value, int flags)
cvar_t *var; cvar_t *var;
var = Cvar_FindVar (var_name); var = Cvar_FindVar (var_name);
if (!var) if (!var)
{ {
return Cvar_Get (var_name, value, flags); return Cvar_Get (var_name, value, flags);
@ -265,12 +285,13 @@ void Cvar_SetValue (char *var_name, float value)
if (value == (int)value) if (value == (int)value)
Com_sprintf (val, sizeof(val), "%i",(int)value); Com_sprintf (val, sizeof(val), "%i",(int)value);
else else
Com_sprintf (val, sizeof(val), "%f",value); Com_sprintf (val, sizeof(val), "%f",value);
Cvar_Set (var_name, val); Cvar_Set (var_name, val);
} }
/* /*
* Any variables with latched values will now be updated * Any variables with latched values will now be updated
*/ */
@ -282,6 +303,7 @@ void Cvar_GetLatchedVars (void)
{ {
if (!var->latched_string) if (!var->latched_string)
continue; continue;
Z_Free (var->string); Z_Free (var->string);
var->string = var->latched_string; var->string = var->latched_string;
var->latched_string = NULL; var->latched_string = NULL;
@ -304,6 +326,7 @@ qboolean Cvar_Command (void)
/* check variables */ /* check variables */
v = Cvar_FindVar (Cmd_Argv(0)); v = Cvar_FindVar (Cmd_Argv(0));
if (!v) if (!v)
return false; return false;
@ -327,6 +350,7 @@ void Cvar_Set_f (void)
int flags; int flags;
c = Cmd_Argc(); c = Cmd_Argc();
if (c != 3 && c != 4) if (c != 3 && c != 4)
{ {
Com_Printf ("usage: set <variable> <value> [u / s]\n"); Com_Printf ("usage: set <variable> <value> [u / s]\n");
@ -337,20 +361,23 @@ void Cvar_Set_f (void)
{ {
if (!strcmp(Cmd_Argv(3), "u")) if (!strcmp(Cmd_Argv(3), "u"))
flags = CVAR_USERINFO; flags = CVAR_USERINFO;
else if (!strcmp(Cmd_Argv(3), "s")) else if (!strcmp(Cmd_Argv(3), "s"))
flags = CVAR_SERVERINFO; flags = CVAR_SERVERINFO;
else else
{ {
Com_Printf ("flags can only be 'u' or 's'\n"); Com_Printf ("flags can only be 'u' or 's'\n");
return; return;
} }
Cvar_FullSet (Cmd_Argv(1), Cmd_Argv(2), flags); Cvar_FullSet (Cmd_Argv(1), Cmd_Argv(2), flags);
} }
else else
Cvar_Set (Cmd_Argv(1), Cmd_Argv(2)); Cvar_Set (Cmd_Argv(1), Cmd_Argv(2));
} }
/* /*
* Appends lines containing "set variable value" for all variables * Appends lines containing "set variable value" for all variables
* with the archive flag set to true. * with the archive flag set to true.
@ -362,6 +389,7 @@ void Cvar_WriteVariables (char *path)
FILE *f; FILE *f;
f = fopen (path, "a"); f = fopen (path, "a");
for (var = cvar_vars ; var ; var = var->next) for (var = cvar_vars ; var ; var = var->next)
{ {
if (var->flags & CVAR_ARCHIVE) if (var->flags & CVAR_ARCHIVE)
@ -370,6 +398,7 @@ void Cvar_WriteVariables (char *path)
fprintf (f, "%s", buffer); fprintf (f, "%s", buffer);
} }
} }
fclose (f); fclose (f);
} }
@ -379,28 +408,39 @@ void Cvar_List_f (void)
int i; int i;
i = 0; i = 0;
for (var = cvar_vars ; var ; var = var->next, i++) for (var = cvar_vars ; var ; var = var->next, i++)
{ {
if (var->flags & CVAR_ARCHIVE) if (var->flags & CVAR_ARCHIVE)
Com_Printf ("*"); Com_Printf ("*");
else else
Com_Printf (" "); Com_Printf (" ");
if (var->flags & CVAR_USERINFO) if (var->flags & CVAR_USERINFO)
Com_Printf ("U"); Com_Printf ("U");
else else
Com_Printf (" "); Com_Printf (" ");
if (var->flags & CVAR_SERVERINFO) if (var->flags & CVAR_SERVERINFO)
Com_Printf ("S"); Com_Printf ("S");
else else
Com_Printf (" "); Com_Printf (" ");
if (var->flags & CVAR_NOSET) if (var->flags & CVAR_NOSET)
Com_Printf ("-"); Com_Printf ("-");
else if (var->flags & CVAR_LATCH) else if (var->flags & CVAR_LATCH)
Com_Printf ("L"); Com_Printf ("L");
else else
Com_Printf (" "); Com_Printf (" ");
Com_Printf (" %s \"%s\"\n", var->name, var->string); Com_Printf (" %s \"%s\"\n", var->name, var->string);
} }
Com_Printf ("%i cvars\n", i); Com_Printf ("%i cvars\n", i);
} }
@ -418,6 +458,7 @@ char *Cvar_BitInfo (int bit)
if (var->flags & bit) if (var->flags & bit)
Info_SetValueForKey (info, var->name, var->string); Info_SetValueForKey (info, var->name, var->string);
} }
return info; return info;
} }

File diff suppressed because it is too large Load Diff