summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/cl_avi.c19
-rw-r--r--src/client/cl_input.c2
-rw-r--r--src/client/cl_main.c13
-rw-r--r--src/client/cl_parse.c26
-rw-r--r--src/client/client.h2
-rw-r--r--src/client/snd_openal.c31
6 files changed, 61 insertions, 32 deletions
diff --git a/src/client/cl_avi.c b/src/client/cl_avi.c
index 1806b4fa..463f873c 100644
--- a/src/client/cl_avi.c
+++ b/src/client/cl_avi.c
@@ -168,7 +168,7 @@ static ID_INLINE void END_CHUNK( void )
afd.chunkStackTop--;
bufIndex = afd.chunkStack[ afd.chunkStackTop ];
bufIndex += 4;
- WRITE_4BYTES( endIndex - bufIndex - 1 );
+ WRITE_4BYTES( endIndex - bufIndex - 4 );
bufIndex = endIndex;
bufIndex = PAD( bufIndex, 2 );
}
@@ -223,7 +223,7 @@ void CL_WriteAVIHeader( void )
if( afd.motionJpeg )
WRITE_STRING( "MJPG" );
else
- WRITE_STRING( " BGR" );
+ WRITE_4BYTES( 0 ); // BI_RGB
WRITE_4BYTES( 0 ); //dwFlags
WRITE_4BYTES( 0 ); //dwPriority
@@ -250,13 +250,16 @@ void CL_WriteAVIHeader( void )
WRITE_2BYTES( 1 ); //biPlanes
WRITE_2BYTES( 24 ); //biBitCount
- if( afd.motionJpeg ) //biCompression
+ if( afd.motionJpeg ) { //biCompression
WRITE_STRING( "MJPG" );
- else
- WRITE_STRING( " BGR" );
-
- WRITE_4BYTES( afd.width *
+ WRITE_4BYTES( afd.width *
afd.height ); //biSizeImage
+ } else {
+ WRITE_4BYTES( 0 ); // BI_RGB
+ WRITE_4BYTES( afd.width *
+ afd.height*3 ); //biSizeImage
+ }
+
WRITE_4BYTES( 0 ); //biXPelsPetMeter
WRITE_4BYTES( 0 ); //biYPelsPetMeter
WRITE_4BYTES( 0 ); //biClrUsed
@@ -485,7 +488,7 @@ void CL_WriteAVIVideoFrame( const byte *imageBuffer, int size )
// Index
bufIndex = 0;
WRITE_STRING( "00dc" ); //dwIdentifier
- WRITE_4BYTES( 0 ); //dwFlags
+ WRITE_4BYTES( 0x00000010 ); //dwFlags (all frames are KeyFrames)
WRITE_4BYTES( chunkOffset ); //dwOffset
WRITE_4BYTES( size ); //dwLength
SafeFS_Write( buffer, 16, afd.idxF );
diff --git a/src/client/cl_input.c b/src/client/cl_input.c
index 11839729..6faec21c 100644
--- a/src/client/cl_input.c
+++ b/src/client/cl_input.c
@@ -646,7 +646,7 @@ qboolean CL_ReadyToSendPacket( void ) {
}
// send every frame for LAN
- if ( Sys_IsLANAddress( clc.netchan.remoteAddress ) ) {
+ if ( cl_lanForcePackets->integer && Sys_IsLANAddress( clc.netchan.remoteAddress ) ) {
return qtrue;
}
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index 3390ead5..808553b9 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -73,6 +73,8 @@ cvar_t *cl_inGameVideo;
cvar_t *cl_serverStatusResendTime;
cvar_t *cl_trn;
+cvar_t *cl_lanForcePackets;
+
clientActive_t cl;
clientConnection_t clc;
clientStatic_t cls;
@@ -230,10 +232,8 @@ CL_DemoFilename
void CL_DemoFilename( int number, char *fileName ) {
int a,b,c,d;
- if ( number < 0 || number > 9999 ) {
- Com_sprintf( fileName, MAX_OSPATH, "demo9999.tga" );
- return;
- }
+ if(number < 0 || number > 9999)
+ number = 9999;
a = number / 1000;
number -= a*1000;
@@ -301,10 +301,8 @@ void CL_Record_f( void ) {
CL_DemoFilename( number, demoName );
Com_sprintf (name, sizeof(name), "demos/%s.dm_%d", demoName, PROTOCOL_VERSION );
- len = FS_ReadFile( name, NULL );
- if ( len <= 0 ) {
+ if (!FS_FileExists(name))
break; // file doesn't exist
- }
}
}
@@ -2436,6 +2434,7 @@ void CL_Init( void ) {
Cvar_Get( "cl_maxPing", "800", CVAR_ARCHIVE );
+ cl_lanForcePackets = Cvar_Get ("cl_lanForcePackets", "1", CVAR_ARCHIVE);
// userinfo
playerName = getenv( "USER" ); // Unixy stuff
diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c
index dc14cd66..7de07e91 100644
--- a/src/client/cl_parse.c
+++ b/src/client/cl_parse.c
@@ -369,16 +369,38 @@ void CL_SystemInfoChanged( void ) {
// scan through all the variables in the systeminfo and locally set cvars to match
s = systemInfo;
while ( s ) {
+ int cvar_flags;
+
Info_NextPair( &s, key, value );
if ( !key[0] ) {
break;
}
+
// ehw!
- if ( !Q_stricmp( key, "fs_game" ) ) {
+ if (!Q_stricmp(key, "fs_game"))
+ {
+ if(FS_CheckDirTraversal(value))
+ {
+ Com_Printf(S_COLOR_YELLOW "WARNING: Server sent invalid fs_game value %s\n", value);
+ continue;
+ }
+
gameSet = qtrue;
}
- Cvar_Set( key, value );
+ if((cvar_flags = Cvar_Flags(key)) == CVAR_NONEXISTENT)
+ Cvar_Get(key, value, CVAR_SERVER_CREATED | CVAR_ROM);
+ else
+ {
+ // If this cvar may not be modified by a server discard the value.
+ if(!(cvar_flags & (CVAR_SYSTEMINFO | CVAR_SERVER_CREATED)))
+ {
+ Com_Printf(S_COLOR_YELLOW "WARNING: server is not allowed to set %s=%s\n", key, value);
+ continue;
+ }
+
+ Cvar_Set(key, value);
+ }
}
// if game folder should not be set and it is set at the client side
if ( !gameSet && *Cvar_VariableString("fs_game") ) {
diff --git a/src/client/client.h b/src/client/client.h
index e5f5d596..ae5915db 100644
--- a/src/client/client.h
+++ b/src/client/client.h
@@ -355,6 +355,8 @@ extern cvar_t *cl_allowDownload;
extern cvar_t *cl_conXOffset;
extern cvar_t *cl_inGameVideo;
+extern cvar_t *cl_lanForcePackets;
+
//=================================================
//
diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c
index c71a58ee..39a04179 100644
--- a/src/client/snd_openal.c
+++ b/src/client/snd_openal.c
@@ -466,7 +466,11 @@ typedef struct src_s
qboolean local; // Is this local (relative to the cam)
} src_t;
-#define MAX_SRC 128
+#ifdef MACOS_X
+ #define MAX_SRC 64
+#else
+ #define MAX_SRC 128
+#endif
static src_t srcList[MAX_SRC];
static int srcCount = 0;
static qboolean alSourcesInitialised = qfalse;
@@ -1370,6 +1374,9 @@ void S_AL_MusicProcess(ALuint b)
int l;
ALuint format;
+ if(!mus_stream)
+ return;
+
l = S_CodecReadStream(mus_stream, MUSIC_BUFFER_SIZE, decode_buffer);
// Run out data to read, start at the beginning again
@@ -1444,6 +1451,13 @@ void S_AL_StartBackgroundTrack( const char *intro, const char *loop )
if(musicSourceHandle == -1)
return;
+ mus_stream = S_CodecOpenStream(s_backgroundLoop);
+ if(!mus_stream)
+ {
+ S_AL_MusicSourceFree();
+ return;
+ }
+
// Generate the musicBuffers
qalGenBuffers(NUM_MUSIC_BUFFERS, musicBuffers);
@@ -1451,19 +1465,6 @@ void S_AL_StartBackgroundTrack( const char *intro, const char *loop )
for(i = 0; i < NUM_MUSIC_BUFFERS; i++)
{
S_AL_MusicProcess(musicBuffers[i]);
-
- // check whether our stream still exists.
- if(!mus_stream)
- {
- // there was an error in reading which resulted in a
- // closed stream. We must bail out or we'll crash.
-
- // deallocate everything we allocated so far:
- qalDeleteBuffers(NUM_MUSIC_BUFFERS, musicBuffers);
- S_AL_MusicSourceFree();
-
- return;
- }
}
qalSourceQueueBuffers(musicSource, NUM_MUSIC_BUFFERS, musicBuffers);
@@ -1525,6 +1526,8 @@ static ALCcontext *alContext;
#ifdef _WIN32
#define ALDRIVER_DEFAULT "OpenAL32.dll"
+#elif defined(MACOS_X)
+#define ALDRIVER_DEFAULT "/System/Library/Frameworks/OpenAL.framework/OpenAL"
#else
#define ALDRIVER_DEFAULT "libopenal.so.0"
#endif