summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/cl_cin.c3
-rw-r--r--src/client/cl_keys.c12
-rw-r--r--src/client/cl_main.c7
-rw-r--r--src/client/cl_scrn.c4
-rw-r--r--src/client/libmumblelink.c14
-rw-r--r--src/client/snd_openal.c27
6 files changed, 43 insertions, 24 deletions
diff --git a/src/client/cl_cin.c b/src/client/cl_cin.c
index f1fde54b..6d03d40a 100644
--- a/src/client/cl_cin.c
+++ b/src/client/cl_cin.c
@@ -1653,6 +1653,9 @@ void CIN_UploadCinematic(int handle) {
if (cl_inGameVideo->integer == 0 && cinTable[handle].playonwalls == 1) {
cinTable[handle].playonwalls--;
}
+ else if (cl_inGameVideo->integer != 0 && cinTable[handle].playonwalls != 1) {
+ cinTable[handle].playonwalls = 1;
+ }
}
}
diff --git a/src/client/cl_keys.c b/src/client/cl_keys.c
index 212ac8d5..c2cda2d6 100644
--- a/src/client/cl_keys.c
+++ b/src/client/cl_keys.c
@@ -532,12 +532,14 @@ void Field_CharEvent( field_t *edit, int ch ) {
}
if ( key_overstrikeMode ) {
- if ( edit->cursor == MAX_EDIT_LINE - 1 )
+ // - 2 to leave room for the leading slash and trailing \0
+ if ( edit->cursor == MAX_EDIT_LINE - 2 )
return;
edit->buffer[edit->cursor] = ch;
edit->cursor++;
} else { // insert mode
- if ( len == MAX_EDIT_LINE - 1 ) {
+ // - 2 to leave room for the leading slash and trailing \0
+ if ( len == MAX_EDIT_LINE - 2 ) {
return; // all full
}
memmove( edit->buffer + edit->cursor + 1,
@@ -581,8 +583,10 @@ 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 && g_consoleField.buffer[0] != '\\'
- && g_consoleField.buffer[0] != '/' ) {
+ if ( cls.state != CA_ACTIVE &&
+ g_consoleField.buffer[0] &&
+ g_consoleField.buffer[0] != '\\' &&
+ g_consoleField.buffer[0] != '/' ) {
char temp[MAX_EDIT_LINE-1];
Q_strncpyz( temp, g_consoleField.buffer, sizeof( temp ) );
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index 81cb98ac..a4c74c5a 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -3407,7 +3407,6 @@ void CL_Init( void ) {
// userinfo
Cvar_Get ("name", Sys_GetCurrentUser( ), CVAR_USERINFO | CVAR_ARCHIVE );
-
Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("snaps", "20", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("color1", "4", CVAR_USERINFO | CVAR_ARCHIVE );
@@ -3441,7 +3440,7 @@ void CL_Init( void ) {
// just demand it. Who doesn't have at least a DSL line now, anyhow? If
// you don't, you don't need VoIP. :)
if ((cl_voip->integer) && (Cvar_VariableIntegerValue("rate") < 25000)) {
- Com_Printf("Your network rate is too slow for VoIP.\n");
+ Com_Printf(S_COLOR_YELLOW "Your network rate is too slow for VoIP.\n");
Com_Printf("Set 'Data Rate' to 'LAN/Cable/xDSL' in 'Setup/System/Network' and restart.\n");
Com_Printf("Until then, VoIP is disabled.\n");
Cvar_Set("cl_voip", "0");
@@ -3504,14 +3503,14 @@ CL_Shutdown
===============
*/
-void CL_Shutdown( void ) {
+void CL_Shutdown( char *finalmsg ) {
static qboolean recursive = qfalse;
// check whether the client is running at all.
if(!(com_cl_running && com_cl_running->integer))
return;
- Com_Printf( "----- CL_Shutdown -----\n" );
+ Com_Printf( "----- Client Shutdown (%s) -----\n", finalmsg );
if ( recursive ) {
Com_Printf( "WARNING: Recursive shutdown\n" );
diff --git a/src/client/cl_scrn.c b/src/client/cl_scrn.c
index a5769b0d..c8568472 100644
--- a/src/client/cl_scrn.c
+++ b/src/client/cl_scrn.c
@@ -549,8 +549,10 @@ void SCR_UpdateScreen( void ) {
// that case.
if( uivm || com_dedicated->integer )
{
+ // XXX
+ extern cvar_t* r_anaglyphMode;
// if running in stereo, we need to draw the frame twice
- if ( cls.glconfig.stereoEnabled || Cvar_VariableIntegerValue("r_anaglyphMode")) {
+ if ( cls.glconfig.stereoEnabled || r_anaglyphMode->integer) {
SCR_DrawScreenField( STEREO_LEFT );
SCR_DrawScreenField( STEREO_RIGHT );
} else {
diff --git a/src/client/libmumblelink.c b/src/client/libmumblelink.c
index 1b1e521e..10e90011 100644
--- a/src/client/libmumblelink.c
+++ b/src/client/libmumblelink.c
@@ -112,6 +112,7 @@ int mumble_link(const char* name)
}
close(shmfd);
#endif
+ memset(lm, 0, sizeof(LinkedMem));
mbstowcs(lm->name, name, sizeof(lm->name));
return 0;
@@ -128,12 +129,12 @@ void mumble_update_coordinates2(float fAvatarPosition[3], float fAvatarFront[3],
if (!lm)
return;
- memcpy(lm->fAvatarPosition, fAvatarPosition, sizeof(fAvatarPosition));
- memcpy(lm->fAvatarFront, fAvatarFront, sizeof(fAvatarFront));
- memcpy(lm->fAvatarTop, fAvatarTop, sizeof(fAvatarTop));
- memcpy(lm->fCameraPosition, fCameraPosition, sizeof(fCameraPosition));
- memcpy(lm->fCameraFront, fCameraFront, sizeof(fCameraFront));
- memcpy(lm->fCameraTop, fCameraTop, sizeof(fCameraTop));
+ memcpy(lm->fAvatarPosition, fAvatarPosition, sizeof(lm->fAvatarPosition));
+ memcpy(lm->fAvatarFront, fAvatarFront, sizeof(lm->fAvatarFront));
+ memcpy(lm->fAvatarTop, fAvatarTop, sizeof(lm->fAvatarTop));
+ memcpy(lm->fCameraPosition, fCameraPosition, sizeof(lm->fCameraPosition));
+ memcpy(lm->fCameraFront, fCameraFront, sizeof(lm->fCameraFront));
+ memcpy(lm->fCameraTop, fCameraTop, sizeof(lm->fCameraTop));
lm->uiVersion = 2;
lm->uiTick = GetTickCount();
}
@@ -152,6 +153,7 @@ void mumble_set_context(const unsigned char* context, size_t len)
if (!lm)
return;
len = MIN(sizeof(lm->context), len);
+ lm->context_len = len;
memcpy(lm->context, context, len);
}
diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c
index b0e7cae6..6f48713f 100644
--- a/src/client/snd_openal.c
+++ b/src/client/snd_openal.c
@@ -128,6 +128,7 @@ typedef struct alSfx_s
snd_info_t info; // information for this sound like rate, sample count..
qboolean isDefault; // Couldn't be loaded - use default FX
+ qboolean isDefaultChecked; // Sound has been check if it isDefault
qboolean inMemory; // Sound is stored in memory
qboolean isLocked; // Sound is locked (can not be unloaded)
int lastUsedTime; // Time last used
@@ -294,7 +295,7 @@ static qboolean S_AL_BufferEvict( void )
S_AL_BufferLoad
=================
*/
-static void S_AL_BufferLoad(sfxHandle_t sfx)
+static void S_AL_BufferLoad(sfxHandle_t sfx, qboolean cache)
{
ALenum error;
ALuint format;
@@ -302,7 +303,6 @@ static void S_AL_BufferLoad(sfxHandle_t sfx)
void *data;
snd_info_t info;
alSfx_t *curSfx = &knownSfx[sfx];
- int size_per_sec;
// Nothing?
if(curSfx->filename[0] == '\0')
@@ -313,7 +313,7 @@ static void S_AL_BufferLoad(sfxHandle_t sfx)
return;
// Already done?
- if((curSfx->inMemory) || (curSfx->isDefault))
+ if((curSfx->inMemory) || (curSfx->isDefault) || (!cache && curSfx->isDefaultChecked))
return;
// Try to load
@@ -324,9 +324,14 @@ static void S_AL_BufferLoad(sfxHandle_t sfx)
return;
}
- size_per_sec = info.rate * info.channels * info.width;
- if( size_per_sec > 0 )
- curSfx->duration = (int)(1000.0f * ((double)info.size / size_per_sec));
+ curSfx->isDefaultChecked = qtrue;
+
+ if (!cache)
+ {
+ // Don't create AL cache
+ Z_Free(data);
+ return;
+ }
format = S_AL_Format(info.width, info.channels);
@@ -402,7 +407,7 @@ void S_AL_BufferUse(sfxHandle_t sfx)
return;
if((!knownSfx[sfx].inMemory) && (!knownSfx[sfx].isDefault))
- S_AL_BufferLoad(sfx);
+ S_AL_BufferLoad(sfx, qtrue);
knownSfx[sfx].lastUsedTime = Sys_Milliseconds();
}
@@ -468,10 +473,14 @@ sfxHandle_t S_AL_RegisterSound( const char *sample, qboolean compressed )
{
sfxHandle_t sfx = S_AL_BufferFind(sample);
- if( s_alPrecache->integer && (!knownSfx[sfx].inMemory) && (!knownSfx[sfx].isDefault))
- S_AL_BufferLoad(sfx);
+ if((!knownSfx[sfx].inMemory) && (!knownSfx[sfx].isDefault))
+ S_AL_BufferLoad(sfx, s_alPrecache->integer);
knownSfx[sfx].lastUsedTime = Com_Milliseconds();
+ if (knownSfx[sfx].isDefault) {
+ return 0;
+ }
+
return sfx;
}