From d10de2e294bc92847ea3e40027d59dd9b90e5761 Mon Sep 17 00:00:00 2001
From: Tim Angus <tim@ngus.net>
Date: Mon, 13 Feb 2006 22:17:54 +0000
Subject: * Merged ioq3-r540

---
 src/client/cl_keys.c    |  8 ++++++--
 src/client/snd_openal.c | 27 +++++++++++++++++++--------
 src/unix/sdl_glimp.c    | 37 +++++++++++++++++--------------------
 3 files changed, 42 insertions(+), 30 deletions(-)

(limited to 'src')

diff --git a/src/client/cl_keys.c b/src/client/cl_keys.c
index a0d4e065..691a59e2 100644
--- a/src/client/cl_keys.c
+++ b/src/client/cl_keys.c
@@ -549,9 +549,13 @@ void Console_Key (int key) {
 
 	if ( (key == K_MWHEELDOWN && keys[K_SHIFT].down) || ( key == K_DOWNARROW ) || ( key == K_KP_DOWNARROW ) ||
 		 ( ( tolower(key) == 'n' ) && keys[K_CTRL].down ) ) {
-		if (historyLine == nextHistoryLine)
-			return;
 		historyLine++;
+		if (historyLine >= nextHistoryLine) {
+			historyLine = nextHistoryLine;
+			Field_Clear( &g_consoleField );
+			g_consoleField.widthInChars = g_console_field_width;
+			return;
+		}
 		g_consoleField = historyEditLines[ historyLine % COMMAND_HISTORY ];
 		return;
 	}
diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c
index 01b965ae..e3a01754 100644
--- a/src/client/snd_openal.c
+++ b/src/client/snd_openal.c
@@ -40,6 +40,7 @@ cvar_t *s_alMinDistance;
 cvar_t *s_alRolloff;
 cvar_t *s_alDriver;
 cvar_t *s_alMaxSpeakerDistance;
+cvar_t *s_alSpatEntOrigin;
 
 /*
 =================
@@ -1461,20 +1462,29 @@ S_AL_Respatialize
 static
 void S_AL_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3], int inwater )
 {
-	S_AL_SanitiseVector( (vec_t *)origin );
+	float		velocity[3] = {0.0f, 0.0f, 0.0f};
+	float		orientation[6];
+	vec3_t	sorigin;
+
+	if( s_alSpatEntOrigin->integer && entityNum >= 0 )
+		VectorCopy( entityList[ entityNum ].origin, sorigin );
+	else
+	{
+		VectorCopy( origin, sorigin );
+		S_AL_SanitiseVector( sorigin );
+	}
+
 	S_AL_SanitiseVector( axis[ 0 ] );
 	S_AL_SanitiseVector( axis[ 1 ] );
 	S_AL_SanitiseVector( axis[ 2 ] );
-	// Axis[0] = Forward
-	// Axis[2] = Up
-	float velocity[] = {0.0f, 0.0f, 0.0f};
-	float orientation[] = {axis[0][0], axis[0][1], axis[0][2],
-		axis[2][0], axis[2][1], axis[2][2]};
 
-	VectorCopy( origin, lastListenerOrigin );
+	orientation[0] = axis[0][0]; orientation[1] = axis[0][1]; orientation[2] = axis[0][2];
+	orientation[3] = axis[2][0]; orientation[4] = axis[2][1]; orientation[5] = axis[2][2];
+
+	VectorCopy( sorigin, lastListenerOrigin );
 
 	// Set OpenAL listener paramaters
-	qalListenerfv(AL_POSITION, (ALfloat *)origin);
+	qalListenerfv(AL_POSITION, (ALfloat *)sorigin);
 	qalListenerfv(AL_VELOCITY, velocity);
 	qalListenerfv(AL_ORIENTATION, orientation);
 }
@@ -1631,6 +1641,7 @@ qboolean S_AL_Init( soundInterface_t *si )
 	s_alMinDistance = Cvar_Get( "s_alMinDistance", "120", CVAR_CHEAT );
 	s_alRolloff = Cvar_Get( "s_alRolloff", "0.8", CVAR_CHEAT );
 	s_alMaxSpeakerDistance = Cvar_Get( "s_alMaxSpeakerDistance", "1024", CVAR_ARCHIVE );
+	s_alSpatEntOrigin = Cvar_Get( "s_alSpatEntOrigin", "1", CVAR_ARCHIVE );
 
 	s_alDriver = Cvar_Get( "s_alDriver", ALDRIVER_DEFAULT, CVAR_ARCHIVE );
 
diff --git a/src/unix/sdl_glimp.c b/src/unix/sdl_glimp.c
index e0ab58ce..a42fbe8e 100644
--- a/src/unix/sdl_glimp.c
+++ b/src/unix/sdl_glimp.c
@@ -253,27 +253,20 @@ static const char *XLateKey(SDL_keysym *keysym, int *key)
   default: break;
   } 
 
-  if (*key == K_BACKSPACE)
-    buf[0] = 8;
-  else
+  if( keysym->unicode <= 127 )  // maps to ASCII?
   {
-    if (keysym->unicode <= 255 && keysym->unicode >= 20)  // maps to ASCII?
-    {
-      char ch = (char) keysym->unicode;
-      if (ch == '~')
-        *key = '~'; // console HACK
-
-      // The X11 driver converts to lowercase, but apparently we shouldn't.
-      //  There's possibly somewhere else where they covert back. Passing
-      //  uppercase to the engine works fine and fixes all-lower input.
-      //  (https://bugzilla.icculus.org/show_bug.cgi?id=2364)  --ryan.
-      //else if (ch >= 'A' && ch <= 'Z')
-      //  ch = ch - 'A' + 'a';
-
-      buf[0] = ch;
-    }
-    else if(keysym->unicode == 8) // ctrl-h
-      buf[0] = 8;
+    char ch = (char) keysym->unicode;
+    if (ch == '~')
+      *key = '~'; // console HACK
+
+    // The X11 driver converts to lowercase, but apparently we shouldn't.
+    //  There's possibly somewhere else where they covert back. Passing
+    //  uppercase to the engine works fine and fixes all-lower input.
+    //  (https://bugzilla.icculus.org/show_bug.cgi?id=2364)  --ryan.
+    //else if (ch >= 'A' && ch <= 'Z')
+    //  ch = ch - 'A' + 'a';
+
+    buf[0] = ch;
   }
 
   return buf;
@@ -1290,7 +1283,11 @@ void IN_Init(void) {
   in_joystickDebug = Cvar_Get ("in_debugjoystick", "0", CVAR_TEMP);
   joy_threshold = Cvar_Get ("joy_threshold", "0.15", CVAR_ARCHIVE); // FIXME: in_joythreshold
 
+#ifdef MACOS_X
+  Cvar_Set( "cl_platformSensitivity", "1.0" );
+#else
   Cvar_Set( "cl_platformSensitivity", "2.0" );
+#endif
 
   if (in_mouse->value)
     mouse_avail = qtrue;
-- 
cgit