Merge branch 'master' into sdl2

Conflicts:
	code/sdl/sdl_input.c
This commit is contained in:
Tim Angus 2013-08-16 23:34:08 +01:00
commit bde7665462
97 changed files with 6333 additions and 546 deletions

View file

@ -186,15 +186,6 @@ void CL_AddCgameCommand( const char *cmdName ) {
Cmd_AddCommand( cmdName, NULL );
}
/*
=====================
CL_CgameError
=====================
*/
void CL_CgameError( const char *string ) {
Com_Error( ERR_DROP, "%s", string );
}
/*
=====================

View file

@ -191,8 +191,6 @@ void Con_Dump_f (void)
Q_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) );
COM_DefaultExtension( filename, sizeof( filename ), ".txt" );
Com_Printf ("Dumped console text to %s.\n", filename );
f = FS_FOpenFileWrite( filename );
if (!f)
{
@ -200,6 +198,8 @@ void Con_Dump_f (void)
return;
}
Com_Printf ("Dumped console text to %s.\n", filename );
// skip empty lines
for (l = con.current - con.totallines + 1 ; l <= con.current ; l++)
{

View file

@ -1000,7 +1000,7 @@ void Key_Bind_f (void)
if (c == 2)
{
if (keys[b].binding)
if (keys[b].binding && keys[b].binding[0])
Com_Printf ("\"%s\" = \"%s\"\n", Key_KeynumToString(b), keys[b].binding );
else
Com_Printf ("\"%s\" is not bound\n", Key_KeynumToString(b) );
@ -1275,6 +1275,9 @@ void CL_KeyDownEvent( int key, unsigned time )
return;
}
// send the bound action
CL_ParseBinding( key, qtrue, time );
// distribute the key down event to the apropriate handler
if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) {
Console_Key( key );
@ -1291,10 +1294,6 @@ void CL_KeyDownEvent( int key, unsigned time )
} else if ( clc.state == CA_DISCONNECTED ) {
Console_Key( key );
}
// send the bound action
CL_ParseBinding( key, qtrue, time );
return;
}
/*

View file

@ -256,7 +256,7 @@ void CL_Voip_f( void )
reason = "Speex not initialized";
else if (!clc.voipEnabled)
reason = "Server doesn't support VoIP";
else if ( Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER || Cvar_VariableValue("ui_singlePlayerActive"))
else if (!clc.demoplaying && (Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER || Cvar_VariableValue("ui_singlePlayerActive")))
reason = "running in single-player mode";
if (reason != NULL) {
@ -3070,11 +3070,18 @@ CL_ShutdownRef
============
*/
void CL_ShutdownRef( void ) {
if ( !re.Shutdown ) {
return;
if ( re.Shutdown ) {
re.Shutdown( qtrue );
}
re.Shutdown( qtrue );
Com_Memset( &re, 0, sizeof( re ) );
#ifdef USE_RENDERER_DLOPEN
if ( rendererLib ) {
Sys_UnloadLibrary( rendererLib );
rendererLib = NULL;
}
#endif
}
/*
@ -4145,6 +4152,9 @@ void CL_GlobalServers_f( void ) {
com_gamename->string, Cmd_Argv(2));
}
}
else if ( !Q_stricmp( com_gamename->string, LEGACY_MASTER_GAMENAME ) )
Com_sprintf(command, sizeof(command), "getservers %s",
Cmd_Argv(2));
else
Com_sprintf(command, sizeof(command), "getservers %s %s",
com_gamename->string, Cmd_Argv(2));

View file

@ -352,11 +352,6 @@ void CL_SystemInfoChanged( void ) {
// in some cases, outdated cp commands might get sent with this news serverId
cl.serverId = atoi( Info_ValueForKey( systemInfo, "sv_serverid" ) );
// don't set any vars when playing a demo
if ( clc.demoplaying ) {
return;
}
#ifdef USE_VOIP
#ifdef LEGACY_PROTOCOL
if(clc.compat)
@ -365,13 +360,15 @@ void CL_SystemInfoChanged( void ) {
#endif
{
s = Info_ValueForKey( systemInfo, "sv_voip" );
if ( Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER || Cvar_VariableValue("ui_singlePlayerActive"))
clc.voipEnabled = qfalse;
else
clc.voipEnabled = atoi(s);
clc.voipEnabled = atoi(s);
}
#endif
// don't set any vars when playing a demo
if ( clc.demoplaying ) {
return;
}
s = Info_ValueForKey( systemInfo, "sv_cheats" );
cl_connectedToCheatServer = atoi( s );
if ( !cl_connectedToCheatServer ) {
@ -789,7 +786,6 @@ void CL_ParseVoip ( msg_t *msg ) {
}
for (i = 0; i < frames; i++) {
char encoded[256];
const int len = MSG_ReadByte(msg);
if (len < 0) {
Com_DPrintf("VoIP: Short packet!\n");

View file

@ -164,7 +164,6 @@ void S_TransferPaintBuffer(int endtime)
if ( s_testsound->integer ) {
int i;
int count;
// write a fixed sine wave
count = (endtime - s_paintedtime);

View file

@ -1876,6 +1876,7 @@ static void S_AL_MusicSourceFree( void )
{
// Release the output musicSource
S_AL_SrcUnlock(musicSourceHandle);
S_AL_SrcKill(musicSourceHandle);
musicSource = 0;
musicSourceHandle = -1;
}
@ -1908,17 +1909,22 @@ S_AL_StopBackgroundTrack
static
void S_AL_StopBackgroundTrack( void )
{
int numBuffers;
if(!musicPlaying)
return;
// Stop playing
qalSourceStop(musicSource);
// De-queue the musicBuffers
qalSourceUnqueueBuffers(musicSource, NUM_MUSIC_BUFFERS, musicBuffers);
// Destroy the musicBuffers
qalDeleteBuffers(NUM_MUSIC_BUFFERS, musicBuffers);
// Un-queue any buffers, and delete them
qalGetSourcei( musicSource, AL_BUFFERS_PROCESSED, &numBuffers );
while( numBuffers-- )
{
ALuint buffer;
qalSourceUnqueueBuffers(musicSource, 1, &buffer);
qalDeleteBuffers(1, &buffer);
}
// Free the musicSource
S_AL_MusicSourceFree();