[iortcw] 38/95: All: Source alignment and cleanup - Part2
Simon McVittie
smcv at debian.org
Fri Sep 8 10:41:59 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to tag 1.51
in repository iortcw.
commit 7e69fe7359fa11d3af369465e30b25d5aa053361
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Sun Feb 26 15:17:52 2017 -0500
All: Source alignment and cleanup - Part2
---
MP/code/botlib/be_ai_move.c | 2 +-
MP/code/client/cl_cin.c | 36 ++-
MP/code/client/cl_console.c | 11 +-
MP/code/client/cl_input.c | 16 +-
MP/code/client/cl_keys.c | 15 +-
MP/code/client/cl_main.c | 747 ++++++++++++++++++++-----------------------
MP/code/client/cl_net_chan.c | 1 +
MP/code/client/cl_parse.c | 30 +-
MP/code/client/cl_scrn.c | 6 +-
MP/code/client/cl_ui.c | 9 +-
MP/code/client/client.h | 13 +-
MP/code/client/keycodes.h | 2 +-
MP/code/client/snd_dma.c | 8 +-
MP/code/client/snd_mix.c | 4 +-
MP/code/client/snd_openal.c | 8 +-
SP/code/botlib/be_ai_move.c | 2 +-
SP/code/client/cl_cgame.c | 11 +-
SP/code/client/cl_cin.c | 30 +-
SP/code/client/cl_console.c | 40 +--
SP/code/client/cl_input.c | 43 ++-
SP/code/client/cl_keys.c | 14 +-
SP/code/client/cl_main.c | 332 +++++++++----------
SP/code/client/cl_net_chan.c | 7 +-
SP/code/client/cl_parse.c | 38 +--
SP/code/client/cl_scrn.c | 3 +-
SP/code/client/cl_ui.c | 100 +++---
SP/code/client/client.h | 10 +-
SP/code/client/snd_dma.c | 11 +-
SP/code/client/snd_main.c | 1 -
SP/code/client/snd_mem.c | 1 +
SP/code/client/snd_openal.c | 8 +-
SP/code/rend2/tr_init.c | 4 -
SP/code/renderer/tr_init.c | 4 -
SP/code/renderer/tr_public.h | 5 +-
34 files changed, 685 insertions(+), 887 deletions(-)
diff --git a/MP/code/botlib/be_ai_move.c b/MP/code/botlib/be_ai_move.c
index b4ec0ee..327e2ff 100644
--- a/MP/code/botlib/be_ai_move.c
+++ b/MP/code/botlib/be_ai_move.c
@@ -3081,7 +3081,7 @@ void BotMoveToGoal( bot_moveresult_t *result, int movestate, bot_goal_t *goal, i
return;
}
//reset the grapple before testing if the bot has a valid goal
- //because the bot could loose all its goals when stuck to a wall
+ //because the bot could lose all its goals when stuck to a wall
BotResetGrapple( ms );
//
if ( !goal ) {
diff --git a/MP/code/client/cl_cin.c b/MP/code/client/cl_cin.c
index 9b97ac0..1405b12 100644
--- a/MP/code/client/cl_cin.c
+++ b/MP/code/client/cl_cin.c
@@ -46,6 +46,7 @@ If you have questions concerning this license or the applicable additional terms
#include "client.h"
#include "snd_local.h"
+
#define MAXSIZE 8
#define MINSIZE 4
@@ -64,7 +65,7 @@ If you have questions concerning this license or the applicable additional terms
#define MAX_VIDEO_HANDLES 16
-
+extern int s_soundtime;
static void RoQ_init( void );
@@ -92,7 +93,7 @@ typedef struct {
byte file[65536];
short sqrTable[256];
- int mcomp[256];
+ int mcomp[256];
byte *qStatus[2][32768];
long oldXOff, oldYOff, oldysize, oldxsize;
@@ -145,8 +146,6 @@ static cin_cache cinTable[MAX_VIDEO_HANDLES];
static int currentHandle = -1;
static int CL_handle = -1;
-extern int s_soundtime; // sample PAIRS
-
void CIN_CloseAllVideos( void ) {
int i;
@@ -365,7 +364,6 @@ static void move4_32( byte *src, byte *dst, int spl ) {
}
}
-
/******************************************************************************
*
* Function:
@@ -1192,12 +1190,13 @@ redump:
break;
case ZA_SOUND_STEREO:
if ( !cinTable[currentHandle].silent ) {
- if (cinTable[currentHandle].numQuads == -1) {
- S_Update();
- s_rawend[0] = s_soundtime;
- }
- ssize = RllDecodeStereoToStereo( framedata, sbuf, cinTable[currentHandle].RoQFrameSize, 0, (unsigned short)cinTable[currentHandle].roq_flags );
- S_RawSamples(0, ssize, 22050, 2, 2, (byte *)sbuf, 1.0f, -1);
+ if ( cinTable[currentHandle].numQuads == -1 ) {
+ S_Update();
+ Com_DPrintf( "S_Update: Setting rawend to %i\n", s_soundtime );
+ s_rawend[0] = s_soundtime;
+ }
+ ssize = RllDecodeStereoToStereo( framedata, sbuf, cinTable[currentHandle].RoQFrameSize, 0, (unsigned short)cinTable[currentHandle].roq_flags );
+ S_RawSamples(0, ssize, 22050, 2, 2, (byte *)sbuf, 1.0f, -1);
}
break;
case ROQ_QUAD_INFO:
@@ -1416,12 +1415,11 @@ e_status CIN_RunCinematic( int handle ) {
cinTable[currentHandle].tfps = ( ( ( CL_ScaledMilliseconds() - cinTable[currentHandle].startTime ) * 3 ) / 100 );
start = cinTable[currentHandle].startTime;
- while ( ( cinTable[currentHandle].tfps != cinTable[currentHandle].numQuads )
- && ( cinTable[currentHandle].status == FMV_PLAY ) )
+ while ( ( cinTable[currentHandle].tfps != cinTable[currentHandle].numQuads ) && ( cinTable[currentHandle].status == FMV_PLAY ) )
{
RoQInterrupt();
if ( start != cinTable[currentHandle].startTime ) {
- cinTable[currentHandle].tfps = ( ( ( CL_ScaledMilliseconds() - cinTable[currentHandle].startTime) * 3 ) / 100 );
+ cinTable[currentHandle].tfps = ( ( ( CL_ScaledMilliseconds() - cinTable[currentHandle].startTime ) * 3 ) / 100 );
start = cinTable[currentHandle].startTime;
}
}
@@ -1447,7 +1445,6 @@ e_status CIN_RunCinematic( int handle ) {
/*
==================
CIN_PlayCinematic
-
==================
*/
int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBits ) {
@@ -1463,7 +1460,7 @@ int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBi
if ( !( systemBits & CIN_system ) ) {
for ( i = 0 ; i < MAX_VIDEO_HANDLES ; i++ ) {
- if ( !strcmp( cinTable[i].fileName, name ) ) {
+ if ( !Q_stricmp( cinTable[i].fileName, name ) ) {
return i;
}
}
@@ -1525,6 +1522,8 @@ int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBi
Con_Close();
+ Com_DPrintf( "Setting rawend to %i\n", s_soundtime );
+
if (!cinTable[currentHandle].silent) {
s_rawend[0] = s_soundtime;
}
@@ -1656,6 +1655,11 @@ void CIN_DrawCinematic( int handle ) {
cinTable[handle].dirty = qfalse;
}
+/*
+==============
+CL_PlayCinematic_f
+==============
+*/
void CL_PlayCinematic_f( void ) {
char *arg, *s;
int bits = CIN_system;
diff --git a/MP/code/client/cl_console.c b/MP/code/client/cl_console.c
index 795fb11..2df9ad2 100644
--- a/MP/code/client/cl_console.c
+++ b/MP/code/client/cl_console.c
@@ -662,8 +662,7 @@ void Con_DrawNotify( void ) {
skip = strlen( buf ) + 1;
}
- Field_BigDraw( &chatField, skip * BIGCHAR_WIDTH, v,
- SCREEN_WIDTH - ( skip + 1 ) * BIGCHAR_WIDTH, qtrue, qtrue );
+ Field_BigDraw( &chatField, skip * BIGCHAR_WIDTH, v, SCREEN_WIDTH - ( skip + 1 ) * BIGCHAR_WIDTH, qtrue, qtrue );
}
@@ -706,7 +705,6 @@ void Con_DrawSolidConsole( float frac ) {
} else {
SCR_DrawPic( 0, 0, SCREEN_WIDTH, y, cls.consoleShader );
- // NERVE - SMF - merged from WolfSP
if ( frac >= 0.5f ) {
color[0] = color[1] = color[2] = frac * 2.0f;
color[3] = 1.0f;
@@ -716,17 +714,14 @@ void Con_DrawSolidConsole( float frac ) {
SCR_DrawPic( 192, 70, 256, 128, cls.consoleShader2 );
re.SetColor( NULL );
}
- // -NERVE - SMF
}
color[0] = 0;
color[1] = 0;
color[2] = 0;
-// color[3] = 1;
color[3] = 0.6f;
SCR_FillRect( 0, y, SCREEN_WIDTH, 2, color );
-
// draw the version number
re.SetColor( g_color_table[ColorIndex( COLNSOLE_COLOR )] );
@@ -734,9 +729,7 @@ void Con_DrawSolidConsole( float frac ) {
i = strlen( Q3_VERSION );
for ( x = 0 ; x < i ; x++ ) {
-
- SCR_DrawSmallChar( cls.glconfig.vidWidth - ( i - x + 1 ) * SMALLCHAR_WIDTH,
- lines - SMALLCHAR_HEIGHT, Q3_VERSION[x] );
+ SCR_DrawSmallChar( cls.glconfig.vidWidth - ( i - x + 1 ) * SMALLCHAR_WIDTH, lines - SMALLCHAR_HEIGHT, Q3_VERSION[x] );
}
diff --git a/MP/code/client/cl_input.c b/MP/code/client/cl_input.c
index 1b05aa0..de2ab82 100644
--- a/MP/code/client/cl_input.c
+++ b/MP/code/client/cl_input.c
@@ -424,7 +424,6 @@ CL_MouseEvent
*/
void CL_MouseEvent( int dx, int dy, int time ) {
if ( Key_GetCatcher( ) & KEYCATCH_UI ) {
-
// NERVE - SMF - if we just want to pass it along to game
if ( cl_bypassMouseInput->integer == 1 ) {
cl.mouseDx[cl.mouseIndex] += dx;
@@ -502,8 +501,7 @@ void CL_JoystickMove( usercmd_t *cmd ) {
CL_MouseMove
=================
*/
-void CL_MouseMove(usercmd_t *cmd)
-{
+void CL_MouseMove(usercmd_t *cmd) {
float mx, my;
// allow mouse smoothing
@@ -561,8 +559,6 @@ void CL_MouseMove(usercmd_t *cmd)
}
else
{
- // Ridah, experimenting with a slow tracking gun
-
// Rafael - mg42
if ( cl.snap.ps.persistant[PERS_HWEAPON_USE] ) {
mx *= 2.5; //(accelSensitivity * 0.1);
@@ -572,7 +568,6 @@ void CL_MouseMove(usercmd_t *cmd)
mx *= cl_sensitivity->value;
my *= cl_sensitivity->value;
}
-
}
// ingame FOV
@@ -872,8 +867,6 @@ void CL_WritePacket( void ) {
MSG_WriteLong( &buf, clc.serverCommandSequence );
// write any unacknowledged clientCommands
- // NOTE TTimo: if you verbose this, you will see that there are quite a few duplicates
- // typically several unacknowledged cp or userinfo commands stacked up
for ( i = clc.reliableAcknowledge + 1 ; i <= clc.reliableSequence ; i++ ) {
MSG_WriteByte( &buf, clc_clientCommand );
MSG_WriteLong( &buf, i );
@@ -1109,16 +1102,15 @@ void CL_InitInput( void ) {
Cmd_AddCommand( "-wbutton7", IN_Wbutton7Up );
//----(SA) end
-
Cmd_AddCommand( "+mlook", IN_MLookDown );
Cmd_AddCommand( "-mlook", IN_MLookUp );
#ifdef USE_VOIP
- Cmd_AddCommand ("+voiprecord", IN_VoipRecordDown);
- Cmd_AddCommand ("-voiprecord", IN_VoipRecordUp);
+ Cmd_AddCommand( "+voiprecord", IN_VoipRecordDown );
+ Cmd_AddCommand( "-voiprecord", IN_VoipRecordUp );
#endif
- //Cmd_AddCommand ("notebook",IN_Notebook);
+// Cmd_AddCommand( "notebook", IN_Notebook );
Cmd_AddCommand( "help",IN_Help );
cl_nodelta = Cvar_Get( "cl_nodelta", "0", 0 );
diff --git a/MP/code/client/cl_keys.c b/MP/code/client/cl_keys.c
index 1dceb5f..2ba0f5c 100644
--- a/MP/code/client/cl_keys.c
+++ b/MP/code/client/cl_keys.c
@@ -50,7 +50,7 @@ int chat_playerNum;
qboolean key_overstrikeMode;
-int anykeydown;
+int anykeydown;
qkey_t keys[MAX_KEYS];
@@ -342,7 +342,7 @@ keyname_t keynames_d[] = //deutsch
{"ALT", K_ALT},
{"STRG", K_CTRL},
- {"UMSCHALLT", K_SHIFT},
+ {"UMSCHALT", K_SHIFT},
{"FESTSTELLT", K_CAPSLOCK},
@@ -1370,17 +1370,14 @@ void Field_VariableSizeDraw( field_t *edit, int x, int y, int width, int size, q
}
}
-void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape )
-{
+void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape ) {
Field_VariableSizeDraw( edit, x, y, width, SMALLCHAR_WIDTH, showCursor, noColorEscape );
}
-void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape )
-{
+void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape ) {
Field_VariableSizeDraw( edit, x, y, width, BIGCHAR_WIDTH, showCursor, noColorEscape );
}
-
/*
================
Field_Paste
@@ -1738,8 +1735,6 @@ void Message_Key( int key ) {
Com_sprintf( buffer, sizeof( buffer ), "say \"%s\"\n", chatField.buffer );
}
-
-
CL_AddReliableCommand(buffer, qfalse);
}
Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_MESSAGE );
@@ -2458,8 +2453,8 @@ void Key_ClearStates( void ) {
for ( i = 0 ; i < MAX_KEYS ; i++ ) {
if ( keys[i].down ) {
CL_KeyEvent( i, qfalse, 0 );
-
}
+
keys[i].down = 0;
keys[i].repeats = 0;
}
diff --git a/MP/code/client/cl_main.c b/MP/code/client/cl_main.c
index bbdd4f4..f23e717 100644
--- a/MP/code/client/cl_main.c
+++ b/MP/code/client/cl_main.c
@@ -618,7 +618,7 @@ not have future usercmd_t executed before it is executed
void CL_AddReliableCommand(const char *cmd, qboolean isDisconnectCmd)
{
int unacknowledged = clc.reliableSequence - clc.reliableAcknowledge;
-
+
// if we would be losing an old command that hasn't been acknowledged,
// we must drop the connection
// also leave one slot open for the disconnect command in this case.
@@ -724,29 +724,29 @@ record <demoname>
Begins recording a demo from the current position
====================
*/
-static char demoName[MAX_QPATH]; // compiler bug workaround
+static char demoName[MAX_QPATH]; // compiler bug workaround
void CL_Record_f( void ) {
- char name[MAX_OSPATH];
- byte bufData[MAX_MSGLEN];
+ char name[MAX_OSPATH];
+ byte bufData[MAX_MSGLEN];
msg_t buf;
- int i;
- int len;
+ int i;
+ int len;
entityState_t *ent;
entityState_t nullstate;
- char *s;
+ char *s;
if ( Cmd_Argc() > 2 ) {
- Com_Printf ("record <demoname>\n");
+ Com_Printf( "record <demoname>\n" );
return;
}
if ( clc.demorecording ) {
- Com_Printf ("Already recording.\n");
+ Com_Printf( "Already recording.\n" );
return;
}
if ( clc.state != CA_ACTIVE ) {
- Com_Printf ("You must be in a level to record.\n");
+ Com_Printf( "You must be in a level to record.\n" );
return;
}
@@ -756,7 +756,7 @@ void CL_Record_f( void ) {
}
if ( Cmd_Argc() == 2 ) {
- s = Cmd_Argv(1);
+ s = Cmd_Argv( 1 );
Q_strncpyz( demoName, s, sizeof( demoName ) );
#ifdef LEGACY_PROTOCOL
if(clc.compat)
@@ -765,7 +765,7 @@ void CL_Record_f( void ) {
#endif
Com_sprintf(name, sizeof(name), "demos/%s.%s%d", demoName, DEMOEXT, com_protocol->integer);
} else {
- int number;
+ int number;
// scan for a free demo name
for ( number = 0 ; number <= 9999 ; number++ ) {
@@ -783,29 +783,27 @@ void CL_Record_f( void ) {
}
// open the demo file
-
- Com_Printf ("recording to %s.\n", name);
+ Com_Printf( "recording to %s.\n", name );
clc.demofile = FS_FOpenFileWrite( name );
if ( !clc.demofile ) {
- Com_Printf ("ERROR: couldn't open.\n");
+ Com_Printf( "ERROR: couldn't open.\n" );
return;
}
clc.demorecording = qtrue;
-
Q_strncpyz( clc.demoName, demoName, sizeof( clc.demoName ) );
// don't start saving messages until a non-delta compressed message is received
clc.demowaiting = qtrue;
// write out the gamestate message
- MSG_Init (&buf, bufData, sizeof(bufData));
- MSG_Bitstream(&buf);
+ MSG_Init( &buf, bufData, sizeof( bufData ) );
+ MSG_Bitstream( &buf );
// NOTE, MRE: all server->client messages now acknowledge
MSG_WriteLong( &buf, clc.reliableSequence );
- MSG_WriteByte (&buf, svc_gamestate);
- MSG_WriteLong (&buf, clc.serverCommandSequence );
+ MSG_WriteByte( &buf, svc_gamestate );
+ MSG_WriteLong( &buf, clc.serverCommandSequence );
// configstrings
for ( i = 0 ; i < MAX_CONFIGSTRINGS ; i++ ) {
@@ -813,41 +811,41 @@ void CL_Record_f( void ) {
continue;
}
s = cl.gameState.stringData + cl.gameState.stringOffsets[i];
- MSG_WriteByte (&buf, svc_configstring);
- MSG_WriteShort (&buf, i);
- MSG_WriteBigString (&buf, s);
+ MSG_WriteByte( &buf, svc_configstring );
+ MSG_WriteShort( &buf, i );
+ MSG_WriteBigString( &buf, s );
}
// baselines
- Com_Memset (&nullstate, 0, sizeof(nullstate));
+ Com_Memset( &nullstate, 0, sizeof( nullstate ) );
for ( i = 0; i < MAX_GENTITIES ; i++ ) {
ent = &cl.entityBaselines[i];
if ( !ent->number ) {
continue;
}
- MSG_WriteByte (&buf, svc_baseline);
- MSG_WriteDeltaEntity (&buf, &nullstate, ent, qtrue );
+ MSG_WriteByte( &buf, svc_baseline );
+ MSG_WriteDeltaEntity( &buf, &nullstate, ent, qtrue );
}
MSG_WriteByte( &buf, svc_EOF );
-
+
// finished writing the gamestate stuff
// write the client num
- MSG_WriteLong(&buf, clc.clientNum);
+ MSG_WriteLong( &buf, clc.clientNum );
// write the checksum feed
- MSG_WriteLong(&buf, clc.checksumFeed);
+ MSG_WriteLong( &buf, clc.checksumFeed );
// finished writing the client packet
MSG_WriteByte( &buf, svc_EOF );
// write it to the demo file
len = LittleLong( clc.serverMessageSequence - 1 );
- FS_Write (&len, 4, clc.demofile);
+ FS_Write( &len, 4, clc.demofile );
- len = LittleLong (buf.cursize);
- FS_Write (&len, 4, clc.demofile);
- FS_Write (buf.data, buf.cursize, clc.demofile);
+ len = LittleLong( buf.cursize );
+ FS_Write( &len, 4, clc.demofile );
+ FS_Write( buf.data, buf.cursize, clc.demofile );
// the rest of the demo file will be copied from net messages
}
@@ -904,7 +902,7 @@ void CL_DemoCompleted( void )
if( cl_timedemo && cl_timedemo->integer )
{
int time;
-
+
time = Sys_Milliseconds() - clc.timeDemoStart;
if( time > 0 )
{
@@ -963,20 +961,20 @@ CL_ReadDemoMessage
=================
*/
void CL_ReadDemoMessage( void ) {
- int r;
- msg_t buf;
- byte bufData[ MAX_MSGLEN ];
- int s;
+ int r;
+ msg_t buf;
+ byte bufData[ MAX_MSGLEN ];
+ int s;
if ( !clc.demofile ) {
- CL_DemoCompleted ();
+ CL_DemoCompleted();
return;
}
// get the sequence number
- r = FS_Read( &s, 4, clc.demofile);
+ r = FS_Read( &s, 4, clc.demofile );
if ( r != 4 ) {
- CL_DemoCompleted ();
+ CL_DemoCompleted();
return;
}
clc.serverMessageSequence = LittleLong( s );
@@ -985,23 +983,23 @@ void CL_ReadDemoMessage( void ) {
MSG_Init( &buf, bufData, sizeof( bufData ) );
// get the length
- r = FS_Read (&buf.cursize, 4, clc.demofile);
+ r = FS_Read( &buf.cursize, 4, clc.demofile );
if ( r != 4 ) {
- CL_DemoCompleted ();
+ CL_DemoCompleted();
return;
}
buf.cursize = LittleLong( buf.cursize );
if ( buf.cursize == -1 ) {
- CL_DemoCompleted ();
+ CL_DemoCompleted();
return;
}
if ( buf.cursize > buf.maxsize ) {
- Com_Error (ERR_DROP, "CL_ReadDemoMessage: demoMsglen > MAX_MSGLEN");
+ Com_Error( ERR_DROP, "CL_ReadDemoMessage: demoMsglen > MAX_MSGLEN" );
}
r = FS_Read( buf.data, buf.cursize, clc.demofile );
if ( r != buf.cursize ) {
- Com_Printf( "Demo file was truncated.\n");
- CL_DemoCompleted ();
+ Com_Printf( "Demo file was truncated.\n" );
+ CL_DemoCompleted();
return;
}
@@ -1185,7 +1183,6 @@ void CL_PlayDemo_f( void ) {
clc.firstDemoFrameSkipped = qfalse;
}
-
/*
====================
CL_StartDemoLoop
@@ -1195,7 +1192,7 @@ Closing the main menu will restart the demo loop
*/
void CL_StartDemoLoop( void ) {
// start the demo loop again
- Cbuf_AddText ("d1\n");
+ Cbuf_AddText( "d1\n" );
Key_SetCatcher( 0 );
}
@@ -1210,16 +1207,16 @@ If the "nextdemo" cvar is set, that command will be issued
void CL_NextDemo( void ) {
char v[MAX_STRING_CHARS];
- Q_strncpyz( v, Cvar_VariableString ("nextdemo"), sizeof(v) );
- v[MAX_STRING_CHARS-1] = 0;
- Com_DPrintf("CL_NextDemo: %s\n", v );
- if (!v[0]) {
+ Q_strncpyz( v, Cvar_VariableString( "nextdemo" ), sizeof( v ) );
+ v[MAX_STRING_CHARS - 1] = 0;
+ Com_DPrintf( "CL_NextDemo: %s\n", v );
+ if ( !v[0] ) {
return;
}
- Cvar_Set ("nextdemo","");
- Cbuf_AddText (v);
- Cbuf_AddText ("\n");
+ Cvar_Set( "nextdemo","" );
+ Cbuf_AddText( v );
+ Cbuf_AddText( "\n" );
Cbuf_Execute();
}
@@ -1336,8 +1333,7 @@ void CL_ClearMemory(qboolean shutdownRef)
Hunk_Clear();
// clear collision map data
CM_ClearMap();
- }
- else {
+ } else {
// clear all the client data on the hunk
Hunk_ClearToMark();
}
@@ -1485,10 +1481,10 @@ void CL_Disconnect( qboolean showMainMenu ) {
Cvar_Set( "r_uiFullScreen", "1" );
if ( clc.demorecording ) {
- CL_StopRecord_f ();
+ CL_StopRecord_f();
}
- if (clc.download) {
+ if ( clc.download ) {
FS_FCloseFile( clc.download );
clc.download = 0;
}
@@ -1532,7 +1528,7 @@ void CL_Disconnect( qboolean showMainMenu ) {
VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_NONE );
}
- SCR_StopCinematic ();
+ SCR_StopCinematic();
S_ClearSoundBuffer();
// send a disconnect message to the server
@@ -1543,12 +1539,12 @@ void CL_Disconnect( qboolean showMainMenu ) {
CL_WritePacket();
CL_WritePacket();
}
-
+
// Remove pure paks
FS_PureServerSetLoadedPaks("", "");
FS_PureServerSetReferencedPaks( "", "" );
-
- CL_ClearState ();
+
+ CL_ClearState();
// wipe the client connection
Com_Memset( &clc, 0, sizeof( clc ) );
@@ -1593,7 +1589,7 @@ so when they are typed in at the console, they will need to be forwarded.
void CL_ForwardCommandToServer( const char *string ) {
char *cmd;
- cmd = Cmd_Argv(0);
+ cmd = Cmd_Argv( 0 );
// ignore key up commands
if ( cmd[0] == '-' ) {
@@ -1620,7 +1616,7 @@ CL_RequestMotd
*/
void CL_RequestMotd( void ) {
#ifdef UPDATE_SERVER_NAME
- char info[MAX_INFO_STRING];
+ char info[MAX_INFO_STRING];
if ( !cl_motd->integer ) {
return;
@@ -1632,13 +1628,12 @@ void CL_RequestMotd( void ) {
}
cls.updateServer.port = BigShort( PORT_UPDATE );
Com_Printf( "%s resolved to %i.%i.%i.%i:%i\n", UPDATE_SERVER_NAME,
- cls.updateServer.ip[0], cls.updateServer.ip[1],
- cls.updateServer.ip[2], cls.updateServer.ip[3],
- BigShort( cls.updateServer.port ) );
-
- info[0] = 0;
+ cls.updateServer.ip[0], cls.updateServer.ip[1],
+ cls.updateServer.ip[2], cls.updateServer.ip[3],
+ BigShort( cls.updateServer.port ) );
- Com_sprintf( cls.updateChallenge, sizeof( cls.updateChallenge ), "%i", ((rand() << 16) ^ rand()) ^ Com_Milliseconds());
+ info[0] = 0;
+ Com_sprintf( cls.updateChallenge, sizeof( cls.updateChallenge ), "%i", ( (rand() << 16 ) ^ rand() ) ^ Com_Milliseconds() );
Info_SetValueForKey( info, "challenge", cls.updateChallenge );
Info_SetValueForKey( info, "renderer", cls.glconfig.renderer_string );
@@ -1666,9 +1661,9 @@ cdkey may be "demo"
#OLD The authorize server returns a:
-#OLD
+#OLD
#OLD keyAthorize <challenge> <accept | deny>
-#OLD
+#OLD
#OLD A client will be accepted if the cdkey is valid and it has not been used by any other IP
#OLD address in the last 15 minutes.
@@ -1690,8 +1685,8 @@ in anyway.
#ifdef USE_AUTHORIZE_SERVER
void CL_RequestAuthorization( void ) {
char nums[64];
- int i, j, l;
- cvar_t *fs;
+ int i, j, l;
+ cvar_t *fs;
if ( !cls.authorizeServer.port ) {
Com_Printf( "Resolving %s\n", AUTHORIZE_SERVER_NAME );
@@ -1702,9 +1697,9 @@ void CL_RequestAuthorization( void ) {
cls.authorizeServer.port = BigShort( PORT_AUTHORIZE );
Com_Printf( "%s resolved to %i.%i.%i.%i:%i\n", AUTHORIZE_SERVER_NAME,
- cls.authorizeServer.ip[0], cls.authorizeServer.ip[1],
- cls.authorizeServer.ip[2], cls.authorizeServer.ip[3],
- BigShort( cls.authorizeServer.port ) );
+ cls.authorizeServer.ip[0], cls.authorizeServer.ip[1],
+ cls.authorizeServer.ip[2], cls.authorizeServer.ip[3],
+ BigShort( cls.authorizeServer.port ) );
}
if ( cls.authorizeServer.type == NA_BAD ) {
return;
@@ -1719,15 +1714,14 @@ void CL_RequestAuthorization( void ) {
for ( i = 0 ; i < l ; i++ ) {
if ( ( cl_cdkey[i] >= '0' && cl_cdkey[i] <= '9' )
|| ( cl_cdkey[i] >= 'a' && cl_cdkey[i] <= 'z' )
- || ( cl_cdkey[i] >= 'A' && cl_cdkey[i] <= 'Z' )
- ) {
+ || ( cl_cdkey[i] >= 'A' && cl_cdkey[i] <= 'Z' ) ) {
nums[j] = cl_cdkey[i];
j++;
}
}
nums[j] = 0;
- fs = Cvar_Get ("cl_anonymous", "0", CVAR_INIT|CVAR_SYSTEMINFO );
+ fs = Cvar_Get( "cl_anonymous", "0", CVAR_INIT | CVAR_SYSTEMINFO );
NET_OutOfBandPrint(NS_CLIENT, cls.authorizeServer, "getKeyAuthorize %i %s", fs->integer, nums );
}
@@ -1749,10 +1743,10 @@ CL_ForwardToServer_f
*/
void CL_ForwardToServer_f( void ) {
if ( clc.state != CA_ACTIVE || clc.demoplaying ) {
- Com_Printf ("Not connected to a server.\n");
+ Com_Printf( "Not connected to a server.\n" );
return;
}
-
+
// don't forward the first argument
if ( Cmd_Argc() > 1 ) {
CL_AddReliableCommand(Cmd_Args(), qfalse);
@@ -1768,7 +1762,7 @@ void CL_Disconnect_f( void ) {
SCR_StopCinematic();
Cvar_Set("ui_singlePlayerActive", "0");
if ( clc.state != CA_DISCONNECTED && clc.state != CA_CINEMATIC ) {
- Com_Error (ERR_DISCONNECT, "Disconnected from server");
+ Com_Error( ERR_DISCONNECT, "Disconnected from server" );
}
}
@@ -1800,9 +1794,9 @@ void CL_Connect_f( void ) {
if ( argc != 2 && argc != 3 ) {
Com_Printf( "usage: connect [-4|-6] server\n");
- return;
+ return;
}
-
+
if(argc == 2)
server = Cmd_Argv(1);
else
@@ -1835,7 +1829,7 @@ void CL_Connect_f( void ) {
if ( com_sv_running->integer && !strcmp( server, "localhost" ) ) {
// if running a local server, kill it
- SV_Shutdown( "Server quit\n" );
+ SV_Shutdown( "Server quit" );
}
// make sure a local server is killed
@@ -1849,11 +1843,11 @@ void CL_Connect_f( void ) {
Q_strncpyz( clc.servername, server, sizeof(clc.servername) );
if (!NET_StringToAdr(clc.servername, &clc.serverAddress, family) ) {
- Com_Printf ("Bad server address\n");
+ Com_Printf( "Bad server address\n" );
clc.state = CA_DISCONNECTED;
return;
}
- if (clc.serverAddress.port == 0) {
+ if ( clc.serverAddress.port == 0 ) {
clc.serverAddress.port = BigShort( PORT_SERVER );
}
@@ -1938,8 +1932,8 @@ void CL_Rcon_f( void ) {
netadr_t to;
if ( !rcon_client_password->string[0] ) {
- Com_Printf ("You must set 'rconpassword' before\n"
- "issuing an rcon command.\n");
+ Com_Printf( "You must set 'rconpassword' before\n"
+ "issuing an rcon command.\n" );
return;
}
@@ -1954,26 +1948,25 @@ void CL_Rcon_f( void ) {
Q_strcat (message, MAX_RCON_MESSAGE, rcon_client_password->string);
Q_strcat (message, MAX_RCON_MESSAGE, " ");
- // https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=543
Q_strcat (message, MAX_RCON_MESSAGE, Cmd_Cmd()+5);
if ( clc.state >= CA_CONNECTED ) {
to = clc.netchan.remoteAddress;
} else {
- if (!strlen(rconAddress->string)) {
- Com_Printf ("You must either be connected,\n"
+ if ( !strlen( rconAddress->string ) ) {
+ Com_Printf( "You must either be connected,\n"
"or set the 'rconAddress' cvar\n"
- "to issue rcon commands\n");
+ "to issue rcon commands\n" );
return;
}
NET_StringToAdr (rconAddress->string, &to, NA_UNSPEC);
- if (to.port == 0) {
- to.port = BigShort (PORT_SERVER);
+ if ( to.port == 0 ) {
+ to.port = BigShort( PORT_SERVER );
}
}
-
- NET_SendPacket (NS_CLIENT, strlen(message)+1, message, to);
+
+ NET_SendPacket( NS_CLIENT, strlen( message ) + 1, message, to );
}
/*
@@ -2099,9 +2092,9 @@ void CL_UI_Restart_f( void ) { // NERVE - SMF
/*
=================
-CL_Snd_Restart
+CL_Snd_Shutdown
-Restart the sound subsystem
+Shut down the sound subsystem
=================
*/
void CL_Snd_Shutdown(void)
@@ -2150,11 +2143,11 @@ CL_Configstrings_f
==================
*/
void CL_Configstrings_f( void ) {
- int i;
- int ofs;
+ int i;
+ int ofs;
if ( clc.state != CA_ACTIVE ) {
- Com_Printf( "Not connected to a server.\n");
+ Com_Printf( "Not connected to a server.\n" );
return;
}
@@ -2176,11 +2169,12 @@ void CL_Clientinfo_f( void ) {
Com_Printf( "--------- Client Information ---------\n" );
Com_Printf( "state: %i\n", clc.state );
Com_Printf( "Server: %s\n", clc.servername );
- Com_Printf ("User info settings:\n");
+ Com_Printf( "User info settings:\n" );
Info_Print( Cvar_InfoString( CVAR_USERINFO ) );
Com_Printf( "--------------------------------------\n" );
}
+
//====================================================================
/*
@@ -2253,7 +2247,6 @@ void CL_DownloadsComplete( void ) {
// let the client game init and load data
clc.state = CA_LOADING;
- // Pump the loop, this may change gamestate!
Com_EventLoop();
// if the gamestate was changed by calling Com_EventLoop
@@ -2320,15 +2313,13 @@ CL_NextDownload
A download completed or failed
=================
*/
-void CL_NextDownload(void)
-{
+void CL_NextDownload( void ) {
char *s;
char *remoteName, *localName;
qboolean useCURL = qfalse;
// A download has finished, check whether this matches a referenced checksum
- if( *clc.downloadName && !autoupdateStarted )
- {
+ if( *clc.downloadName && !autoupdateStarted ) {
char *zippath = FS_BuildOSPath(Cvar_VariableString("fs_homepath"), clc.downloadName, "");
zippath[strlen(zippath)-1] = '\0';
@@ -2340,27 +2331,31 @@ void CL_NextDownload(void)
Cvar_Set("cl_downloadName", "");
// We are looking to start a download here
- if (*clc.downloadList) {
+ if ( *clc.downloadList ) {
s = clc.downloadList;
// format is:
// @remotename at localname@remotename at localname, etc.
- if (*s == '@')
+ if ( *s == '@' ) {
s++;
+ }
remoteName = s;
-
- if ( (s = strchr(s, '@')) == NULL ) {
+
+ if ( ( s = strchr( s, '@' ) ) == NULL ) {
CL_DownloadsComplete();
return;
}
*s++ = 0;
localName = s;
- if ( (s = strchr(s, '@')) != NULL )
+ if ( ( s = strchr( s, '@' ) ) != NULL ) {
*s++ = 0;
- else
- s = localName + strlen(localName); // point at the nul byte
+ } else {
+ s = localName + strlen( localName ); // point at the nul byte
+
+ }
+
#ifdef USE_CURL
if(!(cl_allowDownload->integer & DLF_NO_REDIRECT)) {
if(clc.sv_allowDownload & DLF_NO_REDIRECT) {
@@ -2406,7 +2401,7 @@ void CL_NextDownload(void)
clc.downloadRestart = qtrue;
// move over the rest
- memmove( clc.downloadList, s, strlen(s) + 1);
+ memmove( clc.downloadList, s, strlen( s ) + 1 );
return;
}
@@ -2435,23 +2430,21 @@ void CL_InitDownloads( void ) {
CL_NextDownload();
return;
}
- } else
- {
+ } else {
if ( !(cl_allowDownload->integer & DLF_ENABLE) ) {
- // autodownload is disabled on the client
- // but it's possible that some referenced files on the server are missing
+ // autodownload is disabled on the client
+ // but it's possible that some referenced files on the server are missing
- // whatever autodownlad configuration, store missing files in a cvar, use later in the ui maybe
- if ( FS_ComparePaks( missingfiles, sizeof( missingfiles ), qfalse ) ) {
- Cvar_Set( "com_missingFiles", missingfiles );
- } else {
- Cvar_Set( "com_missingFiles", "" );
- }
- Com_Printf( "\nWARNING: You are missing some files referenced by the server:\n%s"
- "You might not be able to join the game\n"
- "Go to the setting menu to turn on autodownload, or get the file elsewhere\n\n", missingfiles );
+ // whatever autodownlad configuration, store missing files in a cvar, use later in the ui maybe
+ if ( FS_ComparePaks( missingfiles, sizeof( missingfiles ), qfalse ) ) {
+ Cvar_Set( "com_missingFiles", missingfiles );
+ } else {
+ Cvar_Set( "com_missingFiles", "" );
+ }
+ Com_Printf( "\nWARNING: You are missing some files referenced by the server:\n%s"
+ "You might not be able to join the game\n"
+ "Go to the setting menu to turn on autodownload, or get the file elsewhere\n\n", missingfiles );
}
-
else if ( FS_ComparePaks( clc.downloadList, sizeof( clc.downloadList ), qtrue ) ) {
// this gets printed to UI, i18n
Com_Printf( CL_TranslateStringBuf( "Need paks: %s\n" ), clc.downloadList );
@@ -2468,10 +2461,8 @@ void CL_InitDownloads( void ) {
}
}
}
-
#endif
-
CL_DownloadsComplete();
}
@@ -2522,10 +2513,10 @@ void CL_CheckForResend( void ) {
NET_OutOfBandPrint(NS_CLIENT, clc.serverAddress, "%s", data);
break;
-
+
case CA_CHALLENGING:
// sending back the challenge
- port = Cvar_VariableValue ("net_qport");
+ port = Cvar_VariableValue( "net_qport" );
Q_strncpyz( info, Cvar_InfoString( CVAR_USERINFO ), sizeof( info ) );
@@ -2537,10 +2528,10 @@ void CL_CheckForResend( void ) {
Info_SetValueForKey(info, "protocol", va("%i", com_legacyprotocol->integer));
else
#endif
- Info_SetValueForKey(info, "protocol", va("%i", com_protocol->integer));
- Info_SetValueForKey( info, "qport", va("%i", port ) );
- Info_SetValueForKey( info, "challenge", va("%i", clc.challenge ) );
-
+ Info_SetValueForKey( info, "protocol", va("%i", com_protocol->integer ) );
+ Info_SetValueForKey( info, "qport", va( "%i", port ) );
+ Info_SetValueForKey( info, "challenge", va( "%i", clc.challenge ) );
+
Com_sprintf( data, sizeof(data), "connect \"%s\"", info );
NET_OutOfBandData( NS_CLIENT, clc.serverAddress, (byte *) data, strlen ( data ) );
// the most current userinfo has been sent, so watch for any
@@ -2569,7 +2560,7 @@ void CL_MotdPacket( netadr_t from ) {
return;
}
- info = Cmd_Argv(1);
+ info = Cmd_Argv( 1 );
// check challenge
challenge = Info_ValueForKey( info, "challenge" );
@@ -2650,13 +2641,13 @@ CL_ServersResponsePacket
void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extended ) {
int i, j, count, total;
netadr_t addresses[MAX_SERVERSPERPACKET];
- int numservers;
- byte* buffptr;
- byte* buffend;
-
- Com_Printf("CL_ServersResponsePacket\n");
+ int numservers;
+ byte* buffptr;
+ byte* buffend;
+
+ Com_Printf( "CL_ServersResponsePacket\n" );
- if (cls.numglobalservers == -1) {
+ if ( cls.numglobalservers == -1 ) {
// state to detect lack of servers or lack of response
cls.numglobalservers = 0;
cls.numGlobalServerAddresses = 0;
@@ -2672,7 +2663,7 @@ void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extend
{
if(*buffptr == '\\' || (extended && *buffptr == '/'))
break;
-
+
buffptr++;
} while (buffptr < buffend);
@@ -2708,7 +2699,7 @@ void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extend
else
// syntax error!
break;
-
+
// parse out port
addresses[numservers].port = (*buffptr++) << 8;
addresses[numservers].port += *buffptr++;
@@ -2717,8 +2708,9 @@ void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extend
// syntax check
if (*buffptr != '\\' && *buffptr != '/')
break;
-
+
numservers++;
+
if (numservers >= MAX_SERVERSPERPACKET)
break;
}
@@ -2760,7 +2752,7 @@ void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extend
cls.numglobalservers = count;
total = count + cls.numGlobalServerAddresses;
- Com_Printf("%d servers parsed (total %d)\n", numservers, total);
+ Com_Printf( "%d servers parsed (total %d)\n", numservers, total );
}
/*
@@ -2782,7 +2774,7 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
Cmd_TokenizeString( s );
- c = Cmd_Argv(0);
+ c = Cmd_Argv( 0 );
Com_DPrintf ("CL packet %s: %s\n", NET_AdrToStringwPort(from), c);
@@ -2798,11 +2790,11 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
return;
}
- c = Cmd_Argv(3);
+ c = Cmd_Argv( 3 );
if(*c)
challenge = atoi(c);
- strver = Cmd_Argv(4);
+ strver = Cmd_Argv( 4 );
if(*strver)
{
ver = atoi(strver);
@@ -2876,13 +2868,13 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
}
// server connection
- if ( !Q_stricmp(c, "connectResponse") ) {
+ if ( !Q_stricmp( c, "connectResponse" ) ) {
if ( clc.state >= CA_CONNECTED ) {
- Com_Printf ("Dup connect received. Ignored.\n");
+ Com_Printf( "Dup connect received. Ignored.\n" );
return;
}
if ( clc.state != CA_CHALLENGING ) {
- Com_Printf ("connectResponse packet while not connecting. Ignored.\n");
+ Com_Printf( "connectResponse packet while not connecting. Ignored.\n" );
return;
}
if ( !NET_CompareAdr( from, clc.serverAddress ) ) {
@@ -2928,47 +2920,46 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
#endif
clc.state = CA_CONNECTED;
- clc.lastPacketSentTime = -9999; // send first packet immediately
+ clc.lastPacketSentTime = -9999; // send first packet immediately
return;
}
// server responding to an info broadcast
- if ( !Q_stricmp(c, "infoResponse") ) {
+ if ( !Q_stricmp( c, "infoResponse" ) ) {
CL_ServerInfoPacket( from, msg );
return;
}
// server responding to a get playerlist
- if ( !Q_stricmp(c, "statusResponse") ) {
+ if ( !Q_stricmp( c, "statusResponse" ) ) {
CL_ServerStatusResponse( from, msg );
return;
}
// echo request from server
- if ( !Q_stricmp(c, "echo") ) {
- NET_OutOfBandPrint( NS_CLIENT, from, "%s", Cmd_Argv(1) );
+ if ( !Q_stricmp( c, "echo" ) ) {
+ NET_OutOfBandPrint( NS_CLIENT, from, "%s", Cmd_Argv( 1 ) );
return;
}
// cd check
- if ( !Q_stricmp(c, "keyAuthorize") ) {
+ if ( !Q_stricmp( c, "keyAuthorize" ) ) {
// we don't use these now, so dump them on the floor
return;
}
// global MOTD from id
- if ( !Q_stricmp(c, "motd") ) {
+ if ( !Q_stricmp( c, "motd" ) ) {
CL_MotdPacket( from );
return;
}
// echo request from server
- if(!Q_stricmp(c, "print")){
+ if ( !Q_stricmp( c, "print" ) ) {
s = MSG_ReadString( msg );
Q_strncpyz( clc.serverMessage, s, sizeof( clc.serverMessage ) );
Com_Printf( "%s", s );
-
return;
}
@@ -2979,7 +2970,7 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
}
// list of servers sent back by a master server (classic)
- if ( !Q_strncmp(c, "getserversResponse", 18) ) {
+ if ( !Q_strncmp( c, "getserversResponse", 18 ) ) {
CL_ServersResponsePacket( &from, msg, qfalse );
return;
}
@@ -2990,7 +2981,7 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
return;
}
- Com_DPrintf ("Unknown connectionless packet command.\n");
+ Com_DPrintf( "Unknown connectionless packet command.\n" );
}
/*
@@ -3001,7 +2992,7 @@ A packet has arrived from the main event loop
=================
*/
void CL_PacketEvent( netadr_t from, msg_t *msg ) {
- int headerBytes;
+ int headerBytes;
clc.lastPacketTime = cls.realtime;
@@ -3011,7 +3002,7 @@ void CL_PacketEvent( netadr_t from, msg_t *msg ) {
}
if ( clc.state < CA_CONNECTED ) {
- return; // can't be a valid sequenced packet
+ return; // can't be a valid sequenced packet
}
if ( msg->cursize < 4 ) {
@@ -3023,20 +3014,20 @@ void CL_PacketEvent( netadr_t from, msg_t *msg ) {
// packet from server
//
if ( !NET_CompareAdr( from, clc.netchan.remoteAddress ) ) {
- Com_DPrintf ("%s:sequenced packet without connection\n"
+ Com_DPrintf( "%s:sequenced packet without connection\n"
, NET_AdrToStringwPort( from ) );
// FIXME: send a client disconnect?
return;
}
- if (!CL_Netchan_Process( &clc.netchan, msg) ) {
- return; // out of order, duplicated, etc
+ if ( !CL_Netchan_Process( &clc.netchan, msg ) ) {
+ return; // out of order, duplicated, etc
}
// the header is different lengths for reliable and unreliable messages
headerBytes = msg->readcount;
- // track the last message received so it can be returned in
+ // track the last message received so it can be returned in
// client messages, allowing the server to detect a dropped
// gamestate
clc.serverMessageSequence = LittleLong( *(int *)msg->data );
@@ -3065,9 +3056,9 @@ void CL_CheckTimeout( void ) {
//
if ( ( !CL_CheckPaused() || !sv_paused->integer )
&& clc.state >= CA_CONNECTED && clc.state != CA_CINEMATIC
- && cls.realtime - clc.lastPacketTime > cl_timeout->value*1000) {
- if (++cl.timeoutcount > 5) { // timeoutcount saves debugger
- Com_Printf ("\nServer connection timed out.\n");
+ && cls.realtime - clc.lastPacketTime > cl_timeout->value * 1000 ) {
+ if ( ++cl.timeoutcount > 5 ) { // timeoutcount saves debugger
+ Com_Printf( "\nServer connection timed out.\n" );
CL_Disconnect( qtrue );
return;
}
@@ -3112,8 +3103,7 @@ void CL_CheckUserinfo( void ) {
return;
// send a reliable userinfo update if needed
- if(cvar_modifiedFlags & CVAR_USERINFO)
- {
+ if ( cvar_modifiedFlags & CVAR_USERINFO ) {
cvar_modifiedFlags &= ~CVAR_USERINFO;
CL_AddReliableCommand(va("userinfo \"%s\"", Cvar_InfoString( CVAR_USERINFO ) ), qfalse);
}
@@ -3125,7 +3115,7 @@ CL_Frame
==================
*/
-void CL_Frame ( int msec ) {
+void CL_Frame( int msec ) {
if ( !com_cl_running->integer ) {
return;
@@ -3184,7 +3174,7 @@ void CL_Frame ( int msec ) {
}
}
}
-
+
if( cl_autoRecordDemo->integer ) {
if( clc.state == CA_ACTIVE && !clc.demorecording && !clc.demoplaying ) {
// If not recording a demo, and we should be, start one
@@ -3421,19 +3411,19 @@ DLL glue
================
*/
static __attribute__ ((format (printf, 2, 3))) void QDECL CL_RefPrintf( int print_level, const char *fmt, ...) {
- va_list argptr;
- char msg[MAXPRINTMSG];
-
- va_start (argptr,fmt);
- Q_vsnprintf (msg, sizeof(msg), fmt, argptr);
- va_end (argptr);
+ va_list argptr;
+ char msg[MAXPRINTMSG];
+
+ va_start( argptr,fmt );
+ Q_vsnprintf( msg, sizeof ( msg ), fmt, argptr );
+ va_end( argptr );
if ( print_level == PRINT_ALL ) {
- Com_Printf ("%s", msg);
+ Com_Printf( "%s", msg );
} else if ( print_level == PRINT_WARNING ) {
- Com_Printf (S_COLOR_YELLOW "%s", msg); // yellow
+ Com_Printf( S_COLOR_YELLOW "%s", msg ); // yellow
} else if ( print_level == PRINT_DEVELOPER ) {
- Com_DPrintf (S_COLOR_RED "%s", msg); // red
+ Com_DPrintf( S_COLOR_RED "%s", msg ); // red
}
}
@@ -3469,12 +3459,8 @@ void CL_InitRenderer( void ) {
// load character sets
cls.charSetShader = re.RegisterShader( "gfx/2d/hudchars" );
cls.whiteShader = re.RegisterShader( "white" );
-
-// JPW NERVE
-
cls.consoleShader = re.RegisterShader( "console-16bit" ); // JPW NERVE shader works with 16bit
cls.consoleShader2 = re.RegisterShader( "console2-16bit" ); // JPW NERVE same
-
g_console_field_width = cls.glconfig.vidWidth / SMALLCHAR_WIDTH - 2;
g_consoleField.widthInChars = g_console_field_width;
}
@@ -3488,7 +3474,7 @@ This is the only place that any of these functions are called from
============================
*/
void CL_StartHunkUsers( qboolean rendererOnly ) {
- if (!com_cl_running) {
+ if ( !com_cl_running ) {
return;
}
@@ -3525,6 +3511,10 @@ void CL_StartHunkUsers( qboolean rendererOnly ) {
}
}
+int CL_ScaledMilliseconds( void ) {
+ return Sys_Milliseconds() * com_timescale->value;
+}
+
// DHM - Nerve
void CL_CheckAutoUpdate( void ) {
int validServerNum = 0;
@@ -3658,10 +3648,6 @@ void *CL_RefMalloc( int size ) {
}
#endif
-int CL_ScaledMilliseconds(void) {
- return Sys_Milliseconds()*com_timescale->value;
-}
-
/*
============
CL_RefTagFree
@@ -3774,18 +3760,14 @@ void CL_InitRef( void ) {
ret = GetRefAPI( REF_API_VERSION, &ri );
-#if 0 // MrE defined __USEA3D && defined __A3D_GEOM
- hA3Dg_ExportRenderGeom( ret );
-#endif
-
- Com_Printf( "-------------------------------\n" );
-
if ( !ret ) {
Com_Error( ERR_FATAL, "Couldn't initialize refresh" );
}
re = *ret;
+ Com_Printf( "---- Renderer Initialization Complete ----\n" );
+
// unpause so the cgame definately gets a snapshot and renders a frame
Cvar_Set( "cl_paused", "0" );
}
@@ -3842,22 +3824,6 @@ void CL_LoadTranslations_f( void ) {
//===========================================================================================
-void CL_SetModel_f( void ) {
- char *arg;
- char name[256];
-
- arg = Cmd_Argv( 1 );
- if (arg[0]) {
- Cvar_Set( "model", arg );
- Cvar_Set( "headmodel", arg );
- } else {
- Cvar_VariableStringBuffer( "model", name, sizeof(name) );
- Com_Printf("model is set to %s\n", name);
- }
-}
-
-//===========================================================================================
-
/*
===============
@@ -4137,7 +4103,6 @@ void CL_Init( void ) {
Cvar_Get( "name", "WolfPlayer", CVAR_USERINFO | CVAR_ARCHIVE );
cl_rate = Cvar_Get( "rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE ); // NERVE - SMF - changed from 3000
Cvar_Get( "snaps", "20", CVAR_USERINFO | CVAR_ARCHIVE );
-// Cvar_Get ("model", "american", CVAR_USERINFO | CVAR_ARCHIVE ); // temp until we have an skeletal american model
Cvar_Get( "model", "multi", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get( "head", "default", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get( "color", "4", CVAR_USERINFO | CVAR_ARCHIVE );
@@ -4223,7 +4188,6 @@ void CL_Init( void ) {
Cmd_AddCommand( "showip", CL_ShowIP_f );
Cmd_AddCommand( "fs_openedList", CL_OpenedPK3List_f );
Cmd_AddCommand( "fs_referencedList", CL_ReferencedPK3List_f );
- Cmd_AddCommand ("model", CL_SetModel_f );
Cmd_AddCommand ("video", CL_Video_f );
Cmd_AddCommand ("stopvideo", CL_StopVideo_f );
@@ -4242,7 +4206,7 @@ void CL_Init( void ) {
Cmd_AddCommand( "LoadTranslations", CL_LoadTranslations_f ); // NERVE - SMF - localization
// NERVE - SMF - don't do this in multiplayer
// RF, add this command so clients can't bind a key to send client damage commands to the server
-// Cmd_AddCommand ("cld", CL_ClientDamageCommand );
+// Cmd_AddCommand( "cld", CL_ClientDamageCommand );
Cmd_AddCommand( "startSingleplayer", CL_startSingleplayer_f ); // NERVE - SMF
@@ -4275,7 +4239,7 @@ CL_Shutdown
===============
*/
-void CL_Shutdown(char *finalmsg, qboolean disconnect, qboolean quit) {
+void CL_Shutdown( char *finalmsg, qboolean disconnect, qboolean quit ) {
static qboolean recursive = qfalse;
// check whether the client is running at all.
@@ -4409,10 +4373,10 @@ CL_ServerInfoPacket
===================
*/
void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
- int i, type;
+ int i, type;
char info[MAX_INFO_STRING];
char *infoString;
- int prot;
+ int prot;
char *gamename;
qboolean gameMismatch;
@@ -4449,10 +4413,9 @@ void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
}
// iterate servers waiting for ping response
- for (i=0; i<MAX_PINGREQUESTS; i++)
+ for ( i = 0; i < MAX_PINGREQUESTS; i++ )
{
- if ( cl_pinglist[i].adr.port && !cl_pinglist[i].time && NET_CompareAdr( from, cl_pinglist[i].adr ) )
- {
+ if ( cl_pinglist[i].adr.port && !cl_pinglist[i].time && NET_CompareAdr( from, cl_pinglist[i].adr ) ) {
// calc ping time
cl_pinglist[i].time = Sys_Milliseconds() - cl_pinglist[i].start;
Com_DPrintf( "ping time %dms from %s\n", cl_pinglist[i].time, NET_AdrToString( from ) );
@@ -4462,28 +4425,28 @@ void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
// tack on the net type
// NOTE: make sure these types are in sync with the netnames strings in the UI
- switch (from.type)
+ switch ( from.type )
{
- case NA_BROADCAST:
- case NA_IP:
- type = 1;
- break;
- case NA_IP6:
- type = 2;
- break;
- default:
- type = 0;
- break;
+ case NA_BROADCAST:
+ case NA_IP:
+ type = 1;
+ break;
+ case NA_IP6:
+ type = 2;
+ break;
+ default:
+ type = 0;
+ break;
}
- Info_SetValueForKey( cl_pinglist[i].info, "nettype", va("%d", type) );
- CL_SetServerInfoByAddress(from, infoString, cl_pinglist[i].time);
+ Info_SetValueForKey( cl_pinglist[i].info, "nettype", va( "%d", type ) );
+ CL_SetServerInfoByAddress( from, infoString, cl_pinglist[i].time );
return;
}
}
// if not just sent a local broadcast or pinging local servers
- if (cls.pingUpdateSource != AS_LOCAL) {
+ if ( cls.pingUpdateSource != AS_LOCAL ) {
return;
}
@@ -4509,9 +4472,9 @@ void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
CL_InitServerInfo( &cls.localServers[i], &from );
Q_strncpyz( info, MSG_ReadString( msg ), MAX_INFO_STRING );
- if (strlen(info)) {
- if (info[strlen(info)-1] != '\n') {
- Q_strcat(info, sizeof(info), "\n");
+ if ( strlen( info ) ) {
+ if ( info[strlen( info ) - 1] != '\n' ) {
+ Q_strcat( info, sizeof(info), "\n" );
}
Com_Printf( "%s: %s", NET_AdrToStringwPort( from ), info );
}
@@ -4558,20 +4521,20 @@ CL_GetServerStatus
serverStatus_t *CL_GetServerStatus( netadr_t from ) {
int i, oldest, oldestTime;
- for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) {
+ for ( i = 0; i < MAX_SERVERSTATUSREQUESTS; i++ ) {
if ( NET_CompareAdr( from, cl_serverStatusList[i].address ) ) {
return &cl_serverStatusList[i];
}
}
- for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) {
+ for ( i = 0; i < MAX_SERVERSTATUSREQUESTS; i++ ) {
if ( cl_serverStatusList[i].retrieved ) {
return &cl_serverStatusList[i];
}
}
oldest = -1;
oldestTime = 0;
- for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) {
- if (oldest == -1 || cl_serverStatusList[i].startTime < oldestTime) {
+ for ( i = 0; i < MAX_SERVERSTATUSREQUESTS; i++ ) {
+ if ( oldest == -1 || cl_serverStatusList[i].startTime < oldestTime ) {
oldest = i;
oldestTime = cl_serverStatusList[i].startTime;
}
@@ -4591,7 +4554,7 @@ int CL_ServerStatus( char *serverAddress, char *serverStatusString, int maxLen )
// if no server address then reset all server status requests
if ( !serverAddress ) {
- for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) {
+ for ( i = 0; i < MAX_SERVERSTATUSREQUESTS; i++ ) {
cl_serverStatusList[i].address.port = 0;
cl_serverStatusList[i].retrieved = qtrue;
}
@@ -4609,10 +4572,10 @@ int CL_ServerStatus( char *serverAddress, char *serverStatusString, int maxLen )
}
// if this server status request has the same address
- if ( NET_CompareAdr( to, serverStatus->address) ) {
+ if ( NET_CompareAdr( to, serverStatus->address ) ) {
// if we received a response for this server status request
- if (!serverStatus->pending) {
- Q_strncpyz(serverStatusString, serverStatus->string, maxLen);
+ if ( !serverStatus->pending ) {
+ Q_strncpyz( serverStatusString, serverStatus->string, maxLen );
serverStatus->retrieved = qtrue;
serverStatus->startTime = 0;
return qtrue;
@@ -4650,82 +4613,85 @@ CL_ServerStatusResponse
void CL_ServerStatusResponse( netadr_t from, msg_t *msg ) {
char *s;
char info[MAX_INFO_STRING];
- int i, l, score, ping;
- int len;
+ int i, l, score, ping;
+ int len;
serverStatus_t *serverStatus;
serverStatus = NULL;
- for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) {
+ for ( i = 0; i < MAX_SERVERSTATUSREQUESTS; i++ ) {
if ( NET_CompareAdr( from, cl_serverStatusList[i].address ) ) {
serverStatus = &cl_serverStatusList[i];
break;
}
}
// if we didn't request this server status
- if (!serverStatus) {
+ if ( !serverStatus ) {
return;
}
s = MSG_ReadStringLine( msg );
len = 0;
- Com_sprintf(&serverStatus->string[len], sizeof(serverStatus->string)-len, "%s", s);
+ Com_sprintf( &serverStatus->string[len], sizeof( serverStatus->string ) - len, "%s", s );
- if (serverStatus->print) {
- Com_Printf("Server settings:\n");
+ if ( serverStatus->print ) {
+ Com_Printf( "Server settings:\n" );
// print cvars
- while (*s) {
- for (i = 0; i < 2 && *s; i++) {
- if (*s == '\\')
+ while ( *s ) {
+ for ( i = 0; i < 2 && *s; i++ ) {
+ if ( *s == '\\' ) {
s++;
+ }
l = 0;
- while (*s) {
+ while ( *s ) {
info[l++] = *s;
- if (l >= MAX_INFO_STRING-1)
+ if ( l >= MAX_INFO_STRING - 1 ) {
break;
+ }
s++;
- if (*s == '\\') {
+ if ( *s == '\\' ) {
break;
}
}
info[l] = '\0';
- if (i) {
- Com_Printf("%s\n", info);
- }
- else {
- Com_Printf("%-24s", info);
+ if ( i ) {
+ Com_Printf( "%s\n", info );
+ } else {
+ Com_Printf( "%-24s", info );
}
}
}
}
- len = strlen(serverStatus->string);
- Com_sprintf(&serverStatus->string[len], sizeof(serverStatus->string)-len, "\\");
+ len = strlen( serverStatus->string );
+ Com_sprintf( &serverStatus->string[len], sizeof( serverStatus->string ) - len, "\\" );
- if (serverStatus->print) {
- Com_Printf("\nPlayers:\n");
- Com_Printf("num: score: ping: name:\n");
+ if ( serverStatus->print ) {
+ Com_Printf( "\nPlayers:\n" );
+ Com_Printf( "num: score: ping: name:\n" );
}
- for (i = 0, s = MSG_ReadStringLine( msg ); *s; s = MSG_ReadStringLine( msg ), i++) {
+ for ( i = 0, s = MSG_ReadStringLine( msg ); *s; s = MSG_ReadStringLine( msg ), i++ ) {
- len = strlen(serverStatus->string);
- Com_sprintf(&serverStatus->string[len], sizeof(serverStatus->string)-len, "\\%s", s);
+ len = strlen( serverStatus->string );
+ Com_sprintf( &serverStatus->string[len], sizeof( serverStatus->string ) - len, "\\%s", s );
- if (serverStatus->print) {
+ if ( serverStatus->print ) {
score = ping = 0;
- sscanf(s, "%d %d", &score, &ping);
- s = strchr(s, ' ');
- if (s)
- s = strchr(s+1, ' ');
- if (s)
+ sscanf( s, "%d %d", &score, &ping );
+ s = strchr( s, ' ' );
+ if ( s ) {
+ s = strchr( s + 1, ' ' );
+ }
+ if ( s ) {
s++;
- else
+ } else {
s = "unknown";
- Com_Printf("%-2d %-3d %-3d %s\n", i, score, ping, s );
+ }
+ Com_Printf( "%-2d %-3d %-3d %s\n", i, score, ping, s );
}
}
- len = strlen(serverStatus->string);
- Com_sprintf(&serverStatus->string[len], sizeof(serverStatus->string)-len, "\\");
+ len = strlen( serverStatus->string );
+ Com_sprintf( &serverStatus->string[len], sizeof( serverStatus->string ) - len, "\\" );
serverStatus->time = Com_Milliseconds();
serverStatus->address = from;
@@ -4741,19 +4707,19 @@ CL_LocalServers_f
==================
*/
void CL_LocalServers_f( void ) {
- char *message;
- int i, j;
+ char *message;
+ int i, j;
netadr_t to;
- Com_Printf( "Scanning for servers on the local network...\n");
+ Com_Printf( "Scanning for servers on the local network...\n" );
// reset the list, waiting for response
cls.numlocalservers = 0;
cls.pingUpdateSource = AS_LOCAL;
- for (i = 0; i < MAX_OTHER_SERVERS; i++) {
+ for ( i = 0; i < MAX_OTHER_SERVERS; i++ ) {
qboolean b = cls.localServers[i].visible;
- Com_Memset(&cls.localServers[i], 0, sizeof(cls.localServers[i]));
+ Com_Memset( &cls.localServers[i], 0, sizeof( cls.localServers[i] ) );
cls.localServers[i].visible = b;
}
Com_Memset( &to, 0, sizeof( to ) );
@@ -4769,7 +4735,7 @@ void CL_LocalServers_f( void ) {
// we support multiple server ports so a single machine
// can nicely run multiple servers
for ( j = 0 ; j < NUM_SERVER_PORTS ; j++ ) {
- to.port = BigShort( (short)(PORT_SERVER + j) );
+ to.port = BigShort( (short)( PORT_SERVER + j ) );
to.type = NA_BROADCAST;
NET_SendPacket( NS_CLIENT, strlen( message ), message, to );
@@ -4788,11 +4754,11 @@ void CL_GlobalServers_f( void ) {
netadr_t to;
int count, i, masterNum;
char command[1024], *masteraddress;
-
+
if ((count = Cmd_Argc()) < 3 || (masterNum = atoi(Cmd_Argv(1))) < 0 || masterNum > MAX_MASTER_SERVERS - 1)
{
Com_Printf("usage: globalservers <master# 0-%d> <protocol> [keywords]\n", MAX_MASTER_SERVERS - 1);
- return;
+ return;
}
sprintf(command, "sv_master%d", masterNum + 1);
@@ -4812,7 +4778,7 @@ void CL_GlobalServers_f( void ) {
if(!i)
{
Com_Printf( "CL_GlobalServers_f: Error: could not resolve address of master %s\n", masteraddress);
- return;
+ return;
}
else if(i == 2)
to.port = BigShort(PORT_MASTER);
@@ -4859,11 +4825,10 @@ void CL_GlobalServers_f( void ) {
CL_GetPing
==================
*/
-void CL_GetPing( int n, char *buf, int buflen, int *pingtime )
-{
- const char *str;
- int time;
- int maxPing;
+void CL_GetPing( int n, char *buf, int buflen, int *pingtime ) {
+ const char *str;
+ int time;
+ int maxPing;
if (n < 0 || n >= MAX_PINGREQUESTS || !cl_pinglist[n].adr.port)
{
@@ -4877,22 +4842,20 @@ void CL_GetPing( int n, char *buf, int buflen, int *pingtime )
Q_strncpyz( buf, str, buflen );
time = cl_pinglist[n].time;
- if (!time)
- {
+ if ( !time ) {
// check for timeout
time = Sys_Milliseconds() - cl_pinglist[n].start;
maxPing = Cvar_VariableIntegerValue( "cl_maxPing" );
- if( maxPing < 100 ) {
+ if ( maxPing < 100 ) {
maxPing = 100;
}
- if (time < maxPing)
- {
+ if ( time < maxPing ) {
// not timed out yet
time = 0;
}
}
- CL_SetServerInfoByAddress(cl_pinglist[n].adr, cl_pinglist[n].info, cl_pinglist[n].time);
+ CL_SetServerInfoByAddress( cl_pinglist[n].adr, cl_pinglist[n].info, cl_pinglist[n].time );
*pingtime = time;
}
@@ -4902,13 +4865,12 @@ void CL_GetPing( int n, char *buf, int buflen, int *pingtime )
CL_GetPingInfo
==================
*/
-void CL_GetPingInfo( int n, char *buf, int buflen )
-{
- if (n < 0 || n >= MAX_PINGREQUESTS || !cl_pinglist[n].adr.port)
- {
+void CL_GetPingInfo( int n, char *buf, int buflen ) {
+ if ( n < 0 || n >= MAX_PINGREQUESTS || !cl_pinglist[n].adr.port ) {
// empty or invalid slot
- if (buflen)
+ if ( buflen ) {
buf[0] = '\0';
+ }
return;
}
@@ -4920,10 +4882,10 @@ void CL_GetPingInfo( int n, char *buf, int buflen )
CL_ClearPing
==================
*/
-void CL_ClearPing( int n )
-{
- if (n < 0 || n >= MAX_PINGREQUESTS)
+void CL_ClearPing( int n ) {
+ if ( n < 0 || n >= MAX_PINGREQUESTS ) {
return;
+ }
cl_pinglist[n].adr.port = 0;
}
@@ -4933,22 +4895,21 @@ void CL_ClearPing( int n )
CL_GetPingQueueCount
==================
*/
-int CL_GetPingQueueCount( void )
-{
- int i;
- int count;
+int CL_GetPingQueueCount( void ) {
+ int i;
+ int count;
ping_t* pingptr;
count = 0;
pingptr = cl_pinglist;
- for (i=0; i<MAX_PINGREQUESTS; i++, pingptr++ ) {
- if (pingptr->adr.port) {
+ for ( i = 0; i < MAX_PINGREQUESTS; i++, pingptr++ ) {
+ if ( pingptr->adr.port ) {
count++;
}
}
- return (count);
+ return ( count );
}
/*
@@ -4956,30 +4917,25 @@ int CL_GetPingQueueCount( void )
CL_GetFreePing
==================
*/
-ping_t* CL_GetFreePing( void )
-{
+ping_t* CL_GetFreePing( void ) {
ping_t* pingptr;
- ping_t* best;
- int oldest;
- int i;
- int time;
+ ping_t* best;
+ int oldest;
+ int i;
+ int time;
pingptr = cl_pinglist;
- for (i=0; i<MAX_PINGREQUESTS; i++, pingptr++ )
+ for ( i = 0; i < MAX_PINGREQUESTS; i++, pingptr++ )
{
// find free ping slot
- if (pingptr->adr.port)
- {
- if (!pingptr->time)
- {
+ if ( pingptr->adr.port ) {
+ if ( !pingptr->time ) {
if (Sys_Milliseconds() - pingptr->start < 500)
{
// still waiting for response
continue;
}
- }
- else if (pingptr->time < 500)
- {
+ } else if ( pingptr->time < 500 ) {
// results have not been queried
continue;
}
@@ -4987,25 +4943,24 @@ ping_t* CL_GetFreePing( void )
// clear it
pingptr->adr.port = 0;
- return (pingptr);
+ return ( pingptr );
}
// use oldest entry
pingptr = cl_pinglist;
best = cl_pinglist;
oldest = INT_MIN;
- for (i=0; i<MAX_PINGREQUESTS; i++, pingptr++ )
+ for ( i = 0; i < MAX_PINGREQUESTS; i++, pingptr++ )
{
// scan for oldest
time = Sys_Milliseconds() - pingptr->start;
- if (time > oldest)
- {
+ if ( time > oldest ) {
oldest = time;
best = pingptr;
}
}
- return (best);
+ return ( best );
}
/*
@@ -5015,8 +4970,8 @@ CL_Ping_f
*/
void CL_Ping_f( void ) {
netadr_t to;
- ping_t* pingptr;
- char* server;
+ ping_t* pingptr;
+ char* server;
int argc;
netadrtype_t family = NA_UNSPEC;
@@ -5024,9 +4979,9 @@ void CL_Ping_f( void ) {
if ( argc != 2 && argc != 3 ) {
Com_Printf( "usage: ping [-4|-6] server\n");
- return;
+ return;
}
-
+
if(argc == 2)
server = Cmd_Argv(1);
else
@@ -5041,7 +4996,7 @@ void CL_Ping_f( void ) {
server = Cmd_Argv(2);
}
- Com_Memset( &to, 0, sizeof(netadr_t) );
+ Com_Memset( &to, 0, sizeof( netadr_t ) );
if ( !NET_StringToAdr( server, &to, family ) ) {
return;
@@ -5049,12 +5004,12 @@ void CL_Ping_f( void ) {
pingptr = CL_GetFreePing();
- memcpy( &pingptr->adr, &to, sizeof (netadr_t) );
+ memcpy( &pingptr->adr, &to, sizeof( netadr_t ) );
pingptr->start = Sys_Milliseconds();
pingptr->time = 0;
- CL_SetServerInfoByAddress(pingptr->adr, NULL, 0);
-
+ CL_SetServerInfoByAddress( pingptr->adr, NULL, 0 );
+
NET_OutOfBandPrint( NS_CLIENT, to, "getinfo xxx" );
}
@@ -5063,64 +5018,64 @@ void CL_Ping_f( void ) {
CL_UpdateVisiblePings_f
==================
*/
-qboolean CL_UpdateVisiblePings_f(int source) {
- int slots, i;
- char buff[MAX_STRING_CHARS];
- int pingTime;
- int max;
+qboolean CL_UpdateVisiblePings_f( int source ) {
+ int slots, i;
+ char buff[MAX_STRING_CHARS];
+ int pingTime;
+ int max;
qboolean status = qfalse;
- if (source < 0 || source > AS_FAVORITES) {
+ if ( source < 0 || source > AS_FAVORITES ) {
return qfalse;
}
cls.pingUpdateSource = source;
slots = CL_GetPingQueueCount();
- if (slots < MAX_PINGREQUESTS) {
+ if ( slots < MAX_PINGREQUESTS ) {
serverInfo_t *server = NULL;
- switch (source) {
- case AS_LOCAL :
- server = &cls.localServers[0];
- max = cls.numlocalservers;
+ switch ( source ) {
+ case AS_LOCAL:
+ server = &cls.localServers[0];
+ max = cls.numlocalservers;
break;
- case AS_GLOBAL :
- server = &cls.globalServers[0];
- max = cls.numglobalservers;
+ case AS_GLOBAL:
+ server = &cls.globalServers[0];
+ max = cls.numglobalservers;
break;
- case AS_FAVORITES :
- server = &cls.favoriteServers[0];
- max = cls.numfavoriteservers;
+ case AS_FAVORITES:
+ server = &cls.favoriteServers[0];
+ max = cls.numfavoriteservers;
break;
default:
return qfalse;
}
- for (i = 0; i < max; i++) {
- if (server[i].visible) {
- if (server[i].ping == -1) {
+ for ( i = 0; i < max; i++ ) {
+ if ( server[i].visible ) {
+ if ( server[i].ping == -1 ) {
int j;
- if (slots >= MAX_PINGREQUESTS) {
+ if ( slots >= MAX_PINGREQUESTS ) {
break;
}
- for (j = 0; j < MAX_PINGREQUESTS; j++) {
- if (!cl_pinglist[j].adr.port) {
+ for ( j = 0; j < MAX_PINGREQUESTS; j++ ) {
+ if ( !cl_pinglist[j].adr.port ) {
continue;
}
- if (NET_CompareAdr( cl_pinglist[j].adr, server[i].adr)) {
+ if ( NET_CompareAdr( cl_pinglist[j].adr, server[i].adr ) ) {
// already on the list
break;
}
}
- if (j >= MAX_PINGREQUESTS) {
+ if ( j >= MAX_PINGREQUESTS ) {
status = qtrue;
- for (j = 0; j < MAX_PINGREQUESTS; j++) {
- if (!cl_pinglist[j].adr.port) {
+ for ( j = 0; j < MAX_PINGREQUESTS; j++ ) {
+ if ( !cl_pinglist[j].adr.port ) {
break;
}
}
- memcpy(&cl_pinglist[j].adr, &server[i].adr, sizeof(netadr_t));
+ memcpy( &cl_pinglist[j].adr, &server[i].adr, sizeof( netadr_t ) );
cl_pinglist[j].start = Sys_Milliseconds();
cl_pinglist[j].time = 0;
NET_OutOfBandPrint( NS_CLIENT, cl_pinglist[j].adr, "getinfo xxx" );
@@ -5129,32 +5084,32 @@ qboolean CL_UpdateVisiblePings_f(int source) {
}
// if the server has a ping higher than cl_maxPing or
// the ping packet got lost
- else if (server[i].ping == 0) {
+ else if ( server[i].ping == 0 ) {
// if we are updating global servers
- if (source == AS_GLOBAL) {
+ if ( source == AS_GLOBAL ) {
//
if ( cls.numGlobalServerAddresses > 0 ) {
// overwrite this server with one from the additional global servers
cls.numGlobalServerAddresses--;
- CL_InitServerInfo(&server[i], &cls.globalServerAddresses[cls.numGlobalServerAddresses]);
+ CL_InitServerInfo( &server[i], &cls.globalServerAddresses[cls.numGlobalServerAddresses] );
// NOTE: the server[i].visible flag stays untouched
}
}
}
}
}
- }
+ }
- if (slots) {
+ if ( slots ) {
status = qtrue;
}
- for (i = 0; i < MAX_PINGREQUESTS; i++) {
- if (!cl_pinglist[i].adr.port) {
+ for ( i = 0; i < MAX_PINGREQUESTS; i++ ) {
+ if ( !cl_pinglist[i].adr.port ) {
continue;
}
CL_GetPing( i, buff, MAX_STRING_CHARS, &pingTime );
- if (pingTime != 0) {
- CL_ClearPing(i);
+ if ( pingTime != 0 ) {
+ CL_ClearPing( i );
status = qtrue;
}
}
@@ -5180,9 +5135,9 @@ void CL_UpdateServerInfo( int n ) {
CL_ServerStatus_f
==================
*/
-void CL_ServerStatus_f(void) {
+void CL_ServerStatus_f( void ) {
netadr_t to, *toptr = NULL;
- char *server;
+ char *server;
serverStatus_t *serverStatus;
int argc;
netadrtype_t family = NA_UNSPEC;
@@ -5193,14 +5148,14 @@ void CL_ServerStatus_f(void) {
{
if (clc.state != CA_ACTIVE || clc.demoplaying)
{
- Com_Printf ("Not connected to a server.\n");
+ Com_Printf( "Not connected to a server.\n" );
Com_Printf( "usage: serverstatus [-4|-6] server\n");
return;
}
toptr = &clc.serverAddress;
}
-
+
if(!toptr)
{
Com_Memset( &to, 0, sizeof(netadr_t) );
@@ -5365,8 +5320,6 @@ qboolean CL_GetLimboString( int index, char *buf ) {
}
// -NERVE - SMF
-
-
// NERVE - SMF - Localization code
#define FILE_HASH_SIZE 1024
#define MAX_VA_STRING 32000
diff --git a/MP/code/client/cl_net_chan.c b/MP/code/client/cl_net_chan.c
index 54292a8..54585e8 100644
--- a/MP/code/client/cl_net_chan.c
+++ b/MP/code/client/cl_net_chan.c
@@ -158,6 +158,7 @@ CL_Netchan_Transmit
*/
void CL_Netchan_Transmit( netchan_t *chan, msg_t* msg ) {
MSG_WriteByte( msg, clc_EOF );
+
#ifdef LEGACY_PROTOCOL
if(chan->compat)
CL_Netchan_Encode(msg);
diff --git a/MP/code/client/cl_parse.c b/MP/code/client/cl_parse.c
index dadbaea..9b40999 100644
--- a/MP/code/client/cl_parse.c
+++ b/MP/code/client/cl_parse.c
@@ -473,17 +473,13 @@ gamestate, and possibly during gameplay.
==================
*/
void CL_SystemInfoChanged( void ) {
- char *systemInfo;
- const char *s, *t;
- char key[BIG_INFO_KEY];
- char value[BIG_INFO_VALUE];
- qboolean gameSet;
+ char *systemInfo;
+ const char *s, *t;
+ char key[BIG_INFO_KEY];
+ char value[BIG_INFO_VALUE];
+ qboolean gameSet;
systemInfo = cl.gameState.stringData + cl.gameState.stringOffsets[ CS_SYSTEMINFO ];
- // NOTE TTimo:
- // when the serverId changes, any further messages we send to the server will use this new serverId
- // show_bug.cgi?id=475
- // in some cases, outdated cp commands might get sent with this news serverId
cl.serverId = atoi( Info_ValueForKey( systemInfo, "sv_serverid" ) );
memset( &entLastVisible, 0, sizeof( entLastVisible ) );
@@ -540,9 +536,9 @@ void CL_SystemInfoChanged( void ) {
continue;
}
- gameSet = qtrue;
- }
-
+ gameSet = qtrue;
+ }
+
if((cvar_flags = Cvar_Flags(key)) == CVAR_NONEXISTENT)
Cvar_Get(key, value, CVAR_SERVER_CREATED | CVAR_ROM);
else
@@ -678,10 +674,6 @@ void CL_ParseGamestate( msg_t *msg ) {
}
FS_ConditionalRestart(clc.checksumFeed, qfalse);
- // don't set to true because we yet have to start downloading
- // enabling this can cause double loading of a map when connecting to
- // a server which has a different game directory set
- //clc.downloadRestart = qtrue;
// This used to call CL_StartHunkUsers, but now we enter the download state before loading the
// cgame
@@ -715,7 +707,7 @@ void CL_ParseDownload( msg_t *msg ) {
// read the data
block = MSG_ReadShort( msg );
- if(!block && !clc.downloadBlock) {
+ if( !block && !clc.downloadBlock ) {
// block zero is special, contains file size
clc.downloadSize = MSG_ReadLong( msg );
@@ -729,13 +721,13 @@ void CL_ParseDownload( msg_t *msg ) {
size = MSG_ReadShort( msg );
if ( size < 0 || size > sizeof( data ) ) {
- Com_Error( ERR_DROP, "CL_ParseDownload: Invalid size %d for download chunk.", size );
+ Com_Error( ERR_DROP, "CL_ParseDownload: Invalid size %d for download chunk", size );
return;
}
MSG_ReadData( msg, data, size );
- if((clc.downloadBlock & 0xFFFF) != block) {
+ if( ( clc.downloadBlock & 0xFFFF ) != block ) {
Com_DPrintf( "CL_ParseDownload: Expected block %d, got %d\n", (clc.downloadBlock & 0xFFFF), block);
return;
}
diff --git a/MP/code/client/cl_scrn.c b/MP/code/client/cl_scrn.c
index 5f62c73..e5b1008 100644
--- a/MP/code/client/cl_scrn.c
+++ b/MP/code/client/cl_scrn.c
@@ -216,7 +216,7 @@ void SCR_DrawStringExt( int x, int y, float size, const char *string, float *set
s = string;
xx = x;
while ( *s ) {
- if ( Q_IsColorString( s ) && !noColorEscape ) {
+ if ( !noColorEscape && Q_IsColorString( s ) ) {
s += 2;
continue;
}
@@ -237,8 +237,6 @@ void SCR_DrawStringExt( int x, int y, float size, const char *string, float *set
color[3] = setColor[3];
re.SetColor( color );
}
- s += 2;
- continue;
if ( !noColorEscape ) {
s += 2;
continue;
@@ -435,7 +433,7 @@ static float values[1024];
SCR_DebugGraph
==============
*/
-void SCR_DebugGraph (float value) {
+void SCR_DebugGraph( float value ) {
values[current] = value;
current = (current + 1) % ARRAY_LEN(values);
}
diff --git a/MP/code/client/cl_ui.c b/MP/code/client/cl_ui.c
index 94e7984..bb8ee82 100644
--- a/MP/code/client/cl_ui.c
+++ b/MP/code/client/cl_ui.c
@@ -57,19 +57,22 @@ LAN_LoadCachedServers
void LAN_LoadCachedServers( void ) {
int size;
fileHandle_t fileIn;
+
cls.numglobalservers = cls.numfavoriteservers = 0;
cls.numGlobalServerAddresses = 0;
+
if ( FS_SV_FOpenFileRead( "servercache.dat", &fileIn ) ) {
FS_Read( &cls.numglobalservers, sizeof( int ), fileIn );
FS_Read( &cls.numfavoriteservers, sizeof( int ), fileIn );
FS_Read( &size, sizeof( int ), fileIn );
- if (size == sizeof(cls.globalServers) + sizeof(cls.favoriteServers)) {
+ if ( size == sizeof( cls.globalServers ) + sizeof( cls.favoriteServers ) ) {
FS_Read( &cls.globalServers, sizeof( cls.globalServers ), fileIn );
FS_Read( &cls.favoriteServers, sizeof( cls.favoriteServers ), fileIn );
} else {
cls.numglobalservers = cls.numfavoriteservers = 0;
cls.numGlobalServerAddresses = 0;
}
+
FS_FCloseFile( fileIn );
}
}
@@ -1157,10 +1160,6 @@ void CL_InitUI( void ) {
// sanity check
v = VM_Call( uivm, UI_GETAPIVERSION );
if ( v != UI_API_VERSION ) {
- // Free uivm now, so UI_SHUTDOWN doesn't get called later.
-// VM_Free( uivm );
-// uivm = NULL;
-
Com_Error( ERR_FATAL, "User Interface is version %d, expected %d", v, UI_API_VERSION );
cls.uiStarted = qfalse;
}
diff --git a/MP/code/client/client.h b/MP/code/client/client.h
index f91336e..a824c23 100644
--- a/MP/code/client/client.h
+++ b/MP/code/client/client.h
@@ -57,8 +57,8 @@ If you have questions concerning this license or the applicable additional terms
#define RETRANSMIT_TIMEOUT 3000 // time between connection packet retransmits
-#define LIMBOCHAT_WIDTH 140 // NERVE - SMF - NOTE TTimo buffer size indicator, not related to screen bbox
-#define LIMBOCHAT_HEIGHT 7 // NERVE - SMF
+#define LIMBOCHAT_WIDTH 140 // NERVE - SMF
+#define LIMBOCHAT_HEIGHT 7 // NERVE - SMF
// snapshots are a view of the server at a given time
typedef struct {
@@ -163,8 +163,6 @@ typedef struct {
entityState_t parseEntities[MAX_PARSE_ENTITIES];
// NERVE - SMF
- // NOTE TTimo - UI uses LIMBOCHAT_WIDTH strings (140),
- // but for the processing in CL_AddToLimboChat we need some safe room
char limboChatMsgs[LIMBOCHAT_HEIGHT][LIMBOCHAT_WIDTH * 3 + 1];
int limboChatPos;
@@ -211,7 +209,6 @@ typedef struct {
// these are our reliable messages that go to the server
int reliableSequence;
int reliableAcknowledge; // the last one the server has executed
- // TTimo - NOTE: incidentally, reliableCommands[0] is never used (always start at reliableAcknowledge+1)
char reliableCommands[MAX_RELIABLE_COMMANDS][MAX_TOKEN_CHARS];
// server message (unreliable) and command (reliable) sequence
@@ -396,7 +393,7 @@ typedef struct {
qhandle_t charSetShader;
qhandle_t whiteShader;
qhandle_t consoleShader;
- qhandle_t consoleShader2; // NERVE - SMF - merged from WolfSP
+ qhandle_t consoleShader2; //----(SA) added
} clientStatic_t;
extern clientStatic_t cls;
@@ -616,7 +613,7 @@ typedef enum {
void CL_ClearKeys( void );
void CL_InitInput( void );
-void CL_ShutdownInput(void);
+void CL_ShutdownInput( void );
void CL_SendCmd( void );
void CL_ClearState( void );
void CL_ReadPackets( void );
@@ -668,7 +665,7 @@ void Con_DrawCharacter( int cx, int line, int num );
void Con_CheckResize( void );
void Con_Init( void );
-void Con_Shutdown(void);
+void Con_Shutdown( void );
void Con_Clear_f( void );
void Con_ToggleConsole_f( void );
void Con_DrawNotify( void );
diff --git a/MP/code/client/keycodes.h b/MP/code/client/keycodes.h
index bde0eeb..6a74fe5 100644
--- a/MP/code/client/keycodes.h
+++ b/MP/code/client/keycodes.h
@@ -26,7 +26,7 @@ If you have questions concerning this license or the applicable additional terms
===========================================================================
*/
-# ifndef __KEYCODES_H__
+#ifndef __KEYCODES_H__
#define __KEYCODES_H__
//
diff --git a/MP/code/client/snd_dma.c b/MP/code/client/snd_dma.c
index 93d20f7..54a15ea 100644
--- a/MP/code/client/snd_dma.c
+++ b/MP/code/client/snd_dma.c
@@ -104,11 +104,11 @@ cvar_t *s_mute; // (SA) for DM so he can 'toggle' sound on/off witho
cvar_t *s_wavonly;
static loopSound_t loopSounds[MAX_GENTITIES];
-
static channel_t *freelist = NULL;
-int s_rawend[MAX_RAW_STREAMS];
-portable_samplepair_t s_rawsamples[MAX_RAW_STREAMS][MAX_RAW_SAMPLES];
+int s_rawend[MAX_RAW_STREAMS];
+int s_rawpainted[MAX_RAW_STREAMS];
+portable_samplepair_t s_rawsamples[MAX_RAW_STREAMS][MAX_RAW_SAMPLES];
// ====================================================================
@@ -1557,8 +1557,6 @@ void S_Update_(void) {
if (endtime - s_soundtime > samps)
endtime = s_soundtime + samps;
-
-
SNDDMA_BeginPainting ();
S_PaintChannels (endtime);
diff --git a/MP/code/client/snd_mix.c b/MP/code/client/snd_mix.c
index 4418d22..c546030 100644
--- a/MP/code/client/snd_mix.c
+++ b/MP/code/client/snd_mix.c
@@ -729,7 +729,7 @@ void S_PaintChannels( int endtime ) {
count = sc->soundLength - sampleOffset;
}
- if ( count > 0 ) {
+ if ( count > 0 ) {
if( sc->soundCompressionMethod == 1) {
S_PaintChannelFromADPCM (ch, sc, count, sampleOffset, ltime - s_paintedtime);
} else if( sc->soundCompressionMethod == 2) {
@@ -766,7 +766,7 @@ void S_PaintChannels( int endtime ) {
count = sc->soundLength - sampleOffset;
}
- if ( count > 0 ) {
+ if ( count > 0 ) {
if( sc->soundCompressionMethod == 1) {
S_PaintChannelFromADPCM (ch, sc, count, sampleOffset, ltime - s_paintedtime);
} else if( sc->soundCompressionMethod == 2) {
diff --git a/MP/code/client/snd_openal.c b/MP/code/client/snd_openal.c
index 900dc5e..cbbb8ea 100644
--- a/MP/code/client/snd_openal.c
+++ b/MP/code/client/snd_openal.c
@@ -1389,7 +1389,7 @@ static void S_AL_SrcLoop( alSrcPriority_t priority, sfxHandle_t sfx,
src_t *curSource;
vec3_t sorigin, svelocity;
- if ( entityNum < 0 || entityNum >= MAX_GENTITIES )
+ if( entityNum < 0 || entityNum >= MAX_GENTITIES )
return;
if(S_AL_CheckInput(entityNum, sfx))
@@ -2627,11 +2627,11 @@ qboolean S_AL_Init( soundInterface_t *si )
if( !QAL_Init( s_alDriver->string ) )
{
#if defined( _WIN32 )
- if( !Q_stricmp( s_alDriver->string, ALDRIVER_DEFAULT ) && !QAL_Init( "OpenAL64.dll" ) ) {
+ if( !Q_stricmp( s_alDriver->string, ALDRIVER_DEFAULT ) && !QAL_Init( "OpenAL64.dll" ) ) {
#elif defined ( __APPLE__ )
- if( !Q_stricmp( s_alDriver->string, ALDRIVER_DEFAULT ) && !QAL_Init( "/System/Library/Frameworks/OpenAL.framework/OpenAL" ) ) {
+ if( !Q_stricmp( s_alDriver->string, ALDRIVER_DEFAULT ) && !QAL_Init( "/System/Library/Frameworks/OpenAL.framework/OpenAL" ) ) {
#else
- if( !Q_stricmp( s_alDriver->string, ALDRIVER_DEFAULT ) || !QAL_Init( ALDRIVER_DEFAULT ) ) {
+ if( !Q_stricmp( s_alDriver->string, ALDRIVER_DEFAULT ) || !QAL_Init( ALDRIVER_DEFAULT ) ) {
#endif
return qfalse;
}
diff --git a/SP/code/botlib/be_ai_move.c b/SP/code/botlib/be_ai_move.c
index 72cc7c8..0af4e2d 100644
--- a/SP/code/botlib/be_ai_move.c
+++ b/SP/code/botlib/be_ai_move.c
@@ -3125,7 +3125,7 @@ void BotMoveToGoal( bot_moveresult_t *result, int movestate, bot_goal_t *goal, i
return;
}
//reset the grapple before testing if the bot has a valid goal
- //because the bot could loose all its goals when stuck to a wall
+ //because the bot could lose all its goals when stuck to a wall
BotResetGrapple( ms );
//
if ( !goal ) {
diff --git a/SP/code/client/cl_cgame.c b/SP/code/client/cl_cgame.c
index f9db9b5..6fb99f7 100644
--- a/SP/code/client/cl_cgame.c
+++ b/SP/code/client/cl_cgame.c
@@ -301,7 +301,7 @@ rescan:
cmd = Cmd_Argv( 0 );
if ( !strcmp( cmd, "disconnect" ) ) {
- Com_Error( ERR_SERVERDISCONNECT,"Server disconnected\n" );
+ Com_Error( ERR_SERVERDISCONNECT,"Server disconnected" );
}
if ( !strcmp( cmd, "bcs0" ) ) {
@@ -527,12 +527,6 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
return 0;
case CG_S_CLEARLOOPINGSOUNDS:
S_ClearLoopingSounds( args[1] ); // (SA) modified so no_pvs sounds can function
- // RF, if killall, then stop all sounds
-// if ( args[1] == 1 ) {
-// S_ClearSounds( qtrue, qfalse );
-// } else if ( args[1] == 2 ) {
-// S_ClearSounds( qtrue, qtrue );
-// }
return 0;
case CG_S_ADDLOOPINGSOUND:
// FIXME MrE: handling of looping sounds changed
@@ -767,6 +761,7 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
case CG_LOADCAMERA:
return loadCamera( args[1], VMA( 2 ) );
+
case CG_STARTCAMERA:
if ( args[1] == 0 ) { // CAM_PRIMARY
cl.cameraMode = qtrue; //----(SA) added
@@ -785,6 +780,7 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
case CG_GETCAMERAINFO:
return getCameraInfo( args[1], args[2], VMA( 3 ), VMA( 4 ), VMA( 5 ) );
+
case CG_GET_ENTITY_TOKEN:
return re.GetEntityToken( VMA( 1 ), args[2] );
@@ -1137,6 +1133,7 @@ void CL_FirstSnapshot( void ) {
Cbuf_AddText( cl_activeAction->string );
Cvar_Set( "activeAction", "" );
}
+
#ifdef USE_MUMBLE
if ((cl_useMumble->integer) && !mumble_islinked()) {
int ret = mumble_link(CLIENT_WINDOW_TITLE);
diff --git a/SP/code/client/cl_cin.c b/SP/code/client/cl_cin.c
index 2c8b6a8..3f73bd7 100644
--- a/SP/code/client/cl_cin.c
+++ b/SP/code/client/cl_cin.c
@@ -55,7 +55,6 @@ If you have questions concerning this license or the applicable additional terms
#define LETTERBOX_OFFSET 105
-
#define ROQ_QUAD 0x1000
#define ROQ_QUAD_INFO 0x1001
#define ROQ_CODEBOOK 0x1002
@@ -71,6 +70,7 @@ If you have questions concerning this license or the applicable additional terms
extern int s_soundtime;
#define CIN_STREAM 0 //DAJ const for the sound stream used for cinematics
+
static void RoQ_init( void );
/******************************************************************************
@@ -97,7 +97,7 @@ typedef struct {
byte file[65536];
short sqrTable[256];
- int mcomp[256];
+ int mcomp[256];
byte *qStatus[2][32768];
long oldXOff, oldYOff, oldysize, oldxsize;
@@ -1143,7 +1143,7 @@ static void RoQInterrupt( void ) {
if ( currentHandle < 0 ) {
return;
}
-//resound:
+
FS_Read( cin.file, cinTable[currentHandle].RoQFrameSize+8, cinTable[currentHandle].iFile );
if ( cinTable[currentHandle].RoQPlayed >= cinTable[currentHandle].ROQSize ) {
if ( cinTable[currentHandle].holdAtEnd == qfalse ) {
@@ -1157,6 +1157,7 @@ static void RoQInterrupt( void ) {
}
return;
}
+
framedata = cin.file;
//
// new frame is ready
@@ -1200,7 +1201,6 @@ redump:
s_rawend[CIN_STREAM] = s_soundtime; //DAJ added [CIN_STREAM]
}
ssize = RllDecodeStereoToStereo( framedata, sbuf, cinTable[currentHandle].RoQFrameSize, 0, (unsigned short)cinTable[currentHandle].roq_flags );
-// Com_Printf("%i\n", ssize+s_rawend[CIN_STREAM]- s_soundtime );
S_RawSamples(0, ssize, 22050, 2, 2, (byte *)sbuf, 1.0f, -1);
cinTable[currentHandle].sound = 1;
}
@@ -1262,12 +1262,6 @@ redump:
if ( cinTable[currentHandle].inMemory && ( cinTable[currentHandle].status != FMV_EOF ) ) {
cinTable[currentHandle].inMemory--; framedata += 8; goto redump;
}
-
-// if (cinTable[currentHandle].roq_id == ZA_SOUND_STEREO) {
-// / cinTable[currentHandle].RoQPlayed += cinTable[currentHandle].RoQFrameSize+8;
-// goto resound;
-// }
-
//
// one more frame hits the dust
//
@@ -1425,14 +1419,11 @@ e_status CIN_RunCinematic( int handle ) {
if ( cinTable[currentHandle].shader && ( thisTime - cinTable[currentHandle].lastTime ) > 100 ) {
cinTable[currentHandle].startTime += thisTime - cinTable[currentHandle].lastTime;
}
-
//----(SA) modified to use specified fps for roq's
-
cinTable[currentHandle].tfps = ( ( ( CL_ScaledMilliseconds() - cinTable[currentHandle].startTime ) * cinTable[currentHandle].roqFPS ) / 1000 );
start = cinTable[currentHandle].startTime;
- while ( ( cinTable[currentHandle].tfps != cinTable[currentHandle].numQuads )
- && cinTable[currentHandle].status == FMV_PLAY )
+ while ( ( cinTable[currentHandle].tfps != cinTable[currentHandle].numQuads ) && ( cinTable[currentHandle].status == FMV_PLAY ) )
{
RoQInterrupt();
if ( start != cinTable[currentHandle].startTime ) {
@@ -1484,10 +1475,6 @@ int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBi
char name[MAX_OSPATH];
int i;
-
- // TODO: Laird says don't play cine's in widescreen mode
-
-
if ( strstr( arg, "/" ) == NULL && strstr( arg, "\\" ) == NULL ) {
Com_sprintf( name, sizeof( name ), "video/%s", arg );
} else {
@@ -1658,8 +1645,8 @@ CIN_DrawCinematic
==================
*/
void CIN_DrawCinematic( int handle ) {
- float x, y, w, h; //, barheight;
- byte *buf; \
+ float x, y, w, h;
+ byte *buf;
if ( handle < 0 || handle >= MAX_VIDEO_HANDLES || cinTable[handle].status == FMV_EOF ) {
return;
@@ -1737,8 +1724,6 @@ void CL_PlayCinematic_f( void ) {
}
S_StopAllSounds();
- // make sure volume is up for cine
-// S_FadeAllSounds( 1, 0 );
if ( bits & CIN_letterBox ) {
CL_handle = CIN_PlayCinematic( arg, 0, LETTERBOX_OFFSET, SCREEN_WIDTH, SCREEN_HEIGHT - ( LETTERBOX_OFFSET * 2 ), bits );
@@ -1817,4 +1802,3 @@ void CIN_UploadCinematic( int handle ) {
}
}
}
-
diff --git a/SP/code/client/cl_console.c b/SP/code/client/cl_console.c
index ebcb9d7..081fe5a 100644
--- a/SP/code/client/cl_console.c
+++ b/SP/code/client/cl_console.c
@@ -33,7 +33,6 @@ If you have questions concerning this license or the applicable additional terms
int g_console_field_width = 78;
-
#define COLNSOLE_COLOR COLOR_WHITE //COLOR_BLACK
#define NUM_CON_TIMES 4
@@ -109,7 +108,6 @@ Con_MessageMode_f
void Con_MessageMode_f( void ) {
chat_playerNum = -1;
chat_team = qfalse;
-// chat_limbo = qfalse; // NERVE - SMF
Field_Clear( &chatField );
chatField.widthInChars = 30;
@@ -124,7 +122,6 @@ Con_MessageMode2_f
void Con_MessageMode2_f( void ) {
chat_playerNum = -1;
chat_team = qtrue;
-// chat_limbo = qfalse; // NERVE - SMF
Field_Clear( &chatField );
chatField.widthInChars = 25;
Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE );
@@ -142,7 +139,6 @@ void Con_MessageMode3_f( void ) {
return;
}
chat_team = qfalse;
-// chat_limbo = qfalse; // NERVE - SMF
Field_Clear( &chatField );
chatField.widthInChars = 30;
Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE );
@@ -160,7 +156,6 @@ void Con_MessageMode4_f( void ) {
return;
}
chat_team = qfalse;
-// chat_limbo = qfalse; // NERVE - SMF
Field_Clear( &chatField );
chatField.widthInChars = 30;
Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE );
@@ -173,13 +168,7 @@ Con_StartLimboMode_f
================
*/
void Con_StartLimboMode_f( void ) {
-// chat_playerNum = -1;
-// chat_team = qfalse;
- chat_limbo = qtrue; // NERVE - SMF
-// Field_Clear( &chatField );
-// chatField.widthInChars = 30;
-
-// cls.keyCatchers ^= KEYCATCH_MESSAGE;
+ chat_limbo = qtrue;
}
/*
@@ -188,13 +177,7 @@ Con_StopLimboMode_f
================
*/
void Con_StopLimboMode_f( void ) {
-// chat_playerNum = -1;
-// chat_team = qfalse;
- chat_limbo = qfalse; // NERVE - SMF
-// Field_Clear( &chatField );
-// chatField.widthInChars = 30;
-
-// cls.keyCatchers &= ~KEYCATCH_MESSAGE;
+ chat_limbo = qfalse;
}
// -NERVE - SMF
@@ -213,7 +196,6 @@ void Con_Clear_f( void ) {
Con_Bottom(); // go to end
}
-
/*
================
Con_Dump_f
@@ -318,7 +300,7 @@ If the line width has changed, reformat the buffer.
*/
void Con_CheckResize( void ) {
int i, j, width, oldwidth, oldtotallines, numlines, numchars;
- short tbuf[CON_TEXTSIZE];
+ short tbuf[CON_TEXTSIZE];
width = ( SCREEN_WIDTH / SMALLCHAR_WIDTH ) - 2;
@@ -469,7 +451,7 @@ If no console is visible, the text will appear at the top of the game window
================
*/
void CL_ConsolePrint( char *txt ) {
- int y, l;
+ int y, l;
unsigned char c;
unsigned short color;
@@ -531,15 +513,12 @@ void CL_ConsolePrint( char *txt ) {
}
}
-
// mark time for transparent overlay
-
if ( con.current >= 0 ) {
con.times[con.current % NUM_CON_TIMES] = cls.realtime;
}
}
-
/*
==============================================================================
@@ -643,8 +622,7 @@ void Con_DrawNotify( void ) {
skip = 5;
}
- Field_BigDraw( &chatField, skip * BIGCHAR_WIDTH, v,
- SCREEN_WIDTH - ( skip + 1 ) * BIGCHAR_WIDTH, qtrue, qtrue );
+ Field_BigDraw( &chatField, skip * BIGCHAR_WIDTH, v, SCREEN_WIDTH - ( skip + 1 ) * BIGCHAR_WIDTH, qtrue, qtrue );
}
@@ -664,7 +642,6 @@ void Con_DrawSolidConsole( float frac ) {
short *text;
int row;
int lines;
-// qhandle_t conShader;
int currentColor;
vec4_t color;
@@ -688,7 +665,7 @@ void Con_DrawSolidConsole( float frac ) {
} else {
SCR_DrawPic( 0, 0, SCREEN_WIDTH, y, cls.consoleShader );
- if ( frac >= 0.5f ) { // only draw when the console is down all the way (for now)
+ if ( frac >= 0.5f ) {
color[0] = color[1] = color[2] = frac * 2.0f;
color[3] = 1.0f;
re.SetColor( color );
@@ -712,10 +689,7 @@ void Con_DrawSolidConsole( float frac ) {
i = strlen( Q3_VERSION );
for ( x = 0 ; x < i ; x++ ) {
-
- SCR_DrawSmallChar( cls.glconfig.vidWidth - ( i - x + 1 ) * SMALLCHAR_WIDTH,
- lines - SMALLCHAR_HEIGHT, Q3_VERSION[x] );
-
+ SCR_DrawSmallChar( cls.glconfig.vidWidth - ( i - x + 1 ) * SMALLCHAR_WIDTH, lines - SMALLCHAR_HEIGHT, Q3_VERSION[x] );
}
diff --git a/SP/code/client/cl_input.c b/SP/code/client/cl_input.c
index 2ef75cd..116e0de 100644
--- a/SP/code/client/cl_input.c
+++ b/SP/code/client/cl_input.c
@@ -445,7 +445,7 @@ void CL_JoystickMove( usercmd_t *cmd ) {
float pitch = j_pitch->value * cl.joystickAxis[j_pitch_axis->integer];
float up = j_up->value * cl.joystickAxis[j_up_axis->integer];
- if ( !(kb[KB_SPEED].active ^ cl_run->integer )) {
+ if ( !( kb[KB_SPEED].active ^ cl_run->integer ) ) {
cmd->buttons |= BUTTON_WALKING;
}
@@ -482,13 +482,10 @@ void CL_MouseMove(usercmd_t *cmd) {
float mx, my;
// allow mouse smoothing
- if (m_filter->integer)
- {
- mx = (cl.mouseDx[0] + cl.mouseDx[1]) * 0.5f;
- my = (cl.mouseDy[0] + cl.mouseDy[1]) * 0.5f;
- }
- else
- {
+ if ( m_filter->integer ) {
+ mx = ( cl.mouseDx[0] + cl.mouseDx[1] ) * 0.5f;
+ my = ( cl.mouseDy[0] + cl.mouseDy[1] ) * 0.5f;
+ } else {
mx = cl.mouseDx[cl.mouseIndex];
my = cl.mouseDy[cl.mouseIndex];
}
@@ -1083,11 +1080,11 @@ void CL_InitInput( void ) {
Cmd_AddCommand( "-mlook", IN_MLookUp );
#ifdef USE_VOIP
- Cmd_AddCommand ("+voiprecord", IN_VoipRecordDown);
- Cmd_AddCommand ("-voiprecord", IN_VoipRecordUp);
+ Cmd_AddCommand( "+voiprecord", IN_VoipRecordDown );
+ Cmd_AddCommand( "-voiprecord", IN_VoipRecordUp );
#endif
- Cmd_AddCommand( "notebook",IN_Notebook );
+ Cmd_AddCommand( "notebook", IN_Notebook );
cl_nodelta = Cvar_Get( "cl_nodelta", "0", 0 );
cl_debugMove = Cvar_Get( "cl_debugMove", "0", 0 );
@@ -1155,18 +1152,18 @@ void CL_ShutdownInput(void)
Cmd_RemoveCommand("-attack2");
Cmd_RemoveCommand("+zoom");
Cmd_RemoveCommand("-zoom");
- Cmd_RemoveCommand( "+quickgren" );
- Cmd_RemoveCommand( "-quickgren" );
- Cmd_RemoveCommand( "+reload" );
- Cmd_RemoveCommand( "-reload" );
- Cmd_RemoveCommand( "+leanleft" );
- Cmd_RemoveCommand( "-leanleft" );
- Cmd_RemoveCommand( "+leanright" );
- Cmd_RemoveCommand( "-leanright" );
- Cmd_RemoveCommand( "+wbutton6" );
- Cmd_RemoveCommand( "-wbutton6" );
- Cmd_RemoveCommand( "+wbutton7" );
- Cmd_RemoveCommand( "-wbutton7" );
+ Cmd_RemoveCommand("+quickgren");
+ Cmd_RemoveCommand("-quickgren");
+ Cmd_RemoveCommand("+reload");
+ Cmd_RemoveCommand("-reload");
+ Cmd_RemoveCommand("+leanleft");
+ Cmd_RemoveCommand("-leanleft");
+ Cmd_RemoveCommand("+leanright");
+ Cmd_RemoveCommand("-leanright");
+ Cmd_RemoveCommand("+wbutton6");
+ Cmd_RemoveCommand("-wbutton6");
+ Cmd_RemoveCommand("+wbutton7");
+ Cmd_RemoveCommand("-wbutton7");
Cmd_RemoveCommand("+mlook");
Cmd_RemoveCommand("-mlook");
diff --git a/SP/code/client/cl_keys.c b/SP/code/client/cl_keys.c
index 413bb1f..f28bbcd 100644
--- a/SP/code/client/cl_keys.c
+++ b/SP/code/client/cl_keys.c
@@ -50,7 +50,7 @@ int chat_playerNum;
qboolean key_overstrikeMode;
-int anykeydown;
+int anykeydown;
qkey_t keys[MAX_KEYS];
@@ -342,7 +342,7 @@ keyname_t keynames_d[] = //deutsch
{"ALT", K_ALT},
{"STRG", K_CTRL},
- {"UMSCHALT", K_SHIFT}, // (SA) removed one 'L' for laird 11/15/01
+ {"UMSCHALT", K_SHIFT},
{"FESTSTELLT", K_CAPSLOCK},
@@ -451,7 +451,7 @@ keyname_t keynames_d[] = //deutsch
{"COMMAND", K_COMMAND}, //mac
- {"SEMICOLON", ';'}, // because a raw semicolon seperates commands
+ {"SEMIKOLON", ';'}, // because a raw semicolon seperates commands
{"WORLD_0", K_WORLD_0},
{"WORLD_1", K_WORLD_1},
@@ -689,7 +689,7 @@ keyname_t keynames_f[] = //french
{"COMMAND", K_COMMAND}, //mac
- {"SEMICOLON", ';'}, // because a raw semicolon seperates commands
+ {"PN_VIRGULE", ';'}, // because a raw semicolon seperates commands
{"WORLD_0", K_WORLD_0},
{"WORLD_1", K_WORLD_1},
@@ -804,7 +804,7 @@ keyname_t keynames_f[] = //french
{NULL,0}
}; //end french
-keyname_t keynames_s[] = //Spanish - Updated 11/5
+keyname_t keynames_s[] = //Spanish
{
{"TABULADOR", K_TAB},
{"INTRO", K_ENTER},
@@ -1042,7 +1042,6 @@ keyname_t keynames_s[] = //Spanish - Updated 11/5
{NULL,0}
};
-
keyname_t keynames_i[] = //Italian
{
{"TAB", K_TAB},
@@ -1368,7 +1367,6 @@ void Field_VariableSizeDraw( field_t *edit, int x, int y, int width, int size, q
SCR_DrawBigString( x + ( edit->cursor - prestep - i ) * size, y, str, 1.0, qfalse );
}
-
}
}
@@ -2001,7 +1999,7 @@ void Key_Bind_f( void ) {
if ( keys[b].binding && keys[b].binding[0] ) {
Com_Printf( "\"%s\" = \"%s\"\n", Key_KeynumToString(b, qfalse), keys[b].binding );
} else {
- Com_Printf( "\"%s\" is not bound\n", Key_KeynumToString(b, qfalse));
+ Com_Printf( "\"%s\" is not bound\n", Key_KeynumToString(b, qfalse) );
}
return;
}
diff --git a/SP/code/client/cl_main.c b/SP/code/client/cl_main.c
index d5f4a44..6a9a2c4 100644
--- a/SP/code/client/cl_main.c
+++ b/SP/code/client/cl_main.c
@@ -121,7 +121,13 @@ cvar_t *cl_conXOffset;
cvar_t *cl_inGameVideo;
cvar_t *cl_serverStatusResendTime;
+cvar_t *cl_missionStats;
+cvar_t *cl_waitForFire;
+// NERVE - SMF - localization
+cvar_t *cl_language;
+cvar_t *cl_debugTranslation;
+// -NERVE - SMF
cvar_t *cl_lanForcePackets;
cvar_t *cl_guidServerUniq;
@@ -130,14 +136,6 @@ cvar_t *cl_consoleKeys;
cvar_t *cl_rate;
-cvar_t *cl_missionStats;
-cvar_t *cl_waitForFire;
-
-// NERVE - SMF - localization
-cvar_t *cl_language;
-cvar_t *cl_debugTranslation;
-// -NERVE - SMF
-
clientActive_t cl;
clientConnection_t clc;
clientStatic_t cls;
@@ -167,10 +165,6 @@ typedef struct serverStatus_s
serverStatus_t cl_serverStatusList[MAX_SERVERSTATUSREQUESTS];
-#if 0 // MrE defined __USEA3D && defined __A3D_GEOM
-void hA3Dg_ExportRenderGeom( refexport_t *incoming_re );
-#endif
-
static int noGameRestart = qfalse;
extern void SV_BotFrame( int time );
@@ -715,16 +709,16 @@ record <demoname>
Begins recording a demo from the current position
====================
*/
-static char demoName[MAX_QPATH]; // compiler bug workaround
+static char demoName[MAX_QPATH]; // compiler bug workaround
void CL_Record_f( void ) {
- char name[MAX_OSPATH];
- byte bufData[MAX_MSGLEN];
- msg_t buf;
- int i;
- int len;
- entityState_t *ent;
- entityState_t nullstate;
- char *s;
+ char name[MAX_OSPATH];
+ byte bufData[MAX_MSGLEN];
+ msg_t buf;
+ int i;
+ int len;
+ entityState_t *ent;
+ entityState_t nullstate;
+ char *s;
if ( Cmd_Argc() > 2 ) {
Com_Printf( "record <demoname>\n" );
@@ -756,7 +750,7 @@ void CL_Record_f( void ) {
#endif
Com_sprintf(name, sizeof(name), "demos/%s.%s%d", demoName, DEMOEXT, com_protocol->integer);
} else {
- int number;
+ int number;
// scan for a free demo name
for ( number = 0 ; number <= 9999 ; number++ ) {
@@ -769,7 +763,7 @@ void CL_Record_f( void ) {
Com_sprintf(name, sizeof(name), "demos/%s.%s%d", demoName, DEMOEXT, com_protocol->integer);
if (!FS_FileExists(name))
- break; // file doesn't exist
+ break; // file doesn't exist
}
}
@@ -808,7 +802,7 @@ void CL_Record_f( void ) {
}
// baselines
- memset( &nullstate, 0, sizeof( nullstate ) );
+ Com_Memset( &nullstate, 0, sizeof( nullstate ) );
for ( i = 0; i < MAX_GENTITIES ; i++ ) {
ent = &cl.entityBaselines[i];
if ( !ent->number ) {
@@ -892,7 +886,7 @@ void CL_DemoCompleted( void )
if( cl_timedemo && cl_timedemo->integer )
{
- int time;
+ int time;
time = Sys_Milliseconds() - clc.timeDemoStart;
if( time > 0 )
@@ -952,10 +946,10 @@ CL_ReadDemoMessage
=================
*/
void CL_ReadDemoMessage( void ) {
- int r;
- msg_t buf;
- byte bufData[ MAX_MSGLEN ];
- int s;
+ int r;
+ msg_t buf;
+ byte bufData[ MAX_MSGLEN ];
+ int s;
if ( !clc.demofile ) {
CL_DemoCompleted();
@@ -1196,7 +1190,7 @@ If the "nextdemo" cvar is set, that command will be issued
==================
*/
void CL_NextDemo( void ) {
- char v[MAX_STRING_CHARS];
+ char v[MAX_STRING_CHARS];
Q_strncpyz( v, Cvar_VariableString( "nextdemo" ), sizeof( v ) );
v[MAX_STRING_CHARS - 1] = 0;
@@ -1223,14 +1217,13 @@ void CL_ShutdownAll(qboolean shutdownRef)
{
if(CL_VideoRecording())
CL_CloseAVI();
-
+
if(clc.demorecording)
CL_StopRecord_f();
#ifdef USE_CURL
CL_cURL_Shutdown();
#endif
-
// clear sounds
S_DisableSounds();
// shutdown CGame
@@ -1312,15 +1305,12 @@ void CL_MapLoading( void ) {
Con_Close();
Key_SetCatcher( 0 );
-// this was for multi-threaded music
-// S_StartBackgroundTrack( "sound/music/l_briefing_1.wav", "", -2); // '-2' for 'queue looping track' (QUEUED_PLAY_LOOPED)
-
// if we are already connected to the local host, stay connected
if ( clc.state >= CA_CONNECTED && !Q_stricmp( clc.servername, "localhost" ) ) {
clc.state = CA_CONNECTED; // so the connect screen is drawn
- memset( cls.updateInfoString, 0, sizeof( cls.updateInfoString ) );
- memset( clc.serverMessage, 0, sizeof( clc.serverMessage ) );
- memset( &cl.gameState, 0, sizeof( cl.gameState ) );
+ Com_Memset( cls.updateInfoString, 0, sizeof( cls.updateInfoString ) );
+ Com_Memset( clc.serverMessage, 0, sizeof( clc.serverMessage ) );
+ Com_Memset( &cl.gameState, 0, sizeof( cl.gameState ) );
clc.lastPacketSentTime = -9999;
SCR_UpdateScreen();
} else {
@@ -1456,7 +1446,6 @@ void CL_Disconnect( qboolean showMainMenu ) {
}
SCR_StopCinematic();
-// S_ClearSoundBuffer( qtrue ); //----(SA) modified
S_ClearSoundBuffer();
// send a disconnect message to the server
@@ -1475,7 +1464,7 @@ void CL_Disconnect( qboolean showMainMenu ) {
CL_ClearState();
// wipe the client connection
- memset( &clc, 0, sizeof( clc ) );
+ Com_Memset( &clc, 0, sizeof( clc ) );
clc.state = CA_DISCONNECTED;
@@ -1508,7 +1497,6 @@ void CL_Disconnect( qboolean showMainMenu ) {
noGameRestart = qfalse;
}
-
/*
===================
CL_ForwardCommandToServer
@@ -1519,7 +1507,7 @@ so when they are typed in at the console, they will need to be forwarded.
===================
*/
void CL_ForwardCommandToServer( const char *string ) {
- char *cmd;
+ char *cmd;
cmd = Cmd_Argv( 0 );
@@ -1548,7 +1536,7 @@ CL_RequestMotd
*/
void CL_RequestMotd( void ) {
#ifdef UPDATE_SERVER_NAME
- char info[MAX_INFO_STRING];
+ char info[MAX_INFO_STRING];
if ( !cl_motd->integer ) {
return;
@@ -1575,7 +1563,6 @@ void CL_RequestMotd( void ) {
#endif
}
-
/*
===================
CL_RequestAuthorization
@@ -1617,9 +1604,9 @@ in anyway.
#ifndef STANDALONE
#ifdef USE_AUTHORIZE_SERVER
void CL_RequestAuthorization( void ) {
- char nums[64];
- int i, j, l;
- cvar_t *fs;
+ char nums[64];
+ int i, j, l;
+ cvar_t *fs;
if ( !cls.authorizeServer.port ) {
Com_Printf( "Resolving %s\n", AUTHORIZE_SERVER_NAME );
@@ -1646,9 +1633,8 @@ void CL_RequestAuthorization( void ) {
}
for ( i = 0 ; i < l ; i++ ) {
if ( ( cl_cdkey[i] >= '0' && cl_cdkey[i] <= '9' )
- || ( cl_cdkey[i] >= 'a' && cl_cdkey[i] <= 'z' )
- || ( cl_cdkey[i] >= 'A' && cl_cdkey[i] <= 'Z' )
- ) {
+ || ( cl_cdkey[i] >= 'a' && cl_cdkey[i] <= 'z' )
+ || ( cl_cdkey[i] >= 'A' && cl_cdkey[i] <= 'Z' ) ) {
nums[j] = cl_cdkey[i];
j++;
}
@@ -1805,7 +1791,7 @@ void CL_Connect_f( void ) {
}
Key_SetCatcher( 0 );
- clc.connectTime = -99999; // CL_CheckForResend() will fire immediately
+ clc.connectTime = -99999; // CL_CheckForResend() will fire immediately
clc.connectPacketCount = 0;
// server connection string
@@ -1841,10 +1827,10 @@ CL_Rcon_f
*/
void CL_Rcon_f( void ) {
char message[MAX_RCON_MESSAGE];
- netadr_t to;
+ netadr_t to;
if ( !rcon_client_password->string[0] ) {
- Com_Printf( "You must set 'rcon_password' before\n"
+ Com_Printf( "You must set 'rconpassword' before\n"
"issuing an rcon command.\n" );
return;
}
@@ -1918,6 +1904,9 @@ void CL_Vid_Restart_f( void ) {
vmCvar_t musicCvar;
+ // RF, don't show percent bar, since the memory usage will just sit at the same level anyway
+ Cvar_Set( "com_expectedhunkusage", "-1" );
+
// Settings may have changed so stop recording now
if( CL_VideoRecording( ) ) {
CL_CloseAVI( );
@@ -1926,11 +1915,9 @@ void CL_Vid_Restart_f( void ) {
if(clc.demorecording)
CL_StopRecord_f();
- // RF, don't show percent bar, since the memory usage will just sit at the same level anyway
- Cvar_Set( "com_expectedhunkusage", "-1" );
-
// don't let them loop during the restart
S_StopAllSounds();
+
if(!FS_ConditionalRestart(clc.checksumFeed, qtrue))
{
// if not running a server clear the whole hunk
@@ -1944,7 +1931,7 @@ void CL_Vid_Restart_f( void ) {
// clear the whole hunk
Hunk_Clear();
}
-
+
// shutdown the UI
CL_ShutdownUI();
// shutdown the CGame
@@ -1963,7 +1950,7 @@ void CL_Vid_Restart_f( void ) {
cls.soundRegistered = qfalse;
// unpause so the cgame definately gets a snapshot and renders a frame
- Cvar_Set("cl_paused", "0");
+ Cvar_Set( "cl_paused", "0" );
// initialize the renderer interface
CL_InitRef();
@@ -2045,8 +2032,8 @@ CL_Configstrings_f
==================
*/
void CL_Configstrings_f( void ) {
- int i;
- int ofs;
+ int i;
+ int ofs;
if ( clc.state != CA_ACTIVE ) {
Com_Printf( "Not connected to a server.\n" );
@@ -2112,9 +2099,9 @@ void CL_DownloadsComplete( void ) {
FS_Restart( clc.checksumFeed ); // We possibly downloaded a pak, restart the file system to load it
// inform the server so we get new gamestate info
- CL_AddReliableCommand("donedl", qfalse);
+ CL_AddReliableCommand( "donedl", qfalse );
- // by sending the donenl command we request a new gamestate
+ // by sending the donedl command we request a new gamestate
// so we don't want to load stuff yet
return;
}
@@ -2122,7 +2109,6 @@ void CL_DownloadsComplete( void ) {
// let the client game init and load data
clc.state = CA_LOADING;
-//----(SA) removed some loading stuff
Com_EventLoop();
// if the gamestate was changed by calling Com_EventLoop
@@ -2179,7 +2165,7 @@ void CL_BeginDownload( const char *localName, const char *remoteName ) {
clc.downloadBlock = 0; // Starting new file
clc.downloadCount = 0;
- CL_AddReliableCommand(va("download %s", remoteName), qfalse);
+ CL_AddReliableCommand( va( "download %s", remoteName ), qfalse );
}
/*
@@ -2195,8 +2181,7 @@ void CL_NextDownload( void ) {
qboolean useCURL = qfalse;
// A download has finished, check whether this matches a referenced checksum
- if(*clc.downloadName)
- {
+ if( *clc.downloadName ) {
char *zippath = FS_BuildOSPath(Cvar_VariableString("fs_homepath"), clc.downloadName, "");
zippath[strlen(zippath)-1] = '\0';
@@ -2294,25 +2279,24 @@ After receiving a valid game state, we valid the cgame and local zip files here
and determine if we need to download them
=================
*/
-void CL_InitDownloads(void) {
- char missingfiles[1024];
-
- if ( !(cl_allowDownload->integer & DLF_ENABLE) )
- {
- // autodownload is disabled on the client
- // but it's possible that some referenced files on the server are missing
- if (FS_ComparePaks( missingfiles, sizeof( missingfiles ), qfalse ) )
- {
- // NOTE TTimo I would rather have that printed as a modal message box
- // but at this point while joining the game we don't know wether we will successfully join or not
- Com_Printf( "\nWARNING: You are missing some files referenced by the server:\n%s"
- "You might not be able to join the game\n"
- "Go to the setting menu to turn on autodownload, or get the file elsewhere\n\n", missingfiles );
- }
- }
- else if ( FS_ComparePaks( clc.downloadList, sizeof( clc.downloadList ) , qtrue ) ) {
-
- Com_Printf("Need paks: %s\n", clc.downloadList );
+void CL_InitDownloads( void ) {
+ char missingfiles[1024];
+
+ if ( !(cl_allowDownload->integer & DLF_ENABLE) ) {
+ // autodownload is disabled on the client
+ // but it's possible that some referenced files on the server are missing
+ if (FS_ComparePaks( missingfiles, sizeof( missingfiles ), qfalse ) ) {
+
+ // NOTE TTimo I would rather have that printed as a modal message box
+ // but at this point while joining the game we don't know wether we will successfully join or not
+ Com_Printf( "\nWARNING: You are missing some files referenced by the server:\n%s"
+ "You might not be able to join the game\n"
+ "Go to the setting menu to turn on autodownload, or get the file elsewhere\n\n", missingfiles );
+ }
+ }
+ else if ( FS_ComparePaks( clc.downloadList, sizeof( clc.downloadList ) , qtrue ) ) {
+
+ Com_Printf("Need paks: %s\n", clc.downloadList );
if ( *clc.downloadList ) {
// if autodownloading is not enabled on the server
@@ -2324,7 +2308,6 @@ void CL_InitDownloads(void) {
CL_NextDownload();
return;
}
-
}
CL_DownloadsComplete();
@@ -2339,7 +2322,7 @@ Resend a connect message if the last one has timed out
*/
void CL_CheckForResend( void ) {
int port;
- char info[MAX_INFO_STRING];
+ char info[MAX_INFO_STRING];
char data[MAX_INFO_STRING + 10];
// don't send anything if playing back a demo
@@ -2356,7 +2339,7 @@ void CL_CheckForResend( void ) {
return;
}
- clc.connectTime = cls.realtime; // for retransmit requests
+ clc.connectTime = cls.realtime; // for retransmit requests
clc.connectPacketCount++;
@@ -2383,6 +2366,7 @@ void CL_CheckForResend( void ) {
port = Cvar_VariableValue( "net_qport" );
Q_strncpyz( info, Cvar_InfoString( CVAR_USERINFO ), sizeof( info ) );
+
#ifdef LEGACY_PROTOCOL
if(com_legacyprotocol->integer == com_protocol->integer)
clc.compat = qtrue;
@@ -2391,7 +2375,7 @@ void CL_CheckForResend( void ) {
Info_SetValueForKey(info, "protocol", va("%i", com_legacyprotocol->integer));
else
#endif
- Info_SetValueForKey(info, "protocol", va("%i", com_protocol->integer));
+ Info_SetValueForKey( info, "protocol", va("%i", com_protocol->integer ) );
Info_SetValueForKey( info, "qport", va( "%i", port ) );
Info_SetValueForKey( info, "challenge", va( "%i", clc.challenge ) );
@@ -2415,8 +2399,8 @@ CL_MotdPacket
*/
void CL_MotdPacket( netadr_t from ) {
#ifdef UPDATE_SERVER_NAME
- char *challenge;
- char *info;
+ char *challenge;
+ char *info;
// if not from our server, ignore it
if ( !NET_CompareAdr( from, cls.updateServer ) ) {
@@ -2470,9 +2454,9 @@ CL_ServersResponsePacket
void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extended ) {
int i, j, count, total;
netadr_t addresses[MAX_SERVERSPERPACKET];
- int numservers;
- byte* buffptr;
- byte* buffend;
+ int numservers;
+ byte* buffptr;
+ byte* buffend;
Com_Printf( "CL_ServersResponsePacket\n" );
@@ -2486,6 +2470,7 @@ void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extend
numservers = 0;
buffptr = msg->data;
buffend = buffptr + msg->cursize;
+
// advance to initial token
do
{
@@ -2514,7 +2499,7 @@ void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extend
else if (extended && *buffptr == '/')
{
buffptr++;
-
+
if (buffend - buffptr < sizeof(addresses[numservers].ip6) + sizeof(addresses[numservers].port) + 1)
break;
@@ -2591,12 +2576,12 @@ Responses to broadcasts, etc
=================
*/
void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
- char *s;
- char *c;
+ char *s;
+ char *c;
int challenge = 0;
MSG_BeginReadingOOB( msg );
- MSG_ReadLong( msg ); // skip the -1
+ MSG_ReadLong( msg ); // skip the -1
s = MSG_ReadStringLine( msg );
@@ -2618,11 +2603,11 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
return;
}
- c = Cmd_Argv(2);
+ c = Cmd_Argv( 2 );
if(*c)
challenge = atoi(c);
- strver = Cmd_Argv(3);
+ strver = Cmd_Argv( 3 );
if(*strver)
{
ver = atoi(strver);
@@ -2735,7 +2720,7 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
#endif
clc.state = CA_CONNECTED;
- clc.lastPacketSentTime = -9999; // send first packet immediately
+ clc.lastPacketSentTime = -9999; // send first packet immediately
return;
}
@@ -2772,6 +2757,7 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
// echo request from server
if ( !Q_stricmp( c, "print" ) ) {
s = MSG_ReadString( msg );
+
Q_strncpyz( clc.serverMessage, s, sizeof( clc.serverMessage ) );
Com_Printf( "%s", s );
return;
@@ -2792,7 +2778,6 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
Com_DPrintf( "Unknown connectionless packet command.\n" );
}
-
/*
=================
CL_PacketEvent
@@ -2801,7 +2786,7 @@ A packet has arrived from the main event loop
=================
*/
void CL_PacketEvent( netadr_t from, msg_t *msg ) {
- int headerBytes;
+ int headerBytes;
clc.lastPacketTime = cls.realtime;
@@ -2811,7 +2796,7 @@ void CL_PacketEvent( netadr_t from, msg_t *msg ) {
}
if ( clc.state < CA_CONNECTED ) {
- return; // can't be a valid sequenced packet
+ return; // can't be a valid sequenced packet
}
if ( msg->cursize < 4 ) {
@@ -2830,7 +2815,7 @@ void CL_PacketEvent( netadr_t from, msg_t *msg ) {
}
if ( !CL_Netchan_Process( &clc.netchan, msg ) ) {
- return; // out of order, duplicated, etc
+ return; // out of order, duplicated, etc
}
// the header is different lengths for reliable and unreliable messages
@@ -2865,8 +2850,8 @@ void CL_CheckTimeout( void ) {
//
if ( ( !CL_CheckPaused() || !sv_paused->integer )
&& clc.state >= CA_CONNECTED && clc.state != CA_CINEMATIC
- && cls.realtime - clc.lastPacketTime > cl_timeout->value * 1000 ) {
- if ( ++cl.timeoutcount > 5 ) { // timeoutcount saves debugger
+ && cls.realtime - clc.lastPacketTime > cl_timeout->value * 1000 ) {
+ if ( ++cl.timeoutcount > 5 ) { // timeoutcount saves debugger
Com_Printf( "\nServer connection timed out.\n" );
CL_Disconnect( qtrue );
return;
@@ -2893,6 +2878,7 @@ qboolean CL_CheckPaused(void)
return qfalse;
}
+
//============================================================================
/*
@@ -2915,7 +2901,6 @@ void CL_CheckUserinfo( void ) {
cvar_modifiedFlags &= ~CVAR_USERINFO;
CL_AddReliableCommand(va("userinfo \"%s\"", Cvar_InfoString( CVAR_USERINFO ) ), qfalse);
}
-
}
/*
@@ -3235,8 +3220,6 @@ void CL_SetRecommended_f( void ) {
}
-
-
/*
================
CL_RefPrintf
@@ -3244,10 +3227,9 @@ CL_RefPrintf
DLL glue
================
*/
-#define MAXPRINTMSG 4096
static __attribute__ ((format (printf, 2, 3))) void QDECL CL_RefPrintf( int print_level, const char *fmt, ...) {
- va_list argptr;
- char msg[MAXPRINTMSG];
+ va_list argptr;
+ char msg[MAXPRINTMSG];
va_start( argptr,fmt );
Q_vsnprintf( msg, sizeof ( msg ), fmt, argptr );
@@ -3256,9 +3238,9 @@ static __attribute__ ((format (printf, 2, 3))) void QDECL CL_RefPrintf( int prin
if ( print_level == PRINT_ALL ) {
Com_Printf( "%s", msg );
} else if ( print_level == PRINT_WARNING ) {
- Com_Printf( S_COLOR_YELLOW "%s", msg ); // yellow
+ Com_Printf( S_COLOR_YELLOW "%s", msg ); // yellow
} else if ( print_level == PRINT_DEVELOPER ) {
- Com_DPrintf( S_COLOR_RED "%s", msg ); // red
+ Com_DPrintf( S_COLOR_RED "%s", msg ); // red
}
}
@@ -3346,7 +3328,6 @@ void CL_StartHunkUsers( qboolean rendererOnly ) {
}
}
-
int CL_ScaledMilliseconds( void ) {
return Sys_Milliseconds() * com_timescale->value;
}
@@ -3415,7 +3396,6 @@ void CL_InitRef( void ) {
ri.CM_ClusterPVS = CM_ClusterPVS;
ri.CM_DrawDebugSurface = CM_DrawDebugSurface;
-
ri.FS_ReadFile = FS_ReadFile;
ri.FS_FreeFile = FS_FreeFile;
ri.FS_WriteFile = FS_WriteFile;
@@ -3450,18 +3430,14 @@ void CL_InitRef( void ) {
ret = GetRefAPI( REF_API_VERSION, &ri );
-#if 0 // MrE defined __USEA3D && defined __A3D_GEOM
- hA3Dg_ExportRenderGeom( ret );
-#endif
-
- Com_Printf( "-------------------------------\n" );
-
if ( !ret ) {
Com_Error( ERR_FATAL, "Couldn't initialize refresh" );
}
re = *ret;
+ Com_Printf( "---- Renderer Initialization Complete ----\n" );
+
// unpause so the cgame definately gets a snapshot and renders a frame
Cvar_Set( "cl_paused", "0" );
}
@@ -3529,8 +3505,10 @@ void CL_ShellExecute_URL_f( void ) {
Sys_OpenURL( Cmd_Argv( 2 ),doexit );
}
//----(SA) end
+
//===========================================================================================
+
/*
===============
CL_Video_f
@@ -3647,7 +3625,7 @@ CL_Init
void CL_Init( void ) {
Com_Printf( "----- Client Initialization -----\n" );
- Con_Init ();
+ Con_Init();
if(!com_fullyInitialized)
{
@@ -3768,9 +3746,9 @@ void CL_Init( void ) {
// userinfo
Cvar_Get( "name", "WolfPlayer", CVAR_USERINFO | CVAR_ARCHIVE );
- cl_rate = Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE );
+ cl_rate = Cvar_Get( "rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE ); // NERVE - SMF - changed from 3000
Cvar_Get( "snaps", "20", CVAR_USERINFO | CVAR_ARCHIVE );
- Cvar_Get( "model", "bj2", CVAR_USERINFO | CVAR_ARCHIVE ); // temp until we have an skeletal american model
+ Cvar_Get( "model", "bj2", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get( "head", "default", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get( "color", "4", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get( "handicap", "100", CVAR_USERINFO | CVAR_ARCHIVE );
@@ -3861,10 +3839,7 @@ void CL_Init( void ) {
Cmd_AddCommand( "startMultiplayer", CL_startMultiplayer_f ); // NERVE - SMF
- // TTimo
- // show_bug.cgi?id=447
Cmd_AddCommand( "shellExecute", CL_ShellExecute_URL_f );
- //Cmd_AddCommand ( "shellExecute", CL_ShellExecute_f ); //----(SA) added (mainly for opening web pages from the menu)
// RF, prevent users from issuing a map_restart manually
Cmd_AddCommand( "map_restart", CL_MapRestart_f );
@@ -3893,14 +3868,13 @@ CL_Shutdown
===============
*/
-void CL_Shutdown(char *finalmsg, qboolean disconnect, qboolean quit)
-{
+void CL_Shutdown( char *finalmsg, qboolean disconnect, qboolean quit ) {
static qboolean recursive = qfalse;
// check whether the client is running at all.
if(!(com_cl_running && com_cl_running->integer))
return;
-
+
Com_Printf( "----- Client Shutdown (%s) -----\n", finalmsg );
if ( recursive ) {
@@ -3941,9 +3915,6 @@ void CL_Shutdown(char *finalmsg, qboolean disconnect, qboolean quit)
Cmd_RemoveCommand ("video");
Cmd_RemoveCommand ("stopvideo");
- CL_ShutdownInput();
- Con_Shutdown();
-
// Ridah, startup-caching system
Cmd_RemoveCommand( "cache_startgather" );
Cmd_RemoveCommand( "cache_usedfile" );
@@ -3954,6 +3925,9 @@ void CL_Shutdown(char *finalmsg, qboolean disconnect, qboolean quit)
Cmd_RemoveCommand( "updatehunkusage" );
// done.
+ CL_ShutdownInput();
+ Con_Shutdown();
+
Cvar_Set( "cl_running", "0" );
recursive = qfalse;
@@ -4014,10 +3988,10 @@ CL_ServerInfoPacket
===================
*/
void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
- int i, type;
- char info[MAX_INFO_STRING];
- char *infoString;
- int prot;
+ int i, type;
+ char info[MAX_INFO_STRING];
+ char *infoString;
+ int prot;
char *gamename;
qboolean gameMismatch;
@@ -4042,6 +4016,7 @@ void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
// if this isn't the correct protocol version, ignore it
prot = atoi( Info_ValueForKey( infoString, "protocol" ) );
+
if(prot != com_protocol->integer
#ifdef LEGACY_PROTOCOL
&& prot != com_legacyprotocol->integer
@@ -4071,11 +4046,9 @@ void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
case NA_IP:
type = 1;
break;
-
case NA_IP6:
type = 2;
break;
-
default:
type = 0;
break;
@@ -4158,7 +4131,7 @@ CL_ServerStatus
*/
int CL_ServerStatus( char *serverAddress, char *serverStatusString, int maxLen ) {
int i;
- netadr_t to;
+ netadr_t to;
serverStatus_t *serverStatus;
// if no server address then reset all server status requests
@@ -4182,7 +4155,7 @@ int CL_ServerStatus( char *serverAddress, char *serverStatusString, int maxLen )
// if this server status request has the same address
if ( NET_CompareAdr( to, serverStatus->address ) ) {
- // if we recieved a response for this server status request
+ // if we received a response for this server status request
if ( !serverStatus->pending ) {
Q_strncpyz( serverStatusString, serverStatus->string, maxLen );
serverStatus->retrieved = qtrue;
@@ -4190,12 +4163,12 @@ int CL_ServerStatus( char *serverAddress, char *serverStatusString, int maxLen )
return qtrue;
}
// resend the request regularly
- else if ( serverStatus->startTime < Sys_Milliseconds() - cl_serverStatusResendTime->integer ) {
+ else if ( serverStatus->startTime < Com_Milliseconds() - cl_serverStatusResendTime->integer ) {
serverStatus->print = qfalse;
serverStatus->pending = qtrue;
serverStatus->retrieved = qfalse;
serverStatus->time = 0;
- serverStatus->startTime = Sys_Milliseconds();
+ serverStatus->startTime = Com_Milliseconds();
NET_OutOfBandPrint( NS_CLIENT, to, "getstatus" );
return qfalse;
}
@@ -4206,7 +4179,7 @@ int CL_ServerStatus( char *serverAddress, char *serverStatusString, int maxLen )
serverStatus->print = qfalse;
serverStatus->pending = qtrue;
serverStatus->retrieved = qfalse;
- serverStatus->startTime = Sys_Milliseconds();
+ serverStatus->startTime = Com_Milliseconds();
serverStatus->time = 0;
NET_OutOfBandPrint( NS_CLIENT, to, "getstatus" );
return qfalse;
@@ -4220,10 +4193,10 @@ CL_ServerStatusResponse
===================
*/
void CL_ServerStatusResponse( netadr_t from, msg_t *msg ) {
- char *s;
- char info[MAX_INFO_STRING];
- int i, l, score, ping;
- int len;
+ char *s;
+ char info[MAX_INFO_STRING];
+ int i, l, score, ping;
+ int len;
serverStatus_t *serverStatus;
serverStatus = NULL;
@@ -4302,10 +4275,10 @@ void CL_ServerStatusResponse( netadr_t from, msg_t *msg ) {
len = strlen( serverStatus->string );
Com_sprintf( &serverStatus->string[len], sizeof( serverStatus->string ) - len, "\\" );
- serverStatus->time = Sys_Milliseconds();
+ serverStatus->time = Com_Milliseconds();
serverStatus->address = from;
serverStatus->pending = qfalse;
- if ( serverStatus->print ) {
+ if (serverStatus->print) {
serverStatus->retrieved = qtrue;
}
}
@@ -4316,9 +4289,9 @@ CL_LocalServers_f
==================
*/
void CL_LocalServers_f( void ) {
- char *message;
- int i, j;
- netadr_t to;
+ char *message;
+ int i, j;
+ netadr_t to;
Com_Printf( "Scanning for servers on the local network...\n" );
@@ -4348,7 +4321,6 @@ void CL_LocalServers_f( void ) {
to.type = NA_BROADCAST;
NET_SendPacket( NS_CLIENT, strlen( message ), message, to );
-
to.type = NA_MULTICAST6;
NET_SendPacket( NS_CLIENT, strlen( message ), message, to );
}
@@ -4361,7 +4333,7 @@ CL_GlobalServers_f
==================
*/
void CL_GlobalServers_f( void ) {
- netadr_t to;
+ netadr_t to;
int count, i, masterNum;
char command[1024], *masteraddress;
@@ -4430,16 +4402,15 @@ void CL_GlobalServers_f( void ) {
NET_OutOfBandPrint( NS_SERVER, to, "%s", command );
}
-
/*
==================
CL_GetPing
==================
*/
void CL_GetPing( int n, char *buf, int buflen, int *pingtime ) {
- const char *str;
- int time;
- int maxPing;
+ const char *str;
+ int time;
+ int maxPing;
if (n < 0 || n >= MAX_PINGREQUESTS || !cl_pinglist[n].adr.port)
{
@@ -4477,8 +4448,7 @@ CL_GetPingInfo
==================
*/
void CL_GetPingInfo( int n, char *buf, int buflen ) {
- if (n < 0 || n >= MAX_PINGREQUESTS || !cl_pinglist[n].adr.port)
- {
+ if ( n < 0 || n >= MAX_PINGREQUESTS || !cl_pinglist[n].adr.port ) {
// empty or invalid slot
if ( buflen ) {
buf[0] = '\0';
@@ -4508,9 +4478,9 @@ CL_GetPingQueueCount
==================
*/
int CL_GetPingQueueCount( void ) {
- int i;
- int count;
- ping_t* pingptr;
+ int i;
+ int count;
+ ping_t* pingptr;
count = 0;
pingptr = cl_pinglist;
@@ -4530,11 +4500,11 @@ CL_GetFreePing
==================
*/
ping_t* CL_GetFreePing( void ) {
- ping_t* pingptr;
- ping_t* best;
- int oldest;
- int i;
- int time;
+ ping_t* pingptr;
+ ping_t* best;
+ int oldest;
+ int i;
+ int time;
pingptr = cl_pinglist;
for ( i = 0; i < MAX_PINGREQUESTS; i++, pingptr++ )
@@ -4547,7 +4517,7 @@ ping_t* CL_GetFreePing( void ) {
// still waiting for response
continue;
}
- } else if ( pingptr->time < 500 ) {
+ } else if ( pingptr->time < 500 ) {
// results have not been queried
continue;
}
@@ -4581,9 +4551,9 @@ CL_Ping_f
==================
*/
void CL_Ping_f( void ) {
- netadr_t to;
- ping_t* pingptr;
- char* server;
+ netadr_t to;
+ ping_t* pingptr;
+ char* server;
int argc;
netadrtype_t family = NA_UNSPEC;
@@ -4608,7 +4578,7 @@ void CL_Ping_f( void ) {
server = Cmd_Argv(2);
}
- memset( &to, 0, sizeof( netadr_t ) );
+ Com_Memset( &to, 0, sizeof( netadr_t ) );
if ( !NET_StringToAdr( server, &to, family ) ) {
return;
@@ -4631,10 +4601,10 @@ CL_UpdateVisiblePings_f
==================
*/
qboolean CL_UpdateVisiblePings_f( int source ) {
- int slots, i;
- char buff[MAX_STRING_CHARS];
- int pingTime;
- int max;
+ int slots, i;
+ char buff[MAX_STRING_CHARS];
+ int pingTime;
+ int max;
qboolean status = qfalse;
if ( source < 0 || source > AS_FAVORITES ) {
@@ -4736,7 +4706,7 @@ CL_ServerStatus_f
*/
void CL_ServerStatus_f( void ) {
netadr_t to, *toptr = NULL;
- char *server;
+ char *server;
serverStatus_t *serverStatus;
int argc;
netadrtype_t family = NA_UNSPEC;
diff --git a/SP/code/client/cl_net_chan.c b/SP/code/client/cl_net_chan.c
index 775ed10..fafae59 100644
--- a/SP/code/client/cl_net_chan.c
+++ b/SP/code/client/cl_net_chan.c
@@ -31,7 +31,6 @@ If you have questions concerning this license or the applicable additional terms
#include "../qcommon/qcommon.h"
#include "client.h"
-
#ifdef LEGACY_PROTOCOL
/*
==============
@@ -152,10 +151,8 @@ qboolean CL_Netchan_TransmitNextFragment(netchan_t *chan)
return qfalse;
}
-//byte chksum[65536];
-
/*
-===============
+================
CL_Netchan_Transmit
================
*/
@@ -183,8 +180,6 @@ CL_Netchan_Process
*/
qboolean CL_Netchan_Process( netchan_t *chan, msg_t *msg ) {
int ret;
-// int i;
-// static int newsize = 0;
ret = Netchan_Process( chan, msg );
if ( !ret ) {
diff --git a/SP/code/client/cl_parse.c b/SP/code/client/cl_parse.c
index 4f28fb7..ecc1116 100644
--- a/SP/code/client/cl_parse.c
+++ b/SP/code/client/cl_parse.c
@@ -259,9 +259,9 @@ void CL_ParseSnapshot( msg_t *msg ) {
} else if ( old->messageNum != newSnap.deltaNum ) {
// The frame that the server did the delta from
// is too old, so we can't reconstruct it properly.
- Com_Printf( "Delta frame too old.\n" );
+ Com_DPrintf( "Delta frame too old.\n" );
} else if ( cl.parseEntitiesNum - old->parseEntitiesNum > MAX_PARSE_ENTITIES - MAX_SNAPSHOT_ENTITIES ) {
- Com_Printf( "Delta parseEntitiesNum too old.\n" );
+ Com_DPrintf( "Delta parseEntitiesNum too old.\n" );
} else {
newSnap.valid = qtrue; // valid delta parse
}
@@ -270,9 +270,8 @@ void CL_ParseSnapshot( msg_t *msg ) {
// read areamask
len = MSG_ReadByte( msg );
- if(len > sizeof(newSnap.areamask))
- {
- Com_Error (ERR_DROP,"CL_ParseSnapshot: Invalid size %d for areamask", len);
+ if ( len > sizeof( newSnap.areamask ) ) {
+ Com_Error( ERR_DROP,"CL_ParseSnapshot: Invalid size %d for areamask.", len );
return;
}
@@ -347,11 +346,11 @@ gamestate, and possibly during gameplay.
==================
*/
void CL_SystemInfoChanged( void ) {
- char *systemInfo;
- const char *s, *t;
- char key[BIG_INFO_KEY];
- char value[BIG_INFO_VALUE];
- qboolean gameSet;
+ char *systemInfo;
+ const char *s, *t;
+ char key[BIG_INFO_KEY];
+ char value[BIG_INFO_VALUE];
+ qboolean gameSet;
systemInfo = cl.gameState.stringData + cl.gameState.stringOffsets[ CS_SYSTEMINFO ];
cl.serverId = atoi( Info_ValueForKey( systemInfo, "sv_serverid" ) );
@@ -393,12 +392,12 @@ void CL_SystemInfoChanged( void ) {
s = systemInfo;
while ( s ) {
int cvar_flags;
-
+
Info_NextPair( &s, key, value );
if ( !key[0] ) {
break;
}
-
+
// ehw!
if (!Q_stricmp(key, "fs_game"))
{
@@ -579,8 +578,7 @@ void CL_ParseDownload( msg_t *msg ) {
// read the data
block = MSG_ReadShort( msg );
- if(!block && !clc.downloadBlock)
- {
+ if( !block && !clc.downloadBlock ) {
// block zero is special, contains file size
clc.downloadSize = MSG_ReadLong( msg );
@@ -593,16 +591,14 @@ void CL_ParseDownload( msg_t *msg ) {
}
size = MSG_ReadShort( msg );
- if (size < 0 || size > sizeof(data))
- {
- Com_Error(ERR_DROP, "CL_ParseDownload: Invalid size %d for download chunk", size);
+ if ( size < 0 || size > sizeof( data ) ) {
+ Com_Error( ERR_DROP, "CL_ParseDownload: Invalid size %d for download chunk", size );
return;
}
-
- MSG_ReadData(msg, data, size);
- if((clc.downloadBlock & 0xFFFF) != block)
- {
+ MSG_ReadData( msg, data, size );
+
+ if( ( clc.downloadBlock & 0xFFFF ) != block ) {
Com_DPrintf( "CL_ParseDownload: Expected block %d, got %d\n", (clc.downloadBlock & 0xFFFF), block);
return;
}
diff --git a/SP/code/client/cl_scrn.c b/SP/code/client/cl_scrn.c
index 78bb861..741cb95 100644
--- a/SP/code/client/cl_scrn.c
+++ b/SP/code/client/cl_scrn.c
@@ -405,8 +405,7 @@ static float values[1024];
SCR_DebugGraph
==============
*/
-void SCR_DebugGraph (float value)
-{
+void SCR_DebugGraph( float value ) {
values[current] = value;
current = (current + 1) % ARRAY_LEN(values);
}
diff --git a/SP/code/client/cl_ui.c b/SP/code/client/cl_ui.c
index b4bf1cd..e09c150 100644
--- a/SP/code/client/cl_ui.c
+++ b/SP/code/client/cl_ui.c
@@ -58,27 +58,30 @@ LAN_LoadCachedServers
====================
*/
void LAN_LoadCachedServers( void ) {
- // TTimo: stub, this is only relevant to MP, SP kills the servercache.dat (and favorites)
- // show_bug.cgi?id=445
- /*
- int size;
- fileHandle_t fileIn;
- cls.numglobalservers = cls.numfavoriteservers = 0;
- cls.numGlobalServerAddresses = 0;
- if (FS_SV_FOpenFileRead("servercache.dat", &fileIn)) {
- FS_Read(&cls.numglobalservers, sizeof(int), fileIn);
- FS_Read(&cls.numfavoriteservers, sizeof(int), fileIn);
- FS_Read(&size, sizeof(int), fileIn);
- if (size == sizeof(cls.globalServers) + sizeof(cls.favoriteServers)) {
- FS_Read(&cls.globalServers, sizeof(cls.globalServers), fileIn);
- FS_Read(&cls.favoriteServers, sizeof(cls.favoriteServers), fileIn);
- } else {
- cls.numglobalservers = cls.numfavoriteservers = 0;
- cls.numGlobalServerAddresses = 0;
- }
- FS_FCloseFile(fileIn);
- }
- */
+// TTimo: stub, this is only relevant to MP, SP kills the servercache.dat (and favorites)
+// show_bug.cgi?id=445
+/*
+ int size;
+ fileHandle_t fileIn;
+
+ cls.numglobalservers = cls.numfavoriteservers = 0;
+ cls.numGlobalServerAddresses = 0;
+
+ if ( FS_SV_FOpenFileRead( "servercache.dat", &fileIn ) ) {
+ FS_Read( &cls.numglobalservers, sizeof( int ), fileIn );
+ FS_Read( &cls.numfavoriteservers, sizeof( int ), fileIn );
+ FS_Read( &size, sizeof( int ), fileIn );
+ if ( size == sizeof( cls.globalServers ) + sizeof( cls.favoriteServers ) ) {
+ FS_Read( &cls.globalServers, sizeof( cls.globalServers ), fileIn );
+ FS_Read( &cls.favoriteServers, sizeof( cls.favoriteServers ), fileIn );
+ } else {
+ cls.numglobalservers = cls.numfavoriteservers = 0;
+ cls.numGlobalServerAddresses = 0;
+ }
+
+ FS_FCloseFile( fileIn );
+ }
+*/
}
/*
@@ -87,20 +90,20 @@ LAN_SaveServersToCache
====================
*/
void LAN_SaveServersToCache( void ) {
- // TTimo: stub, this is only relevant to MP, SP kills the servercache.dat (and favorites)
- // show_bug.cgi?id=445
- /*
- int size;
- fileHandle_t fileOut;
- fileOut = FS_SV_FOpenFileWrite("servercache.dat");
- FS_Write(&cls.numglobalservers, sizeof(int), fileOut);
- FS_Write(&cls.numfavoriteservers, sizeof(int), fileOut);
- size = sizeof(cls.globalServers) + sizeof(cls.favoriteServers);
- FS_Write(&size, sizeof(int), fileOut);
- FS_Write(&cls.globalServers, sizeof(cls.globalServers), fileOut);
- FS_Write(&cls.favoriteServers, sizeof(cls.favoriteServers), fileOut);
- FS_FCloseFile(fileOut);
- */
+// TTimo: stub, this is only relevant to MP, SP kills the servercache.dat (and favorites)
+// show_bug.cgi?id=445
+/*
+ int size;
+ fileHandle_t fileOut;
+ fileOut = FS_SV_FOpenFileWrite( "servercache.dat" );
+ FS_Write( &cls.numglobalservers, sizeof( int ), fileOut );
+ FS_Write( &cls.numfavoriteservers, sizeof( int ), fileOut );
+ size = sizeof(cls.globalServers) + sizeof(cls.favoriteServers);
+ FS_Write( &size, sizeof( int ), fileOut );
+ FS_Write( &cls.globalServers, sizeof( cls.globalServers ), fileOut );
+ FS_Write( &cls.favoriteServers, sizeof( cls.favoriteServers ), fileOut );
+ FS_FCloseFile( fileOut );
+*/
}
@@ -670,17 +673,16 @@ static void CLUI_SetCDKey( char *buf ) {
if ( UI_usesUniqueCDKey() && fs && fs->string[0] != 0 ) {
memcpy( &cl_cdkey[16], buf, 16 );
cl_cdkey[32] = 0;
- // set the flag so the fle will be written at the next opportunity
+ // set the flag so the file will be written at the next opportunity
cvar_modifiedFlags |= CVAR_ARCHIVE;
} else {
memcpy( cl_cdkey, buf, 16 );
- // set the flag so the fle will be written at the next opportunity
+ // set the flag so the file will be written at the next opportunity
cvar_modifiedFlags |= CVAR_ARCHIVE;
}
}
#endif
-
/*
====================
GetConfigString
@@ -1032,7 +1034,7 @@ intptr_t CL_UISystemCalls( intptr_t *args ) {
return args[1];
case UI_MEMCPY:
- Com_Memset( VMA(1), args[2], args[3] );
+ Com_Memcpy( VMA(1), VMA(2), args[3] );
return args[1];
case UI_STRNCPY:
@@ -1072,7 +1074,6 @@ intptr_t CL_UISystemCalls( intptr_t *args ) {
S_StopBackgroundTrack();
return 0;
case UI_S_STARTBACKGROUNDTRACK:
-// S_StartBackgroundTrack( VMA( 1 ), VMA( 2 ), args[3] ); //----(SA) added fadeup time
S_StartBackgroundTrack( VMA( 1 ), VMA( 2 ) );
return 0;
@@ -1145,25 +1146,9 @@ CL_InitUI
void CL_InitUI( void ) {
int v;
- vmInterpret_t interpret;
// load the dll or bytecode
- interpret = Cvar_VariableValue("vm_ui");
- if(cl_connectedToPureServer)
- {
- // if sv_pure is set we only allow qvms to be loaded
- if(interpret != VMI_COMPILED && interpret != VMI_BYTECODE)
- interpret = VMI_COMPILED;
- }
-
-//----(SA) always dll
-
-#ifdef WOLF_SP_DEMO
- uivm = VM_Create( "ui", CL_UISystemCalls, VMI_NATIVE );
-#else
- uivm = VM_Create( "ui", CL_UISystemCalls, interpret );
-#endif
-
+ uivm = VM_Create( "ui", CL_UISystemCalls, Cvar_VariableValue("vm_ui") );
if ( !uivm ) {
Com_Error( ERR_FATAL, "VM_Create on UI failed" );
}
@@ -1176,7 +1161,6 @@ void CL_InitUI( void ) {
}
// init for this gamestate
-// VM_Call( uivm, UI_INIT );
VM_Call( uivm, UI_INIT, ( clc.state >= CA_AUTHORIZING && clc.state < CA_ACTIVE ) );
}
diff --git a/SP/code/client/client.h b/SP/code/client/client.h
index 38f5991..6861d6b 100644
--- a/SP/code/client/client.h
+++ b/SP/code/client/client.h
@@ -57,8 +57,8 @@ If you have questions concerning this license or the applicable additional terms
#define RETRANSMIT_TIMEOUT 3000 // time between connection packet retransmits
-#define LIMBOCHAT_WIDTH 140 // NERVE - SMF
-#define LIMBOCHAT_HEIGHT 7 // NERVE - SMF
+#define LIMBOCHAT_WIDTH 140 // NERVE - SMF
+#define LIMBOCHAT_HEIGHT 7 // NERVE - SMF
// snapshots are a view of the server at a given time
typedef struct {
@@ -356,7 +356,7 @@ typedef struct {
serverInfo_t globalServers[MAX_GLOBAL_SERVERS];
// additional global servers
int numGlobalServerAddresses;
- netadr_t globalServerAddresses[MAX_GLOBAL_SERVERS];
+ netadr_t globalServerAddresses[MAX_GLOBAL_SERVERS];
int numfavoriteservers;
serverInfo_t favoriteServers[MAX_OTHER_SERVERS];
@@ -376,7 +376,6 @@ typedef struct {
qhandle_t whiteShader;
qhandle_t consoleShader;
qhandle_t consoleShader2; //----(SA) added
-
} clientStatic_t;
extern clientStatic_t cls;
@@ -486,6 +485,7 @@ extern cvar_t *cl_waitForFire;
// NERVE - SMF - localization
extern cvar_t *cl_language;
// -NERVE - SMF
+
//=================================================
//
@@ -566,7 +566,6 @@ typedef enum {
KB_WBUTTONS7,
KB_MLOOK,
KB_KICK,
-
NUM_BUTTONS
} kbuttons_t;
@@ -700,7 +699,6 @@ void Key_SetCatcher( int catcher );
void LAN_LoadCachedServers( void );
void LAN_SaveServersToCache( void );
-
//
// cl_net_chan.c
//
diff --git a/SP/code/client/snd_dma.c b/SP/code/client/snd_dma.c
index d32df93..43a9cd3 100644
--- a/SP/code/client/snd_dma.c
+++ b/SP/code/client/snd_dma.c
@@ -93,11 +93,9 @@ cvar_t *s_wavonly;
static loopSound_t loopSounds[MAX_GENTITIES];
static channel_t *freelist = NULL;
-int s_rawend[MAX_RAW_STREAMS];
-int s_rawpainted[MAX_RAW_STREAMS];
-portable_samplepair_t s_rawsamples[MAX_RAW_STREAMS][MAX_RAW_SAMPLES];
-// RF, store the volumes, since now they get adjusted at time of painting, so we can extract talking data first
-portable_samplepair_t s_rawVolume[MAX_RAW_STREAMS];
+int s_rawend[MAX_RAW_STREAMS];
+int s_rawpainted[MAX_RAW_STREAMS];
+portable_samplepair_t s_rawsamples[MAX_RAW_STREAMS][MAX_RAW_SAMPLES];
// ====================================================================
@@ -965,7 +963,7 @@ void S_Base_AddLoopingSound( int entityNum, const vec3_t origin, const vec3_t ve
return;
}
- if( entityNum < 0 || entityNum >= MAX_GENTITIES )
+ if ( entityNum < 0 || entityNum >= MAX_GENTITIES )
return;
sfx = &s_knownSfx[ sfxHandle ];
@@ -1584,7 +1582,6 @@ void S_Update_(void) {
if (endtime - s_soundtime > samps)
endtime = s_soundtime + samps;
-
SNDDMA_BeginPainting ();
S_PaintChannels (endtime);
diff --git a/SP/code/client/snd_main.c b/SP/code/client/snd_main.c
index b9ef304..860c9ee 100644
--- a/SP/code/client/snd_main.c
+++ b/SP/code/client/snd_main.c
@@ -202,7 +202,6 @@ int S_GetVoiceAmplitude( int entityNum )
return 0;
}
-
/*
=================
S_RawSamples
diff --git a/SP/code/client/snd_mem.c b/SP/code/client/snd_mem.c
index acbcc35..77ff1ce 100644
--- a/SP/code/client/snd_mem.c
+++ b/SP/code/client/snd_mem.c
@@ -154,6 +154,7 @@ static int ResampleSfx( sfx_t *sfx, int channels, int inrate, int inwidth, int s
}
chunk = newchunk;
}
+
chunk->sndChunk[part] = sample;
}
}
diff --git a/SP/code/client/snd_openal.c b/SP/code/client/snd_openal.c
index 27ea5ed..8f2dfdb 100644
--- a/SP/code/client/snd_openal.c
+++ b/SP/code/client/snd_openal.c
@@ -2241,7 +2241,7 @@ void S_AL_StartBackgroundTrack( const char *intro, const char *loop )
// Generate the musicBuffers
if (!S_AL_GenBuffers(NUM_MUSIC_BUFFERS, musicBuffers, "music"))
return;
-
+
// Queue the musicBuffers up
for(i = 0; i < NUM_MUSIC_BUFFERS; i++)
{
@@ -2322,8 +2322,7 @@ void S_AL_FadeAllSounds( float targetvol, int time ) {
S_StartStreamingSound
======================
*/
-static
-void S_AL_StartStreamingSound( const char *intro, const char *loop, int entnum, int channel, int attenuation ) {
+static void S_AL_StartStreamingSound( const char *intro, const char *loop, int entnum, int channel, int attenuation ) {
// FIXME: Stub
}
@@ -2332,8 +2331,7 @@ void S_AL_StartStreamingSound( const char *intro, const char *loop, int entnum,
S_StopEntStreamingSound
======================
*/
-static
-void S_AL_StopEntStreamingSound( int entnum ) {
+static void S_AL_StopEntStreamingSound( int entnum ) {
// FIXME: Stub
}
diff --git a/SP/code/rend2/tr_init.c b/SP/code/rend2/tr_init.c
index d3b1962..e9fae70 100644
--- a/SP/code/rend2/tr_init.c
+++ b/SP/code/rend2/tr_init.c
@@ -1821,10 +1821,6 @@ refexport_t *GetRefAPI( int apiVersion, refimport_t *rimp ) {
re.GetEntityToken = R_GetEntityToken;
re.TakeVideoFrame = RE_TakeVideoFrame;
-#ifdef BLAH // MrE __USEA3D
- re.A3D_RenderGeometry = RE_A3D_RenderGeometry;
-#endif
-
// RF
re.ZombieFXAddNewHit = RB_ZombieFXAddNewHit;
diff --git a/SP/code/renderer/tr_init.c b/SP/code/renderer/tr_init.c
index 0406232..bd30f6d 100644
--- a/SP/code/renderer/tr_init.c
+++ b/SP/code/renderer/tr_init.c
@@ -1624,10 +1624,6 @@ refexport_t *GetRefAPI( int apiVersion, refimport_t *rimp ) {
re.GetEntityToken = R_GetEntityToken;
re.TakeVideoFrame = RE_TakeVideoFrame;
-#ifdef BLAH // MrE __USEA3D
- re.A3D_RenderGeometry = RE_A3D_RenderGeometry;
-#endif
-
// RF
re.ZombieFXAddNewHit = RB_ZombieFXAddNewHit;
diff --git a/SP/code/renderer/tr_public.h b/SP/code/renderer/tr_public.h
index ea8fd9c..f233b0f 100644
--- a/SP/code/renderer/tr_public.h
+++ b/SP/code/renderer/tr_public.h
@@ -106,12 +106,9 @@ typedef struct {
int ( *LerpTag )( orientation_t *tag, const refEntity_t *refent, const char *tagName, int startIndex );
void ( *ModelBounds )( qhandle_t model, vec3_t mins, vec3_t maxs );
-#ifdef __USEA3D
- void ( *A3D_RenderGeometry )( void *pVoidA3D, void *pVoidGeom, void *pVoidMat, void *pVoidGeomStatus );
-#endif
-
void ( *RegisterFont )( const char *fontName, int pointSize, fontInfo_t *font );
void ( *RemapShader )( const char *oldShader, const char *newShader, const char *offsetTime );
+
// RF
void ( *ZombieFXAddNewHit )( int entityNum, const vec3_t hitPos, const vec3_t hitDir );
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list