Fixed spelling and spacing in other modules
This commit is contained in:
parent
a7cb70de5a
commit
3a297fb75e
|
@ -141,7 +141,7 @@ static qboolean CL_GetSnapshot( int snapshotNumber, snapshot_t *snapshot ) {
|
|||
}
|
||||
snapshot->numEntities = count;
|
||||
for ( i = 0 ; i < count ; i++ ) {
|
||||
snapshot->entities[i] =
|
||||
snapshot->entities[i] =
|
||||
cl.parseEntities[ ( clSnap->parseEntitiesNum + i ) & (MAX_PARSE_ENTITIES-1) ];
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ static void CL_ConfigstringModified( void ) {
|
|||
|
||||
// leave the first 0 for uninitialized strings
|
||||
cl.gameState.dataCount = 1;
|
||||
|
||||
|
||||
for ( i = 0 ; i < MAX_CONFIGSTRINGS ; i++ ) {
|
||||
if ( i == index ) {
|
||||
dup = s;
|
||||
|
@ -334,7 +334,7 @@ rescan:
|
|||
// the clientLevelShot command is used during development
|
||||
// to generate 128*128 screenshots from the intermission
|
||||
// point of levels for the menu system to use
|
||||
// we pass it along to the cgame to make apropriate adjustments,
|
||||
// we pass it along to the cgame to make appropriate adjustments,
|
||||
// but we also clear the console and notify lines here
|
||||
if ( !strcmp( cmd, "clientLevelShot" ) ) {
|
||||
// don't do it if we aren't running the server locally,
|
||||
|
@ -385,7 +385,7 @@ void CL_ShutdownCGame( void ) {
|
|||
if ( !cgvm ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
re.VertexLighting( qfalse );
|
||||
|
||||
VM_Call( cgvm, 0, CG_SHUTDOWN );
|
||||
|
@ -468,7 +468,7 @@ static intptr_t CL_CgameSystemCalls( intptr_t *args ) {
|
|||
case CG_MILLISECONDS:
|
||||
return Sys_Milliseconds();
|
||||
case CG_CVAR_REGISTER:
|
||||
Cvar_Register( VMA(1), VMA(2), VMA(3), args[4] );
|
||||
Cvar_Register( VMA(1), VMA(2), VMA(3), args[4] );
|
||||
return 0;
|
||||
case CG_CVAR_UPDATE:
|
||||
Cvar_Update( VMA(1) );
|
||||
|
@ -587,7 +587,7 @@ static intptr_t CL_CgameSystemCalls( intptr_t *args ) {
|
|||
return 0;
|
||||
case CG_R_LOADWORLDMAP:
|
||||
re.LoadWorld( VMA(1) );
|
||||
return 0;
|
||||
return 0;
|
||||
case CG_R_REGISTERMODEL:
|
||||
return re.RegisterModel( VMA(1) );
|
||||
case CG_R_REGISTERSKIN:
|
||||
|
@ -1018,7 +1018,7 @@ static void CL_FirstSnapshot( void ) {
|
|||
Cbuf_AddText( "\n" );
|
||||
Cvar_Set( "activeAction", "" );
|
||||
}
|
||||
|
||||
|
||||
Sys_BeginProfiling();
|
||||
}
|
||||
|
||||
|
@ -1138,7 +1138,7 @@ void CL_SetCGameTime( void ) {
|
|||
cl.serverTimeDelta -= cls.frametime;
|
||||
} else {
|
||||
// cl_timeNudge is a user adjustable cvar that allows more
|
||||
// or less latency to be added in the interest of better
|
||||
// or less latency to be added in the interest of better
|
||||
// smoothness or better responsiveness.
|
||||
cl.serverTime = cls.realtime + cl.serverTimeDelta - CL_TimeNudge();
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ static void IN_MLookUp( void ) {
|
|||
static void IN_KeyDown( kbutton_t *b ) {
|
||||
const char *c;
|
||||
int k;
|
||||
|
||||
|
||||
c = Cmd_Argv(1);
|
||||
if ( c[0] ) {
|
||||
k = atoi(c);
|
||||
|
@ -119,7 +119,7 @@ static void IN_KeyDown( kbutton_t *b ) {
|
|||
if ( k == b->down[0] || k == b->down[1] ) {
|
||||
return; // repeating key
|
||||
}
|
||||
|
||||
|
||||
if ( !b->down[0] ) {
|
||||
b->down[0] = k;
|
||||
} else if ( !b->down[1] ) {
|
||||
|
@ -128,7 +128,7 @@ static void IN_KeyDown( kbutton_t *b ) {
|
|||
Com_Printf ("Three keys down for a button!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( b->active ) {
|
||||
return; // still down
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ Moves the local angle positions
|
|||
*/
|
||||
static void CL_AdjustAngles( void ) {
|
||||
float speed;
|
||||
|
||||
|
||||
if ( in_speed.active ) {
|
||||
speed = 0.001 * cls.frametime * cl_anglespeedkey->value;
|
||||
} else {
|
||||
|
@ -327,7 +327,7 @@ static void CL_KeyMove( usercmd_t *cmd ) {
|
|||
|
||||
//
|
||||
// adjust for speed key / running
|
||||
// the walking flag is to keep animations consistant
|
||||
// the walking flag is to keep animations consistent
|
||||
// even during acceleration and develeration
|
||||
//
|
||||
if ( in_speed.active ^ cl_run->integer ) {
|
||||
|
@ -452,27 +452,27 @@ static void CL_MouseMove( usercmd_t *cmd )
|
|||
mx = cl.mouseDx[cl.mouseIndex];
|
||||
my = cl.mouseDy[cl.mouseIndex];
|
||||
}
|
||||
|
||||
|
||||
cl.mouseIndex ^= 1;
|
||||
cl.mouseDx[cl.mouseIndex] = 0;
|
||||
cl.mouseDy[cl.mouseIndex] = 0;
|
||||
|
||||
if (mx == 0.0f && my == 0.0f)
|
||||
return;
|
||||
|
||||
|
||||
if (cl_mouseAccel->value != 0.0f)
|
||||
{
|
||||
if(cl_mouseAccelStyle->integer == 0)
|
||||
{
|
||||
float accelSensitivity;
|
||||
float rate;
|
||||
|
||||
|
||||
rate = sqrt(mx * mx + my * my) / (float) frame_msec;
|
||||
|
||||
accelSensitivity = cl_sensitivity->value + rate * cl_mouseAccel->value;
|
||||
mx *= accelSensitivity;
|
||||
my *= accelSensitivity;
|
||||
|
||||
|
||||
if(cl_showMouseRate->integer)
|
||||
Com_Printf("rate: %f, accelSensitivity: %f\n", rate, accelSensitivity);
|
||||
}
|
||||
|
@ -540,7 +540,7 @@ static void CL_CmdButtons( usercmd_t *cmd ) {
|
|||
// figure button bits
|
||||
// send a button bit even if the key was pressed and released in
|
||||
// less than a frame
|
||||
//
|
||||
//
|
||||
for ( i = 0 ; i < ARRAY_LEN( in_buttons ); i++ ) {
|
||||
if ( in_buttons[i].active || in_buttons[i].wasPressed ) {
|
||||
cmd->buttons |= 1 << i;
|
||||
|
@ -594,7 +594,7 @@ static usercmd_t CL_CreateCmd( void ) {
|
|||
|
||||
// keyboard angle adjustment
|
||||
CL_AdjustAngles ();
|
||||
|
||||
|
||||
Com_Memset( &cmd, 0, sizeof( cmd ) );
|
||||
|
||||
CL_CmdButtons( &cmd );
|
||||
|
@ -613,7 +613,7 @@ static usercmd_t CL_CreateCmd( void ) {
|
|||
cl.viewangles[PITCH] = oldAngles[PITCH] + 90;
|
||||
} else if ( oldAngles[PITCH] - cl.viewangles[PITCH] > 90 ) {
|
||||
cl.viewangles[PITCH] = oldAngles[PITCH] - 90;
|
||||
}
|
||||
}
|
||||
|
||||
// store out the final values
|
||||
CL_FinishMove( &cmd );
|
||||
|
@ -691,15 +691,14 @@ static qboolean CL_ReadyToSendPacket( void ) {
|
|||
}
|
||||
|
||||
// If we are downloading, we send no less than 50ms between packets
|
||||
if ( *clc.downloadTempName &&
|
||||
cls.realtime - clc.lastPacketSentTime < 50 ) {
|
||||
if ( *clc.downloadTempName && cls.realtime - clc.lastPacketSentTime < 50 ) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
// if we don't have a valid gamestate yet, only send
|
||||
// one packet a second
|
||||
if ( cls.state != CA_ACTIVE &&
|
||||
cls.state != CA_PRIMED &&
|
||||
if ( cls.state != CA_ACTIVE &&
|
||||
cls.state != CA_PRIMED &&
|
||||
!*clc.downloadTempName &&
|
||||
cls.realtime - clc.lastPacketSentTime < 1000 ) {
|
||||
return qfalse;
|
||||
|
@ -975,7 +974,7 @@ void CL_InitInput( void ) {
|
|||
cl_mouseAccelOffset = Cvar_Get( "cl_mouseAccelOffset", "5", CVAR_ARCHIVE_ND );
|
||||
Cvar_CheckRange( cl_mouseAccelOffset, "0.001", "50000", CV_FLOAT );
|
||||
|
||||
cl_showMouseRate = Cvar_Get ("cl_showmouserate", "0", 0);
|
||||
cl_showMouseRate = Cvar_Get( "cl_showmouserate", "0", 0 );
|
||||
|
||||
m_pitch = Cvar_Get( "m_pitch", "0.022", CVAR_ARCHIVE_ND );
|
||||
m_yaw = Cvar_Get( "m_yaw", "0.022", CVAR_ARCHIVE_ND );
|
||||
|
|
|
@ -99,7 +99,7 @@ static void Field_VariableSizeDraw( field_t *edit, int x, int y, int width, int
|
|||
for ( i = 0; i < prestep + 1; i++, s++ ) {
|
||||
if ( Q_IsColorString( s ) ) {
|
||||
curColor = *(s+1);
|
||||
s++;
|
||||
s++;
|
||||
}
|
||||
}
|
||||
// scroll marker
|
||||
|
@ -237,7 +237,7 @@ static void Field_KeyDownEvent( field_t *edit, int key ) {
|
|||
switch ( key ) {
|
||||
case K_DEL:
|
||||
if ( edit->cursor < len ) {
|
||||
memmove( edit->buffer + edit->cursor,
|
||||
memmove( edit->buffer + edit->cursor,
|
||||
edit->buffer + edit->cursor + 1, len - edit->cursor );
|
||||
}
|
||||
break;
|
||||
|
@ -309,7 +309,7 @@ static void Field_CharEvent( field_t *edit, int ch ) {
|
|||
|
||||
if ( ch == 'h' - 'a' + 1 ) { // ctrl-h is backspace
|
||||
if ( edit->cursor > 0 ) {
|
||||
memmove( edit->buffer + edit->cursor - 1,
|
||||
memmove( edit->buffer + edit->cursor - 1,
|
||||
edit->buffer + edit->cursor, len + 1 - edit->cursor );
|
||||
edit->cursor--;
|
||||
if ( edit->cursor < edit->scroll )
|
||||
|
@ -339,7 +339,7 @@ static void Field_CharEvent( field_t *edit, int ch ) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ( key_overstrikeMode ) {
|
||||
if ( key_overstrikeMode ) {
|
||||
// - 2 to leave room for the leading slash and trailing \0
|
||||
if ( edit->cursor == MAX_EDIT_LINE - 2 )
|
||||
return;
|
||||
|
@ -350,7 +350,7 @@ static void Field_CharEvent( field_t *edit, int ch ) {
|
|||
if ( len == MAX_EDIT_LINE - 2 ) {
|
||||
return; // all full
|
||||
}
|
||||
memmove( edit->buffer + edit->cursor + 1,
|
||||
memmove( edit->buffer + edit->cursor + 1,
|
||||
edit->buffer + edit->cursor, len + 1 - edit->cursor );
|
||||
edit->buffer[edit->cursor] = ch;
|
||||
edit->cursor++;
|
||||
|
@ -392,7 +392,7 @@ static void Console_Key( int key ) {
|
|||
// enter finishes the line
|
||||
if ( key == K_ENTER || key == K_KP_ENTER ) {
|
||||
// if not in the game explicitly prepend a slash if needed
|
||||
if ( cls.state != CA_ACTIVE
|
||||
if ( cls.state != CA_ACTIVE
|
||||
&& g_consoleField.buffer[0] != '\0'
|
||||
&& g_consoleField.buffer[0] != '\\'
|
||||
&& g_consoleField.buffer[0] != '/' ) {
|
||||
|
@ -580,7 +580,7 @@ static void CL_KeyDownEvent( int key, unsigned time )
|
|||
}
|
||||
|
||||
// keys can still be used for bound actions
|
||||
if ( ( key < 128 || key == K_MOUSE1 )
|
||||
if ( ( key < 128 || key == K_MOUSE1 )
|
||||
&& cls.state == CA_CINEMATIC && Key_GetCatcher( ) == 0 ) {
|
||||
|
||||
if ( Cvar_VariableIntegerValue( "com_cameraMode" ) == 0 ) {
|
||||
|
@ -642,17 +642,17 @@ static void CL_KeyDownEvent( int key, unsigned time )
|
|||
}
|
||||
|
||||
|
||||
// distribute the key down event to the apropriate handler
|
||||
// distribute the key down event to the appropriate handler
|
||||
if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) {
|
||||
Console_Key( key );
|
||||
} else if ( Key_GetCatcher( ) & KEYCATCH_UI ) {
|
||||
if ( uivm ) {
|
||||
VM_Call( uivm, 2, UI_KEY_EVENT, key, qtrue );
|
||||
}
|
||||
}
|
||||
} else if ( Key_GetCatcher( ) & KEYCATCH_CGAME ) {
|
||||
if ( cgvm ) {
|
||||
VM_Call( cgvm, 2, CG_KEY_EVENT, key, qtrue );
|
||||
}
|
||||
}
|
||||
} else if ( Key_GetCatcher( ) & KEYCATCH_MESSAGE ) {
|
||||
Message_Key( key );
|
||||
} else if ( cls.state == CA_DISCONNECTED ) {
|
||||
|
@ -735,7 +735,7 @@ void CL_CharEvent( int key )
|
|||
if ( key == 127 )
|
||||
return;
|
||||
|
||||
// distribute the key down event to the apropriate handler
|
||||
// distribute the key down event to the appropriate handler
|
||||
if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE )
|
||||
{
|
||||
Field_CharEvent( &g_consoleField, key );
|
||||
|
@ -744,7 +744,7 @@ void CL_CharEvent( int key )
|
|||
{
|
||||
VM_Call( uivm, 2, UI_KEY_EVENT, key | K_CHAR_FLAG, qtrue );
|
||||
}
|
||||
else if ( Key_GetCatcher( ) & KEYCATCH_MESSAGE )
|
||||
else if ( Key_GetCatcher( ) & KEYCATCH_MESSAGE )
|
||||
{
|
||||
Field_CharEvent( &chatField, key );
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ CLIENT RELIABLE COMMAND COMMUNICATION
|
|||
======================
|
||||
CL_AddReliableCommand
|
||||
|
||||
The given command will be transmitted to the server, and is gauranteed to
|
||||
The given command will be transmitted to the server, and is guaranteed to
|
||||
not have future usercmd_t executed before it is executed
|
||||
======================
|
||||
*/
|
||||
|
@ -183,9 +183,9 @@ void CL_AddReliableCommand( const char *cmd, qboolean isDisconnectCmd ) {
|
|||
// 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.
|
||||
|
||||
|
||||
if ((isDisconnectCmd && unacknowledged > MAX_RELIABLE_COMMANDS) ||
|
||||
(!isDisconnectCmd && unacknowledged >= MAX_RELIABLE_COMMANDS))
|
||||
(!isDisconnectCmd && unacknowledged >= MAX_RELIABLE_COMMANDS))
|
||||
{
|
||||
if( com_errorEntered )
|
||||
return;
|
||||
|
@ -317,7 +317,7 @@ static void CL_WriteServerCommands( msg_t *msg ) {
|
|||
CL_WriteGamestate
|
||||
====================
|
||||
*/
|
||||
static void CL_WriteGamestate( qboolean initial )
|
||||
static void CL_WriteGamestate( qboolean initial )
|
||||
{
|
||||
byte bufData[ MAX_MSGLEN_BUF ];
|
||||
char *s;
|
||||
|
@ -340,9 +340,9 @@ static void CL_WriteGamestate( qboolean initial )
|
|||
} else {
|
||||
CL_WriteServerCommands( &msg );
|
||||
}
|
||||
|
||||
|
||||
clc.demoDeltaNum = 0; // reset delta for next snapshot
|
||||
|
||||
|
||||
MSG_WriteByte( &msg, svc_gamestate );
|
||||
MSG_WriteLong( &msg, clc.serverCommandSequence );
|
||||
|
||||
|
@ -369,7 +369,7 @@ static void CL_WriteGamestate( qboolean initial )
|
|||
|
||||
// finalize message
|
||||
MSG_WriteByte( &msg, svc_EOF );
|
||||
|
||||
|
||||
// finished writing the gamestate stuff
|
||||
|
||||
// write the client num
|
||||
|
@ -436,7 +436,7 @@ static void CL_EmitPacketEntities( clSnapshot_t *from, clSnapshot_t *to, msg_t *
|
|||
if ( newnum == oldnum ) {
|
||||
// delta update from old position
|
||||
// because the force parm is qfalse, this will not result
|
||||
// in any bytes being emited if the entity has not changed at all
|
||||
// in any bytes being emitted if the entity has not changed at all
|
||||
MSG_WriteDeltaEntity (msg, oldent, newent, qfalse );
|
||||
oldindex++;
|
||||
newindex++;
|
||||
|
@ -470,9 +470,9 @@ CL_WriteSnapshot
|
|||
static void CL_WriteSnapshot( void ) {
|
||||
|
||||
static clSnapshot_t saved_snap;
|
||||
static entityState_t saved_ents[ MAX_SNAPSHOT_ENTITIES ];
|
||||
static entityState_t saved_ents[ MAX_SNAPSHOT_ENTITIES ];
|
||||
|
||||
clSnapshot_t *snap, *oldSnap;
|
||||
clSnapshot_t *snap, *oldSnap;
|
||||
byte bufData[ MAX_MSGLEN_BUF ];
|
||||
msg_t msg;
|
||||
int i, len;
|
||||
|
@ -495,7 +495,7 @@ static void CL_WriteSnapshot( void ) {
|
|||
|
||||
// Write all pending server commands
|
||||
CL_WriteServerCommands( &msg );
|
||||
|
||||
|
||||
MSG_WriteByte( &msg, svc_snapshot );
|
||||
MSG_WriteLong( &msg, snap->serverTime ); // sv.time
|
||||
MSG_WriteByte( &msg, clc.demoDeltaNum ); // 0 or 1
|
||||
|
@ -674,7 +674,7 @@ CL_DemoCompleted
|
|||
static void CL_DemoCompleted( void ) {
|
||||
if ( com_timedemo->integer ) {
|
||||
int time;
|
||||
|
||||
|
||||
time = Sys_Milliseconds() - clc.timeDemoStart;
|
||||
if ( time > 0 ) {
|
||||
Com_Printf( "%i frames, %3.*f seconds: %3.1f fps\n", clc.timeDemoFrames,
|
||||
|
@ -743,7 +743,7 @@ void CL_ReadDemoMessage( void ) {
|
|||
CL_ParseServerMessage( &buf );
|
||||
|
||||
if ( clc.demorecording ) {
|
||||
// track changes and write new message
|
||||
// track changes and write new message
|
||||
if ( clc.eventMask & EM_GAMESTATE ) {
|
||||
CL_WriteGamestate( qfalse );
|
||||
// nothing should came after gamestate in current message
|
||||
|
@ -762,7 +762,7 @@ CL_WalkDemoExt
|
|||
static int CL_WalkDemoExt( const char *arg, char *name, fileHandle_t *handle )
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
*handle = FS_INVALID_HANDLE;
|
||||
i = 0;
|
||||
|
||||
|
@ -790,7 +790,7 @@ static int CL_WalkDemoExt( const char *arg, char *name, fileHandle_t *handle )
|
|||
CL_DemoExtCallback
|
||||
====================
|
||||
*/
|
||||
static qboolean CL_DemoNameCallback_f( const char *filename, int length )
|
||||
static qboolean CL_DemoNameCallback_f( const char *filename, int length )
|
||||
{
|
||||
int version;
|
||||
|
||||
|
@ -882,13 +882,13 @@ static void CL_PlayDemo_f( void ) {
|
|||
}
|
||||
else
|
||||
protocol = CL_WalkDemoExt( arg, name, &hFile );
|
||||
|
||||
|
||||
if ( hFile == FS_INVALID_HANDLE ) {
|
||||
Com_Printf( S_COLOR_YELLOW "couldn't open %s\n", name );
|
||||
return;
|
||||
}
|
||||
|
||||
FS_FCloseFile( hFile );
|
||||
FS_FCloseFile( hFile );
|
||||
hFile = FS_INVALID_HANDLE;
|
||||
|
||||
// make sure a local server is killed
|
||||
|
@ -898,7 +898,7 @@ static void CL_PlayDemo_f( void ) {
|
|||
CL_Disconnect( qtrue );
|
||||
|
||||
// clc.demofile will be closed during CL_Disconnect so reopen it
|
||||
if ( FS_FOpenFileRead( name, &clc.demofile, qtrue ) == -1 )
|
||||
if ( FS_FOpenFileRead( name, &clc.demofile, qtrue ) == -1 )
|
||||
{
|
||||
// drop this time
|
||||
Com_Error( ERR_DROP, "couldn't open %s\n", name );
|
||||
|
@ -949,7 +949,7 @@ If the "nextdemo" cvar is set, that command will be issued
|
|||
static void CL_NextDemo( void ) {
|
||||
char v[ MAX_CVAR_VALUE_STRING ];
|
||||
|
||||
Cvar_VariableStringBuffer( "nextdemo", v, sizeof( v ) );
|
||||
Cvar_VariableStringBuffer( "nextdemo", v, sizeof( v ) );
|
||||
Com_DPrintf( "CL_NextDemo: %s\n", v );
|
||||
if ( !v[0] ) {
|
||||
return;
|
||||
|
@ -1060,11 +1060,11 @@ memory on the hunk from cgame, ui, and renderer
|
|||
=====================
|
||||
*/
|
||||
void CL_MapLoading( void ) {
|
||||
if ( com_dedicated->integer ) {
|
||||
cls.state = CA_DISCONNECTED;
|
||||
Key_SetCatcher( KEYCATCH_CONSOLE );
|
||||
return;
|
||||
}
|
||||
if ( com_dedicated->integer ) {
|
||||
cls.state = CA_DISCONNECTED;
|
||||
Key_SetCatcher( KEYCATCH_CONSOLE );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !com_cl_running->integer ) {
|
||||
return;
|
||||
|
@ -1130,7 +1130,7 @@ static void CL_UpdateGUID( const char *prefix, int prefix_len )
|
|||
len = FS_SV_FOpenFileRead( QKEY_FILE, &f );
|
||||
FS_FCloseFile( f );
|
||||
|
||||
if( len != QKEY_SIZE )
|
||||
if( len != QKEY_SIZE )
|
||||
Cvar_Set( "cl_guid", "" );
|
||||
else
|
||||
Cvar_Set( "cl_guid", Com_MD5File( QKEY_FILE, QKEY_SIZE,
|
||||
|
@ -1146,7 +1146,7 @@ static void CL_UpdateGUID( const char *prefix, int prefix_len )
|
|||
CL_ResetOldGame
|
||||
=====================
|
||||
*/
|
||||
void CL_ResetOldGame( void )
|
||||
void CL_ResetOldGame( void )
|
||||
{
|
||||
cl_oldGameSet = qfalse;
|
||||
cl_oldGame[0] = '\0';
|
||||
|
@ -1186,7 +1186,7 @@ This is also called on Com_Error and Com_Quit, so it shouldn't cause any errors
|
|||
qboolean CL_Disconnect( qboolean showMainMenu ) {
|
||||
static qboolean cl_disconnecting = qfalse;
|
||||
qboolean cl_restarted = qfalse;
|
||||
|
||||
|
||||
if ( !com_cl_running || !com_cl_running->integer ) {
|
||||
return cl_restarted;
|
||||
}
|
||||
|
@ -1347,13 +1347,13 @@ void CL_RequestMotd( void ) {
|
|||
cls.updateServer.ip[0], cls.updateServer.ip[1],
|
||||
cls.updateServer.ip[2], cls.updateServer.ip[3],
|
||||
BigShort( cls.updateServer.port ) );
|
||||
|
||||
|
||||
info[0] = 0;
|
||||
// NOTE TTimo xoring against Com_Milliseconds, otherwise we may not have a true randomization
|
||||
// only srand I could catch before here is tr_noise.c l:26 srand(1001)
|
||||
// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=382
|
||||
// NOTE: the Com_Milliseconds xoring only affects the lower 16-bit word,
|
||||
// but I decided it was enough randomization
|
||||
// NOTE TTimo xoring against Com_Milliseconds, otherwise we may not have a true randomization
|
||||
// only srand I could catch before here is tr_noise.c l:26 srand(1001)
|
||||
// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=382
|
||||
// NOTE: the Com_Milliseconds xoring only affects the lower 16-bit word,
|
||||
// but I decided it was enough randomization
|
||||
Com_sprintf( cls.updateChallenge, sizeof( cls.updateChallenge ), "%i", ((rand() << 16) ^ rand()) ^ Com_Milliseconds());
|
||||
|
||||
Info_SetValueForKey( info, "challenge", cls.updateChallenge );
|
||||
|
@ -1382,9 +1382,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.
|
||||
|
||||
|
@ -1442,7 +1442,7 @@ static void CL_RequestAuthorization( void ) {
|
|||
}
|
||||
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 );
|
||||
}
|
||||
|
@ -1541,9 +1541,9 @@ static 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 {
|
||||
|
@ -1616,7 +1616,7 @@ static void CL_Connect_f( void ) {
|
|||
|
||||
Q_strncpyz( cls.servername, server, sizeof( cls.servername ) );
|
||||
|
||||
// copy resolved address
|
||||
// copy resolved address
|
||||
clc.serverAddress = addr;
|
||||
|
||||
if (clc.serverAddress.port == 0) {
|
||||
|
@ -1678,8 +1678,8 @@ static void CL_CompleteRcon( char *args, int argNum )
|
|||
=====================
|
||||
CL_Rcon_f
|
||||
|
||||
Send the rest of the command line over as
|
||||
an unconnected command.
|
||||
Send the rest of the command line over as
|
||||
an unconnected command.
|
||||
=====================
|
||||
*/
|
||||
static void CL_Rcon_f( void ) {
|
||||
|
@ -1785,7 +1785,7 @@ static void CL_Vid_Restart( void ) {
|
|||
S_Shutdown();
|
||||
// shutdown the renderer and clear the renderer interface
|
||||
CL_ShutdownRef( qfalse );
|
||||
// client is no longer pure untill new checksums are sent
|
||||
// client is no longer pure until new checksums are sent
|
||||
CL_ResetPureClientAtServer();
|
||||
// clear pak references
|
||||
FS_ClearPakReferences( FS_UI_REF | FS_CGAME_REF );
|
||||
|
@ -1799,7 +1799,7 @@ static void CL_Vid_Restart( void ) {
|
|||
cls.soundRegistered = qfalse;
|
||||
cls.soundStarted = qfalse;
|
||||
|
||||
// unpause so the cgame definately gets a snapshot and renders a frame
|
||||
// unpause so the cgame definitely gets a snapshot and renders a frame
|
||||
Cvar_Set( "cl_paused", "0" );
|
||||
|
||||
CL_ClearMemory();
|
||||
|
@ -1991,12 +1991,12 @@ static void CL_DownloadsComplete( void ) {
|
|||
|
||||
#ifdef USE_CURL
|
||||
// if we downloaded with cURL
|
||||
if(clc.cURLUsed) {
|
||||
if ( clc.cURLUsed ) {
|
||||
clc.cURLUsed = qfalse;
|
||||
CL_cURL_Shutdown();
|
||||
if( clc.cURLDisconnected ) {
|
||||
if(clc.downloadRestart) {
|
||||
FS_Restart(clc.checksumFeed);
|
||||
if ( clc.cURLDisconnected ) {
|
||||
if ( clc.downloadRestart ) {
|
||||
FS_Restart( clc.checksumFeed );
|
||||
clc.downloadRestart = qfalse;
|
||||
}
|
||||
clc.cURLDisconnected = qfalse;
|
||||
|
@ -2007,7 +2007,7 @@ static void CL_DownloadsComplete( void ) {
|
|||
#endif
|
||||
|
||||
// if we downloaded files we need to restart the file system
|
||||
if (clc.downloadRestart) {
|
||||
if ( clc.downloadRestart ) {
|
||||
clc.downloadRestart = qfalse;
|
||||
|
||||
FS_Restart(clc.checksumFeed); // We possibly downloaded a pak, restart the file system to load it
|
||||
|
@ -2101,17 +2101,17 @@ void CL_NextDownload( void )
|
|||
char *remoteName, *localName;
|
||||
qboolean useCURL = qfalse;
|
||||
|
||||
// A download has finished, check whether this matches a referenced checksum
|
||||
if(*clc.downloadName)
|
||||
{
|
||||
const char *zippath = FS_BuildOSPath(Cvar_VariableString("fs_homepath"), clc.downloadName, NULL );
|
||||
// A download has finished, check whether this matches a referenced checksum
|
||||
if(*clc.downloadName)
|
||||
{
|
||||
const char *zippath = FS_BuildOSPath(Cvar_VariableString("fs_homepath"), clc.downloadName, NULL );
|
||||
|
||||
if(!FS_CompareZipChecksum(zippath))
|
||||
Com_Error(ERR_DROP, "Incorrect checksum for file: %s", clc.downloadName);
|
||||
}
|
||||
if(!FS_CompareZipChecksum(zippath))
|
||||
Com_Error(ERR_DROP, "Incorrect checksum for file: %s", clc.downloadName);
|
||||
}
|
||||
|
||||
*clc.downloadTempName = *clc.downloadName = 0;
|
||||
Cvar_Set("cl_downloadName", "");
|
||||
*clc.downloadTempName = *clc.downloadName = 0;
|
||||
Cvar_Set("cl_downloadName", "");
|
||||
|
||||
// We are looking to start a download here
|
||||
if (*clc.downloadList) {
|
||||
|
@ -2123,7 +2123,7 @@ void CL_NextDownload( void )
|
|||
if (*s == '@')
|
||||
s++;
|
||||
remoteName = s;
|
||||
|
||||
|
||||
if ( (s = strchr(s, '@')) == NULL ) {
|
||||
CL_DownloadsComplete();
|
||||
return;
|
||||
|
@ -2173,7 +2173,7 @@ void CL_NextDownload( void )
|
|||
"disabled on your client. "
|
||||
"(cl_allowDownload is %d)",
|
||||
cl_allowDownload->integer);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
CL_BeginDownload( localName, remoteName );
|
||||
|
@ -2253,7 +2253,7 @@ void CL_InitDownloads( void ) {
|
|||
}
|
||||
}
|
||||
#endif // USE_CURL
|
||||
|
||||
|
||||
CL_DownloadsComplete();
|
||||
}
|
||||
|
||||
|
@ -2299,7 +2299,7 @@ static void CL_CheckForResend( void ) {
|
|||
// The challenge request shall be followed by a client challenge so no malicious server can hijack this connection.
|
||||
NET_OutOfBandPrint( NS_CLIENT, &clc.serverAddress, "getchallenge %d", clc.challenge );
|
||||
break;
|
||||
|
||||
|
||||
case CA_CHALLENGING:
|
||||
// sending back the challenge
|
||||
port = Cvar_VariableIntegerValue( "net_qport" );
|
||||
|
@ -2312,7 +2312,7 @@ static void CL_CheckForResend( void ) {
|
|||
infoTruncated |= Info_RemoveKey( info, "xp_name" ) ? qtrue : qfalse;
|
||||
infoTruncated |= Info_RemoveKey( info, "xp_country" ) ? qtrue : qfalse;
|
||||
}
|
||||
|
||||
|
||||
len = strlen( info );
|
||||
if ( len > MAX_USERINFO_LENGTH ) {
|
||||
notOverflowed = qfalse;
|
||||
|
@ -2322,7 +2322,7 @@ static void CL_CheckForResend( void ) {
|
|||
|
||||
notOverflowed &= Info_SetValueForKey_s( info, MAX_USERINFO_LENGTH, "protocol",
|
||||
va( "%i", clc.compat ? PROTOCOL_VERSION : NEW_PROTOCOL_VERSION ) );
|
||||
|
||||
|
||||
notOverflowed &= Info_SetValueForKey_s( info, MAX_USERINFO_LENGTH, "qport",
|
||||
va( "%i", port ) );
|
||||
|
||||
|
@ -2414,7 +2414,7 @@ typedef struct hash_chain_s {
|
|||
struct hash_chain_s *next;
|
||||
} hash_chain_t;
|
||||
|
||||
hash_chain_t *hash_table[1024];
|
||||
hash_chain_t *hash_table[1024];
|
||||
hash_chain_t hash_list[MAX_GLOBAL_SERVERS];
|
||||
unsigned int hash_count = 0;
|
||||
|
||||
|
@ -2441,7 +2441,7 @@ unsigned int hash_func( const netadr_t *addr ) {
|
|||
return (hash & 1023);
|
||||
}
|
||||
|
||||
static void hash_insert( const netadr_t *addr )
|
||||
static void hash_insert( const netadr_t *addr )
|
||||
{
|
||||
hash_chain_t **tab, *cur;
|
||||
unsigned int hash;
|
||||
|
@ -2458,7 +2458,7 @@ static void hash_insert( const netadr_t *addr )
|
|||
*tab = cur;
|
||||
}
|
||||
|
||||
static void hash_reset( void )
|
||||
static void hash_reset( void )
|
||||
{
|
||||
hash_count = 0;
|
||||
memset( hash_list, 0, sizeof( hash_list ) );
|
||||
|
@ -2490,7 +2490,7 @@ static void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean
|
|||
byte* buffptr;
|
||||
byte* buffend;
|
||||
serverInfo_t *server;
|
||||
|
||||
|
||||
//Com_Printf("CL_ServersResponsePacket\n"); // moved down
|
||||
|
||||
if (cls.numglobalservers == -1) {
|
||||
|
@ -2510,7 +2510,7 @@ static void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean
|
|||
{
|
||||
if(*buffptr == '\\' || (extended && *buffptr == '/'))
|
||||
break;
|
||||
|
||||
|
||||
buffptr++;
|
||||
} while (buffptr < buffend);
|
||||
|
||||
|
@ -2537,10 +2537,10 @@ static void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean
|
|||
|
||||
if (buffend - buffptr < sizeof(addresses[numservers].ipv._6) + sizeof(addresses[numservers].port) + 1)
|
||||
break;
|
||||
|
||||
|
||||
for(i = 0; i < sizeof(addresses[numservers].ipv._6); i++)
|
||||
addresses[numservers].ipv._6[i] = *buffptr++;
|
||||
|
||||
|
||||
addresses[numservers].type = NA_IP6;
|
||||
addresses[numservers].scope_id = from->scope_id;
|
||||
}
|
||||
|
@ -2548,7 +2548,7 @@ static void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean
|
|||
else
|
||||
// syntax error!
|
||||
break;
|
||||
|
||||
|
||||
// parse out port
|
||||
addresses[numservers].port = (*buffptr++) << 8;
|
||||
addresses[numservers].port += *buffptr++;
|
||||
|
@ -2557,7 +2557,7 @@ static void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean
|
|||
// syntax check
|
||||
if (*buffptr != '\\' && *buffptr != '/')
|
||||
break;
|
||||
|
||||
|
||||
numservers++;
|
||||
if (numservers >= MAX_SERVERSPERPACKET)
|
||||
break;
|
||||
|
@ -2635,13 +2635,13 @@ static qboolean CL_ConnectionlessPacket( const netadr_t *from, msg_t *msg ) {
|
|||
{
|
||||
char *strver;
|
||||
int ver;
|
||||
|
||||
|
||||
if ( cls.state != CA_CONNECTING )
|
||||
{
|
||||
Com_DPrintf( "Unwanted challenge response received. Ignored.\n" );
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
|
||||
c = Cmd_Argv( 2 );
|
||||
if ( *c )
|
||||
challenge = atoi( c );
|
||||
|
@ -2660,7 +2660,7 @@ static qboolean CL_ConnectionlessPacket( const netadr_t *from, msg_t *msg ) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( clc.compat )
|
||||
{
|
||||
if( !NET_CompareAdr( from, &clc.serverAddress ) )
|
||||
|
@ -2723,7 +2723,7 @@ static qboolean CL_ConnectionlessPacket( const netadr_t *from, msg_t *msg ) {
|
|||
Com_Printf("Bad connectResponse received. Ignored.\n");
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
|
||||
if(challenge != clc.challenge)
|
||||
{
|
||||
Com_Printf("ConnectResponse with bad challenge received. Ignored.\n");
|
||||
|
@ -2844,7 +2844,7 @@ void CL_PacketEvent( const netadr_t *from, msg_t *msg ) {
|
|||
// 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 );
|
||||
|
@ -2871,7 +2871,7 @@ static void CL_CheckTimeout( void ) {
|
|||
//
|
||||
// check timeout
|
||||
//
|
||||
if ( ( !CL_CheckPaused() || !sv_paused->integer )
|
||||
if ( ( !CL_CheckPaused() || !sv_paused->integer )
|
||||
&& cls.state >= CA_CONNECTED && cls.state != CA_CINEMATIC
|
||||
&& cls.realtime - clc.lastPacketTime > cl_timeout->integer * 1000 ) {
|
||||
if ( ++cl.timeoutcount > 5 ) { // timeoutcount saves debugger
|
||||
|
@ -2904,7 +2904,7 @@ qboolean CL_CheckPaused( void )
|
|||
// lag behind.
|
||||
if(cl_paused->integer || cl_paused->modified)
|
||||
return qtrue;
|
||||
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
|
@ -2918,7 +2918,7 @@ qboolean CL_NoDelay( void )
|
|||
{
|
||||
if ( CL_VideoRecording() || ( com_timedemo->integer && clc.demofile != FS_INVALID_HANDLE ) )
|
||||
return qtrue;
|
||||
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
|
@ -3025,7 +3025,7 @@ void CL_Frame( int msec, int realMsec ) {
|
|||
clc.aviVideoFrameRemainder = frameDuration - msec;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( cl_autoRecordDemo->integer && !clc.demoplaying ) {
|
||||
if ( cls.state == CA_ACTIVE && !clc.demorecording ) {
|
||||
// If not recording a demo, and we should be, start one
|
||||
|
@ -3113,7 +3113,7 @@ CL_RefPrintf
|
|||
static __attribute__ ((format (printf, 2, 3))) void QDECL CL_RefPrintf( printParm_t level, const char *fmt, ... ) {
|
||||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
|
||||
|
||||
va_start( argptr, fmt );
|
||||
Q_vsnprintf( msg, sizeof( msg ), fmt, argptr );
|
||||
va_end( argptr );
|
||||
|
@ -3139,7 +3139,7 @@ static void CL_ShutdownRef( qboolean unloadDLL ) {
|
|||
unloadDLL = qtrue;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if ( re.Shutdown ) {
|
||||
if ( unloadDLL )
|
||||
re.Shutdown( REF_UNLOAD_DLL );
|
||||
|
@ -3374,7 +3374,7 @@ static void CL_InitRef( void ) {
|
|||
#endif
|
||||
rimp.Hunk_AllocateTempMemory = Hunk_AllocateTempMemory;
|
||||
rimp.Hunk_FreeTempMemory = Hunk_FreeTempMemory;
|
||||
|
||||
|
||||
rimp.CM_ClusterPVS = CM_ClusterPVS;
|
||||
rimp.CM_DrawDebugSurface = CM_DrawDebugSurface;
|
||||
|
||||
|
@ -3444,7 +3444,7 @@ static void CL_InitRef( void ) {
|
|||
|
||||
re = *ret;
|
||||
|
||||
// unpause so the cgame definately gets a snapshot and renders a frame
|
||||
// unpause so the cgame definitely gets a snapshot and renders a frame
|
||||
Cvar_Set( "cl_paused", "0" );
|
||||
}
|
||||
|
||||
|
@ -3611,7 +3611,7 @@ static void CL_GenerateQKey(void)
|
|||
FS_FCloseFile( f );
|
||||
Com_Printf( "QKEY generated\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -3730,7 +3730,7 @@ static void CL_InitGLimp_Cvars( void )
|
|||
r_allowSoftwareGL = Cvar_Get( "r_allowSoftwareGL", "0", CVAR_LATCH );
|
||||
r_swapInterval = Cvar_Get( "r_swapInterval", "0", CVAR_ARCHIVE_ND );
|
||||
r_glDriver = Cvar_Get( "r_glDriver", OPENGL_DRIVER_NAME, CVAR_ARCHIVE_ND | CVAR_LATCH );
|
||||
|
||||
|
||||
r_displayRefresh = Cvar_Get( "r_displayRefresh", "0", CVAR_LATCH );
|
||||
Cvar_CheckRange( r_displayRefresh, "0", "360", CV_INTEGER );
|
||||
Cvar_SetDescription( r_displayRefresh, "Override monitor refresh rate in fullscreen mode:\n 0 - use current monitor refresh rate\n >0 - use custom refresh rate" );
|
||||
|
@ -3827,7 +3827,7 @@ void CL_Init( void ) {
|
|||
|
||||
cl_aviPipeFormat = Cvar_Get( "cl_aviPipeFormat",
|
||||
"-preset medium -crf 23 -vcodec libx264 -flags +cgop -pix_fmt yuv420p "
|
||||
"-bf 2 -codec:a aac -strict -2 -b:a 160k -r:a 22050 -movflags faststart",
|
||||
"-bf 2 -codec:a aac -strict -2 -b:a 160k -r:a 22050 -movflags faststart",
|
||||
CVAR_ARCHIVE );
|
||||
|
||||
rconAddress = Cvar_Get ("rconAddress", "", 0);
|
||||
|
@ -3866,7 +3866,7 @@ void CL_Init( void ) {
|
|||
cl_guidServerUniq = Cvar_Get( "cl_guidServerUniq", "1", CVAR_ARCHIVE_ND );
|
||||
|
||||
cl_dlURL = Cvar_Get( "cl_dlURL", "http://ws.q3df.org/maps/download/%1", CVAR_ARCHIVE_ND );
|
||||
|
||||
|
||||
cl_dlDirectory = Cvar_Get( "cl_dlDirectory", "0", CVAR_ARCHIVE_ND );
|
||||
Cvar_CheckRange( cl_dlDirectory, "0", "1", CV_INTEGER );
|
||||
s = va( "Save downloads initiated by \\dlmap and \\download commands in:\n"
|
||||
|
@ -3950,7 +3950,7 @@ void CL_Init( void ) {
|
|||
|
||||
Cvar_Set( "cl_running", "1" );
|
||||
#ifdef USE_MD5
|
||||
CL_GenerateQKey();
|
||||
CL_GenerateQKey();
|
||||
#endif
|
||||
Cvar_Get( "cl_guid", "", CVAR_USERINFO | CVAR_ROM | CVAR_PROTECTED );
|
||||
CL_UpdateGUID( NULL, 0 );
|
||||
|
@ -4437,7 +4437,7 @@ static void CL_GlobalServers_f( void ) {
|
|||
int count, i, masterNum;
|
||||
char command[1024];
|
||||
const char *masteraddress;
|
||||
|
||||
|
||||
if ( (count = Cmd_Argc()) < 3 || (masterNum = atoi(Cmd_Argv(1))) < 0 || masterNum > MAX_MASTER_SERVERS )
|
||||
{
|
||||
Com_Printf( "usage: globalservers <master# 0-%d> <protocol> [keywords]\n", MAX_MASTER_SERVERS );
|
||||
|
@ -4469,22 +4469,22 @@ static void CL_GlobalServers_f( void ) {
|
|||
|
||||
sprintf( command, "sv_master%d", masterNum );
|
||||
masteraddress = Cvar_VariableString( command );
|
||||
|
||||
|
||||
if ( !*masteraddress )
|
||||
{
|
||||
Com_Printf( "CL_GlobalServers_f: Error: No master server address given.\n");
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
// reset the list, waiting for response
|
||||
// -1 is used to distinguish a "no response"
|
||||
|
||||
i = NET_StringToAdr( masteraddress, &to, NA_UNSPEC );
|
||||
|
||||
|
||||
if ( i == 0 )
|
||||
{
|
||||
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 );
|
||||
|
@ -4499,7 +4499,7 @@ static void CL_GlobalServers_f( void ) {
|
|||
if ( to.type == NA_IP6 || to.type == NA_MULTICAST6 )
|
||||
{
|
||||
int v4enabled = Cvar_VariableIntegerValue( "net_enabled" ) & NET_ENABLEV4;
|
||||
|
||||
|
||||
if ( v4enabled )
|
||||
{
|
||||
Com_sprintf( command, sizeof( command ), "getserversExt %s %s",
|
||||
|
@ -4701,9 +4701,9 @@ static 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
|
||||
|
@ -4719,7 +4719,7 @@ static void CL_Ping_f( void ) {
|
|||
else
|
||||
Com_Printf( "warning: only -4 as address type understood.\n" );
|
||||
#endif
|
||||
|
||||
|
||||
server = Cmd_Argv(2);
|
||||
}
|
||||
|
||||
|
@ -4736,7 +4736,7 @@ static void CL_Ping_f( void ) {
|
|||
pingptr->time = 0;
|
||||
|
||||
CL_SetServerInfoByAddress( &pingptr->adr, NULL, 0 );
|
||||
|
||||
|
||||
NET_OutOfBandPrint( NS_CLIENT, &to, "getinfo xxx" );
|
||||
}
|
||||
|
||||
|
@ -4826,7 +4826,7 @@ qboolean CL_UpdateVisiblePings_f(int source) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (slots) {
|
||||
status = qtrue;
|
||||
|
@ -4875,11 +4875,11 @@ static void CL_ServerStatus_f( void ) {
|
|||
|
||||
toptr = &clc.serverAddress;
|
||||
}
|
||||
|
||||
|
||||
if ( !toptr )
|
||||
{
|
||||
Com_Memset( &to, 0, sizeof( to ) );
|
||||
|
||||
|
||||
if ( argc == 2 )
|
||||
server = Cmd_Argv(1);
|
||||
else
|
||||
|
@ -4895,7 +4895,7 @@ static void CL_ServerStatus_f( void ) {
|
|||
else
|
||||
Com_Printf( "warning: only -4 as address type understood.\n" );
|
||||
#endif
|
||||
|
||||
|
||||
server = Cmd_Argv(2);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ static const char *svc_strings[256] = {
|
|||
"svc_nop",
|
||||
"svc_gamestate",
|
||||
"svc_configstring",
|
||||
"svc_baseline",
|
||||
"svc_baseline",
|
||||
"svc_serverCommand",
|
||||
"svc_download",
|
||||
"svc_snapshot",
|
||||
|
@ -61,8 +61,7 @@ Parses deltas from the given base and adds the resulting entity
|
|||
to the current frame
|
||||
==================
|
||||
*/
|
||||
static void CL_DeltaEntity( msg_t *msg, clSnapshot_t *frame, int newnum, const entityState_t *old,
|
||||
qboolean unchanged) {
|
||||
static void CL_DeltaEntity( msg_t *msg, clSnapshot_t *frame, int newnum, const entityState_t *old, qboolean unchanged) {
|
||||
entityState_t *state;
|
||||
|
||||
// save the parsed entity state into the big circular buffer so
|
||||
|
@ -129,7 +128,7 @@ static void CL_ParsePacketEntities( msg_t *msg, const clSnapshot_t *oldframe, cl
|
|||
Com_Printf ("%3i: unchanged: %i\n", msg->readcount, oldnum);
|
||||
}
|
||||
CL_DeltaEntity( msg, newframe, oldnum, oldstate, qtrue );
|
||||
|
||||
|
||||
oldindex++;
|
||||
|
||||
if ( oldindex >= oldframe->numEntities ) {
|
||||
|
@ -177,7 +176,7 @@ static void CL_ParsePacketEntities( msg_t *msg, const clSnapshot_t *oldframe, cl
|
|||
Com_Printf ("%3i: unchanged: %i\n", msg->readcount, oldnum);
|
||||
}
|
||||
CL_DeltaEntity( msg, newframe, oldnum, oldstate, qtrue );
|
||||
|
||||
|
||||
oldindex++;
|
||||
|
||||
if ( oldindex >= oldframe->numEntities ) {
|
||||
|
@ -238,7 +237,7 @@ static void CL_ParseSnapshot( msg_t *msg ) {
|
|||
// If the frame is delta compressed from data that we
|
||||
// no longer have available, we must suck up the rest of
|
||||
// the frame, but not use it, then ask for a non-compressed
|
||||
// message
|
||||
// message
|
||||
if ( newSnap.deltaNum <= 0 ) {
|
||||
newSnap.valid = qtrue; // uncompressed frame
|
||||
old = NULL;
|
||||
|
@ -261,13 +260,13 @@ static void CL_ParseSnapshot( msg_t *msg ) {
|
|||
|
||||
// read areamask
|
||||
newSnap.areabytes = MSG_ReadByte( msg );
|
||||
|
||||
|
||||
if ( newSnap.areabytes > sizeof(newSnap.areamask) )
|
||||
{
|
||||
Com_Error( ERR_DROP,"CL_ParseSnapshot: Invalid size %d for areamask", newSnap.areabytes );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
MSG_ReadData( msg, &newSnap.areamask, newSnap.areabytes );
|
||||
|
||||
// read playerinfo
|
||||
|
@ -412,7 +411,7 @@ void CL_SystemInfoChanged( qboolean onlyGame ) {
|
|||
s = systemInfo;
|
||||
while ( s ) {
|
||||
int cvar_flags;
|
||||
|
||||
|
||||
Info_NextPair( &s, key, value );
|
||||
if ( !key[0] ) {
|
||||
break;
|
||||
|
@ -428,9 +427,9 @@ void CL_SystemInfoChanged( qboolean onlyGame ) {
|
|||
if ( !Q_stricmp( key, "sv_referencedPaks" ) || !Q_stricmp( key, "sv_referencedPakNames" ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ( !Q_stricmp( key, "fs_game" ) ) {
|
||||
continue; // already procesed
|
||||
continue; // already processed
|
||||
}
|
||||
|
||||
if((cvar_flags = Cvar_Flags(key)) == CVAR_NONEXISTENT)
|
||||
|
@ -539,7 +538,7 @@ static void CL_ParseGamestate( msg_t *msg ) {
|
|||
if ( cmd == svc_EOF ) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ( cmd == svc_configstring ) {
|
||||
int len;
|
||||
|
||||
|
@ -552,7 +551,7 @@ static void CL_ParseGamestate( msg_t *msg ) {
|
|||
len = strlen( s );
|
||||
|
||||
if ( len + 1 + cl.gameState.dataCount > MAX_GAMESTATE_CHARS ) {
|
||||
Com_Error( ERR_DROP, "MAX_GAMESTATE_CHARS exceeded: %i",
|
||||
Com_Error( ERR_DROP, "MAX_GAMESTATE_CHARS exceeded: %i",
|
||||
len + 1 + cl.gameState.dataCount );
|
||||
}
|
||||
|
||||
|
@ -596,7 +595,7 @@ static void CL_ParseGamestate( msg_t *msg ) {
|
|||
}
|
||||
|
||||
gamedirModified = ( Cvar_Flags( "fs_game" ) & CVAR_MODIFIED ) ? qtrue : qfalse;
|
||||
|
||||
|
||||
if ( !cl_oldGameSet && gamedirModified ) {
|
||||
cl_oldGameSet = qtrue;
|
||||
Q_strncpyz( cl_oldGame, oldGame, sizeof( cl_oldGame ) );
|
||||
|
@ -627,7 +626,7 @@ checks for valid ZIP signature
|
|||
returns qtrue for normal and empty archives
|
||||
=====================
|
||||
*/
|
||||
qboolean CL_ValidPakSignature( const byte *data, int len )
|
||||
qboolean CL_ValidPakSignature( const byte *data, int len )
|
||||
{
|
||||
// maybe it is not 100% correct to check for file size here
|
||||
// because we may receive more data in future packets
|
||||
|
@ -695,7 +694,7 @@ static void CL_ParseDownload( msg_t *msg ) {
|
|||
Com_Error(ERR_DROP, "CL_ParseDownload: Invalid size %d for download chunk", size);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
MSG_ReadData(msg, data, size);
|
||||
|
||||
if((clc.downloadBlock & 0xFFFF) != block)
|
||||
|
@ -705,9 +704,9 @@ static void CL_ParseDownload( msg_t *msg ) {
|
|||
}
|
||||
|
||||
// open the file if not opened yet
|
||||
if ( clc.download == FS_INVALID_HANDLE )
|
||||
if ( clc.download == FS_INVALID_HANDLE )
|
||||
{
|
||||
if ( !CL_ValidPakSignature( data, size ) )
|
||||
if ( !CL_ValidPakSignature( data, size ) )
|
||||
{
|
||||
Com_Printf( S_COLOR_YELLOW "Invalid pak signature for %s\n", clc.downloadName );
|
||||
CL_AddReliableCommand( "stopdl", qfalse );
|
||||
|
@ -717,7 +716,7 @@ static void CL_ParseDownload( msg_t *msg ) {
|
|||
|
||||
clc.download = FS_SV_FOpenFileWrite( clc.downloadTempName );
|
||||
|
||||
if ( clc.download == FS_INVALID_HANDLE )
|
||||
if ( clc.download == FS_INVALID_HANDLE )
|
||||
{
|
||||
Com_Printf( "Could not create %s\n", clc.downloadTempName );
|
||||
CL_AddReliableCommand( "stopdl", qfalse );
|
||||
|
@ -831,7 +830,7 @@ void CL_ParseServerMessage( msg_t *msg ) {
|
|||
|
||||
// get the reliable sequence acknowledge number
|
||||
clc.reliableAcknowledge = MSG_ReadLong( msg );
|
||||
//
|
||||
//
|
||||
if ( clc.reliableAcknowledge < clc.reliableSequence - MAX_RELIABLE_COMMANDS ) {
|
||||
clc.reliableAcknowledge = clc.reliableSequence;
|
||||
}
|
||||
|
@ -859,12 +858,12 @@ void CL_ParseServerMessage( msg_t *msg ) {
|
|||
SHOWNET( msg, svc_strings[cmd] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// other commands
|
||||
switch ( cmd ) {
|
||||
default:
|
||||
Com_Error (ERR_DROP,"CL_ParseServerMessage: Illegible server message");
|
||||
break;
|
||||
break;
|
||||
case svc_nop:
|
||||
break;
|
||||
case svc_serverCommand:
|
||||
|
|
|
@ -61,7 +61,7 @@ void LAN_LoadCachedServers( void ) {
|
|||
FS_FCloseFile( fileIn );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
FS_Read( &cls.numglobalservers, sizeof(int), fileIn );
|
||||
FS_Read( &cls.numfavoriteservers, sizeof(int), fileIn );
|
||||
|
@ -85,7 +85,6 @@ LAN_SaveServersToCache
|
|||
====================
|
||||
*/
|
||||
void LAN_SaveServersToCache( void ) {
|
||||
|
||||
fileHandle_t fileOut;
|
||||
int size;
|
||||
|
||||
|
@ -725,7 +724,7 @@ static int GetConfigString(int index, char *buf, int size)
|
|||
}
|
||||
|
||||
Q_strncpyz( buf, cl.gameState.stringData+offset, size);
|
||||
|
||||
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
|
@ -796,7 +795,7 @@ static intptr_t CL_UISystemCalls( intptr_t *args ) {
|
|||
return Sys_Milliseconds();
|
||||
|
||||
case UI_CVAR_REGISTER:
|
||||
Cvar_Register( VMA(1), VMA(2), VMA(3), args[4] );
|
||||
Cvar_Register( VMA(1), VMA(2), VMA(3), args[4] );
|
||||
return 0;
|
||||
|
||||
case UI_CVAR_UPDATE:
|
||||
|
@ -977,7 +976,7 @@ static intptr_t CL_UISystemCalls( intptr_t *args ) {
|
|||
case UI_GETCLIENTSTATE:
|
||||
VM_CHECKBOUNDS( uivm, args[1], sizeof( uiClientState_t ) );
|
||||
GetClientState( VMA(1) );
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
case UI_GETGLCONFIG:
|
||||
VM_CHECKBOUNDS( uivm, args[1], sizeof( glconfig_t ) );
|
||||
|
@ -1070,7 +1069,7 @@ static intptr_t CL_UISystemCalls( intptr_t *args ) {
|
|||
CLUI_SetCDKey( VMA(1) );
|
||||
#endif
|
||||
return 0;
|
||||
|
||||
|
||||
case UI_SET_PBCLSTATUS:
|
||||
return 0;
|
||||
|
||||
|
@ -1172,7 +1171,7 @@ static intptr_t CL_UISystemCalls( intptr_t *args ) {
|
|||
case UI_TRAP_GETVALUE:
|
||||
VM_CHECKBOUNDS( uivm, args[1], args[2] );
|
||||
return UI_GetValue( VMA(1), args[2], VMA(3) );
|
||||
|
||||
|
||||
default:
|
||||
Com_Error( ERR_DROP, "Bad UI system trap: %ld", (long int) args[0] );
|
||||
|
||||
|
@ -1250,7 +1249,7 @@ void CL_InitUI( void ) {
|
|||
uivm = VM_Create( VM_UI, CL_UISystemCalls, UI_DllSyscall, interpret );
|
||||
if ( !uivm ) {
|
||||
if ( cl_connectedToPureServer && CL_GameSwitch() ) {
|
||||
// server-side modificaton may require and reference only single custom ui.qvm
|
||||
// server-side modification may require and reference only single custom ui.qvm
|
||||
// so allow referencing everything until we download all files
|
||||
// new gamestate will be requested after downloads complete
|
||||
// which will correct filesystem permissions
|
||||
|
|
|
@ -19,7 +19,7 @@ along with Quake III Arena source code; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
// snd_local.h -- private sound definations
|
||||
// snd_local.h -- private sound definitions
|
||||
|
||||
|
||||
#include "../qcommon/q_shared.h"
|
||||
|
@ -38,14 +38,14 @@ typedef struct {
|
|||
} portable_samplepair_t;
|
||||
|
||||
typedef struct adpcm_state {
|
||||
short sample; /* Previous output value */
|
||||
char index; /* Index into stepsize table */
|
||||
short sample; /* Previous output value */
|
||||
char index; /* Index into stepsize table */
|
||||
} adpcm_state_t;
|
||||
|
||||
typedef struct sndBuffer_s {
|
||||
short sndChunk[SND_CHUNK_SIZE];
|
||||
struct sndBuffer_s *next;
|
||||
int size;
|
||||
int size;
|
||||
adpcm_state_t adpcm;
|
||||
} sndBuffer;
|
||||
|
||||
|
@ -54,7 +54,7 @@ typedef struct sfx_s {
|
|||
qboolean defaultSound; // couldn't be loaded, so use buzz
|
||||
qboolean inMemory; // not in Memory
|
||||
qboolean soundCompressed; // not in Memory
|
||||
int soundCompressionMethod;
|
||||
int soundCompressionMethod;
|
||||
int soundLength;
|
||||
int soundChannels;
|
||||
char soundName[MAX_QPATH];
|
||||
|
|
|
@ -89,7 +89,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#define CS_SOUNDS (CS_MODELS+MAX_MODELS)
|
||||
#define CS_PLAYERS (CS_SOUNDS+MAX_SOUNDS)
|
||||
#define CS_LOCATIONS (CS_PLAYERS+MAX_CLIENTS)
|
||||
#define CS_PARTICLES (CS_LOCATIONS+MAX_LOCATIONS)
|
||||
#define CS_PARTICLES (CS_LOCATIONS+MAX_LOCATIONS)
|
||||
|
||||
#define CS_MAX (CS_PARTICLES+MAX_LOCATIONS)
|
||||
|
||||
|
@ -136,7 +136,7 @@ typedef enum {
|
|||
} pmtype_t;
|
||||
|
||||
typedef enum {
|
||||
WEAPON_READY,
|
||||
WEAPON_READY,
|
||||
WEAPON_RAISING,
|
||||
WEAPON_DROPPING,
|
||||
WEAPON_FIRING
|
||||
|
@ -210,10 +210,10 @@ typedef enum {
|
|||
STAT_PERSISTANT_POWERUP,
|
||||
#endif
|
||||
STAT_WEAPONS, // 16 bit fields
|
||||
STAT_ARMOR,
|
||||
STAT_ARMOR,
|
||||
STAT_DEAD_YAW, // look this direction when dead (FIXME: get rid of?)
|
||||
STAT_CLIENTS_READY, // bit mask of clients wishing to exit the intermission (FIXME: configstring?)
|
||||
STAT_MAX_HEALTH // health / armor limit, changable by handicap
|
||||
STAT_MAX_HEALTH // health / armor limit, changeable by handicap
|
||||
} statIndex_t;
|
||||
|
||||
|
||||
|
@ -562,7 +562,7 @@ typedef enum {
|
|||
//team task
|
||||
typedef enum {
|
||||
TEAMTASK_NONE,
|
||||
TEAMTASK_OFFENSE,
|
||||
TEAMTASK_OFFENSE,
|
||||
TEAMTASK_DEFENSE,
|
||||
TEAMTASK_PATROL,
|
||||
TEAMTASK_FOLLOW,
|
||||
|
|
|
@ -61,9 +61,9 @@ typedef struct {
|
|||
|
||||
int svFlags; // SVF_NOCLIENT, SVF_BROADCAST, etc
|
||||
|
||||
// only send to this client when SVF_SINGLECLIENT is set
|
||||
// only send to this client when SVF_SINGLECLIENT is set
|
||||
// if SVF_CLIENTMASK is set, use bitmask for clients to send to (maxclients must be <= 32, up to the mod to enforce this)
|
||||
int singleClient;
|
||||
int singleClient;
|
||||
|
||||
qboolean bmodel; // if false, assume an explicit mins / maxs bounding box
|
||||
// only set by trap_SetBrushModel
|
||||
|
@ -76,7 +76,7 @@ typedef struct {
|
|||
// currentOrigin will be used for all collision detection and world linking.
|
||||
// it will not necessarily be the same as the trajectory evaluation for the current
|
||||
// time, because each entity must be moved one at a time after time is advanced
|
||||
// to avoid simultanious collision issues
|
||||
// to avoid simultaneous collision issues
|
||||
vec3_t currentOrigin;
|
||||
vec3_t currentAngles;
|
||||
|
||||
|
@ -195,7 +195,7 @@ typedef enum {
|
|||
// if it is not passed to linkentity. If the size, position, or
|
||||
// solidity changes, it must be relinked.
|
||||
|
||||
G_UNLINKENTITY, // ( gentity_t *ent );
|
||||
G_UNLINKENTITY, // ( gentity_t *ent );
|
||||
// call before removing an interactive entity
|
||||
|
||||
G_ENTITIES_IN_BOX, // ( const vec3_t mins, const vec3_t maxs, gentity_t **list, int maxcount );
|
||||
|
@ -225,7 +225,7 @@ typedef enum {
|
|||
|
||||
G_TRACECAPSULE, // ( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
|
||||
G_ENTITY_CONTACTCAPSULE, // ( const vec3_t mins, const vec3_t maxs, const gentity_t *ent );
|
||||
|
||||
|
||||
// 1.32
|
||||
G_FS_SEEK,
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ static qboolean CM_NeedsSubdivision( const vec3_t a, const vec3_t b, const vec3_
|
|||
// see if the curve is far enough away from the linear mid
|
||||
VectorSubtract( cmid, lmid, delta );
|
||||
dist = VectorLength( delta );
|
||||
|
||||
|
||||
return dist >= SUBDIVIDE_DISTANCE;
|
||||
}
|
||||
|
||||
|
@ -300,7 +300,7 @@ static void CM_SubdivideGridColumns( cGrid_t *grid ) {
|
|||
// grid->points[i+2][x] is an interpolating control point
|
||||
|
||||
//
|
||||
// first see if we can collapse the aproximating collumn away
|
||||
// first see if we can collapse the aproximating column away
|
||||
//
|
||||
for ( j = 0 ; j < grid->height ; j++ ) {
|
||||
if ( CM_NeedsSubdivision( grid->points[i][j], grid->points[i+1][j], grid->points[i+2][j] ) ) {
|
||||
|
@ -818,7 +818,7 @@ static qboolean CM_ValidateFacet( const facet_t *facet ) {
|
|||
// see if the facet is unreasonably large
|
||||
WindingBounds( w, bounds[0], bounds[1] );
|
||||
FreeWinding( w );
|
||||
|
||||
|
||||
for ( j = 0 ; j < 3 ; j++ ) {
|
||||
if ( bounds[1][j] - bounds[0][j] > MAX_MAP_BOUNDS ) {
|
||||
return qfalse; // we must be missing a plane
|
||||
|
@ -886,7 +886,7 @@ static void CM_AddFacetBevels( facet_t *facet ) {
|
|||
if (CM_PlaneEqual(&planes[facet->surfacePlane], plane, &flipped)) {
|
||||
continue;
|
||||
}
|
||||
// see if the plane is allready present
|
||||
// see if the plane is already present
|
||||
for ( i = 0 ; i < facet->numBorders ; i++ ) {
|
||||
if (CM_PlaneEqual(&planes[facet->borderPlanes[i]], plane, &flipped))
|
||||
break;
|
||||
|
@ -952,7 +952,7 @@ static void CM_AddFacetBevels( facet_t *facet ) {
|
|||
if (CM_PlaneEqual(&planes[facet->surfacePlane], plane, &flipped)) {
|
||||
continue;
|
||||
}
|
||||
// see if the plane is allready present
|
||||
// see if the plane is already present
|
||||
for ( i = 0 ; i < facet->numBorders ; i++ ) {
|
||||
if (CM_PlaneEqual(&planes[facet->borderPlanes[i]], plane, &flipped)) {
|
||||
break;
|
||||
|
@ -1054,13 +1054,13 @@ static void CM_PatchCollideFromGrid( const cGrid_t *grid, patchCollide_t *pf ) {
|
|||
// create the borders for each facet
|
||||
for ( i = 0 ; i < grid->width - 1 ; i++ ) {
|
||||
for ( j = 0 ; j < grid->height - 1 ; j++ ) {
|
||||
|
||||
|
||||
borders[EN_TOP] = -1;
|
||||
if ( j > 0 ) {
|
||||
borders[EN_TOP] = gridPlanes[i][j-1][1];
|
||||
} else if ( grid->wrapHeight ) {
|
||||
borders[EN_TOP] = gridPlanes[i][grid->height-2][1];
|
||||
}
|
||||
}
|
||||
noAdjust[EN_TOP] = ( borders[EN_TOP] == gridPlanes[i][j][0] );
|
||||
if ( borders[EN_TOP] == -1 || noAdjust[EN_TOP] ) {
|
||||
borders[EN_TOP] = CM_EdgePlaneNum( grid, gridPlanes, i, j, 0 );
|
||||
|
@ -1125,7 +1125,7 @@ static void CM_PatchCollideFromGrid( const cGrid_t *grid, patchCollide_t *pf ) {
|
|||
numFacets++;
|
||||
}
|
||||
} else {
|
||||
// two seperate triangles
|
||||
// two separate triangles
|
||||
facet->surfacePlane = gridPlanes[i][j][0];
|
||||
facet->numBorders = 3;
|
||||
facet->borderPlanes[0] = borders[EN_TOP];
|
||||
|
@ -1234,7 +1234,7 @@ struct patchCollide_s *CM_GeneratePatchCollide( int width, int height, vec3_t *p
|
|||
CM_RemoveDegenerateColumns( &grid );
|
||||
|
||||
// we now have a grid of points exactly on the curve
|
||||
// the aproximate surface defined by these points will be
|
||||
// the approximate surface defined by these points will be
|
||||
// collided against
|
||||
pf = Hunk_Alloc( sizeof( *pf ), h_high );
|
||||
ClearBounds( pf->bounds[0], pf->bounds[1] );
|
||||
|
@ -1390,7 +1390,7 @@ static int CM_CheckFacetPlane( const float *plane, const vec3_t start, const vec
|
|||
return qfalse;
|
||||
}
|
||||
|
||||
// if it doesn't cross the plane, the plane isn't relevent
|
||||
// if it doesn't cross the plane, the plane isn't relevant
|
||||
if (d1 <= 0 && d2 <= 0 ) {
|
||||
return qtrue;
|
||||
}
|
||||
|
@ -1457,7 +1457,7 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
|
|||
VectorCopy(pp->plane, plane);
|
||||
plane[3] = pp->plane[3];
|
||||
if ( tw->sphere.use ) {
|
||||
// adjust the plane distance apropriately for radius
|
||||
// adjust the plane distance appropriately for radius
|
||||
plane[3] += tw->sphere.radius;
|
||||
|
||||
// find the closest point on the capsule to the plane
|
||||
|
@ -1496,7 +1496,7 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
|
|||
plane[3] = pp->plane[3];
|
||||
}
|
||||
if ( tw->sphere.use ) {
|
||||
// adjust the plane distance apropriately for radius
|
||||
// adjust the plane distance appropriately for radius
|
||||
plane[3] += tw->sphere.radius;
|
||||
|
||||
// find the closest point on the capsule to the plane
|
||||
|
@ -1585,7 +1585,7 @@ qboolean CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchColli
|
|||
VectorCopy(pp->plane, plane);
|
||||
plane[3] = pp->plane[3];
|
||||
if ( tw->sphere.use ) {
|
||||
// adjust the plane distance apropriately for radius
|
||||
// adjust the plane distance appropriately for radius
|
||||
plane[3] += tw->sphere.radius;
|
||||
|
||||
// find the closest point on the capsule to the plane
|
||||
|
@ -1618,7 +1618,7 @@ qboolean CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchColli
|
|||
plane[3] = pp->plane[3];
|
||||
}
|
||||
if ( tw->sphere.use ) {
|
||||
// adjust the plane distance apropriately for radius
|
||||
// adjust the plane distance appropriately for radius
|
||||
plane[3] += tw->sphere.radius;
|
||||
|
||||
// find the closest point on the capsule to the plane
|
||||
|
|
|
@ -102,7 +102,7 @@ static float CM_DistanceFromLineSquared( const vec3_t p, const vec3_t lp1, const
|
|||
int j;
|
||||
|
||||
CM_ProjectPointOntoVector(p, lp1, dir, proj);
|
||||
for (j = 0; j < 3; j++)
|
||||
for (j = 0; j < 3; j++)
|
||||
if ((proj[j] > lp1[j] && proj[j] > lp2[j]) ||
|
||||
(proj[j] < lp1[j] && proj[j] < lp2[j]))
|
||||
break;
|
||||
|
@ -182,7 +182,7 @@ static void CM_TestBoxInBrush( traceWork_t *tw, const cbrush_t *brush ) {
|
|||
side = brush->sides + i;
|
||||
plane = side->plane;
|
||||
|
||||
// adjust the plane distance apropriately for radius
|
||||
// adjust the plane distance appropriately for radius
|
||||
dist = plane->dist + tw->sphere.radius;
|
||||
// find the closest point on the capsule to the plane
|
||||
t = DotProductDP( plane->normal, tw->sphere.offset );
|
||||
|
@ -207,7 +207,7 @@ static void CM_TestBoxInBrush( traceWork_t *tw, const cbrush_t *brush ) {
|
|||
side = brush->sides + i;
|
||||
plane = side->plane;
|
||||
|
||||
// adjust the plane distance apropriately for mins/maxs
|
||||
// adjust the plane distance appropriately for mins/maxs
|
||||
dist = plane->dist - DotProduct( tw->offsets[ plane->signbits ], plane->normal );
|
||||
|
||||
d1 = DotProductDP( tw->start, plane->normal ) - dist;
|
||||
|
@ -249,7 +249,7 @@ static void CM_TestInLeaf( traceWork_t *tw, const cLeaf_t *leaf ) {
|
|||
if ( !(b->contents & tw->contents)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
CM_TestBoxInBrush( tw, b );
|
||||
if ( tw->trace.allsolid ) {
|
||||
return;
|
||||
|
@ -275,7 +275,7 @@ static void CM_TestInLeaf( traceWork_t *tw, const cLeaf_t *leaf ) {
|
|||
if ( !(patch->contents & tw->contents)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ( CM_PositionTestInPatchCollide( tw, patch->pc ) ) {
|
||||
tw->trace.startsolid = tw->trace.allsolid = qtrue;
|
||||
tw->trace.fraction = 0;
|
||||
|
@ -512,7 +512,7 @@ static void CM_TraceThroughBrush( traceWork_t *tw, const cbrush_t *brush ) {
|
|||
side = brush->sides + i;
|
||||
plane = side->plane;
|
||||
|
||||
// adjust the plane distance apropriately for radius
|
||||
// adjust the plane distance appropriately for radius
|
||||
dist = plane->dist + tw->sphere.radius;
|
||||
|
||||
// find the closest point on the capsule to the plane
|
||||
|
@ -543,7 +543,7 @@ static void CM_TraceThroughBrush( traceWork_t *tw, const cbrush_t *brush ) {
|
|||
return;
|
||||
}
|
||||
|
||||
// if it doesn't cross the plane, the plane isn't relevent
|
||||
// if it doesn't cross the plane, the plane isn't relevant
|
||||
if (d1 <= 0 && d2 <= 0 ) {
|
||||
continue;
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ static void CM_TraceThroughBrush( traceWork_t *tw, const cbrush_t *brush ) {
|
|||
side = brush->sides + i;
|
||||
plane = side->plane;
|
||||
|
||||
// adjust the plane distance apropriately for mins/maxs
|
||||
// adjust the plane distance appropriately for mins/maxs
|
||||
dist = plane->dist - DotProductDP( tw->offsets[ plane->signbits ], plane->normal );
|
||||
|
||||
d1 = DotProductDP( tw->start, plane->normal ) - dist;
|
||||
|
@ -597,7 +597,7 @@ static void CM_TraceThroughBrush( traceWork_t *tw, const cbrush_t *brush ) {
|
|||
return;
|
||||
}
|
||||
|
||||
// if it doesn't cross the plane, the plane isn't relevent
|
||||
// if it doesn't cross the plane, the plane isn't relevant
|
||||
if (d1 <= 0 && d2 <= 0 ) {
|
||||
continue;
|
||||
}
|
||||
|
@ -638,7 +638,7 @@ static void CM_TraceThroughBrush( traceWork_t *tw, const cbrush_t *brush ) {
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (enterFrac < leaveFrac) {
|
||||
if (enterFrac > -1 && enterFrac < tw->trace.fraction) {
|
||||
if (enterFrac < 0) {
|
||||
|
@ -712,7 +712,7 @@ static void CM_TraceThroughLeaf( traceWork_t *tw, const cLeaf_t *leaf ) {
|
|||
if ( !(patch->contents & tw->contents) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
CM_TraceThroughPatch( tw, patch );
|
||||
if ( !tw->trace.fraction ) {
|
||||
return;
|
||||
|
@ -1058,7 +1058,7 @@ static void CM_TraceThroughTree( traceWork_t *tw, int num, float p1f, float p2f,
|
|||
node = cm.nodes + num;
|
||||
plane = node->plane;
|
||||
|
||||
// adjust the plane distance apropriately for mins/maxs
|
||||
// adjust the plane distance appropriately for mins/maxs
|
||||
if ( plane->type < 3 ) {
|
||||
t1 = p1[plane->type] - plane->dist;
|
||||
t2 = p2[plane->type] - plane->dist;
|
||||
|
@ -1107,7 +1107,7 @@ static void CM_TraceThroughTree( traceWork_t *tw, int num, float p1f, float p2f,
|
|||
} else if ( frac > 1 ) {
|
||||
frac = 1;
|
||||
}
|
||||
|
||||
|
||||
midf = p1f + (p2f - p1f)*frac;
|
||||
|
||||
mid[0] = p1[0] + frac*(p2[0] - p1[0]);
|
||||
|
@ -1122,7 +1122,7 @@ static void CM_TraceThroughTree( traceWork_t *tw, int num, float p1f, float p2f,
|
|||
} else if ( frac2 > 1 ) {
|
||||
frac2 = 1;
|
||||
}
|
||||
|
||||
|
||||
midf = p1f + (p2f - p1f)*frac2;
|
||||
|
||||
mid[0] = p1[0] + frac2*(p2[0] - p1[0]);
|
||||
|
@ -1200,7 +1200,7 @@ static void CM_Trace( trace_t *results, const vec3_t start, const vec3_t end, co
|
|||
|
||||
tw.maxOffset = tw.size[1][0] + tw.size[1][1] + tw.size[1][2];
|
||||
|
||||
// tw.offsets[signbits] = vector to apropriate corner from origin
|
||||
// tw.offsets[signbits] = vector to appropriate corner from origin
|
||||
tw.offsets[0][0] = tw.size[0][0];
|
||||
tw.offsets[0][1] = tw.size[0][1];
|
||||
tw.offsets[0][2] = tw.size[0][2];
|
||||
|
@ -1414,7 +1414,7 @@ void CM_TransformedBoxTrace( trace_t *results, const vec3_t start, const vec3_t
|
|||
VectorSubtract( end_l, origin, end_l );
|
||||
|
||||
// rotate start and end into the models frame of reference
|
||||
if ( model != BOX_MODEL_HANDLE &&
|
||||
if ( model != BOX_MODEL_HANDLE &&
|
||||
(angles[0] || angles[1] || angles[2]) ) {
|
||||
rotated = qtrue;
|
||||
} else {
|
||||
|
|
|
@ -89,9 +89,9 @@ Adds command text at the end of the buffer, does NOT add a final \n
|
|||
*/
|
||||
void Cbuf_AddText( const char *text ) {
|
||||
int l;
|
||||
|
||||
|
||||
l = strlen (text);
|
||||
|
||||
|
||||
if (cmd_text.cursize + l >= cmd_text.maxsize)
|
||||
{
|
||||
Com_Printf ("Cbuf_AddText: overflow\n");
|
||||
|
@ -230,7 +230,7 @@ void Cbuf_Execute( void )
|
|||
|
||||
Com_Memcpy( line, text, i );
|
||||
line[i] = '\0';
|
||||
|
||||
|
||||
// delete the text from the command buffer and move remaining commands down
|
||||
// this is necessary because commands (exec) can insert data at the
|
||||
// beginning of the text buffer
|
||||
|
@ -296,7 +296,7 @@ static void Cmd_Exec_f( void ) {
|
|||
}
|
||||
if (!quiet)
|
||||
Com_Printf ("execing %s\n", filename);
|
||||
|
||||
|
||||
Cbuf_InsertText( f.c );
|
||||
|
||||
#ifdef DELAY_WRITECONFIG
|
||||
|
@ -480,7 +480,7 @@ void Cmd_Args_Sanitize( const char *separators )
|
|||
for( i = 1; i < cmd_argc; i++ )
|
||||
{
|
||||
char *c = cmd_argv[i];
|
||||
|
||||
|
||||
while ( ( c = strpbrk( c, separators ) ) != NULL ) {
|
||||
*c = ' ';
|
||||
++c;
|
||||
|
@ -494,8 +494,8 @@ void Cmd_Args_Sanitize( const char *separators )
|
|||
Cmd_TokenizeString
|
||||
|
||||
Parses the given string into command line tokens.
|
||||
The text is copied to a seperate buffer and 0 characters
|
||||
are inserted in the apropriate place, The argv array
|
||||
The text is copied to a separate buffer and 0 characters
|
||||
are inserted in the appropriate place, The argv array
|
||||
will point into this temporary buffer.
|
||||
============
|
||||
*/
|
||||
|
@ -517,7 +517,7 @@ static void Cmd_TokenizeString2( const char *text_in, qboolean ignoreQuotes ) {
|
|||
if ( !text_in ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Q_strncpyz( cmd_cmd, text_in, sizeof( cmd_cmd ) );
|
||||
|
||||
text = cmd_cmd; // read from safe-length buffer
|
||||
|
@ -652,7 +652,7 @@ Cmd_AddCommand
|
|||
*/
|
||||
void Cmd_AddCommand( const char *cmd_name, xcommand_t function ) {
|
||||
cmd_function_t *cmd;
|
||||
|
||||
|
||||
// fail if the command already exists
|
||||
if ( Cmd_FindCommand( cmd_name ) )
|
||||
{
|
||||
|
@ -773,7 +773,7 @@ Cmd_CommandCompletion
|
|||
*/
|
||||
void Cmd_CommandCompletion( void(*callback)(const char *s) ) {
|
||||
const cmd_function_t *cmd;
|
||||
|
||||
|
||||
for ( cmd = cmd_functions ; cmd ; cmd=cmd->next ) {
|
||||
callback( cmd->name );
|
||||
}
|
||||
|
@ -837,7 +837,7 @@ void Cmd_ExecuteString( const char *text ) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// check cvars
|
||||
if ( Cvar_Command() ) {
|
||||
return;
|
||||
|
|
|
@ -52,7 +52,7 @@ const int demo_protocols[] = { 66, 67, PROTOCOL_VERSION, NEW_PROTOCOL_VERSION, 0
|
|||
#define DEF_COMZONEMEGS 25
|
||||
#endif
|
||||
|
||||
jmp_buf abortframe; // an ERR_DROP occured, exit the entire frame
|
||||
jmp_buf abortframe; // an ERR_DROP occurred, exit the entire frame
|
||||
|
||||
int CPU_Flags = 0;
|
||||
|
||||
|
@ -164,7 +164,7 @@ void Com_EndRedirect( void )
|
|||
Com_Printf
|
||||
|
||||
Both client and server can use this, and it will output
|
||||
to the apropriate place.
|
||||
to the appropriate place.
|
||||
|
||||
A raw string should NEVER be passed as fmt, because of "%f" type crashers.
|
||||
=============
|
||||
|
@ -223,7 +223,7 @@ void QDECL Com_Printf( const char *fmt, ... ) {
|
|||
logfile = FS_FOpenFileAppend( "qconsole.log" );
|
||||
else
|
||||
logfile = FS_FOpenFileWrite( "qconsole.log" );
|
||||
|
||||
|
||||
if ( logfile != FS_INVALID_HANDLE )
|
||||
{
|
||||
Com_Printf( "logfile opened on %s\n", asctime( newtime ) );
|
||||
|
@ -260,7 +260,7 @@ A Com_Printf that only shows up if the "developer" cvar is set
|
|||
void QDECL Com_DPrintf( const char *fmt, ...) {
|
||||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
|
||||
|
||||
if ( !com_developer || !com_developer->integer ) {
|
||||
return; // don't confuse non-developers with techie stuff...
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ void QDECL Com_DPrintf( const char *fmt, ...) {
|
|||
Com_Error
|
||||
|
||||
Both client and server can use this, and it will
|
||||
do the apropriate things.
|
||||
do the appropriate things.
|
||||
=============
|
||||
*/
|
||||
void QDECL Com_Error( errorParm_t code, const char *fmt, ... ) {
|
||||
|
@ -299,7 +299,7 @@ void QDECL Com_Error( errorParm_t code, const char *fmt, ... ) {
|
|||
if(com_errorEntered)
|
||||
{
|
||||
if(!calledSysError)
|
||||
{
|
||||
{
|
||||
calledSysError = qtrue;
|
||||
Sys_Error("recursive error after: %s", com_errorMessage);
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ void QDECL Com_Error( errorParm_t code, const char *fmt, ... ) {
|
|||
|
||||
longjmp( abortframe, -1 );
|
||||
} else if ( code == ERR_DROP ) {
|
||||
Com_Printf( "********************\nERROR: %s\n********************\n",
|
||||
Com_Printf( "********************\nERROR: %s\n********************\n",
|
||||
com_errorMessage );
|
||||
VM_Forced_Unload_Start();
|
||||
SV_Shutdown( va( "Server crashed: %s", com_errorMessage ) );
|
||||
|
@ -367,7 +367,7 @@ void QDECL Com_Error( errorParm_t code, const char *fmt, ... ) {
|
|||
CL_FlushMemory();
|
||||
#endif
|
||||
VM_Forced_Unload_Done();
|
||||
|
||||
|
||||
FS_PureServerSetLoadedPaks( "", "" );
|
||||
com_errorEntered = qfalse;
|
||||
|
||||
|
@ -412,7 +412,7 @@ void QDECL Com_Error( errorParm_t code, const char *fmt, ... ) {
|
|||
Com_Quit_f
|
||||
|
||||
Both client and server can use this, and it will
|
||||
do the apropriate things.
|
||||
do the appropriate things.
|
||||
=============
|
||||
*/
|
||||
void Com_Quit_f( void ) {
|
||||
|
@ -441,7 +441,7 @@ void Com_Quit_f( void ) {
|
|||
|
||||
COMMAND LINE FUNCTIONS
|
||||
|
||||
+ characters seperate the commandLine string into multiple console
|
||||
+ characters separate the commandLine string into multiple console
|
||||
command lines.
|
||||
|
||||
All of these are valid:
|
||||
|
@ -505,11 +505,11 @@ Com_EarlyParseCmdLine
|
|||
returns qtrue if both vid_xpos and vid_ypos was set
|
||||
===================
|
||||
*/
|
||||
qboolean Com_EarlyParseCmdLine( char *commandLine, char *con_title, int title_size, int *vid_xpos, int *vid_ypos )
|
||||
qboolean Com_EarlyParseCmdLine( char *commandLine, char *con_title, int title_size, int *vid_xpos, int *vid_ypos )
|
||||
{
|
||||
int flags = 0;
|
||||
int i;
|
||||
|
||||
|
||||
*con_title = '\0';
|
||||
Com_ParseCommandLine( commandLine );
|
||||
|
||||
|
@ -627,7 +627,7 @@ void Com_StartupVariable( const char *match ) {
|
|||
Com_AddStartupCommands
|
||||
|
||||
Adds command line parameters as script statements
|
||||
Commands are seperated by + signs
|
||||
Commands are separated by + signs
|
||||
|
||||
Returns qtrue if any late commands were added, which
|
||||
will keep the demoloop from immediately starting
|
||||
|
@ -948,7 +948,7 @@ int64_t Sys_Microseconds( void )
|
|||
if ( !freq.QuadPart )
|
||||
{
|
||||
return (int64_t)Sys_Milliseconds() * 1000LL; // fallback
|
||||
}
|
||||
}
|
||||
inited = qtrue;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1073,7 +1073,7 @@ static void RemoveFree( memblock_t *block )
|
|||
Com_Error( ERR_FATAL, "RemoveFree: bad pointers fb->next: %p, fb->prev: %p\n", fb->next, fb->prev );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
prev = fb->prev;
|
||||
next = fb->next;
|
||||
|
||||
|
@ -1102,7 +1102,7 @@ static void InsertFree( memzone_t *zone, memblock_t *block )
|
|||
else
|
||||
#endif
|
||||
prev = &zone->freelist;
|
||||
|
||||
|
||||
next = prev->next;
|
||||
|
||||
#ifdef ZONE_DEBUG
|
||||
|
@ -1129,16 +1129,16 @@ Separator is needed to avoid additional runtime checks in Z_Free()
|
|||
to prevent merging it with previous free block
|
||||
================
|
||||
*/
|
||||
static freeblock_t *NewBlock( memzone_t *zone, int size )
|
||||
static freeblock_t *NewBlock( memzone_t *zone, int size )
|
||||
{
|
||||
memblock_t *prev, *next;
|
||||
memblock_t *block, *sep;
|
||||
int alloc_size;
|
||||
|
||||
|
||||
// zone->prev is pointing on last block in the list
|
||||
prev = zone->blocklist.prev;
|
||||
next = prev->next;
|
||||
|
||||
|
||||
size = PAD( size, 1<<21 ); // round up to 2M blocks
|
||||
// allocate separator block before new free block
|
||||
alloc_size = size + sizeof( *sep );
|
||||
|
@ -1183,7 +1183,7 @@ static freeblock_t *NewBlock( memzone_t *zone, int size )
|
|||
|
||||
static memblock_t *SearchFree( memzone_t *zone, int size )
|
||||
{
|
||||
const freeblock_t *fb;
|
||||
const freeblock_t *fb;
|
||||
memblock_t *base;
|
||||
|
||||
#ifdef TINY_SIZE
|
||||
|
@ -1269,7 +1269,7 @@ static void Z_ClearZone( memzone_t *zone, memzone_t *head, int size, int segnum
|
|||
#endif
|
||||
zone->size = size;
|
||||
zone->used = 0;
|
||||
|
||||
|
||||
block->prev = block->next = &zone->blocklist;
|
||||
block->tag = TAG_FREE; // free block
|
||||
block->id = ZONEID;
|
||||
|
@ -1288,7 +1288,7 @@ static void Z_ClearZone( memzone_t *zone, memzone_t *head, int size, int segnum
|
|||
|
||||
InitFree( &zone->freelist_tiny );
|
||||
zone->freelist_tiny.next = zone->freelist_tiny.prev = &zone->freelist_tiny;
|
||||
|
||||
|
||||
InsertFree( zone, block );
|
||||
#endif
|
||||
}
|
||||
|
@ -1376,7 +1376,7 @@ void Z_Free( void *ptr ) {
|
|||
|
||||
block->tag = TAG_FREE; // mark as free
|
||||
block->id = ZONEID;
|
||||
|
||||
|
||||
other = block->prev;
|
||||
if ( other->tag == TAG_FREE ) {
|
||||
#ifdef USE_MULTI_SEGMENT
|
||||
|
@ -1435,7 +1435,7 @@ int Z_FreeTags( memtag_t tag ) {
|
|||
if ( block->tag == tag && block->id == ZONEID ) {
|
||||
if ( block->prev->tag == TAG_FREE )
|
||||
freed = block->prev; // current block will be merged with previous
|
||||
else
|
||||
else
|
||||
freed = block; // will leave in place
|
||||
Z_Free( (void*)( block + 1 ) );
|
||||
block = freed;
|
||||
|
@ -1502,7 +1502,7 @@ void *Z_TagMalloc( int size, memtag_t tag ) {
|
|||
|
||||
#ifdef USE_MULTI_SEGMENT
|
||||
base = SearchFree( zone, size );
|
||||
|
||||
|
||||
RemoveFree( base );
|
||||
#else
|
||||
|
||||
|
@ -1586,7 +1586,7 @@ void *Z_MallocDebug( int size, char *label, char *file, int line ) {
|
|||
void *Z_Malloc( int size ) {
|
||||
#endif
|
||||
void *buf;
|
||||
|
||||
|
||||
//Z_CheckHeap (); // DEBUG
|
||||
|
||||
#ifdef ZONE_DEBUG
|
||||
|
@ -1781,7 +1781,7 @@ char *CopyString( const char *in ) {
|
|||
==============================================================================
|
||||
|
||||
Goals:
|
||||
reproducable without history effects -- no out of memory errors on weird map to map changes
|
||||
reproducible without history effects -- no out of memory errors on weird map to map changes
|
||||
allow restarting of the client without fragmentation
|
||||
minimize total pages in use at run time
|
||||
minimize total pages needed during load time
|
||||
|
@ -1871,7 +1871,7 @@ typedef struct zone_stats_s {
|
|||
} zone_stats_t;
|
||||
|
||||
|
||||
static void Zone_Stats( const char *name, const memzone_t *z, qboolean printDetails, zone_stats_t *stats )
|
||||
static void Zone_Stats( const char *name, const memzone_t *z, qboolean printDetails, zone_stats_t *stats )
|
||||
{
|
||||
const memblock_t *block;
|
||||
const memzone_t *zone;
|
||||
|
@ -1881,7 +1881,7 @@ static void Zone_Stats( const char *name, const memzone_t *z, qboolean printDeta
|
|||
zone = z;
|
||||
st.zoneSegments = 1;
|
||||
st.freeSmallest = 0x7FFFFFFF;
|
||||
|
||||
|
||||
//if ( printDetails ) {
|
||||
// Com_Printf( "---------- %s zone segment #%i ----------\n", name, zone->segnum );
|
||||
//}
|
||||
|
@ -2190,7 +2190,7 @@ static void Com_InitHunkMemory( void ) {
|
|||
|
||||
// make sure the file system has allocated and "not" freed any temp blocks
|
||||
// this allows the config and product id files ( journal files too ) to be loaded
|
||||
// by the file system without redunant routines in the file system utilizing different
|
||||
// by the file system without redunant routines in the file system utilizing different
|
||||
// memory systems
|
||||
if ( FS_LoadStack() != 0 ) {
|
||||
Com_Error( ERR_FATAL, "Hunk initialization failed. File system load stack not zero" );
|
||||
|
@ -2430,7 +2430,7 @@ void *Hunk_AllocateTempMemory( int size ) {
|
|||
|
||||
// return a Z_Malloc'd block if the hunk has not been initialized
|
||||
// this allows the config and product id files ( journal files too ) to be loaded
|
||||
// by the file system without redunant routines in the file system utilizing different
|
||||
// by the file system without redunant routines in the file system utilizing different
|
||||
// memory systems
|
||||
if ( s_hunkData == NULL )
|
||||
{
|
||||
|
@ -2478,7 +2478,7 @@ void Hunk_FreeTempMemory( void *buf ) {
|
|||
|
||||
// free with Z_Free if the hunk has not been initialized
|
||||
// this allows the config and product id files ( journal files too ) to be loaded
|
||||
// by the file system without redunant routines in the file system utilizing different
|
||||
// by the file system without redunant routines in the file system utilizing different
|
||||
// memory systems
|
||||
if ( s_hunkData == NULL )
|
||||
{
|
||||
|
@ -2601,7 +2601,7 @@ static const char *Sys_EventName( sysEventType_t evType ) {
|
|||
"SE_CHAR",
|
||||
"SE_MOUSE",
|
||||
"SE_JOYSTICK_AXIS",
|
||||
"SE_CONSOLE"
|
||||
"SE_CONSOLE"
|
||||
};
|
||||
|
||||
if ( evType >= SE_MAX ) {
|
||||
|
@ -2715,7 +2715,7 @@ Com_GetRealEvent
|
|||
=================
|
||||
*/
|
||||
static sysEvent_t Com_GetRealEvent( void ) {
|
||||
|
||||
|
||||
// get or save an event from/to the journal file
|
||||
if ( com_journalFile != FS_INVALID_HANDLE ) {
|
||||
int r;
|
||||
|
@ -3042,7 +3042,7 @@ void Com_GameRestart( int checksumFeed, qboolean clientRestart )
|
|||
{
|
||||
CL_Disconnect( qfalse );
|
||||
CL_ShutdownAll();
|
||||
CL_ClearMemory(); // Hunk_Clear(); // -EC-
|
||||
CL_ClearMemory(); // Hunk_Clear(); // -EC-
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -3066,17 +3066,17 @@ void Com_GameRestart( int checksumFeed, qboolean clientRestart )
|
|||
#endif
|
||||
|
||||
FS_Restart( checksumFeed );
|
||||
|
||||
|
||||
// Load new configuration
|
||||
Com_ExecuteCfg();
|
||||
|
||||
|
||||
#ifndef DEDICATED
|
||||
// Restart sound subsystem so old handles are flushed
|
||||
//CL_Snd_Restart();
|
||||
if ( clientRestart )
|
||||
CL_StartHunkUsers();
|
||||
#endif
|
||||
|
||||
|
||||
com_gameRestarting = qfalse;
|
||||
}
|
||||
}
|
||||
|
@ -3161,7 +3161,7 @@ qboolean Com_CDKeyValidate( const char *key, const char *checksum ) {
|
|||
}
|
||||
|
||||
sprintf(chs, "%02x", sum);
|
||||
|
||||
|
||||
if (checksum && !Q_stricmp(chs, checksum)) {
|
||||
return qtrue;
|
||||
}
|
||||
|
@ -3473,7 +3473,7 @@ void Sys_SnapVector( float *vector )
|
|||
|
||||
mxcsr = _mm_getcsr();
|
||||
vf0 = _mm_setr_ps( vector[0], vector[1], vector[2], 0.0f );
|
||||
|
||||
|
||||
_mm_setcsr( mxcsr & ~0x6000 ); // enforce rounding mode to "round to nearest"
|
||||
|
||||
vi = _mm_cvtps_epi32( vf0 );
|
||||
|
@ -3622,7 +3622,7 @@ void Com_Init( char *commandLine ) {
|
|||
Com_StartupVariable( "vm_rtChecks" );
|
||||
vm_rtChecks = Cvar_Get( "vm_rtChecks", "15", CVAR_INIT | CVAR_PROTECTED );
|
||||
Cvar_CheckRange( vm_rtChecks, "0", "15", CV_INTEGER );
|
||||
Cvar_SetDescription( vm_rtChecks,
|
||||
Cvar_SetDescription( vm_rtChecks,
|
||||
"Runtime checks in compiled vm code, bitmask:\n 1 - program stack overflow\n" \
|
||||
" 2 - opcode stack overflow\n 4 - jump target range\n 8 - data read/write range" );
|
||||
|
||||
|
@ -3681,7 +3681,7 @@ void Com_Init( char *commandLine ) {
|
|||
com_affinityMask->modified = qfalse;
|
||||
#endif
|
||||
|
||||
com_blood = Cvar_Get ("com_blood", "1", CVAR_ARCHIVE_ND );
|
||||
com_blood = Cvar_Get( "com_blood", "1", CVAR_ARCHIVE_ND );
|
||||
|
||||
com_logfile = Cvar_Get( "logfile", "0", CVAR_TEMP );
|
||||
Cvar_CheckRange( com_logfile, "0", "4", CV_INTEGER );
|
||||
|
@ -3694,23 +3694,23 @@ void Com_Init( char *commandLine ) {
|
|||
|
||||
com_timescale = Cvar_Get( "timescale", "1", CVAR_CHEAT | CVAR_SYSTEMINFO );
|
||||
Cvar_CheckRange( com_timescale, "0", NULL, CV_FLOAT );
|
||||
com_fixedtime = Cvar_Get ("fixedtime", "0", CVAR_CHEAT);
|
||||
com_showtrace = Cvar_Get ("com_showtrace", "0", CVAR_CHEAT);
|
||||
com_fixedtime = Cvar_Get( "fixedtime", "0", CVAR_CHEAT );
|
||||
com_showtrace = Cvar_Get( "com_showtrace", "0", CVAR_CHEAT );
|
||||
com_viewlog = Cvar_Get( "viewlog", "0", 0 );
|
||||
com_speeds = Cvar_Get ("com_speeds", "0", 0);
|
||||
com_cameraMode = Cvar_Get ("com_cameraMode", "0", CVAR_CHEAT);
|
||||
com_speeds = Cvar_Get( "com_speeds", "0", 0 );
|
||||
com_cameraMode = Cvar_Get( "com_cameraMode", "0", CVAR_CHEAT );
|
||||
|
||||
#ifndef DEDICATED
|
||||
#ifndef DEDICATED
|
||||
com_timedemo = Cvar_Get( "timedemo", "0", 0 );
|
||||
Cvar_CheckRange( com_timedemo, "0", "1", CV_INTEGER );
|
||||
cl_paused = Cvar_Get ("cl_paused", "0", CVAR_ROM);
|
||||
cl_packetdelay = Cvar_Get ("cl_packetdelay", "0", CVAR_CHEAT);
|
||||
com_cl_running = Cvar_Get ("cl_running", "0", CVAR_ROM | CVAR_NOTABCOMPLETE );
|
||||
cl_paused = Cvar_Get( "cl_paused", "0", CVAR_ROM );
|
||||
cl_packetdelay = Cvar_Get( "cl_packetdelay", "0", CVAR_CHEAT );
|
||||
com_cl_running = Cvar_Get( "cl_running", "0", CVAR_ROM | CVAR_NOTABCOMPLETE );
|
||||
#endif
|
||||
|
||||
sv_paused = Cvar_Get ("sv_paused", "0", CVAR_ROM);
|
||||
sv_packetdelay = Cvar_Get ("sv_packetdelay", "0", CVAR_CHEAT);
|
||||
com_sv_running = Cvar_Get ("sv_running", "0", CVAR_ROM | CVAR_NOTABCOMPLETE );
|
||||
sv_paused = Cvar_Get( "sv_paused", "0", CVAR_ROM );
|
||||
sv_packetdelay = Cvar_Get( "sv_packetdelay", "0", CVAR_CHEAT );
|
||||
com_sv_running = Cvar_Get( "sv_running", "0", CVAR_ROM | CVAR_NOTABCOMPLETE );
|
||||
|
||||
com_buildScript = Cvar_Get( "com_buildScript", "0", 0 );
|
||||
|
||||
|
@ -3926,7 +3926,7 @@ static int Com_ModifyMsec( int msec ) {
|
|||
} else if (com_cameraMode->integer) {
|
||||
msec *= com_timescale->value;
|
||||
}
|
||||
|
||||
|
||||
// don't let it scale below 1 msec
|
||||
if ( msec < 1 && com_timescale->value) {
|
||||
msec = 1;
|
||||
|
@ -3940,7 +3940,7 @@ static int Com_ModifyMsec( int msec ) {
|
|||
Com_Printf( "Hitch warning: %i msec frame time\n", msec );
|
||||
|
||||
clampTime = 5000;
|
||||
} else
|
||||
} else
|
||||
if ( !com_sv_running->integer ) {
|
||||
// clients of remote servers do not want to clamp time, because
|
||||
// it would skew their view of the server's time temporarily
|
||||
|
@ -4042,7 +4042,7 @@ void Com_Frame( qboolean noDelay ) {
|
|||
if ( com_speeds->integer ) {
|
||||
timeBeforeFirstEvents = Sys_Milliseconds();
|
||||
}
|
||||
|
||||
|
||||
// we may want to spin here if things are going too fast
|
||||
if ( com_dedicated->integer ) {
|
||||
minMsec = SV_FrameMsec();
|
||||
|
@ -4065,7 +4065,7 @@ void Com_Frame( qboolean noDelay ) {
|
|||
|
||||
timeVal = com_frameTime - lastTime;
|
||||
bias += timeVal - minMsec;
|
||||
|
||||
|
||||
if ( bias > minMsec )
|
||||
bias = minMsec;
|
||||
|
||||
|
@ -4196,15 +4196,15 @@ void Com_Frame( qboolean noDelay ) {
|
|||
sv -= time_game;
|
||||
cl -= time_frontend + time_backend;
|
||||
|
||||
Com_Printf ("frame:%i all:%3i sv:%3i ev:%3i cl:%3i gm:%3i rf:%3i bk:%3i\n",
|
||||
Com_Printf ("frame:%i all:%3i sv:%3i ev:%3i cl:%3i gm:%3i rf:%3i bk:%3i\n",
|
||||
com_frameNumber, all, sv, ev, cl, time_game, time_frontend, time_backend );
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// trace optimization tracking
|
||||
//
|
||||
if ( com_showtrace->integer ) {
|
||||
|
||||
|
||||
extern int c_traces, c_brush_traces, c_patch_traces;
|
||||
extern int c_pointcontents;
|
||||
|
||||
|
@ -4386,7 +4386,7 @@ static qboolean Field_Complete( void )
|
|||
}
|
||||
|
||||
Com_Printf( "]%s\n", completionField->buffer );
|
||||
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
|
@ -4435,9 +4435,9 @@ void Field_CompleteKeyBind( int key )
|
|||
if ( vlen + blen > sizeof( completionField->buffer ) - 1 )
|
||||
{
|
||||
//vlen = sizeof( completionField->buffer ) - 1 - blen;
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
memcpy( completionField->buffer + blen, value, vlen + 1 );
|
||||
completionField->cursor = blen + vlen;
|
||||
|
||||
|
@ -4481,7 +4481,7 @@ static void Field_CompleteCvarValue( const char *value, const char *current )
|
|||
if ( vlen + blen > sizeof( completionField->buffer ) - 1 )
|
||||
{
|
||||
//vlen = sizeof( completionField->buffer ) - 1 - blen;
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( blen > 1 )
|
||||
|
|
|
@ -73,7 +73,7 @@ static const keyname_t keynames[] =
|
|||
{"+", K_PLUS},
|
||||
{",", K_COMMA},
|
||||
{"-", K_MINUS},
|
||||
{".", K_DOT},
|
||||
{".", K_DOT},
|
||||
{"/", K_SLASH},
|
||||
{"SEMICOLON", K_SEMICOLON}, // because a raw semicolon separates commands
|
||||
{"=", K_EQUAL},
|
||||
|
@ -95,7 +95,7 @@ static const keyname_t keynames[] =
|
|||
{"COMMAND", K_COMMAND},
|
||||
|
||||
{"CAPSLOCK", K_CAPSLOCK},
|
||||
|
||||
|
||||
{"F1", K_F1},
|
||||
{"F2", K_F2},
|
||||
{"F3", K_F3},
|
||||
|
@ -248,7 +248,7 @@ static const keyname_t keynames[] =
|
|||
Key_SetOverstrikeMode
|
||||
===================
|
||||
*/
|
||||
qboolean Key_GetOverstrikeMode( void )
|
||||
qboolean Key_GetOverstrikeMode( void )
|
||||
{
|
||||
return key_overstrikeMode;
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ qboolean Key_GetOverstrikeMode( void )
|
|||
Key_SetOverstrikeMode
|
||||
===================
|
||||
*/
|
||||
void Key_SetOverstrikeMode( qboolean state )
|
||||
void Key_SetOverstrikeMode( qboolean state )
|
||||
{
|
||||
key_overstrikeMode = state;
|
||||
}
|
||||
|
@ -270,9 +270,9 @@ void Key_SetOverstrikeMode( qboolean state )
|
|||
Key_IsDown
|
||||
===================
|
||||
*/
|
||||
qboolean Key_IsDown( int keynum )
|
||||
qboolean Key_IsDown( int keynum )
|
||||
{
|
||||
if ( keynum < 0 || keynum >= MAX_KEYS )
|
||||
if ( keynum < 0 || keynum >= MAX_KEYS )
|
||||
{
|
||||
return qfalse;
|
||||
}
|
||||
|
@ -289,14 +289,14 @@ Returns a key number to be used to index keys[] by looking at
|
|||
the given string. Single ascii characters return themselves, while
|
||||
the K_* names are matched up.
|
||||
|
||||
0x11 will be interpreted as raw hex, which will allow new controlers
|
||||
0x11 will be interpreted as raw hex, which will allow new controllers
|
||||
|
||||
to be configured even if they don't have defined names.
|
||||
===================
|
||||
*/
|
||||
int Key_StringToKeynum( const char *str ) {
|
||||
const keyname_t *kn;
|
||||
|
||||
|
||||
if ( !str || str[0] == '\0' ) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ int Key_StringToKeynum( const char *str ) {
|
|||
// check for hex code
|
||||
if ( strlen( str ) == 4 ) {
|
||||
int n = Com_HexStrToInt( str );
|
||||
|
||||
|
||||
if ( n >= 0 ) {
|
||||
return n;
|
||||
}
|
||||
|
@ -386,12 +386,12 @@ void Key_SetBinding( int keynum, const char *binding ) {
|
|||
if ( keys[ keynum ].binding ) {
|
||||
Z_Free( keys[ keynum ].binding );
|
||||
}
|
||||
|
||||
|
||||
// allocate memory for new binding
|
||||
keys[ keynum ].binding = CopyString( binding );
|
||||
|
||||
// consider this like modifying an archived cvar, so the
|
||||
// file write will be triggered at the next oportunity
|
||||
// file write will be triggered at the next opportunity
|
||||
cvar_modifiedFlags |= CVAR_ARCHIVE;
|
||||
}
|
||||
|
||||
|
@ -410,7 +410,7 @@ const char *Key_GetBinding( int keynum ) {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
===================
|
||||
Key_GetKey
|
||||
===================
|
||||
|
@ -443,7 +443,7 @@ static void Key_Unbind_f( void )
|
|||
Com_Printf( "unbind <key> : remove commands from a key\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
b = Key_StringToKeynum( Cmd_Argv( 1 ) );
|
||||
if ( b == -1 )
|
||||
{
|
||||
|
@ -463,8 +463,8 @@ Key_Unbindall_f
|
|||
static void Key_Unbindall_f( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i = 0 ; i < MAX_KEYS; i++ )
|
||||
|
||||
for ( i = 0 ; i < MAX_KEYS; i++ )
|
||||
{
|
||||
if ( keys[i].binding )
|
||||
{
|
||||
|
@ -482,7 +482,7 @@ Key_Bind_f
|
|||
static void Key_Bind_f( void )
|
||||
{
|
||||
int c, b;
|
||||
|
||||
|
||||
c = Cmd_Argc();
|
||||
|
||||
if ( c < 2 )
|
||||
|
@ -506,7 +506,7 @@ static void Key_Bind_f( void )
|
|||
Com_Printf( "\"%s\" is not bound\n", Cmd_Argv( 1 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// copy the rest of the command line
|
||||
Key_SetBinding( b, Cmd_ArgsFrom( 2 ) );
|
||||
}
|
||||
|
@ -663,7 +663,7 @@ void Key_ParseBinding( int key, qboolean down, unsigned time )
|
|||
Com_InitKeyCommands
|
||||
===================
|
||||
*/
|
||||
void Com_InitKeyCommands( void )
|
||||
void Com_InitKeyCommands( void )
|
||||
{
|
||||
// register our functions
|
||||
Cmd_AddCommand( "bind", Key_Bind_f );
|
||||
|
|
|
@ -149,11 +149,11 @@ void GL_Cull( cullType_t cullType ) {
|
|||
|
||||
glState.faceCulling = cullType;
|
||||
|
||||
if ( cullType == CT_TWO_SIDED )
|
||||
if ( cullType == CT_TWO_SIDED )
|
||||
{
|
||||
qglDisable( GL_CULL_FACE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
qboolean cullFront;
|
||||
qglEnable( GL_CULL_FACE );
|
||||
|
@ -455,9 +455,9 @@ static void SetViewportAndScissor( void ) {
|
|||
qglMatrixMode(GL_MODELVIEW);
|
||||
|
||||
// set the window clipping
|
||||
qglViewport( backEnd.viewParms.viewportX, backEnd.viewParms.viewportY,
|
||||
qglViewport( backEnd.viewParms.viewportX, backEnd.viewParms.viewportY,
|
||||
backEnd.viewParms.viewportWidth, backEnd.viewParms.viewportHeight );
|
||||
qglScissor( backEnd.viewParms.scissorX, backEnd.viewParms.scissorY,
|
||||
qglScissor( backEnd.viewParms.scissorX, backEnd.viewParms.scissorY,
|
||||
backEnd.viewParms.scissorWidth, backEnd.viewParms.scissorHeight );
|
||||
}
|
||||
|
||||
|
@ -546,7 +546,7 @@ static void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
|
|||
drawSurf_t *drawSurf;
|
||||
unsigned int oldSort;
|
||||
float oldShaderSort;
|
||||
double originalTime; // -EC-
|
||||
double originalTime; // -EC-
|
||||
|
||||
// save original time for entity shader offsets
|
||||
originalTime = backEnd.refdef.floatTime;
|
||||
|
@ -574,7 +574,7 @@ static void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
|
|||
|
||||
//
|
||||
// change the tess parameters if needed
|
||||
// a "entityMergable" shader is a shader that can have surfaces from seperate
|
||||
// a "entityMergable" shader is a shader that can have surfaces from separate
|
||||
// entities merged into a single batch, like smoke and blood puff sprites
|
||||
if ( ( (oldSort ^ drawSurfs->sort ) & ~QSORT_REFENTITYNUM_MASK ) || !shader->entityMergable ) {
|
||||
if ( oldShader != NULL ) {
|
||||
|
@ -620,7 +620,7 @@ static void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
|
|||
#ifdef USE_LEGACY_DLIGHTS
|
||||
#ifdef USE_PMLIGHT
|
||||
if ( !r_dlightMode->integer )
|
||||
#endif
|
||||
#endif
|
||||
if ( backEnd.currentEntity->needDlights ) {
|
||||
R_TransformDlights( backEnd.refdef.num_dlights, backEnd.refdef.dlights, &backEnd.or );
|
||||
}
|
||||
|
@ -628,7 +628,7 @@ static void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
|
|||
if ( backEnd.currentEntity->e.renderfx & RF_DEPTHHACK ) {
|
||||
// hack the depth range to prevent view model from poking into walls
|
||||
depthRange = qtrue;
|
||||
|
||||
|
||||
if(backEnd.currentEntity->e.renderfx & RF_CROSSHAIR)
|
||||
isCrosshair = qtrue;
|
||||
}
|
||||
|
@ -758,7 +758,7 @@ static void RB_RenderLitSurfList( dlight_t* dl ) {
|
|||
qboolean depthRange, oldDepthRange, isCrosshair, wasCrosshair;
|
||||
const litSurf_t *litSurf;
|
||||
unsigned int oldSort;
|
||||
double originalTime; // -EC-
|
||||
double originalTime; // -EC-
|
||||
|
||||
// save original time for entity shader offsets
|
||||
originalTime = backEnd.refdef.floatTime;
|
||||
|
@ -792,7 +792,7 @@ static void RB_RenderLitSurfList( dlight_t* dl ) {
|
|||
|
||||
//
|
||||
// change the tess parameters if needed
|
||||
// a "entityMergable" shader is a shader that can have surfaces from seperate
|
||||
// a "entityMergable" shader is a shader that can have surfaces from separate
|
||||
// entities merged into a single batch, like smoke and blood puff sprites
|
||||
if ( ( (oldSort ^ litSurf->sort) & ~QSORT_REFENTITYNUM_MASK ) || !shader->entityMergable ) {
|
||||
if ( oldShader != NULL ) {
|
||||
|
@ -824,7 +824,7 @@ static void RB_RenderLitSurfList( dlight_t* dl ) {
|
|||
if ( backEnd.currentEntity->e.renderfx & RF_DEPTHHACK ) {
|
||||
// hack the depth range to prevent view model from poking into walls
|
||||
depthRange = qtrue;
|
||||
|
||||
|
||||
if(backEnd.currentEntity->e.renderfx & RF_CROSSHAIR)
|
||||
isCrosshair = qtrue;
|
||||
}
|
||||
|
@ -1397,7 +1397,7 @@ static const void *RB_ColorMask( const void *data )
|
|||
const colorMaskCommand_t *cmd = data;
|
||||
|
||||
qglColorMask( cmd->rgba[0], cmd->rgba[1], cmd->rgba[2], cmd->rgba[3] );
|
||||
|
||||
|
||||
return (const void *)(cmd + 1);
|
||||
}
|
||||
|
||||
|
@ -1410,11 +1410,11 @@ RB_ClearDepth
|
|||
static const void *RB_ClearDepth( const void *data )
|
||||
{
|
||||
const clearDepthCommand_t *cmd = data;
|
||||
|
||||
|
||||
RB_EndSurface();
|
||||
|
||||
qglClear( GL_DEPTH_BUFFER_BIT );
|
||||
|
||||
|
||||
return (const void *)(cmd + 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -347,7 +347,7 @@ static void R_InitExtensions( void )
|
|||
if ( R_HaveExtension( "GL_ARB_texture_compression" ) &&
|
||||
R_HaveExtension( "GL_EXT_texture_compression_s3tc" ) )
|
||||
{
|
||||
if ( r_ext_compressed_textures->integer ){
|
||||
if ( r_ext_compressed_textures->integer ){
|
||||
glConfig.textureCompression = TC_S3TC_ARB;
|
||||
ri.Printf( PRINT_ALL, "...using GL_EXT_texture_compression_s3tc\n" );
|
||||
} else {
|
||||
|
@ -474,7 +474,7 @@ static void R_InitExtensions( void )
|
|||
if ( err )
|
||||
{
|
||||
ri.Printf( PRINT_WARNING, "Error resolving ARB program function '%s'\n", err );
|
||||
qglGenProgramsARB = NULL; // indicates presense of ARB shaders functionality
|
||||
qglGenProgramsARB = NULL; // indicates presence of ARB shaders functionality
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -488,7 +488,7 @@ static void R_InitExtensions( void )
|
|||
if ( err )
|
||||
{
|
||||
ri.Printf( PRINT_WARNING, "Error resolving VBO function '%s'\n", err );
|
||||
qglBindBufferARB = NULL; // indicates presense of VBO functionality
|
||||
qglBindBufferARB = NULL; // indicates presence of VBO functionality
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -502,7 +502,7 @@ static void R_InitExtensions( void )
|
|||
if ( err )
|
||||
{
|
||||
ri.Printf( PRINT_WARNING, "Error resolving FBO function '%s'\n", err );
|
||||
qglGenFramebuffers = NULL; // indicates presense of FBO functionality
|
||||
qglGenFramebuffers = NULL; // indicates presence of FBO functionality
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -533,7 +533,7 @@ static void InitOpenGL( void )
|
|||
// - r_ignorehwgamma
|
||||
// - r_gamma
|
||||
//
|
||||
|
||||
|
||||
if ( glConfig.vidWidth == 0 )
|
||||
{
|
||||
const char *err;
|
||||
|
@ -556,7 +556,7 @@ static void InitOpenGL( void )
|
|||
glConfig.maxTextureSize = max_texture_size;
|
||||
|
||||
// stubbed or broken drivers may have reported 0...
|
||||
if ( glConfig.maxTextureSize <= 0 )
|
||||
if ( glConfig.maxTextureSize <= 0 )
|
||||
glConfig.maxTextureSize = 0;
|
||||
else if ( glConfig.maxTextureSize > 2048 )
|
||||
glConfig.maxTextureSize = 2048; // ResampleTexture() relies on that maximum
|
||||
|
@ -676,10 +676,10 @@ void GL_CheckErrors( void ) {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SCREEN SHOTS
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SCREEN SHOTS
|
||||
|
||||
NOTE TTimo
|
||||
some thoughts about the screenshots system:
|
||||
|
@ -692,11 +692,11 @@ we use statics to store a count and start writing the first screenshot/screensho
|
|||
(with FS_FileExists / FS_FOpenFileWrite calls)
|
||||
FIXME: the statics don't get a reinit between fs_game changes
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
RB_ReadPixels
|
||||
|
||||
Reads an image but takes care of alignment issues for reading RGB images.
|
||||
|
@ -709,8 +709,8 @@ alignment of packAlign to ensure efficient copying.
|
|||
Stores the length of padding after a line of pixels to address padlen
|
||||
|
||||
Return value must be freed with ri.Hunk_FreeTempMemory()
|
||||
==================
|
||||
*/
|
||||
==================
|
||||
*/
|
||||
static byte *RB_ReadPixels(int x, int y, int width, int height, size_t *offset, int *padlen, int lineAlign )
|
||||
{
|
||||
byte *buffer, *bufstart;
|
||||
|
@ -746,7 +746,7 @@ static byte *RB_ReadPixels(int x, int y, int width, int height, size_t *offset,
|
|||
==================
|
||||
RB_TakeScreenshot
|
||||
==================
|
||||
*/
|
||||
*/
|
||||
void RB_TakeScreenshot( int x, int y, int width, int height, const char *fileName )
|
||||
{
|
||||
const int header_size = 18;
|
||||
|
@ -785,10 +785,10 @@ void RB_TakeScreenshot( int x, int y, int width, int height, const char *fileNam
|
|||
*destptr++ = srcptr[2];
|
||||
*destptr++ = srcptr[1];
|
||||
*destptr++ = temp;
|
||||
|
||||
|
||||
srcptr += 3;
|
||||
}
|
||||
|
||||
|
||||
// Skip the pad
|
||||
srcptr += padlen;
|
||||
}
|
||||
|
@ -805,10 +805,10 @@ void RB_TakeScreenshot( int x, int y, int width, int height, const char *fileNam
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
RB_TakeScreenshotJPEG
|
||||
==================
|
||||
==================
|
||||
*/
|
||||
void RB_TakeScreenshotJPEG( int x, int y, int width, int height, const char *fileName )
|
||||
{
|
||||
|
@ -952,11 +952,11 @@ void RB_TakeScreenshotBMP( int x, int y, int width, int height, const char *file
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
R_ScreenshotFilename
|
||||
==================
|
||||
*/
|
||||
==================
|
||||
*/
|
||||
static void R_ScreenshotFilename( char *fileName, const char *fileExt ) {
|
||||
qtime_t t;
|
||||
int count;
|
||||
|
@ -964,12 +964,12 @@ static void R_ScreenshotFilename( char *fileName, const char *fileExt ) {
|
|||
count = 0;
|
||||
ri.Com_RealTime( &t );
|
||||
|
||||
Com_sprintf( fileName, MAX_OSPATH, "screenshots/shot-%04d%02d%02d-%02d%02d%02d.%s",
|
||||
Com_sprintf( fileName, MAX_OSPATH, "screenshots/shot-%04d%02d%02d-%02d%02d%02d.%s",
|
||||
1900 + t.tm_year, 1 + t.tm_mon, t.tm_mday,
|
||||
t.tm_hour, t.tm_min, t.tm_sec, fileExt );
|
||||
|
||||
while ( ri.FS_FileExists( fileName ) && ++count < 1000 ) {
|
||||
Com_sprintf( fileName, MAX_OSPATH, "screenshots/shot-%04d%02d%02d-%02d%02d%02d-%d.%s",
|
||||
Com_sprintf( fileName, MAX_OSPATH, "screenshots/shot-%04d%02d%02d-%02d%02d%02d-%d.%s",
|
||||
1900 + t.tm_year, 1 + t.tm_mon, t.tm_mday,
|
||||
t.tm_hour, t.tm_min, t.tm_sec, count, fileExt );
|
||||
}
|
||||
|
@ -1044,8 +1044,8 @@ static void R_LevelShot( void ) {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
R_ScreenShot_f
|
||||
|
||||
screenshot
|
||||
|
@ -1054,8 +1054,8 @@ screenshot [levelshot]
|
|||
screenshot [filename]
|
||||
|
||||
Doesn't print the pacifier message if there is a second arg
|
||||
==================
|
||||
*/
|
||||
==================
|
||||
*/
|
||||
static void R_ScreenShot_f( void ) {
|
||||
char checkname[MAX_OSPATH];
|
||||
qboolean silent;
|
||||
|
@ -1190,10 +1190,10 @@ const void *RB_TakeVideoFrameCmd( const void *data )
|
|||
*destptr++ = srcptr[0];
|
||||
srcptr += 3;
|
||||
}
|
||||
|
||||
|
||||
Com_Memset(destptr, '\0', avipadlen);
|
||||
destptr += avipadlen;
|
||||
|
||||
|
||||
srcptr += padlen;
|
||||
}
|
||||
|
||||
|
@ -1334,7 +1334,7 @@ static void GfxInfo( void )
|
|||
if ( glConfig.isFullscreen )
|
||||
{
|
||||
const char *modefs = ri.Cvar_VariableString( "r_modeFullscreen" );
|
||||
if ( *modefs )
|
||||
if ( *modefs )
|
||||
mode = atoi( modefs );
|
||||
else
|
||||
mode = ri.Cvar_VariableIntegerValue( "r_mode" );
|
||||
|
@ -1350,7 +1350,7 @@ static void GfxInfo( void )
|
|||
{
|
||||
ri.Printf( PRINT_ALL, "RENDER: %d x %d, MODE: %d, %d x %d %s hz:", glConfig.vidWidth, glConfig.vidHeight, mode, gls.windowWidth, gls.windowHeight, fs );
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
ri.Printf( PRINT_ALL, "MODE: %d, %d x %d %s hz:", mode, gls.windowWidth, gls.windowHeight, fs );
|
||||
}
|
||||
|
@ -1817,7 +1817,7 @@ refexport_t *GetRefAPI ( int apiVersion, refimport_t *rimp ) {
|
|||
Com_Memset( &re, 0, sizeof( re ) );
|
||||
|
||||
if ( apiVersion != REF_API_VERSION ) {
|
||||
ri.Printf(PRINT_ALL, "Mismatched REF_API_VERSION: expected %i, got %i\n",
|
||||
ri.Printf(PRINT_ALL, "Mismatched REF_API_VERSION: expected %i, got %i\n",
|
||||
REF_API_VERSION, apiVersion );
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#define DLIGHT_AT_RADIUS 16
|
||||
// at the edge of a dlight's influence, this amount of light will be added
|
||||
|
||||
#define DLIGHT_MINIMUM_RADIUS 16
|
||||
#define DLIGHT_MINIMUM_RADIUS 16
|
||||
// never calculate a range less than this to prevent huge light numbers
|
||||
|
||||
|
||||
|
@ -143,7 +143,7 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) {
|
|||
float totalFactor;
|
||||
|
||||
if ( ent->e.renderfx & RF_LIGHTING_ORIGIN ) {
|
||||
// seperate lightOrigins are needed so an object that is
|
||||
// separate lightOrigins are needed so an object that is
|
||||
// sinking into the ground can still be lit, and so
|
||||
// multi-part models can be lit identically
|
||||
VectorCopy( ent->e.lightingOrigin, lightOrigin );
|
||||
|
@ -294,7 +294,7 @@ void R_SetupEntityLighting( const trRefdef_t *refdef, trRefEntity_t *ent ) {
|
|||
vec3_t shadowLightDir;
|
||||
#endif
|
||||
|
||||
// lighting calculations
|
||||
// lighting calculations
|
||||
if ( ent->lightingCalculated ) {
|
||||
return;
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ void R_SetupEntityLighting( const trRefdef_t *refdef, trRefEntity_t *ent ) {
|
|||
// trace a sample point down to find ambient light
|
||||
//
|
||||
if ( ent->e.renderfx & RF_LIGHTING_ORIGIN ) {
|
||||
// seperate lightOrigins are needed so an object that is
|
||||
// separate lightOrigins are needed so an object that is
|
||||
// sinking into the ground can still be lit, and so
|
||||
// multi-part models can be lit identically
|
||||
VectorCopy( ent->e.lightingOrigin, lightOrigin );
|
||||
|
@ -313,13 +313,13 @@ void R_SetupEntityLighting( const trRefdef_t *refdef, trRefEntity_t *ent ) {
|
|||
}
|
||||
|
||||
// if NOWORLDMODEL, only use dynamic lights (menu system, etc)
|
||||
if ( !(refdef->rdflags & RDF_NOWORLDMODEL )
|
||||
if ( !(refdef->rdflags & RDF_NOWORLDMODEL )
|
||||
&& tr.world->lightGridData ) {
|
||||
R_SetupEntityLightingGrid( ent );
|
||||
} else {
|
||||
ent->ambientLight[0] = ent->ambientLight[1] =
|
||||
ent->ambientLight[0] = ent->ambientLight[1] =
|
||||
ent->ambientLight[2] = tr.identityLight * 150;
|
||||
ent->directedLight[0] = ent->directedLight[1] =
|
||||
ent->directedLight[0] = ent->directedLight[1] =
|
||||
ent->directedLight[2] = tr.identityLight * 150;
|
||||
VectorCopy( tr.sunDirection, ent->lightDir );
|
||||
}
|
||||
|
@ -338,7 +338,7 @@ void R_SetupEntityLighting( const trRefdef_t *refdef, trRefEntity_t *ent ) {
|
|||
d = VectorLength( ent->directedLight );
|
||||
VectorScale( ent->lightDir, d, lightDir );
|
||||
#ifdef USE_PMLIGHT
|
||||
if ( r_dlightMode->integer == 2 ) {
|
||||
if ( r_dlightMode->integer == 2 ) {
|
||||
// only direct lights
|
||||
// but we need to deal with shadow light direction
|
||||
VectorCopy( lightDir, shadowLightDir );
|
||||
|
@ -391,7 +391,7 @@ void R_SetupEntityLighting( const trRefdef_t *refdef, trRefEntity_t *ent ) {
|
|||
((byte *)&ent->ambientLightInt)[1] = myftol( ent->ambientLight[1] );
|
||||
((byte *)&ent->ambientLightInt)[2] = myftol( ent->ambientLight[2] );
|
||||
((byte *)&ent->ambientLightInt)[3] = 0xff;
|
||||
|
||||
|
||||
// transform the direction to local space
|
||||
VectorNormalize( lightDir );
|
||||
ent->lightDir[0] = DotProduct( lightDir, ent->e.axis[0] );
|
||||
|
@ -417,7 +417,7 @@ R_LightForPoint
|
|||
int R_LightForPoint( vec3_t point, vec3_t ambientLight, vec3_t directedLight, vec3_t lightDir )
|
||||
{
|
||||
trRefEntity_t ent;
|
||||
|
||||
|
||||
if ( tr.world->lightGridData == NULL )
|
||||
return qfalse;
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ static void DrawNormals( const shaderCommands_t *input ) {
|
|||
for ( i = tess.numVertexes-1; i >= 0; i-- ) {
|
||||
VectorMA( tess.xyz[i], 2.0, tess.normal[i], tess.xyz[i*2 + 1] );
|
||||
VectorCopy( tess.xyz[i], tess.xyz[i*2] );
|
||||
}
|
||||
}
|
||||
|
||||
qglVertexPointer( 3, GL_FLOAT, sizeof( tess.xyz[0] ), tess.xyz );
|
||||
|
||||
|
@ -198,7 +198,7 @@ to overflow.
|
|||
void RB_BeginSurface( shader_t *shader, int fogNum ) {
|
||||
|
||||
shader_t *state;
|
||||
|
||||
|
||||
#ifdef USE_PMLIGHT
|
||||
if ( !tess.dlightPass && shader->isStaticShader && !shader->remappedShader )
|
||||
#else
|
||||
|
@ -349,7 +349,7 @@ static void ProjectDlightTexture_scalar( void ) {
|
|||
for ( l = 0 ; l < backEnd.refdef.num_dlights ; l++ ) {
|
||||
|
||||
if ( !( tess.dlightBits & ( 1 << l ) ) ) {
|
||||
continue; // this surface definately doesn't have any of this light
|
||||
continue; // this surface definitely doesn't have any of this light
|
||||
}
|
||||
texCoords = texCoordsArray[0];
|
||||
colors = colorArray[0];
|
||||
|
@ -358,11 +358,11 @@ static void ProjectDlightTexture_scalar( void ) {
|
|||
VectorCopy( dl->transformed, origin );
|
||||
radius = dl->radius;
|
||||
scale = 1.0f / radius;
|
||||
|
||||
|
||||
for ( i = 0 ; i < tess.numVertexes ; i++, texCoords += 2, colors += 4 ) {
|
||||
int clip = 0;
|
||||
vec3_t dist;
|
||||
|
||||
|
||||
VectorSubtract( origin, tess.xyz[i], dist );
|
||||
|
||||
backEnd.pc.c_dlightVertexes++;
|
||||
|
@ -771,7 +771,7 @@ void R_ComputeTexCoords( const int b, const textureBundle_t *bundle ) {
|
|||
RB_CalcScaleTexCoords( bundle->texMods[tm].scale, (float *) src, (float *) dst );
|
||||
src = dst;
|
||||
break;
|
||||
|
||||
|
||||
case TMOD_STRETCH:
|
||||
RB_CalcStretchTexCoords( &bundle->texMods[tm].wave, (float *)src, (float *) dst );
|
||||
src = dst;
|
||||
|
@ -965,7 +965,7 @@ void RB_StageIteratorGeneric( void )
|
|||
//
|
||||
RB_IterateStagesGeneric( input );
|
||||
|
||||
//
|
||||
//
|
||||
// now do any dynamic lighting needed
|
||||
//
|
||||
#ifdef USE_LEGACY_DLIGHTS
|
||||
|
@ -986,7 +986,7 @@ void RB_StageIteratorGeneric( void )
|
|||
RB_FogPass();
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// unlock arrays
|
||||
//
|
||||
if ( qglUnlockArraysEXT )
|
||||
|
@ -1021,7 +1021,7 @@ void RB_EndSurface( void ) {
|
|||
|
||||
if ( input->numIndexes > SHADER_MAX_INDEXES ) {
|
||||
ri.Error( ERR_DROP, "RB_EndSurface() - SHADER_MAX_INDEXES hit" );
|
||||
}
|
||||
}
|
||||
|
||||
if ( input->numVertexes > SHADER_MAX_VERTEXES ) {
|
||||
ri.Error( ERR_DROP, "RB_EndSurface() - SHADER_MAX_VERTEXES hit" );
|
||||
|
@ -1046,7 +1046,7 @@ void RB_EndSurface( void ) {
|
|||
backEnd.pc.c_lit_batches++;
|
||||
backEnd.pc.c_lit_vertices += tess.numVertexes;
|
||||
backEnd.pc.c_lit_indices += tess.numIndexes;
|
||||
} else
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
backEnd.pc.c_shaders++;
|
||||
|
|
|
@ -46,7 +46,7 @@ return a hash value for the filename
|
|||
================
|
||||
*/
|
||||
#ifdef __GNUCC__
|
||||
#warning TODO: check if long is ok here
|
||||
#warning TODO: check if long is ok here
|
||||
#endif
|
||||
|
||||
#define generateHashValue Com_GenerateHashValue
|
||||
|
@ -139,7 +139,7 @@ NameToAFunc
|
|||
===============
|
||||
*/
|
||||
static unsigned NameToAFunc( const char *funcname )
|
||||
{
|
||||
{
|
||||
if ( !Q_stricmp( funcname, "GT0" ) )
|
||||
{
|
||||
return GLS_ATEST_GT_0;
|
||||
|
@ -484,7 +484,7 @@ static void ParseTexMod( const char *_text, shaderStage_t *stage )
|
|||
return;
|
||||
}
|
||||
tmi->wave.frequency = Q_atof( token );
|
||||
|
||||
|
||||
tmi->type = TMOD_STRETCH;
|
||||
}
|
||||
//
|
||||
|
@ -1029,7 +1029,7 @@ static qboolean ParseStage( shaderStage_t *stage, const char **text )
|
|||
|
||||
stage->bundle[0].tcGen = TCGEN_VECTOR;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
ri.Printf( PRINT_WARNING, "WARNING: unknown texgen parm in shader '%s'\n", shader.name );
|
||||
}
|
||||
|
@ -1180,7 +1180,7 @@ static void ParseDeform( const char **text ) {
|
|||
|
||||
if ( !Q_stricmpn( token, "text", 4 ) ) {
|
||||
int n;
|
||||
|
||||
|
||||
n = token[4] - '0';
|
||||
if ( n < 0 || n > 7 ) {
|
||||
n = 0;
|
||||
|
@ -1304,7 +1304,7 @@ static void ParseSkyParms( const char **text ) {
|
|||
if ( r_neatsky->integer ) {
|
||||
imgFlags = IMGFLAG_NONE;
|
||||
}
|
||||
|
||||
|
||||
// outerbox
|
||||
token = COM_ParseExt( text, qfalse );
|
||||
if ( token[0] == 0 ) {
|
||||
|
@ -1541,7 +1541,7 @@ static qboolean ParseCondition( const char **text, resultType *res )
|
|||
ri.Printf( PRINT_WARNING, "WARNING: expecting lvalue for condition in shader %s\n", shader.name );
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
|
||||
Q_strncpyz( lval_str, token, sizeof( lval_str ) );
|
||||
lval_type = com_tokentype;
|
||||
|
||||
|
@ -1563,18 +1563,18 @@ static qboolean ParseCondition( const char **text, resultType *res )
|
|||
|
||||
// read next token, expect '||', '&&' or ')', allow newlines
|
||||
/*token =*/ COM_ParseComplex( text, qtrue );
|
||||
}
|
||||
else if ( com_tokentype == TK_SCOPE_CLOSE || com_tokentype == TK_OR || com_tokentype == TK_AND )
|
||||
}
|
||||
else if ( com_tokentype == TK_SCOPE_CLOSE || com_tokentype == TK_OR || com_tokentype == TK_AND )
|
||||
{
|
||||
// no r-value, assume 'not zero' comparison
|
||||
op = TK_NEQ;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
ri.Printf( PRINT_WARNING, "WARNING: unexpected operator '%s' for comparison in shader %s\n", token, shader.name );
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
|
||||
str = qfalse;
|
||||
|
||||
if ( lval_type == TK_QUOTED ) {
|
||||
|
@ -1626,7 +1626,7 @@ static qboolean ParseCondition( const char **text, resultType *res )
|
|||
r |= r0;
|
||||
else
|
||||
r &= r0;
|
||||
|
||||
|
||||
if ( com_tokentype == TK_OR ) {
|
||||
rm = maskOR;
|
||||
continue;
|
||||
|
@ -1647,7 +1647,7 @@ static qboolean ParseCondition( const char **text, resultType *res )
|
|||
|
||||
if ( res )
|
||||
*res = r ? res_true : res_false;
|
||||
|
||||
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
|
@ -1727,7 +1727,7 @@ static qboolean ParseShader( const char **text )
|
|||
tr.sunLight[1] = Q_atof( token );
|
||||
token = COM_ParseExt( text, qfalse );
|
||||
tr.sunLight[2] = Q_atof( token );
|
||||
|
||||
|
||||
VectorNormalize( tr.sunLight );
|
||||
|
||||
token = COM_ParseExt( text, qfalse );
|
||||
|
@ -2129,7 +2129,7 @@ static qboolean CollapseMultitexture( shaderStage_t *st0, shaderStage_t *st1, in
|
|||
if ( num_stages > 2 )
|
||||
{
|
||||
memmove( st1, st1+1, sizeof( stages[0] ) * ( num_stages - 2 ) );
|
||||
}
|
||||
}
|
||||
|
||||
Com_Memset( st0 + num_stages - 1, 0, sizeof( stages[0] ) );
|
||||
|
||||
|
@ -2339,7 +2339,7 @@ static shader_t *GeneratePermanentShader( void ) {
|
|||
|
||||
tr.shaders[ tr.numShaders ] = newShader;
|
||||
newShader->index = tr.numShaders;
|
||||
|
||||
|
||||
tr.sortedShaders[ tr.numShaders ] = newShader;
|
||||
newShader->sortedIndex = tr.numShaders;
|
||||
|
||||
|
@ -2599,23 +2599,23 @@ static shader_t *FinishShader( void ) {
|
|||
if ( pStage->isDetail && !r_detailTextures->integer )
|
||||
{
|
||||
int index;
|
||||
|
||||
|
||||
for(index = stage + 1; index < MAX_SHADER_STAGES; index++)
|
||||
{
|
||||
if(!stages[index].active)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if(index < MAX_SHADER_STAGES)
|
||||
memmove(pStage, pStage + 1, sizeof(*pStage) * (index - stage));
|
||||
else
|
||||
{
|
||||
if(stage + 1 < MAX_SHADER_STAGES)
|
||||
memmove(pStage, pStage + 1, sizeof(*pStage) * (index - stage - 1));
|
||||
|
||||
|
||||
Com_Memset(&stages[index - 1], 0, sizeof(*stages));
|
||||
}
|
||||
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2677,7 +2677,7 @@ static shader_t *FinishShader( void ) {
|
|||
|
||||
colorBlend = qtrue;
|
||||
}
|
||||
|
||||
|
||||
stage++;
|
||||
}
|
||||
|
||||
|
@ -2968,7 +2968,7 @@ shader_t *R_FindShader( const char *name, int lightmapIndex, qboolean mipRawImag
|
|||
|
||||
InitShader( strippedName, lightmapIndex );
|
||||
|
||||
// FIXME: set these "need" values apropriately
|
||||
// FIXME: set these "need" values appropriately
|
||||
//shader.needsNormal = qtrue;
|
||||
//shader.needsST1 = qtrue;
|
||||
//shader.needsST2 = qtrue;
|
||||
|
@ -3074,7 +3074,7 @@ qhandle_t RE_RegisterShaderFromImage(const char *name, int lightmapIndex, image_
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
====================
|
||||
RE_RegisterShaderLightMap
|
||||
|
||||
|
@ -3108,7 +3108,7 @@ qhandle_t RE_RegisterShaderLightMap( const char *name, int lightmapIndex ) {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
====================
|
||||
RE_RegisterShader
|
||||
|
||||
|
@ -3279,7 +3279,7 @@ static int loadShaderBuffers( char **shaderFiles, const int numShaderFiles, char
|
|||
|
||||
if ( !buffers[i] )
|
||||
ri.Error( ERR_DROP, "Couldn't load %s", filename );
|
||||
|
||||
|
||||
// comment some buggy shaders from pak0
|
||||
if ( summand == 35910 && strcmp( shaderFiles[i], "sky.shader" ) == 0 )
|
||||
{
|
||||
|
@ -3303,14 +3303,14 @@ static int loadShaderBuffers( char **shaderFiles, const int numShaderFiles, char
|
|||
|
||||
p = buffers[i];
|
||||
COM_BeginParseSession( filename );
|
||||
|
||||
|
||||
shaderStart = NULL;
|
||||
denyErrors = qfalse;
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
token = COM_ParseExt( &p, qtrue );
|
||||
|
||||
|
||||
if ( !*token )
|
||||
break;
|
||||
|
||||
|
@ -3540,7 +3540,7 @@ static void CreateExternalShaders( void ) {
|
|||
if(!tr.flareShader->defaultShader)
|
||||
{
|
||||
int index;
|
||||
|
||||
|
||||
for(index = 0; index < tr.flareShader->numUnfoggedPasses; index++)
|
||||
{
|
||||
tr.flareShader->stages[index]->adjustColorsForFog = ACFF_NONE;
|
||||
|
|
|
@ -80,7 +80,7 @@ void R_LoadTGA ( const char *name, byte **pic, int *width, int *height)
|
|||
targa_header.id_length = buf_p[0];
|
||||
targa_header.colormap_type = buf_p[1];
|
||||
targa_header.image_type = buf_p[2];
|
||||
|
||||
|
||||
memcpy(&targa_header.colormap_index, &buf_p[3], 2);
|
||||
memcpy(&targa_header.colormap_length, &buf_p[5], 2);
|
||||
targa_header.colormap_size = buf_p[7];
|
||||
|
@ -100,9 +100,9 @@ void R_LoadTGA ( const char *name, byte **pic, int *width, int *height)
|
|||
|
||||
buf_p += 18;
|
||||
|
||||
if (targa_header.image_type!=2
|
||||
if (targa_header.image_type!=2
|
||||
&& targa_header.image_type!=10
|
||||
&& targa_header.image_type != 3 )
|
||||
&& targa_header.image_type != 3 )
|
||||
{
|
||||
ri.Error (ERR_DROP, "LoadTGA: Only type 2 (RGB), 3 (gray), and 10 (RGB) TGA images supported");
|
||||
}
|
||||
|
@ -136,9 +136,9 @@ void R_LoadTGA ( const char *name, byte **pic, int *width, int *height)
|
|||
|
||||
buf_p += targa_header.id_length; // skip TARGA image comment
|
||||
}
|
||||
|
||||
|
||||
if ( targa_header.image_type == 2 || targa_header.image_type == 3 )
|
||||
{
|
||||
{
|
||||
if ( buf_p + columns * rows * targa_header.pixel_size / 8 > end )
|
||||
{
|
||||
ri.Error( ERR_DROP, "LoadTGA: file truncated (%s)", name );
|
||||
|
@ -225,7 +225,7 @@ void R_LoadTGA ( const char *name, byte **pic, int *width, int *height)
|
|||
red = green = blue = alphabyte = 0; // silence compiler warning
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
for(j=0;j<packetSize;j++) {
|
||||
*pixbuf++=red;
|
||||
*pixbuf++=green;
|
||||
|
@ -279,7 +279,7 @@ void R_LoadTGA ( const char *name, byte **pic, int *width, int *height)
|
|||
else
|
||||
goto breakOut;
|
||||
pixbuf = targa_rgba + row*columns*4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -287,8 +287,8 @@ void R_LoadTGA ( const char *name, byte **pic, int *width, int *height)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
// TTimo: this is the chunk of code to ensure a behavior that meets TGA specs
|
||||
#if 0
|
||||
// TTimo: this is the chunk of code to ensure a behavior that meets TGA specs
|
||||
// bit 5 set => top-down
|
||||
if (targa_header.attributes & 0x20) {
|
||||
unsigned char *flip = (unsigned char*)malloc (columns*4);
|
||||
|
|
|
@ -79,7 +79,7 @@ typedef struct {
|
|||
void (*RenderScene)( const refdef_t *fd );
|
||||
|
||||
void (*SetColor)( const float *rgba ); // NULL = 1,1,1,1
|
||||
void (*DrawStretchPic) ( float x, float y, float w, float h,
|
||||
void (*DrawStretchPic) ( float x, float y, float w, float h,
|
||||
float s1, float t1, float s2, float t2, qhandle_t hShader ); // 0 = white
|
||||
|
||||
// Draw images for cinematic rendering, pass as 32 bit rgba
|
||||
|
@ -95,7 +95,7 @@ typedef struct {
|
|||
int (*MarkFragments)( int numPoints, const vec3_t *points, const vec3_t projection,
|
||||
int maxPoints, vec3_t pointBuffer, int maxFragments, markFragment_t *fragmentBuffer );
|
||||
|
||||
int (*LerpTag)( orientation_t *tag, qhandle_t model, int startFrame, int endFrame,
|
||||
int (*LerpTag)( orientation_t *tag, qhandle_t model, int startFrame, int endFrame,
|
||||
float frac, const char *tagName );
|
||||
void (*ModelBounds)( qhandle_t model, vec3_t mins, vec3_t maxs );
|
||||
|
||||
|
@ -183,7 +183,7 @@ typedef struct {
|
|||
void (*CM_DrawDebugSurface)( void (*drawPoly)(int color, int numPoints, float *points) );
|
||||
|
||||
// a qfalse return means the file does not exist
|
||||
// NULL can be passed for buf to just determine existance
|
||||
// NULL can be passed for buf to just determine existence
|
||||
//int (*FS_FileIsInPAK)( const char *name, int *pCheckSum );
|
||||
int (*FS_ReadFile)( const char *name, void **buf );
|
||||
void (*FS_FreeFile)( void *buf );
|
||||
|
@ -198,7 +198,7 @@ typedef struct {
|
|||
e_status (*CIN_RunCinematic)( int handle );
|
||||
|
||||
void (*CL_WriteAVIVideoFrame)( const byte *buffer, int size );
|
||||
|
||||
|
||||
size_t (*CL_SaveJPGToBuffer)( byte *buffer, size_t bufSize, int quality, int image_width, int image_height, byte *image_buffer, int padding );
|
||||
void (*CL_SaveJPG)( const char *filename, int quality, int image_width, int image_height, byte *image_buffer, int padding );
|
||||
void (*CL_LoadJPG)( const char *filename, unsigned char **pic, int *width, int *height );
|
||||
|
|
|
@ -37,7 +37,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
typedef struct svEntity_s {
|
||||
struct worldSector_s *worldSector;
|
||||
struct svEntity_s *nextEntityInWorldSector;
|
||||
|
||||
|
||||
entityState_t baseline; // for delta compression of initial sighting
|
||||
int numClusters; // if -1, use headnode instead
|
||||
int clusternums[MAX_ENT_CLUSTERS];
|
||||
|
@ -157,9 +157,9 @@ typedef struct client_s {
|
|||
char userinfo[MAX_INFO_STRING]; // name, etc
|
||||
|
||||
char reliableCommands[MAX_RELIABLE_COMMANDS][MAX_STRING_CHARS];
|
||||
int reliableSequence; // last added reliable message, not necesarily sent or acknowledged yet
|
||||
int reliableSequence; // last added reliable message, not necessarily sent or acknowledged yet
|
||||
int reliableAcknowledge; // last acknowledged reliable message
|
||||
int reliableSent; // last sent reliable message, not necesarily acknowledged yet
|
||||
int reliableSent; // last sent reliable message, not necessarily acknowledged yet
|
||||
int messageAcknowledge;
|
||||
|
||||
int gamestateMessageNum; // netchan->outgoingSequence of gamestate
|
||||
|
@ -264,7 +264,7 @@ typedef struct
|
|||
netadr_t ip;
|
||||
// For a CIDR-Notation type suffix
|
||||
int subnet;
|
||||
|
||||
|
||||
qboolean isexception;
|
||||
} serverBan_t;
|
||||
#endif
|
||||
|
|
|
@ -137,7 +137,7 @@ void SV_GetChallenge( const netadr_t *from ) {
|
|||
|
||||
// Create a unique challenge for this client without storing state on the server
|
||||
challenge = SV_CreateChallenge( svs.time >> TS_SHIFT, from );
|
||||
|
||||
|
||||
if ( Cmd_Argc() < 2 ) {
|
||||
// legacy client query, don't send unneeded information
|
||||
NET_OutOfBandPrint( NS_SERVER, from, "challengeResponse %i", challenge );
|
||||
|
@ -164,25 +164,25 @@ static qboolean SV_IsBanned( const netadr_t *from, qboolean isexception )
|
|||
{
|
||||
int index;
|
||||
serverBan_t *curban;
|
||||
|
||||
|
||||
if(!isexception)
|
||||
{
|
||||
// If this is a query for a ban, first check whether the client is excepted
|
||||
if(SV_IsBanned(from, qtrue))
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
|
||||
for(index = 0; index < serverBansCount; index++)
|
||||
{
|
||||
curban = &serverBans[index];
|
||||
|
||||
|
||||
if(curban->isexception == isexception)
|
||||
{
|
||||
if(NET_CompareBaseAdrMask(&curban->ip, from, curban->subnet))
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
#endif
|
||||
|
@ -249,9 +249,9 @@ static qboolean SV_LoadIP4DB( const char *filename )
|
|||
uint32_t last_ip;
|
||||
void *buf;
|
||||
int len, i;
|
||||
|
||||
|
||||
len = FS_SV_FOpenFileRead( filename, &fh );
|
||||
|
||||
|
||||
if ( len <= 0 )
|
||||
{
|
||||
if ( fh != FS_INVALID_HANDLE )
|
||||
|
@ -274,7 +274,7 @@ static qboolean SV_LoadIP4DB( const char *filename )
|
|||
FS_Read( buf, len, fh );
|
||||
FS_FCloseFile( fh );
|
||||
|
||||
// check intergity of loaded databse
|
||||
// check integrity of loaded databse
|
||||
last_ip = 0;
|
||||
num_tlds = len / 10;
|
||||
|
||||
|
@ -301,7 +301,7 @@ static qboolean SV_LoadIP4DB( const char *filename )
|
|||
}
|
||||
|
||||
if ( i != num_tlds ) {
|
||||
Com_Printf( S_COLOR_YELLOW "invalid ip4db entry #%i: range=[%08x..%08x], tld=%c%c\n",
|
||||
Com_Printf( S_COLOR_YELLOW "invalid ip4db entry #%i: range=[%08x..%08x], tld=%c%c\n",
|
||||
i, ipdb_range[i].from, ipdb_range[i].to, ipdb_tld[i].tld[0], ipdb_tld[i].tld[1] );
|
||||
SV_FreeIP4DB();
|
||||
return qtrue; // to not try to load it again
|
||||
|
@ -938,7 +938,7 @@ int SV_RemainingGameState( void )
|
|||
|
||||
// reserve some space for potential userinfo expansion
|
||||
len += 512;
|
||||
|
||||
|
||||
return MAX_MSGLEN - len;
|
||||
}
|
||||
|
||||
|
@ -1219,7 +1219,7 @@ static int SV_WriteDownloadToClient( client_t *cl, msg_t *msg )
|
|||
// Chop off filename extension.
|
||||
Q_strncpyz( pakbuf, cl->downloadName, sizeof( pakbuf ) );
|
||||
pakptr = strrchr( pakbuf, '.' );
|
||||
|
||||
|
||||
if(pakptr)
|
||||
{
|
||||
*pakptr = '\0';
|
||||
|
@ -1298,17 +1298,17 @@ static int SV_WriteDownloadToClient( client_t *cl, msg_t *msg )
|
|||
MSG_WriteString( msg, errorMessage );
|
||||
|
||||
*cl->downloadName = '\0';
|
||||
|
||||
|
||||
if ( cl->download != FS_INVALID_HANDLE ) {
|
||||
FS_FCloseFile( cl->download );
|
||||
cl->download = FS_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Com_Printf( "clientDownload: %d : beginning \"%s\"\n", (int) (cl - svs.clients), cl->downloadName );
|
||||
|
||||
|
||||
// Init
|
||||
cl->downloadCurrentBlock = cl->downloadClientBlock = cl->downloadXmitBlock = 0;
|
||||
cl->downloadCount = 0;
|
||||
|
@ -1402,11 +1402,11 @@ int SV_SendQueuedMessages( void )
|
|||
{
|
||||
int i, retval = -1, nextFragT;
|
||||
client_t *cl;
|
||||
|
||||
|
||||
for( i = 0; i < sv_maxclients->integer; i++ )
|
||||
{
|
||||
cl = &svs.clients[i];
|
||||
|
||||
|
||||
if ( cl->state )
|
||||
{
|
||||
nextFragT = SV_RateMsec(cl);
|
||||
|
@ -1436,18 +1436,18 @@ int SV_SendDownloadMessages( void )
|
|||
client_t *cl;
|
||||
msg_t msg;
|
||||
byte msgBuffer[ MAX_MSGLEN_BUF ];
|
||||
|
||||
|
||||
for( i = 0; i < sv_maxclients->integer; i++ )
|
||||
{
|
||||
cl = &svs.clients[i];
|
||||
|
||||
|
||||
if ( cl->state >= CS_CONNECTED && *cl->downloadName )
|
||||
{
|
||||
MSG_Init( &msg, msgBuffer, MAX_MSGLEN );
|
||||
MSG_WriteLong( &msg, cl->lastClientCommand );
|
||||
|
||||
|
||||
retval = SV_WriteDownloadToClient( cl, &msg );
|
||||
|
||||
|
||||
if ( retval )
|
||||
{
|
||||
MSG_WriteByte( &msg, svc_EOF );
|
||||
|
@ -1492,7 +1492,7 @@ static void SV_VerifyPaks_f( client_t *cl ) {
|
|||
const char *pArg;
|
||||
qboolean bGood = qtrue;
|
||||
|
||||
// if we are pure, we "expect" the client to load certain things from
|
||||
// if we are pure, we "expect" the client to load certain things from
|
||||
// certain pk3 files, namely we want the client to have loaded the
|
||||
// ui and cgame that we think should be loaded based on the pure setting
|
||||
//
|
||||
|
@ -1527,7 +1527,7 @@ static void SV_VerifyPaks_f( client_t *cl ) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// we basically use this while loop to avoid using 'goto' :)
|
||||
while (bGood) {
|
||||
|
||||
|
@ -1692,7 +1692,7 @@ void SV_UserinfoChanged( client_t *cl, qboolean updateUserinfo, qboolean runFilt
|
|||
i = sv_fps->integer;
|
||||
|
||||
i = 1000 / i; // from FPS to milliseconds
|
||||
|
||||
|
||||
if ( i != cl->snapshotMsec )
|
||||
{
|
||||
// Reset last sent snapshot so we avoid desync between server frame time and snapshot send time
|
||||
|
@ -1737,7 +1737,7 @@ void SV_UserinfoChanged( client_t *cl, qboolean updateUserinfo, qboolean runFilt
|
|||
if ( runFilter )
|
||||
{
|
||||
val = SV_RunFilters( cl->userinfo, &cl->netchan.remoteAddress );
|
||||
if ( *val != '\0' )
|
||||
if ( *val != '\0' )
|
||||
{
|
||||
SV_DropClient( cl, val );
|
||||
}
|
||||
|
@ -1835,7 +1835,7 @@ void SV_PrintLocations_f( client_t *client ) {
|
|||
|
||||
s = Q_stradd( s, line );
|
||||
}
|
||||
|
||||
|
||||
if ( buf[0] )
|
||||
{
|
||||
if ( client )
|
||||
|
@ -1890,7 +1890,7 @@ Also called by bot code
|
|||
qboolean SV_ExecuteClientCommand( client_t *cl, const char *s ) {
|
||||
const ucmd_t *ucmd;
|
||||
qboolean bFloodProtect;
|
||||
|
||||
|
||||
Cmd_TokenizeString( s );
|
||||
|
||||
// malicious users may try using too many string commands
|
||||
|
@ -1964,7 +1964,7 @@ static qboolean SV_ClientCommand( client_t *cl, msg_t *msg ) {
|
|||
|
||||
// drop the connection if we have somehow lost commands
|
||||
if ( seq > cl->lastClientCommand + 1 ) {
|
||||
Com_Printf( "Client %s lost %i clientCommands\n", cl->name,
|
||||
Com_Printf( "Client %s lost %i clientCommands\n", cl->name,
|
||||
seq - cl->lastClientCommand + 1 );
|
||||
SV_DropClient( cl, "Lost reliable commands" );
|
||||
return qfalse;
|
||||
|
@ -2006,7 +2006,7 @@ void SV_ClientThink (client_t *cl, usercmd_t *cmd) {
|
|||
==================
|
||||
SV_UserMove
|
||||
|
||||
The message usually contains all the movement commands
|
||||
The message usually contains all the movement commands
|
||||
that were in the last three packets, so that the information
|
||||
in dropped packets can be recovered.
|
||||
|
||||
|
@ -2070,9 +2070,9 @@ static void SV_UserMove( client_t *cl, msg_t *msg, qboolean delta ) {
|
|||
return;
|
||||
}
|
||||
SV_ClientEnterWorld( cl, &cmds[0] );
|
||||
// the moves can be processed normaly
|
||||
// the moves can be processed normally
|
||||
}
|
||||
|
||||
|
||||
// a bad cp command was sent, drop the client
|
||||
if ( sv_pure->integer != 0 && !cl->pureAuthentic ) {
|
||||
SV_DropClient( cl, "Cannot validate pure client!" );
|
||||
|
@ -2158,7 +2158,7 @@ void SV_ExecuteClientMessage( client_t *cl, msg_t *msg ) {
|
|||
|
||||
// if this is a usercmd from a previous gamestate,
|
||||
// ignore it or retransmit the current gamestate
|
||||
//
|
||||
//
|
||||
// if the client was downloading, let it stay at whatever serverId and
|
||||
// gamestate it was at. This allows it to keep downloading even when
|
||||
// the gamestate changes. After the download is finished, we'll
|
||||
|
|
|
@ -139,7 +139,7 @@ void SV_SetConfigstring (int index, const char *val) {
|
|||
if ( index == CS_SERVERINFO && ( SV_GentityNum( i )->r.svFlags & SVF_NOSERVERINFO ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
SV_SendConfigstring(client, index);
|
||||
}
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ baseline will be transmitted
|
|||
*/
|
||||
static void SV_CreateBaseline( void ) {
|
||||
sharedEntity_t *ent;
|
||||
int entnum;
|
||||
int entnum;
|
||||
|
||||
for ( entnum = 0; entnum < sv.num_entities ; entnum++ ) {
|
||||
ent = SV_GentityNum( entnum );
|
||||
|
@ -256,7 +256,7 @@ static void SV_BoundMaxClients( int minimum ) {
|
|||
SV_SetSnapshotParams
|
||||
===============
|
||||
*/
|
||||
static void SV_SetSnapshotParams( void )
|
||||
static void SV_SetSnapshotParams( void )
|
||||
{
|
||||
// PACKET_BACKUP frames is just about 6.67MB so use that even on listen servers
|
||||
svs.numSnapshotEntities = PACKET_BACKUP * MAX_GENTITIES;
|
||||
|
@ -290,7 +290,7 @@ static void SV_Startup( void ) {
|
|||
}
|
||||
|
||||
Cvar_Set( "sv_running", "1" );
|
||||
|
||||
|
||||
// Join the ipv6 multicast group now that a map is running so clients can scan for us on the local network.
|
||||
#ifdef USE_IPV6
|
||||
NET_JoinMulticast6();
|
||||
|
@ -354,7 +354,7 @@ void SV_ChangeMaxClients( void ) {
|
|||
|
||||
// free the old clients on the hunk
|
||||
Hunk_FreeTempMemory( oldClients );
|
||||
|
||||
|
||||
SV_SetSnapshotParams();
|
||||
}
|
||||
|
||||
|
@ -374,7 +374,7 @@ static void SV_ClearServer( void ) {
|
|||
}
|
||||
|
||||
if ( !sv_levelTimeReset->integer ) {
|
||||
i = sv.time;
|
||||
i = sv.time;
|
||||
Com_Memset( &sv, 0, sizeof( sv ) );
|
||||
sv.time = i;
|
||||
} else {
|
||||
|
@ -427,7 +427,7 @@ void SV_SpawnServer( const char *mapname, qboolean killBots ) {
|
|||
// Restart renderer?
|
||||
// CL_StartHunkUsers( );
|
||||
|
||||
// init client structures and svs.numSnapshotEntities
|
||||
// init client structures and svs.numSnapshotEntities
|
||||
if ( !Cvar_VariableIntegerValue( "sv_running" ) ) {
|
||||
SV_Startup();
|
||||
} else {
|
||||
|
@ -456,7 +456,7 @@ void SV_SpawnServer( const char *mapname, qboolean killBots ) {
|
|||
// server has changed
|
||||
svs.snapFlagServerBit ^= SNAPFLAG_SERVERCOUNT;
|
||||
|
||||
// set nextmap to the same map, but it may be overriden
|
||||
// set nextmap to the same map, but it may be overridden
|
||||
// by the game startup or another console command
|
||||
Cvar_Set( "nextmap", "map_restart 0" );
|
||||
// Cvar_Set( "nextmap", va("map %s", server) );
|
||||
|
@ -516,7 +516,7 @@ void SV_SpawnServer( const char *mapname, qboolean killBots ) {
|
|||
|
||||
// clear physics interaction links
|
||||
SV_ClearWorld();
|
||||
|
||||
|
||||
// media configstring setting should be done during
|
||||
// the loading stage, so connected clients don't have
|
||||
// to load during actual gameplay
|
||||
|
@ -589,7 +589,7 @@ void SV_SpawnServer( const char *mapname, qboolean killBots ) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// run another frame to allow things to look at all the players
|
||||
sv.time += 100;
|
||||
|
@ -771,7 +771,7 @@ void SV_Init( void )
|
|||
// init the botlib here because we need the pre-compiler in the UI
|
||||
SV_BotInitBotLib();
|
||||
|
||||
#ifdef USE_BANS
|
||||
#ifdef USE_BANS
|
||||
// Load saved bans
|
||||
Cbuf_AddText("rehashbans\n");
|
||||
#endif
|
||||
|
@ -802,7 +802,7 @@ to totally exit after returning from this function.
|
|||
void SV_FinalMessage( const char *message ) {
|
||||
int i, j;
|
||||
client_t *cl;
|
||||
|
||||
|
||||
// send it twice, ignoring rate
|
||||
for ( j = 0 ; j < 2 ; j++ ) {
|
||||
for (i=0, cl = svs.clients ; i < sv_maxclients->integer ; i++, cl++) {
|
||||
|
@ -861,7 +861,7 @@ void SV_Shutdown( const char *finalmsg ) {
|
|||
|
||||
for ( index = 0; index < sv_maxclients->integer; index++ )
|
||||
SV_FreeClient( &svs.clients[ index ] );
|
||||
|
||||
|
||||
Z_Free( svs.clients );
|
||||
}
|
||||
Com_Memset( &svs, 0, sizeof( svs ) );
|
||||
|
|
|
@ -65,12 +65,12 @@ void QGL_Shutdown( qboolean unloadDLL )
|
|||
// suffice to say I don't see anything in the Q3 code that could cause it.
|
||||
// I suspect it's an Nvidia driver bug, but without the source or means to
|
||||
// debug I obviously can't prove (or disprove) this. Interestingly (though
|
||||
// perhaps not suprisingly), Enemy Territory and Doom 3 both exhibit the
|
||||
// perhaps not surprisingly), Enemy Territory and Doom 3 both exhibit the
|
||||
// same problem.
|
||||
//
|
||||
// After many, many reboots and prodding here and there, it seems that a
|
||||
// placing a short delay before libGL is unloaded works around the problem.
|
||||
// This delay is changable via the r_GLlibCoolDownMsec cvar (nice name
|
||||
// This delay is changeable via the r_GLlibCoolDownMsec cvar (nice name
|
||||
// huh?), and it defaults to 0. For me, 500 seems to work.
|
||||
//if( r_GLlibCoolDownMsec->integer )
|
||||
// usleep( r_GLlibCoolDownMsec->integer * 1000 );
|
||||
|
@ -108,12 +108,12 @@ void *GL_GetProcAddress( const char *symbol )
|
|||
/*
|
||||
** QGL_Init
|
||||
**
|
||||
** This is responsible for binding our qgl function pointers to
|
||||
** the appropriate GL stuff. In Windows this means doing a
|
||||
** This is responsible for binding our qgl function pointers to
|
||||
** the appropriate GL stuff. In Windows this means doing a
|
||||
** LoadLibrary and a bunch of calls to GetProcAddress. On other
|
||||
** operating systems we need to do the right thing, whatever that
|
||||
** might be.
|
||||
**
|
||||
**
|
||||
*/
|
||||
qboolean QGL_Init( const char *dllname )
|
||||
{
|
||||
|
|
|
@ -109,7 +109,7 @@ tty_err Sys_ConsoleInputInit( void );
|
|||
// General routines
|
||||
// =======================================================================
|
||||
|
||||
// bk001207
|
||||
// bk001207
|
||||
#define MEM_THRESHOLD 96*1024*1024
|
||||
|
||||
/*
|
||||
|
@ -232,7 +232,7 @@ void Sys_ConsoleInputShutdown( void )
|
|||
|
||||
stdin_active = qfalse;
|
||||
ttycon_on = qfalse;
|
||||
|
||||
|
||||
ttycon_hide = 0;
|
||||
}
|
||||
|
||||
|
@ -252,16 +252,16 @@ void CON_SigCont( int signum )
|
|||
void CON_SigTStp( int signum )
|
||||
{
|
||||
sigset_t mask;
|
||||
|
||||
|
||||
tty_FlushIn();
|
||||
Sys_ConsoleInputShutdown();
|
||||
|
||||
sigemptyset( &mask );
|
||||
sigaddset( &mask, SIGTSTP );
|
||||
sigprocmask( SIG_UNBLOCK, &mask, NULL );
|
||||
|
||||
|
||||
signal( SIGTSTP, SIG_DFL );
|
||||
|
||||
|
||||
kill( getpid(), SIGTSTP );
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ void Sys_Exit( int code )
|
|||
Sys_ConsoleInputShutdown();
|
||||
|
||||
#ifdef NDEBUG // regular behavior
|
||||
// We can't do this
|
||||
// We can't do this
|
||||
// as long as GL DLL's keep installing with atexit...
|
||||
//exit(ex);
|
||||
_exit( code );
|
||||
|
@ -361,7 +361,7 @@ tty_err Sys_ConsoleInputInit( void )
|
|||
|
||||
// If SIGCONT is received, reinitialize console
|
||||
signal( SIGCONT, CON_SigCont );
|
||||
|
||||
|
||||
if ( signal( SIGTSTP, SIG_IGN ) == SIG_DFL )
|
||||
{
|
||||
signal( SIGTSTP, CON_SigTStp );
|
||||
|
@ -565,7 +565,7 @@ char *Sys_ConsoleInput( void )
|
|||
|
||||
len = read( STDIN_FILENO, text, sizeof( text ) );
|
||||
if ( len == 0 ) // eof!
|
||||
{
|
||||
{
|
||||
fcntl( STDIN_FILENO, F_SETFL, stdin_flags );
|
||||
stdin_active = qfalse;
|
||||
return NULL;
|
||||
|
@ -606,7 +606,7 @@ void Sys_SendKeyEvents( void )
|
|||
==================
|
||||
Sys_Sleep
|
||||
|
||||
Block execution for msec or until input is recieved.
|
||||
Block execution for msec or until input is received.
|
||||
==================
|
||||
*/
|
||||
void Sys_Sleep( int msec ) {
|
||||
|
@ -776,7 +776,7 @@ void Sys_ConfigureFPU( void ) // bk001213 - divide by zero
|
|||
_FPU_SETCW( fpu_word );
|
||||
#endif // NDEBUG
|
||||
#endif // __GLIBC__
|
||||
#endif // __i386
|
||||
#endif // __i386
|
||||
#endif // __linux
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ typedef struct
|
|||
int visLevel;
|
||||
qboolean quitOnClose;
|
||||
int windowWidth, windowHeight;
|
||||
|
||||
|
||||
LONG_PTR SysInputLineWndProc;
|
||||
LONG_PTR SysStatusWndProc;
|
||||
LONG_PTR SysBufferWndProc;
|
||||
|
@ -109,7 +109,7 @@ static int conBufPos;
|
|||
|
||||
static void AddBufferText( const char *text, int textLength );
|
||||
|
||||
static void ConClear( void )
|
||||
static void ConClear( void )
|
||||
{
|
||||
//SendMessage( s_wcd.hwndBuffer, EM_SETSEL, 0, -1 );
|
||||
//SendMessage( s_wcd.hwndBuffer, EM_REPLACESEL, FALSE, ( LPARAM ) "" );
|
||||
|
@ -120,7 +120,7 @@ static void ConClear( void )
|
|||
conBufPos = 0;
|
||||
}
|
||||
|
||||
static int GetStatusBarHeight( void )
|
||||
static int GetStatusBarHeight( void )
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
|
@ -169,7 +169,7 @@ static LRESULT WINAPI ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
{
|
||||
|
||||
case WM_SETFOCUS:
|
||||
if ( s_wcd.hwndInputLine )
|
||||
if ( s_wcd.hwndInputLine )
|
||||
{
|
||||
SetFocus( s_wcd.hwndInputLine );
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ static LRESULT WINAPI ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
}
|
||||
break;
|
||||
|
||||
case WM_ENTERSIZEMOVE:
|
||||
case WM_ENTERSIZEMOVE:
|
||||
if ( conTimerID == 0 && (v = GetTimerMsec()) > 0 ) {
|
||||
conTimerID = SetTimer( s_wcd.hWnd, CON_TIMER_ID, v, NULL );
|
||||
}
|
||||
|
@ -355,7 +355,7 @@ static LRESULT WINAPI ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
{
|
||||
InvalidateRect( s_wcd.hwndErrorBox, NULL, FALSE );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( wParam == CON_TIMER_ID && conTimerID != 0 && !com_errorEntered )
|
||||
{
|
||||
#ifdef DEDICATED
|
||||
|
@ -369,7 +369,7 @@ static LRESULT WINAPI ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
case WM_CONTEXTMENU:
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return DefWindowProc( hWnd, uMsg, wParam, lParam );
|
||||
}
|
||||
|
||||
|
@ -383,7 +383,7 @@ static LRESULT WINAPI BufferWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
|
|||
|
||||
case WM_VSCROLL:
|
||||
if ( (int)LOWORD(wParam) == SB_ENDSCROLL ) {
|
||||
if ( bufTimerID != 0 ) {
|
||||
if ( bufTimerID != 0 ) {
|
||||
KillTimer( hWnd, bufTimerID );
|
||||
bufTimerID = 0;
|
||||
}
|
||||
|
@ -399,7 +399,7 @@ static LRESULT WINAPI BufferWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
|
|||
if ( bufTimerID == 0 && (v = GetTimerMsec()) > 0 )
|
||||
bufTimerID = SetTimer( hWnd, BUF_TIMER_ID, v, NULL );
|
||||
} else {
|
||||
if ( bufTimerID != 0 ) {
|
||||
if ( bufTimerID != 0 ) {
|
||||
KillTimer( hWnd, bufTimerID );
|
||||
bufTimerID = 0;
|
||||
}
|
||||
|
@ -416,7 +416,7 @@ static LRESULT WINAPI BufferWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
|
|||
#endif
|
||||
}
|
||||
if ( wParam == TEX_TIMER_ID && texTimerID != 0 ) {
|
||||
if ( conBufPos ) {
|
||||
if ( conBufPos ) {
|
||||
// dump text
|
||||
AddBufferText( conBuffer, conBufPos );
|
||||
conBufPos = 0;
|
||||
|
@ -427,7 +427,7 @@ static LRESULT WINAPI BufferWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
|
|||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
case WM_CONTEXTMENU:
|
||||
return 0;
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ LRESULT WINAPI StatusWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||
EmptyClipboard();
|
||||
len = GetWindowTextLength( s_wcd.hwndBuffer );
|
||||
if ( len > 0 ) {
|
||||
hMem = GlobalAlloc( GMEM_MOVEABLE | GMEM_DDESHARE | GMEM_ZEROINIT,
|
||||
hMem = GlobalAlloc( GMEM_MOVEABLE | GMEM_DDESHARE | GMEM_ZEROINIT,
|
||||
(len + 1) * sizeof( TCHAR ) );
|
||||
if ( hMem != NULL ) {
|
||||
text = ( TCHAR* )GlobalLock( hMem );
|
||||
|
@ -590,10 +590,10 @@ LRESULT WINAPI InputLineWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||
|
||||
while ( *s == '\\' || *s == '/' ) // skip leading slashes
|
||||
s++;
|
||||
|
||||
|
||||
strncat( s_wcd.consoleText, s, sizeof( s_wcd.consoleText ) - strlen( s_wcd.consoleText ) - 2 );
|
||||
strcat( s_wcd.consoleText, "\n" );
|
||||
|
||||
|
||||
SetWindowText( s_wcd.hwndInputLine, T("") );
|
||||
Field_Clear( &console );
|
||||
|
||||
|
@ -609,7 +609,7 @@ LRESULT WINAPI InputLineWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||
Q_strncpyz( console.buffer, WtoA( inputBuffer ), sizeof( console.buffer ) );
|
||||
SendMessage( hWnd, EM_GETSEL, (WPARAM) &pos, (LPARAM) 0 );
|
||||
console.cursor = pos;
|
||||
|
||||
|
||||
Field_AutoComplete( &console );
|
||||
|
||||
SetWindowText( hWnd, AtoW( console.buffer ) );
|
||||
|
@ -677,7 +677,7 @@ void Sys_CreateConsole( const char *title, int xPos, int yPos, qboolean useXYpos
|
|||
} else {
|
||||
GetCursorPos( &p );
|
||||
}
|
||||
|
||||
|
||||
memset( &mInfo, 0, sizeof( mInfo ) );
|
||||
mInfo.cbSize = sizeof( MONITORINFO );
|
||||
// Query display dimensions
|
||||
|
@ -768,7 +768,7 @@ void Sys_CreateConsole( const char *title, int xPos, int yPos, qboolean useXYpos
|
|||
h = rect.bottom - rect.top - 1;
|
||||
w = (rect.right - rect.left - 4) / 2;
|
||||
|
||||
// create the buttons
|
||||
// create the buttons
|
||||
s_wcd.hwndButtonCopy = CreateWindow( T("button"), T("copy"), WS_VISIBLE | WS_CHILD,
|
||||
x, rect.top, w, h, s_wcd.hwndStatusBar, (HMENU)(LRESULT)COPY_ID, g_wv.hInstance, NULL );
|
||||
x += w + 4;
|
||||
|
@ -817,7 +817,7 @@ void Sys_CreateConsole( const char *title, int xPos, int yPos, qboolean useXYpos
|
|||
ShowWindow( s_wcd.hWnd, SW_SHOWDEFAULT );
|
||||
UpdateWindow( s_wcd.hWnd );
|
||||
SetForegroundWindow( s_wcd.hWnd );
|
||||
|
||||
|
||||
SendMessage( s_wcd.hwndBuffer, EM_SETLIMITTEXT, MAX_CONSIZE, 0 );
|
||||
maxConSize = SendMessage( s_wcd.hwndBuffer, EM_GETLIMITTEXT, 0, 0 );
|
||||
|
||||
|
@ -993,7 +993,7 @@ void Conbuf_AppendText( const char *msg )
|
|||
if ( bufLen + conBufPos >= sizeof( conBuffer )-1 ) {
|
||||
AddBufferText( conBuffer, conBufPos );
|
||||
conBufPos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// new message is too long -> flush
|
||||
if ( bufLen >= sizeof( conBuffer )-1 ) {
|
||||
|
@ -1011,7 +1011,7 @@ void Conbuf_AppendText( const char *msg )
|
|||
|
||||
// set flush timer
|
||||
if ( texTimerID == 0 ) {
|
||||
texTimerID = SetTimer( s_wcd.hwndBuffer, TEX_TIMER_ID,
|
||||
texTimerID = SetTimer( s_wcd.hwndBuffer, TEX_TIMER_ID,
|
||||
s_wcd.visLevel == 1 ? 25 : 100, NULL );
|
||||
}
|
||||
}
|
||||
|
@ -1089,7 +1089,7 @@ void Sys_SetErrorText( const char *buf )
|
|||
SendMessage( s_wcd.hwndErrorBox, WM_SETFONT, ( WPARAM ) s_wcd.hfBufferFont, 0 );
|
||||
SetWindowText( s_wcd.hwndErrorBox, AtoW( buf ) );
|
||||
|
||||
Sys_SetStatus( "Fatal error occured" );
|
||||
Sys_SetStatus( "Fatal error occurred" );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue