r986 - in branches/1.34: . code/botlib code/cgame code/client code/game code/qcommon code/renderer code/server code/unix/MacSupport code/unix/setup code/win32 code/win32/msvc

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Nov 28 11:06:46 EST 2006


Author: tma
Date: 2006-11-28 11:06:46 -0500 (Tue, 28 Nov 2006)
New Revision: 986

Added:
   branches/1.34/code/unix/MacSupport/ioquake3.icns
   branches/1.34/code/unix/setup/preuninstall.sh
Modified:
   branches/1.34/Makefile
   branches/1.34/NOTTODO
   branches/1.34/README
   branches/1.34/TODO
   branches/1.34/code/botlib/be_ai_weight.c
   branches/1.34/code/cgame/cg_main.c
   branches/1.34/code/client/cl_keys.c
   branches/1.34/code/client/cl_main.c
   branches/1.34/code/client/cl_parse.c
   branches/1.34/code/client/client.h
   branches/1.34/code/client/snd_openal.c
   branches/1.34/code/game/bg_lib.c
   branches/1.34/code/qcommon/common.c
   branches/1.34/code/qcommon/q_shared.h
   branches/1.34/code/qcommon/vm_ppc_new.c
   branches/1.34/code/renderer/tr_model.c
   branches/1.34/code/server/server.h
   branches/1.34/code/server/sv_client.c
   branches/1.34/code/server/sv_init.c
   branches/1.34/code/server/sv_main.c
   branches/1.34/code/unix/setup/Makefile
   branches/1.34/code/unix/setup/Solaris_pkg.sh
   branches/1.34/code/unix/setup/doit
   branches/1.34/code/unix/setup/ioquake3.sh
   branches/1.34/code/unix/setup/setup.xml
   branches/1.34/code/win32/msvc/quake3.vcproj
   branches/1.34/code/win32/win_shared.c
   branches/1.34/make-macosx-ub.sh
Log:
* Merge trunk changes (sans curl) to the 1.34 branch
* Update versioning to rc3


Modified: branches/1.34/Makefile
===================================================================
--- branches/1.34/Makefile	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/Makefile	2006-11-28 16:06:46 UTC (rev 986)
@@ -316,13 +316,13 @@
   endif
 
   ifeq ($(ARCH),ppc)
-    OPTIMIZE += -faltivec
+    OPTIMIZE += -faltivec -O3
     # Carbon is required on PPC only to make a call to MakeDataExecutable
     # in the PPC vm (should be a better non-Carbon way).
     LDFLAGS += -framework Carbon
   endif
   ifeq ($(ARCH),i386)
-    OPTIMIZE += -msse2
+    OPTIMIZE += -march=prescott -mfpmath=sse
     # x86 vm will crash without -mstackrealign since MMX instructions will be
     # used no matter what and they corrupt the frame pointer in VM calls
     BASE_CFLAGS += -mstackrealign
@@ -362,7 +362,7 @@
     #CLIENT_LDFLAGS += -L/usr/X11R6/$(LIB) -lX11 -lXext -lXxf86dga -lXxf86vm
   endif
 
-  OPTIMIZE += -O3 -ffast-math -falign-loops=16
+  OPTIMIZE += -ffast-math -falign-loops=16
 
   ifneq ($(HAVE_VM_COMPILED),true)
     BASE_CFLAGS += -DNO_VM_COMPILED
@@ -420,7 +420,7 @@
 
   BINEXT=.exe
 
-  LDFLAGS= -mwindows -lshfolder -lwsock32 -lgdi32 -lwinmm -lole32
+  LDFLAGS= -mwindows -lwsock32 -lgdi32 -lwinmm -lole32
   CLIENT_LDFLAGS=
 
   ifeq ($(USE_CODEC_VORBIS),1)

Modified: branches/1.34/NOTTODO
===================================================================
--- branches/1.34/NOTTODO	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/NOTTODO	2006-11-28 16:06:46 UTC (rev 986)
@@ -17,3 +17,5 @@
 
 Removing the SDL/OpenAL header files from SVN. Having them in SVN makes it easier
 for non-Linux platforms to compile the game. This isn't changing.
+
+MP3 support. It is already done, see: http://icculus.org/quake3/?page=patches

Modified: branches/1.34/README
===================================================================
--- branches/1.34/README	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/README	2006-11-28 16:06:46 UTC (rev 986)
@@ -5,7 +5,7 @@
                    |  |_\___/\__, |\_,_\__,_|_\_\___|___/  |
                    |            |_|                        |
                    |                                       |
-                   `---------- http://icculus.org/quake3 --'
+                   `---------- http://ioquake3.org --------'
                                              
 The intent of this project is to provide a baseline Quake 3 which may be used
 for further development. Some of the major features currently implemented are:
@@ -22,7 +22,9 @@
   * Optional Ogg Vorbis support
   * Much improved QVM tools
   * Support for various esoteric operating systems (see
-    http://icculus.org/quake3/?page=status)
+    http://ioquake3.org/?page=status)
+  * Multiuser support on Windows systems (user specific game data
+    is stored in "%APPDATA%\Quake3")
   * Many, many bug fixes
 
 The map editor and associated compiling tools are not included. We suggest you
@@ -58,8 +60,8 @@
      XCode 2.2 and newer.
   2. Change to the directory containing this README file.
   3. Run './make-macosx-ub.sh'
-  4. Copy all of the files in the resulting build/release-darwin-ub/ 
-     directory to the Contents/MacOS/ subdirectory of your .app bundle.
+  4. Copy the resulting ioquake3.app in /build/release-darwin-ub to your 
+     /Applications/ioquake3 folder.
 
 Installation, for *nix
   1. Set the COPYDIR variable in the shell to be where you installed Quake 3
@@ -113,8 +115,12 @@
   s_alDopplerSpeed                  - the value passed to alDopplerVelocity
   s_alMinDistance                   - the value of AL_REFERENCE_DISTANCE for
                                       each source
+  s_alMaxDistance                   - the maximum distance before sounds start
+                                      to become inaudible.
   s_alRolloff                       - the value of AL_ROLLOFF_FACTOR for each
                                       source
+  s_alGraceDistance                 - after having passed MaxDistance, length
+                                      until sounds are completely inaudible.
   s_alMaxSpeakerDistance            - ET_SPEAKERS beyond this distance are
                                       culled
   s_alDriver                        - which OpenAL library to use
@@ -192,7 +198,32 @@
   compiler. See http://www.quakesrc.org/forums/viewtopic.php?t=5665 (if it
   still exists when you read this) for more details.
 
+Multiuser Support on Windows systems
+    On Windows, all user specific files such as autogenerated configuration,
+    demos, videos, screenshots, and autodownloaded pk3s are now saved in a
+    directory specific to the user who is running ioquake3.
 
+    On NT-based such as Windows XP, this is usually a directory named:
+      "C:\Documents and Settings\%USERNAME%\Application Data\Quake3\"
+
+    Windows 95, Windows 98, and Windows ME will use a directory like: 
+      "C:\Windows\Application Data\Quake3"
+    in single-user mode, or:
+      "C:\Windows\Profiles\%USERNAME%\Application Data\Quake3"
+    if multiple logins have been enabled. 
+
+    In order to access this directory more easily, the installer may create a
+    Shortcut which has its target set to:
+      "%APPDATA%\Quake3\"
+    This Shortcut would work for all users on the system regardless of the
+    locale settings.  Unfortunately, this environment variable is only 
+    present on Windows NT based systems.
+    
+    You can revert to the old single-user behaviour by setting the fs_homepath
+    cvar to the directory where ioquake3 is installed.  For example:
+      ioquake3.exe +set fs_homepath "c:\ioquake3"
+    Note that this cvar MUST be set as a command line parameter.
+
 ------------------------------------------------------------- Contributing -----
 
 Please send all patches to bugzilla (https://bugzilla.icculus.org), or join the
@@ -217,7 +248,7 @@
 but we have some general guidelines:
 
   * Please include the id patch pk3s in your installer, which are available
-    from http://icculus.org/quake3/?page=getdata subject to agreement to the id
+    from http://ioquake3.org/?page=getdata subject to agreement to the id
     EULA. Your installer shall also ask the user to agree to this EULA (which
     is in the /web/include directory for your convenience) and subsequently
     refuse to continue the installation of the patch pk3s and pak0.pk3 if they
@@ -253,15 +284,16 @@
 Maintainers
   Aaron Gyes <floam at sh dot nu>
   Ludwig Nussel <ludwig.nussel at suse.de>
-  Ryan C. Gordon <icculus at icculus.org>
   Thilo Schulz <arny at ats.s.bawue.de>
   Tim Angus <tim at ngus.net>
   Tony J. White <tjw at tjw.org>
   Zachary J. Slater <zakk at timedoctor.org>
 
 Significant contributions from
+  Ryan C. Gordon <icculus at icculus.org>
   Andreas Kohn <andreas at syndrom23.de>
   Joerg Dietrich <Dietrich_Joerg at t-online.de>
   Stuart Dalton <badcdev at gmail.com>
   Vincent S. Cojot <vincent at cojot dot name>
   optical <alex at rigbo.se>
+

Modified: branches/1.34/TODO
===================================================================
--- branches/1.34/TODO	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/TODO	2006-11-28 16:06:46 UTC (rev 986)
@@ -6,6 +6,9 @@
    whatever
 4) Installers which include all up-to-date id pak files, require no cd rom,
    user will have to copy pak0.pk3 themselves.
+4a) installers that require no cd-rom can optionally install the data from cd
+-roms, just that people can deal with pak0s themselves and not be forced into
+locating the disc right then -at install time.
 
 For 1.34:
 See above.
@@ -18,6 +21,8 @@
 * IPv6 support
 * merge unix_net.c and win_net.c
 * Replace windows DirectX backend with SDL
+* Graphical "ioquake3" watermark in videos, optional, on by default
+* Gamma stuff while recording videos.
 
 For 1.99:
 * Four player split-screen

Modified: branches/1.34/code/botlib/be_ai_weight.c
===================================================================
--- branches/1.34/code/botlib/be_ai_weight.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/botlib/be_ai_weight.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -593,9 +593,12 @@
 			if (fs->next->child) w2 = FuzzyWeight_r(inventory, fs->next->child);
 			else w2 = fs->next->weight;
 			//the scale factor
-			scale = (inventory[fs->index] - fs->value) / (fs->next->value - fs->value);
+			if(fs->next->value == MAX_INVENTORYVALUE) // is fs->next the default case?
+        		return w2;      // can't interpolate, return default weight
+			else
+				scale = (float) (inventory[fs->index] - fs->value) / (fs->next->value - fs->value);
 			//scale between the two weights
-			return scale * w1 + (1 - scale) * w2;
+			return (1 - scale) * w1 + scale * w2;
 		} //end if
 		return FuzzyWeight_r(inventory, fs->next);
 	} //end else if
@@ -627,9 +630,12 @@
 			if (fs->next->child) w2 = FuzzyWeight_r(inventory, fs->next->child);
 			else w2 = fs->next->minweight + random() * (fs->next->maxweight - fs->next->minweight);
 			//the scale factor
-			scale = (inventory[fs->index] - fs->value) / (fs->next->value - fs->value);
+			if(fs->next->value == MAX_INVENTORYVALUE) // is fs->next the default case?
+        		return w2;      // can't interpolate, return default weight
+			else
+				scale = (float) (inventory[fs->index] - fs->value) / (fs->next->value - fs->value);
 			//scale between the two weights
-			return scale * w1 + (1 - scale) * w2;
+			return (1 - scale) * w1 + scale * w2;
 		} //end if
 		return FuzzyWeightUndecided_r(inventory, fs->next);
 	} //end else if
@@ -750,7 +756,7 @@
 	else if (fs->type == WT_BALANCE)
 	{
 		//
-		fs->weight = (fs->maxweight + fs->minweight) * scale;
+		fs->weight = (float) (fs->maxweight + fs->minweight) * scale;
 		//get the weight between bounds
 		if (fs->weight < fs->minweight) fs->weight = fs->minweight;
 		else if (fs->weight > fs->maxweight) fs->weight = fs->maxweight;

Modified: branches/1.34/code/cgame/cg_main.c
===================================================================
--- branches/1.34/code/cgame/cg_main.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/cgame/cg_main.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -391,8 +391,6 @@
 		} else {
 			trap_Cvar_Set( "teamoverlay", "0" );
 		}
-		// FIXME E3 HACK
-		trap_Cvar_Set( "teamoverlay", "1" );
 	}
 
 	// if force model changed

Modified: branches/1.34/code/client/cl_keys.c
===================================================================
--- branches/1.34/code/client/cl_keys.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/client/cl_keys.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -1070,7 +1070,8 @@
 		if (!down) {
 			return;
 		}
-    Con_ToggleConsole_f ();
+		Con_ToggleConsole_f ();
+		Key_ClearStates ();
 		return;
 	}
 

Modified: branches/1.34/code/client/cl_main.c
===================================================================
--- branches/1.34/code/client/cl_main.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/client/cl_main.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -1199,6 +1199,9 @@
 		CL_CloseAVI( );
 	}
 
+	if(clc.demorecording)
+		CL_StopRecord_f();
+
 	// don't let them loop during the restart
 	S_StopAllSounds();
 	// shutdown the UI

Modified: branches/1.34/code/client/cl_parse.c
===================================================================
--- branches/1.34/code/client/cl_parse.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/client/cl_parse.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -482,8 +482,12 @@
 	// parse serverId and other cvars
 	CL_SystemInfoChanged();
 
+	// stop recording now so the demo won't have an unnecessary level load at the end.
+	if(cl_autoRecordDemo->integer && clc.demorecording)
+		CL_StopRecord_f();
+	
 	// reinitialize the filesystem if the game directory has changed
-  FS_ConditionalRestart( clc.checksumFeed );
+	FS_ConditionalRestart( clc.checksumFeed );
 
 	// This used to call CL_StartHunkUsers, but now we enter the download state before loading the
 	// cgame

Modified: branches/1.34/code/client/client.h
===================================================================
--- branches/1.34/code/client/client.h	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/client/client.h	2006-11-28 16:06:46 UTC (rev 986)
@@ -355,6 +355,7 @@
 extern	cvar_t	*cl_inGameVideo;
 
 extern	cvar_t	*cl_lanForcePackets;
+extern	cvar_t	*cl_autoRecordDemo;
 
 //=================================================
 
@@ -376,6 +377,7 @@
 void CL_StartDemoLoop( void );
 void CL_NextDemo( void );
 void CL_ReadDemoMessage( void );
+void CL_StopRecord_f(void);
 
 void CL_InitDownloads(void);
 void CL_NextDownload(void);

Modified: branches/1.34/code/client/snd_openal.c
===================================================================
--- branches/1.34/code/client/snd_openal.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/client/snd_openal.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -36,7 +36,9 @@
 cvar_t *s_alDopplerFactor;
 cvar_t *s_alDopplerSpeed;
 cvar_t *s_alMinDistance;
+cvar_t *s_alMaxDistance;
 cvar_t *s_alRolloff;
+cvar_t *s_alGraceDistance;
 cvar_t *s_alDriver;
 cvar_t *s_alDevice;
 cvar_t *s_alAvailableDevices;
@@ -135,7 +137,11 @@
 	{
 		// Got one
 		if(knownSfx[i].filename[0] == '\0')
+		{
+			if(i >= numSfx)
+				numSfx = i + 1;
 			return i;
+		}
 	}
 
 	// Shit...
@@ -156,7 +162,7 @@
 	sfxHandle_t sfx = -1;
 	int i;
 
-	for(i = 0; i < MAX_SFX; i++)
+	for(i = 0; i < numSfx; i++)
 	{
 		if(!Q_stricmp(knownSfx[i].filename, filename))
 		{
@@ -231,7 +237,7 @@
 	int	i, oldestBuffer = -1;
 	int	oldestTime = Sys_Milliseconds( );
 
-	for( i = 0; i < MAX_SFX; i++ )
+	for( i = 0; i < numSfx; i++ )
 	{
 		if( !knownSfx[ i ].filename[ 0 ] )
 			continue;
@@ -405,7 +411,7 @@
 	knownSfx[default_sfx].isLocked = qfalse;
 
 	// Free all used effects
-	for(i = 0; i < MAX_SFX; i++)
+	for(i = 0; i < numSfx; i++)
 		S_AL_BufferUnload(i);
 
 	// Clear the tables
@@ -464,6 +470,9 @@
 	int							isLooping;	// Is this a looping effect (attached to an entity)
 	int							isTracking;	// Is this object tracking it's owner
 
+	float							curGain;	// gain employed if source is within maxdistance.
+	float							scaleGain;	// Last gain value for this source. 0 if muted.
+
 	qboolean				local;			// Is this local (relative to the cam)
 } src_t;
 
@@ -513,6 +522,50 @@
 
 /*
 =================
+S_AL_ScaleGain
+Adapt the gain if necessary to get a quicker fadeout when the source is too far away.
+=================
+*/
+
+static void S_AL_ScaleGain(src_t *chksrc, vec3_t origin)
+{
+	float distance;
+
+	if(chksrc->local)
+		distance = VectorLength(origin);
+	else
+		distance = Distance(origin, lastListenerOrigin);
+
+	// If we exceed a certain distance, scale the gain linearly until the sound
+	// vanishes into nothingness.
+	if((distance -= s_alMaxDistance->value) > 0)
+	{
+		float scaleFactor;
+
+		if(distance >= s_alGraceDistance->value)
+			scaleFactor = 0.0f;
+		else
+			scaleFactor = 1.0f - distance / s_alGraceDistance->value;
+		
+		scaleFactor *= chksrc->curGain;
+		
+		if(chksrc->scaleGain != scaleFactor);
+		{
+			chksrc->scaleGain = scaleFactor;
+			// if(scaleFactor > 0.0f)
+			// Com_Printf("%f\n", scaleFactor);
+			qalSourcef(chksrc->alSource, AL_GAIN, chksrc->scaleGain);
+		}
+	}
+	else if(chksrc->scaleGain != chksrc->curGain)
+	{
+		chksrc->scaleGain = chksrc->curGain;
+		qalSourcef(chksrc->alSource, AL_GAIN, chksrc->scaleGain);
+	}
+}
+
+/*
+=================
 S_AL_HearingThroughEntity
 =================
 */
@@ -616,41 +669,46 @@
 		int entity, int channel, qboolean local)
 {
 	ALuint buffer;
+	src_t *curSource;
 
 	// Mark the SFX as used, and grab the raw AL buffer
 	S_AL_BufferUse(sfx);
 	buffer = S_AL_BufferGet(sfx);
 
 	// Set up src struct
-	srcList[src].lastUsedTime = Sys_Milliseconds();
-	srcList[src].sfx = sfx;
-	srcList[src].priority = priority;
-	srcList[src].entity = entity;
-	srcList[src].channel = channel;
-	srcList[src].isActive = qtrue;
-	srcList[src].isLocked = qfalse;
-	srcList[src].isLooping = qfalse;
-	srcList[src].isTracking = qfalse;
-	srcList[src].local = local;
+	curSource = &srcList[src];
+	
+	curSource->lastUsedTime = Sys_Milliseconds();
+	curSource->sfx = sfx;
+	curSource->priority = priority;
+	curSource->entity = entity;
+	curSource->channel = channel;
+	curSource->isActive = qtrue;
+	curSource->isLocked = qfalse;
+	curSource->isLooping = qfalse;
+	curSource->isTracking = qfalse;
+	curSource->curGain = s_alGain->value * s_volume->value;
+	curSource->scaleGain = curSource->curGain;
+	curSource->local = local;
 
 	// Set up OpenAL source
-	qalSourcei(srcList[src].alSource, AL_BUFFER, buffer);
-	qalSourcef(srcList[src].alSource, AL_PITCH, 1.0f);
-	qalSourcef(srcList[src].alSource, AL_GAIN, s_alGain->value * s_volume->value);
-	qalSourcefv(srcList[src].alSource, AL_POSITION, vec3_origin);
-	qalSourcefv(srcList[src].alSource, AL_VELOCITY, vec3_origin);
-	qalSourcei(srcList[src].alSource, AL_LOOPING, AL_FALSE);
-	qalSourcef(srcList[src].alSource, AL_REFERENCE_DISTANCE, s_alMinDistance->value);
+	qalSourcei(curSource->alSource, AL_BUFFER, buffer);
+	qalSourcef(curSource->alSource, AL_PITCH, 1.0f);
+	qalSourcef(curSource->alSource, AL_GAIN, curSource->curGain);
+	qalSourcefv(curSource->alSource, AL_POSITION, vec3_origin);
+	qalSourcefv(curSource->alSource, AL_VELOCITY, vec3_origin);
+	qalSourcei(curSource->alSource, AL_LOOPING, AL_FALSE);
+	qalSourcef(curSource->alSource, AL_REFERENCE_DISTANCE, s_alMinDistance->value);
 
 	if(local)
 	{
-		qalSourcei(srcList[src].alSource, AL_SOURCE_RELATIVE, AL_TRUE);
-		qalSourcef(srcList[src].alSource, AL_ROLLOFF_FACTOR, 0.0f);
+		qalSourcei(curSource->alSource, AL_SOURCE_RELATIVE, AL_TRUE);
+		qalSourcef(curSource->alSource, AL_ROLLOFF_FACTOR, 0.0f);
 	}
 	else
 	{
-		qalSourcei(srcList[src].alSource, AL_SOURCE_RELATIVE, AL_FALSE);
-		qalSourcef(srcList[src].alSource, AL_ROLLOFF_FACTOR, s_alRolloff->value);
+		qalSourcei(curSource->alSource, AL_SOURCE_RELATIVE, AL_FALSE);
+		qalSourcef(curSource->alSource, AL_ROLLOFF_FACTOR, s_alRolloff->value);
 	}
 }
 
@@ -826,6 +884,27 @@
 
 /*
 =================
+S_AL_CheckInput
+Check whether input values from mods are out of range.
+Necessary for i.g. Western Quake3 mod which is buggy.
+=================
+*/
+static qboolean S_AL_CheckInput(int entityNum, sfxHandle_t sfx)
+{
+	if (entityNum < 0 || entityNum > MAX_GENTITIES)
+		Com_Error(ERR_DROP, "S_StartSound: bad entitynum %i", entityNum);
+
+	if (sfx < 0 || sfx >= numSfx)
+	{
+		Com_Printf(S_COLOR_RED, "ERROR: S_AL_CheckInput: handle %i out of range\n", sfx);
+                return qtrue;
+        }
+
+	return qfalse;
+}
+
+/*
+=================
 S_AL_StartLocalSound
 
 Play a local (non-spatialized) sound effect
@@ -834,6 +913,9 @@
 static
 void S_AL_StartLocalSound(sfxHandle_t sfx, int channel)
 {
+	if(S_AL_CheckInput(0, sfx))
+		return;
+
 	// Try to grab a source
 	srcHandle_t src = S_AL_SrcAlloc(SRCPRI_LOCAL, -1, channel);
 	if(src == -1)
@@ -858,6 +940,9 @@
 {
 	vec3_t sorigin;
 
+	if(S_AL_CheckInput(origin ? 0 : entnum, sfx))
+		return;
+
 	// Try to grab a source
 	srcHandle_t src = S_AL_SrcAlloc(SRCPRI_ONESHOT, entnum, entchannel);
 	if(src == -1)
@@ -866,8 +951,6 @@
 	// Set up the effect
 	if( origin == NULL )
 	{
-		srcList[ src ].isTracking = qtrue;
-
 		if( S_AL_HearingThroughEntity( entnum ) )
 		{
 			// Where the entity is the local player, play a local sound
@@ -879,6 +962,7 @@
 			S_AL_SrcSetup( src, sfx, SRCPRI_ONESHOT, entnum, entchannel, qfalse );
 			VectorCopy( entityList[ entnum ].origin, sorigin );
 		}
+		srcList[ src ].isTracking = qtrue;
 	}
 	else
 	{
@@ -888,6 +972,7 @@
 
 	S_AL_SanitiseVector( sorigin );
 	qalSourcefv( srcList[ src ].alSource, AL_POSITION, sorigin );
+	S_AL_ScaleGain(&srcList[src], sorigin);
 
 	// Start it playing
 	qalSourcePlay(srcList[src].alSource);
@@ -919,6 +1004,7 @@
 {
 	int				src;
 	sentity_t	*sent = &entityList[ entityNum ];
+	src_t		*curSource;
 
 	// Do we need to allocate a new source for this entity
 	if( !sent->srcAllocated )
@@ -946,28 +1032,33 @@
 	// If this is not set then the looping sound is removed
 	sent->loopAddedThisFrame = qtrue;
 
+	curSource = &srcList[src];
+
 	// UGH
 	// These lines should be called via S_AL_SrcSetup, but we
 	// can't call that yet as it buffers sfxes that may change
 	// with subsequent calls to S_AL_SrcLoop
-	srcList[ src ].entity = entityNum;
-	srcList[ src ].isLooping = qtrue;
-	srcList[ src ].isActive = qtrue;
+	curSource->entity = entityNum;
+	curSource->isLooping = qtrue;
+	curSource->isActive = qtrue;
 
 	if( S_AL_HearingThroughEntity( entityNum ) )
 	{
-		srcList[ src ].local = qtrue;
+		curSource->local = qtrue;
 
-		qalSourcefv( srcList[ src ].alSource, AL_POSITION, vec3_origin );
-		qalSourcefv( srcList[ src ].alSource, AL_VELOCITY, vec3_origin );
+		qalSourcefv( curSource->alSource, AL_POSITION, vec3_origin );
+		qalSourcefv( curSource->alSource, AL_VELOCITY, vec3_origin );
 	}
 	else
 	{
-		srcList[ src ].local = qfalse;
+		curSource->local = qfalse;
 
-		qalSourcefv( srcList[ src ].alSource, AL_POSITION, (ALfloat *)sent->origin );
-		qalSourcefv( srcList[ src ].alSource, AL_VELOCITY, (ALfloat *)velocity );
+		qalSourcefv( curSource->alSource, AL_POSITION, (ALfloat *)sent->origin );
+		qalSourcefv( curSource->alSource, AL_VELOCITY, (ALfloat *)velocity );
+		
 	}
+
+	S_AL_ScaleGain(curSource, sent->origin);
 }
 
 /*
@@ -978,6 +1069,9 @@
 static
 void S_AL_AddLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx )
 {
+	if(S_AL_CheckInput(entityNum, sfx))
+		return;
+
 	S_AL_SanitiseVector( (vec_t *)origin );
 	S_AL_SanitiseVector( (vec_t *)velocity );
 	S_AL_SrcLoop(SRCPRI_ENTITY, sfx, origin, velocity, entityNum);
@@ -991,6 +1085,9 @@
 static
 void S_AL_AddRealLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx )
 {
+	if(S_AL_CheckInput(entityNum, sfx))
+		return;
+
 	S_AL_SanitiseVector( (vec_t *)origin );
 	S_AL_SanitiseVector( (vec_t *)velocity );
 
@@ -1029,63 +1126,65 @@
 	int i;
 	int entityNum;
 	ALint state;
+	src_t *curSource;	
 
 	for(i = 0; i < srcCount; i++)
 	{
 		entityNum = srcList[i].entity;
+		curSource = &srcList[i];
 
-		if(srcList[i].isLocked)
+		if(curSource->isLocked)
 			continue;
 
-		if(!srcList[i].isActive)
+		if(!curSource->isActive)
 			continue;
 
 		// Update source parameters
 		if((s_alGain->modified)||(s_volume->modified))
-			qalSourcef(srcList[i].alSource, AL_GAIN, s_alGain->value * s_volume->value);
-		if((s_alRolloff->modified)&&(!srcList[i].local))
-			qalSourcef(srcList[i].alSource, AL_ROLLOFF_FACTOR, s_alRolloff->value);
+			curSource->curGain = s_alGain->value * s_volume->value;
+		if((s_alRolloff->modified)&&(!curSource->local))
+			qalSourcef(curSource->alSource, AL_ROLLOFF_FACTOR, s_alRolloff->value);
 		if(s_alMinDistance->modified)
-			qalSourcef(srcList[i].alSource, AL_REFERENCE_DISTANCE, s_alMinDistance->value);
+			qalSourcef(curSource->alSource, AL_REFERENCE_DISTANCE, s_alMinDistance->value);
 
-		if( srcList[ i ].isLooping )
+		if(curSource->isLooping)
 		{
 			sentity_t *sent = &entityList[ entityNum ];
 
 			// If a looping effect hasn't been touched this frame, kill it
-			if( sent->loopAddedThisFrame )
+			if(sent->loopAddedThisFrame)
 			{
 				// The sound has changed without an intervening removal
-				if( srcList[ i ].isActive && !sent->startLoopingSound &&
-						srcList[ i ].sfx != sent->loopSfx )
+				if(curSource->isActive && !sent->startLoopingSound &&
+						curSource->sfx != sent->loopSfx)
 				{
-					qalSourceStop( srcList[ i ].alSource );
-					qalSourcei( srcList[ i ].alSource, AL_BUFFER, 0 );
+					qalSourceStop(curSource->alSource);
+					qalSourcei(curSource->alSource, AL_BUFFER, 0);
 					sent->startLoopingSound = qtrue;
 				}
 
-				// Ths sound hasn't been started yet
-				if( sent->startLoopingSound )
+				// The sound hasn't been started yet
+				if(sent->startLoopingSound)
 				{
-					S_AL_SrcSetup( i, sent->loopSfx, sent->loopPriority,
-							entityNum, -1, srcList[ i ].local );
-					srcList[ i ].isLooping = qtrue;
-					qalSourcei( srcList[ i ].alSource, AL_LOOPING, AL_TRUE );
-					qalSourcePlay( srcList[ i ].alSource );
+					S_AL_SrcSetup(i, sent->loopSfx, sent->loopPriority,
+							entityNum, -1, curSource->local);
+					curSource->isLooping = qtrue;
+					qalSourcei(curSource->alSource, AL_LOOPING, AL_TRUE);
+					qalSourcePlay(curSource->alSource);
 
 					sent->startLoopingSound = qfalse;
 				}
 
 				// Update locality
-				if( srcList[ i ].local)
+				if(curSource->local)
 				{
-					qalSourcei( srcList[ i ].alSource, AL_SOURCE_RELATIVE, AL_TRUE );
-					qalSourcef( srcList[ i ].alSource, AL_ROLLOFF_FACTOR, 0.0f );
+					qalSourcei(curSource->alSource, AL_SOURCE_RELATIVE, AL_TRUE);
+					qalSourcef(curSource->alSource, AL_ROLLOFF_FACTOR, 0.0f);
 				}
 				else
 				{
-					qalSourcei( srcList[ i ].alSource, AL_SOURCE_RELATIVE, AL_FALSE );
-					qalSourcef( srcList[ i ].alSource, AL_ROLLOFF_FACTOR, s_alRolloff->value );
+					qalSourcei(curSource->alSource, AL_SOURCE_RELATIVE, AL_FALSE);
+					qalSourcef(curSource->alSource, AL_ROLLOFF_FACTOR, s_alRolloff->value);
 				}
 			}
 			else
@@ -1094,20 +1193,23 @@
 			continue;
 		}
 
-		// Query relativity of source, don't move if it's true
-		qalGetSourcei( srcList[ i ].alSource, AL_SOURCE_RELATIVE, &state );
-
-		// See if it needs to be moved
-		if( srcList[ i ].isTracking && !state )
-			qalSourcefv(srcList[i].alSource, AL_POSITION, entityList[entityNum].origin);
-		
 		// Check if it's done, and flag it
-		qalGetSourcei(srcList[i].alSource, AL_SOURCE_STATE, &state);
+		qalGetSourcei(curSource->alSource, AL_SOURCE_STATE, &state);
 		if(state == AL_STOPPED)
 		{
 			S_AL_SrcKill(i);
 			continue;
 		}
+
+		// Query relativity of source, don't move if it's true
+		qalGetSourcei(curSource->alSource, AL_SOURCE_RELATIVE, &state);
+
+		// See if it needs to be moved
+		if(curSource->isTracking && !state)
+		{
+			qalSourcefv(curSource->alSource, AL_POSITION, entityList[entityNum].origin);
+ 			S_AL_ScaleGain(curSource, entityList[entityNum].origin);
+		}
 	}
 }
 
@@ -1463,7 +1565,7 @@
 	// Stop any existing music that might be playing
 	S_AL_StopBackgroundTrack();
 
-	if((!intro || !*intro) && (!intro || !*intro))
+	if((!intro || !*intro) && (!loop || !*loop))
 		return;
 
 	// Allocate a musicSource
@@ -1776,7 +1878,9 @@
 	s_alDopplerFactor = Cvar_Get( "s_alDopplerFactor", "1.0", CVAR_ARCHIVE );
 	s_alDopplerSpeed = Cvar_Get( "s_alDopplerSpeed", "2200", CVAR_ARCHIVE );
 	s_alMinDistance = Cvar_Get( "s_alMinDistance", "120", CVAR_CHEAT );
-	s_alRolloff = Cvar_Get( "s_alRolloff", "0.8", CVAR_CHEAT );
+	s_alMaxDistance = Cvar_Get("s_alMaxDistance", "1024", CVAR_CHEAT);
+	s_alRolloff = Cvar_Get( "s_alRolloff", "2", CVAR_CHEAT);
+	s_alGraceDistance = Cvar_Get("s_alGraceDistance", "512", CVAR_CHEAT);
 	s_alMaxSpeakerDistance = Cvar_Get( "s_alMaxSpeakerDistance", "1024", CVAR_ARCHIVE );
 
 	s_alDriver = Cvar_Get( "s_alDriver", ALDRIVER_DEFAULT, CVAR_ARCHIVE );
@@ -1788,7 +1892,7 @@
 		return qfalse;
 	}
 
-	// Device enumeration support (extension currently only exists for windows).
+	// Device enumeration support (extension is implemented reasonably only on Windows right now).
 	if((enumsupport = qalcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT")))
 	{
 		char devicenames[1024] = "";
@@ -1864,6 +1968,7 @@
 	S_AL_SrcInit( );
 
 	// Set up OpenAL parameters (doppler, etc)
+	qalDistanceModel(AL_INVERSE_DISTANCE_CLAMPED);
 	qalDopplerFactor( s_alDopplerFactor->value );
 	qalDopplerVelocity( s_alDopplerSpeed->value );
 

Modified: branches/1.34/code/game/bg_lib.c
===================================================================
--- branches/1.34/code/game/bg_lib.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/game/bg_lib.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -1067,7 +1067,7 @@
 	}
 
 	if( flags & LADJUST ) {
-		while ( width-- ) {
+		while ( width-- > 0) {
 			*buf++ = ( flags & ZEROPAD ) ? '0' : ' ';
 		}
 	}

Modified: branches/1.34/code/qcommon/common.c
===================================================================
--- branches/1.34/code/qcommon/common.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/qcommon/common.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -262,9 +262,6 @@
 		code = ERR_FATAL;
 	}
 
-	// make sure we can get at our local stuff
-	FS_PureServerSetLoadedPaks( "", "" );
-
 	// if we are getting a solid stream of ERR_DROP, do an ERR_FATAL
 	currentTime = Sys_Milliseconds();
 	if ( currentTime - lastErrorTime < 100 ) {
@@ -285,20 +282,22 @@
 	vsprintf (com_errorMessage,fmt,argptr);
 	va_end (argptr);
 
-	if ( code != ERR_DISCONNECT && code != ERR_NEED_CD ) {
+	if (code != ERR_DISCONNECT && code != ERR_NEED_CD)
 		Cvar_Set("com_errorMessage", com_errorMessage);
-	}
 
-	if ( code == ERR_SERVERDISCONNECT ) {
+	if (code == ERR_DISCONNECT || code == ERR_SERVERDISCONNECT) {
 		CL_Disconnect( qtrue );
 		CL_FlushMemory( );
+		// make sure we can get at our local stuff
+		FS_PureServerSetLoadedPaks("", "");
 		com_errorEntered = qfalse;
 		longjmp (abortframe, -1);
-	} else if ( code == ERR_DROP || code == ERR_DISCONNECT ) {
+	} else if (code == ERR_DROP) {
 		Com_Printf ("********************\nERROR: %s\n********************\n", com_errorMessage);
 		SV_Shutdown (va("Server crashed: %s",  com_errorMessage));
 		CL_Disconnect( qtrue );
 		CL_FlushMemory( );
+		FS_PureServerSetLoadedPaks("", "");
 		com_errorEntered = qfalse;
 		longjmp (abortframe, -1);
 	} else if ( code == ERR_NEED_CD ) {
@@ -311,6 +310,7 @@
 		} else {
 			Com_Printf("Server didn't have CD\n" );
 		}
+		FS_PureServerSetLoadedPaks("", "");
 		longjmp (abortframe, -1);
 	} else {
 		CL_Shutdown ();

Modified: branches/1.34/code/qcommon/q_shared.h
===================================================================
--- branches/1.34/code/qcommon/q_shared.h	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/qcommon/q_shared.h	2006-11-28 16:06:46 UTC (rev 986)
@@ -26,7 +26,7 @@
 // q_shared.h -- included first by ALL program modules.
 // A user mod should never modify this file
 
-#define Q3_VERSION            "ioQ3 1.34-rc2"
+#define Q3_VERSION            "ioQ3 1.34-rc3"
 #ifndef SVN_VERSION
   #define SVN_VERSION Q3_VERSION
 #endif

Modified: branches/1.34/code/qcommon/vm_ppc_new.c
===================================================================
--- branches/1.34/code/qcommon/vm_ppc_new.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/qcommon/vm_ppc_new.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -157,32 +157,38 @@
 #define	RG_EA 				r14
 
 // The deepest value I saw in the Quake3 games was 9.
-#define OP_STACK_MAX_DEPTH	12
+#define OP_STACK_MAX_DEPTH	16
 
-// These are all volatile and thus must be saved
-// upon entry to the VM code.
+// These are all volatile and thus must be saved upon entry to the VM code.
+// NOTE: These are General Purpose Registers (GPR) numbers like the 
+//       R_ definitions in the regNums_t enum above (31 is the max)
 static int opStackIntRegisters[OP_STACK_MAX_DEPTH] =
 {
 	16, 17, 18, 19,
 	20, 21, 22, 23,
-	24, 25, 26, 27
+	24, 25, 26, 27,
+	28, 29, 30, 31
 };
 
 static unsigned int *opStackLoadInstructionAddr[OP_STACK_MAX_DEPTH];
 
 // We use different registers for the floating point
 // operand stack (these are volatile in the PPC ABI)
+// NOTE: these are Floating Point Register (FPR) numbers, not 
+//       General Purpose Register (GPR) numbers
 static int opStackFloatRegisters[OP_STACK_MAX_DEPTH] =
 {
 	0, 1, 2, 3,
 	4, 5, 6, 7,
-	8, 9, 10, 11
+	8, 9, 10, 11,
+	12, 13, 14, 15
 };
 
 static int opStackRegType[OP_STACK_MAX_DEPTH] =
 {
 	0, 0, 0, 0,
 	0, 0, 0, 0,
+	0, 0, 0, 0,
 	0, 0, 0, 0
 };
 

Modified: branches/1.34/code/renderer/tr_model.c
===================================================================
--- branches/1.34/code/renderer/tr_model.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/renderer/tr_model.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -652,9 +652,9 @@
 			
 			for(j = 0; j < surf->numTriangles; j++)
 			{
-				tri->indexes[0] = curtri->indexes[0];
-				tri->indexes[1] = curtri->indexes[1];
-				tri->indexes[2] = curtri->indexes[2];
+				tri->indexes[0] = LittleLong(curtri->indexes[0]);
+				tri->indexes[1] = LittleLong(curtri->indexes[1]);
+				tri->indexes[2] = LittleLong(curtri->indexes[2]);
 				
 				tri++;
 				curtri++;

Modified: branches/1.34/code/server/server.h
===================================================================
--- branches/1.34/code/server/server.h	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/server/server.h	2006-11-28 16:06:46 UTC (rev 986)
@@ -168,6 +168,7 @@
 	netchan_buffer_t **netchan_end_queue;
 
 	int				oldServerTime;
+	qboolean			csUpdated[MAX_CONFIGSTRINGS+1];	
 } client_t;
 
 //=============================================================================
@@ -272,6 +273,7 @@
 //
 void SV_SetConfigstring( int index, const char *val );
 void SV_GetConfigstring( int index, char *buffer, int bufferSize );
+void SV_UpdateConfigstrings( client_t *client );
 
 void SV_SetUserinfo( int index, const char *val );
 void SV_GetUserinfo( int index, char *buffer, int bufferSize );

Modified: branches/1.34/code/server/sv_client.c
===================================================================
--- branches/1.34/code/server/sv_client.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/server/sv_client.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -620,6 +620,10 @@
 	Com_DPrintf( "Going from CS_PRIMED to CS_ACTIVE for %s\n", client->name );
 	client->state = CS_ACTIVE;
 
+	// resend all configstrings using the cs commands since these are
+	// no longer sent when the client is CS_PRIMED
+	SV_UpdateConfigstrings( client );
+
 	// set up the entity for the client
 	clientNum = client - svs.clients;
 	ent = SV_GentityNum( clientNum );

Modified: branches/1.34/code/server/sv_init.c
===================================================================
--- branches/1.34/code/server/sv_init.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/server/sv_init.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -22,15 +22,89 @@
 
 #include "server.h"
 
+
 /*
 ===============
+SV_SendConfigstring
+
+Creates and sends the server command necessary to update the CS index for the
+given client
+===============
+*/
+static void SV_SendConfigstring(client_t *client, int index)
+{
+	int maxChunkSize = MAX_STRING_CHARS - 24;
+	int len;
+
+	len = strlen(sv.configstrings[index]);
+
+	if( len >= maxChunkSize ) {
+		int		sent = 0;
+		int		remaining = len;
+		char	*cmd;
+		char	buf[MAX_STRING_CHARS];
+
+		while (remaining > 0 ) {
+			if ( sent == 0 ) {
+				cmd = "bcs0";
+			}
+			else if( remaining < maxChunkSize ) {
+				cmd = "bcs2";
+			}
+			else {
+				cmd = "bcs1";
+			}
+			Q_strncpyz( buf, &sv.configstrings[index][sent],
+				maxChunkSize );
+
+			SV_SendServerCommand( client, "%s %i \"%s\"\n", cmd,
+				index, buf );
+
+			sent += (maxChunkSize - 1);
+			remaining -= (maxChunkSize - 1);
+		}
+	} else {
+		// standard cs, just send it
+		SV_SendServerCommand( client, "cs %i \"%s\"\n", index,
+			sv.configstrings[index] );
+	}
+}
+
+/*
+===============
+SV_UpdateConfigstrings
+
+Called when a client goes from CS_PRIMED to CS_ACTIVE.  Updates all
+Configstring indexes that have changed while the client was in CS_PRIMED
+===============
+*/
+void SV_UpdateConfigstrings(client_t *client)
+{
+	int index;
+
+	for( index = 0; index <= MAX_CONFIGSTRINGS; index++ ) {
+		// if the CS hasn't changed since we went to CS_PRIMED, ignore
+		if(!client->csUpdated[index])
+			continue;
+
+		// do not always send server info to all clients
+		if ( index == CS_SERVERINFO && client->gentity &&
+			(client->gentity->r.svFlags & SVF_NOSERVERINFO) ) {
+			continue;
+		}
+		SV_SendConfigstring(client, index);
+		client->csUpdated[index] = qfalse;
+	}
+}
+
+/*
+===============
 SV_SetConfigstring
 
 ===============
 */
 void SV_SetConfigstring (int index, const char *val) {
 	int		len, i;
-	int		maxChunkSize = MAX_STRING_CHARS - 24;
 	client_t	*client;
 
 	if ( index < 0 || index >= MAX_CONFIGSTRINGS ) {
@@ -56,48 +130,23 @@
 
 		// send the data to all relevent clients
 		for (i = 0, client = svs.clients; i < sv_maxclients->integer ; i++, client++) {
-			if ( client->state < CS_PRIMED ) {
+			if ( client->state < CS_ACTIVE ) {
+				if ( client->state == CS_PRIMED )
+					client->csUpdated[ index ] = qtrue;
 				continue;
 			}
 			// do not always send server info to all clients
 			if ( index == CS_SERVERINFO && client->gentity && (client->gentity->r.svFlags & SVF_NOSERVERINFO) ) {
 				continue;
 			}
+		
 
 			len = strlen( val );
-			if( len >= maxChunkSize ) {
-				int		sent = 0;
-				int		remaining = len;
-				char	*cmd;
-				char	buf[MAX_STRING_CHARS];
-
-				while (remaining > 0 ) {
-					if ( sent == 0 ) {
-						cmd = "bcs0";
-					}
-					else if( remaining < maxChunkSize ) {
-						cmd = "bcs2";
-					}
-					else {
-						cmd = "bcs1";
-					}
-					Q_strncpyz( buf, &val[sent], maxChunkSize );
-
-					SV_SendServerCommand( client, "%s %i \"%s\"\n", cmd, index, buf );
-
-					sent += (maxChunkSize - 1);
-					remaining -= (maxChunkSize - 1);
-				}
-			} else {
-				// standard cs, just send it
-				SV_SendServerCommand( client, "cs %i \"%s\"\n", index, val );
-			}
+			SV_SendConfigstring(client, index);
 		}
 	}
 }
 
-
-
 /*
 ===============
 SV_GetConfigstring

Modified: branches/1.34/code/server/sv_main.c
===================================================================
--- branches/1.34/code/server/sv_main.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/server/sv_main.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -135,6 +135,10 @@
 //		return;
 //	}
 
+	// do not send commands until the gamestate has been sent
+	if( client->state < CS_PRIMED )
+		return;
+
 	client->reliableSequence++;
 	// if we would be losing an old command that hasn't been acknowledged,
 	// we must drop the connection
@@ -193,9 +197,6 @@
 
 	// send the data to all relevent clients
 	for (j = 0, client = svs.clients; j < sv_maxclients->integer ; j++, client++) {
-		if ( client->state < CS_PRIMED ) {
-			continue;
-		}
 		SV_AddServerCommand( client, (char *)message );
 	}
 }

Added: branches/1.34/code/unix/MacSupport/ioquake3.icns
===================================================================
(Binary files differ)


Property changes on: branches/1.34/code/unix/MacSupport/ioquake3.icns
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Modified: branches/1.34/code/unix/setup/Makefile
===================================================================
--- branches/1.34/code/unix/setup/Makefile	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/unix/setup/Makefile	2006-11-28 16:06:46 UTC (rev 986)
@@ -1,5 +1,5 @@
-VERSION=FIXME
-RELEASE=1
+VERSION=1.34
+RELEASE=rc3
 
 all:
 	VERSION=$(VERSION) RELEASE=$(RELEASE) ./doit

Modified: branches/1.34/code/unix/setup/Solaris_pkg.sh
===================================================================
--- branches/1.34/code/unix/setup/Solaris_pkg.sh	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/unix/setup/Solaris_pkg.sh	2006-11-28 16:06:46 UTC (rev 986)
@@ -18,9 +18,9 @@
 SVNVERSION=/usr/local/bin/svnversion
 if [ -x /usr/local/bin/svnversion ]; then
 	SVN_BANNER=`/usr/local/bin/svnversion ${MOUNT_DIR}|sed -e 's/S$//' -e 's/M$//' `
-	BUILD_VERSION="1.34-rc2"
+	BUILD_VERSION="1.34-rc3"
 else
-	BUILD_VERSION="1.34-rc2"
+	BUILD_VERSION="1.34-rc3"
 fi
 PKG_VERSION="`date '+%Y%m%d%H%M'`"
 PKG_MAINT_ID="quake at cojot.name"

Modified: branches/1.34/code/unix/setup/doit
===================================================================
--- branches/1.34/code/unix/setup/doit	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/unix/setup/doit	2006-11-28 16:06:46 UTC (rev 986)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
-: ${MAKESELF:=/usr/share/loki-setup/makeself}
-: ${SETUPIMAGE:=/usr/share/loki-setup/image}
+: ${MAKESELF:=/usr/share/loki_setup/makeself}
+: ${SETUPIMAGE:=/usr/share/loki_setup/image}
 
 : ${VERSION:=0.0_`date +%Y%m%d%H%M`}
 : ${RELEASE:=0}
@@ -11,14 +11,6 @@
 
 arch=`uname -m`
 
-# $§&%!!
-setup_arch=$arch
-links=
-case "$arch" in
-	i?86) arch=i386; setup_arch=x86; links="amd64 x86_64" ;;
-	x86_64) links=amd64
-esac
-
 rm -rf image
 mkdir image
 
@@ -32,36 +24,82 @@
 cp ../quake3.png image/quake3.png
 
 ### binaries
+src="../../../../../build"
+
 mkdir image/tmp
 pushd image/tmp
 mkdir baseq3 demoq3 missionpack
-src="../../../../../build/release-linux-$arch/"
-install -m 755 $src/ioquake3.$arch ioquake3.$arch
-install -m 755 $src/ioq3ded.$arch ioq3ded.$arch
-install -m 644 $src/baseq3/*.so baseq3
-install -m 644 $src/missionpack/*.so missionpack
+# 32 bit binaries
+install -m 755 $src/release-linux-i386/ioquake3.i386 ioquake3.i386
+install -m 755 $src/release-linux-i386/ioq3ded.i386 ioq3ded.i386
+install -m 644 $src/release-linux-i386/baseq3/*.so baseq3
+install -m 644 $src/release-linux-i386/missionpack/*.so missionpack
 pushd demoq3
 ln -s ../baseq3/*.so .
 popd
 popd
 
-tar --owner=root --group=root -C image/tmp -cf image/ioquake3.tar .
+tar --owner=root --group=root -C ./image/tmp -cf ./image/ioquake3.i386.tar .
+rm -rf ./image/tmp
+
+mkdir image/tmp
+pushd image/tmp
+mkdir baseq3 demoq3 missionpack
+# 64 bit binaries
+install -m 755 $src/release-linux-x86_64/ioquake3.x86_64 ioquake3.x86_64
+install -m 755 $src/release-linux-x86_64/ioq3ded.x86_64 ioq3ded.x86_64
+install -m 644 $src/release-linux-x86_64/baseq3/*.so baseq3
+install -m 644 $src/release-linux-x86_64/missionpack/*.so missionpack
+pushd demoq3
+ln -s ../baseq3/*.so .
+popd
+popd
+
+tar --owner=root --group=root -C ./image/tmp -cf ./image/ioquake3.x86_64.tar .
 rm -rf image/tmp
 
+mkdir image/tmp
+pushd image/tmp
+mkdir baseq3 demoq3 missionpack
+# ppc binaries
+install -m 755 $src/release-linux-ppc/ioquake3.ppc ioquake3.ppc
+install -m 755 $src/release-linux-ppc/ioq3ded.ppc ioq3ded.ppc
+install -m 644 $src/release-linux-ppc/baseq3/*.so baseq3
+install -m 644 $src/release-linux-ppc/missionpack/*.so missionpack
+pushd demoq3
+ln -s ../baseq3/*.so .
+popd
+popd
+
+tar --owner=root --group=root -C ./image/tmp -cf ./image/ioquake3.ppc.tar .
+rm -rf image/tmp
+
+# patch pk3 files
+install -m 644 ./idpatchpk3s.tar image/idpatchpk3s.tar
+install -m 644 ./idtapatchpk3s.tar image/idtapatchpk3s.tar
+
 ### setup.xml
 sed 's/@VERSION@/'$VERSION'/g' < setup.xml > image/setup.data/setup.xml
 
+### uninstall script
+install -m 755 ./preuninstall.sh image/preuninstall.sh
+
 ### start script
-mkdir -p image/bin/Linux/$setup_arch
-for i in $links; do
-	ln -s $setup_arch image/bin/Linux/$i
-done
-install -m 755 ioquake3.sh image/bin/Linux/$setup_arch/ioquake3
-install -m 755 ioq3demo.sh image/bin/Linux/$setup_arch/ioq3demo
+mkdir -p image/bin/Linux/x86
+mkdir -p image/bin/Linux/x86_64
+mkdir -p image/bin/Linux/ppc
 
-### README and COPYING
+install -m 755 ioquake3.sh image/bin/Linux/x86/ioquake3
+install -m 755 ioq3demo.sh image/bin/Linux/x86/ioq3demo
+install -m 755 ioquake3.sh image/bin/Linux/x86_64/ioquake3
+install -m 755 ioq3demo.sh image/bin/Linux/x86_64/ioq3demo
+install -m 755 ioquake3.sh image/bin/Linux/ppc/ioquake3
+install -m 755 ioq3demo.sh image/bin/Linux/ppc/ioq3demo
+
+### README, COPYING and EULA
 install -m 644 ../../../README image/README
 install -m 644 ../../../COPYING.txt image/COPYING
+install -m 644 ./id_patch_pk3s_Q3A_EULA.txt image/id_patch_pk3s_Q3A_EULA.txt
 
 ### makeself installer
-$MAKESELF/makeself.sh image ioquake3-$VERSION-$RELEASE.$arch.run "ioquake3 $VERSION" ./setup.sh
+$MAKESELF/makeself.sh image ioquake3-$VERSION-$RELEASE.run "ioquake3 $VERSION-$RELEASE" ./setup.sh

Modified: branches/1.34/code/unix/setup/ioquake3.sh
===================================================================
--- branches/1.34/code/unix/setup/ioquake3.sh	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/unix/setup/ioquake3.sh	2006-11-28 16:06:46 UTC (rev 986)
@@ -5,7 +5,7 @@
     
     if [ -L "$path" ]; then 
         ll="$(LC_ALL=C ls -l "$path" 2> /dev/null)" &&
-        echo "${ll/* -> }"
+        echo "${ll##* -> }"
     else    
         return 1
     fi

Added: branches/1.34/code/unix/setup/preuninstall.sh
===================================================================
--- branches/1.34/code/unix/setup/preuninstall.sh	                        (rev 0)
+++ branches/1.34/code/unix/setup/preuninstall.sh	2006-11-28 16:06:46 UTC (rev 986)
@@ -0,0 +1,3 @@
+#!/bin/sh
+rm -f COPYING
+rmdir --ignore-fail-on-non-empty demoq3 missionpack >& /dev/null

Modified: branches/1.34/code/unix/setup/setup.xml
===================================================================
--- branches/1.34/code/unix/setup/setup.xml	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/unix/setup/setup.xml	2006-11-28 16:06:46 UTC (rev 986)
@@ -3,34 +3,101 @@
 	desc="ioquake3"
 	version="@VERSION@"
 	update_url="http://www.icculus.org/quake3/updates.txt"
-	promptbinaries="yes">
+	promptbinaries="yes"
+	reinstall="yes"
+	nopromptoverwrite="yes"
+	preuninstall="preuninstall.sh">
   <readme>
     README
   </readme>
-<!--
   <eula>
-   COPYING
+    id_patch_pk3s_Q3A_EULA.txt
   </eula>
--->
-  <component name="Default" version="@VERSION@" default="yes">
-   <option install="true" required="true">
-    Quake 3
 
-    <binary arch="any" libc="any" symlink="ioquake3" icon="quake3.png" play="yes"
-	    name="ioquake3">
-      ioquake3
-    </binary>
-    <files>
-      ioquake3.tar
-      quake3.png
-    </files>
+  <component name="Quake3 Arena gamedata" version="@VERSION@" default="yes">
+   <option size="457M">
+     <help>
+       If you don't select this, you must make sure to copy pak0.pk3 to the baseq3 directory manually.
+     </help>
+     Copy Quake3 Arena CD data
+     <files cdromid="CD 1" path="baseq3" size="457M">
+       Quake3/baseq3/pak0.pk3
+     </files>
    </option>
-   <option install="false" required="false">
-    Quake 3 Demo start script
-    <binary arch="any" libc="any" symlink="ioq3demo" icon="quake3.png" play="no"
-	    name="ioquake3 (Demo)">
-      ioq3demo
-    </binary>
+   <option required="true" install="true" show="false">
+     <files path="baseq3">
+       idpatchpk3s.tar
+     </files>
+     <files path="">
+       COPYING
+     </files>
    </option>
   </component>
+
+  <component name="Quake3 Team Arena gamedata" version="@VERSION@">
+   <option>
+     Install Team Arena components
+     <files path="missionpack">
+       idtapatchpk3s.tar
+     </files>
+     <option size="457M">
+       <help>
+         If you don't select this, you must make sure to copy the TA pak0.pk3 to the missionpack directory manually.
+       </help>
+       Copy Quake3 Team Arena CD data
+       <files cdromid="CD 2" path="missionpack" size="457M">
+         Setup/missionpack/pak0.pk3
+       </files>
+     </option>
+   </option>
+  </component>
+  <component arch="x86_64" name="x86_64" version="@VERSION@">
+    <option install="true">
+     x86_64 binaries
+     <binary libc="any" symlink="ioquake3" icon="quake3.png"
+             menu="." name="ioquake3">
+       ioquake3
+     </binary>
+     <files>
+       ioquake3.x86_64.tar
+       quake3.png
+     </files>
+    </option>
+  </component>
+
+  <component if="|(x86,x86_64)" name="i386" version="@VERSION@">
+    <option install="true">
+     x86 (32 bit) binaries
+     <binary libc="any" symlink="ioquake3" icon="quake3.png"
+             menu="." name="ioquake3">
+       ioquake3
+     </binary>
+     <files>
+       ioquake3.i386.tar
+       quake3.png
+     </files>
+    </option>
+  </component>
+
+  <component arch="ppc" name="ppc" version="@VERSION@">
+    <option install="true">
+     ppc 32 bit binaries
+     <binary libc="any" symlink="ioquake3" icon="quake3.png"
+             menu="." name="ioquake3">
+       ioquake3
+     </binary>
+     <files>
+       ioquake3.ppc.tar
+       quake3.png
+     </files>
+    </option>
+  </component>
+
+  <cdrom id="CD 1" name="Quake 3 Arena installation CD">
+    Setup/BaseEF/pak0.pk3
+  </cdrom>
+  <cdrom id="CD 2" name="Quake 3 Team Arena installation CD">
+    Setup/missionpack/pak0.pk3
+  </cdrom>
+
 </install>

Modified: branches/1.34/code/win32/msvc/quake3.vcproj
===================================================================
--- branches/1.34/code/win32/msvc/quake3.vcproj	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/win32/msvc/quake3.vcproj	2006-11-28 16:06:46 UTC (rev 986)
@@ -37,7 +37,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib shfolder.lib"
+				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib"
 				OutputFile="$(OutDir)\ioquake3.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="TRUE"
@@ -105,7 +105,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib shfolder.lib"
+				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib"
 				OutputFile="$(OutDir)\ioquake3.exe"
 				LinkIncremental="2"
 				SuppressStartupBanner="TRUE"
@@ -176,7 +176,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib shfolder.lib"
+				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib"
 				OutputFile="$(OutDir)\ioquake3.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="TRUE"
@@ -243,7 +243,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib shfolder.lib"
+				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib"
 				OutputFile="$(OutDir)\ioquake3.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="TRUE"
@@ -310,7 +310,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib shfolder.lib"
+				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib"
 				OutputFile="$(OutDir)\ioquake3.exe"
 				LinkIncremental="2"
 				SuppressStartupBanner="TRUE"
@@ -380,7 +380,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib shfolder.lib"
+				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib"
 				OutputFile="$(OutDir)\ioquake3.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="TRUE"
@@ -447,7 +447,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib shfolder.lib"
+				AdditionalDependencies="winmm.lib wsock32.lib openal32.lib"
 				OutputFile="$(OutDir)\ioquake3.exe"
 				LinkIncremental="2"
 				SuppressStartupBanner="TRUE"

Modified: branches/1.34/code/win32/win_shared.c
===================================================================
--- branches/1.34/code/win32/win_shared.c	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/code/win32/win_shared.c	2006-11-28 16:06:46 UTC (rev 986)
@@ -287,15 +287,32 @@
 char	*Sys_DefaultHomePath(void) {
 	TCHAR szPath[MAX_PATH];
 	static char path[MAX_OSPATH];
+	FARPROC qSHGetFolderPath;
+	HMODULE shfolder = LoadLibrary("shfolder.dll");
+	
+	if(shfolder == NULL) {
+		Com_Printf("Unable to load SHFolder.dll\n");
+		return NULL;
+	}
 
-	if( !SUCCEEDED( SHGetFolderPath( NULL, CSIDL_LOCAL_APPDATA,
+	qSHGetFolderPath = GetProcAddress(shfolder, "SHGetFolderPathA");
+	if(qSHGetFolderPath == NULL)
+	{
+		Com_Printf("Unable to find SHGetFolderPath in SHFolder.dll\n");
+		FreeLibrary(shfolder);
+		return NULL;
+	}
+
+	if( !SUCCEEDED( qSHGetFolderPath( NULL, CSIDL_APPDATA,
 		NULL, 0, szPath ) ) )
 	{
-
+		Com_Printf("Unable to detect CSIDL_APPDATA\n");
+		FreeLibrary(shfolder);
 		return NULL;
 	}
 	Q_strncpyz( path, szPath, sizeof(path) );
 	Q_strcat( path, sizeof(path), "\\Quake3" );
+	FreeLibrary(shfolder);
 	if( !CreateDirectory( path, NULL ) )
 	{
 		if( GetLastError() != ERROR_ALREADY_EXISTS )

Modified: branches/1.34/make-macosx-ub.sh
===================================================================
--- branches/1.34/make-macosx-ub.sh	2006-11-28 14:03:27 UTC (rev 985)
+++ branches/1.34/make-macosx-ub.sh	2006-11-28 16:06:46 UTC (rev 986)
@@ -1,8 +1,13 @@
 #!/bin/sh
-
+APPBUNDLE=ioquake3.app
+BINARY=ioquake3.ub
+PKGINFO=APPIOQ3
+ICNS=code/unix/MacSupport/ioquake3.icns
 DESTDIR=build/release-darwin-ub
 BASEDIR=baseq3
 MPACKDIR=missionpack
+Q3_VERSION=`grep "\#define Q3_VERSION" code/qcommon/q_shared.h | \
+	sed -e 's/.*".* \([^ ]*\)"/\1/'`;
 
 BIN_OBJ="
 	build/release-darwin-ppc/ioquake3.ppc
@@ -44,19 +49,57 @@
 
 (BUILD_MACOSX_UB=ppc make && BUILD_MACOSX_UB=i386 make) || exit 1;
 
-if [ ! -d $DESTDIR ]; then 
-	mkdir $DESTDIR || exit 1;
+echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
+if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
+	mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
 fi
-if [ ! -d $DESTDIR/$BASEDIR ]; then
-	mkdir $DESTDIR/$BASEDIR || exit 1;
+if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR ]; then
+	mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR || exit 1;
 fi
-if [ ! -d $DESTDIR/$MPACKDIR ]; then
-	mkdir $DESTDIR/$MPACKDIR || exit 1;
+if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then
+	mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources
 fi
+cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/ioquake3.icns || exit 1;
+echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo
+echo "
+	<?xml version=\"1.0\" encoding="UTF-8"?>
+	<!DOCTYPE plist
+		PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
+		\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+	<plist version=\"1.0\">
+	<dict>
+		<key>CFBundleDevelopmentRegion</key>
+		<string>English</string>
+		<key>CFBundleExecutable</key>
+		<string>$BINARY</string>
+		<key>CFBundleGetInfoString</key>
+		<string>ioquake3 $Q3_VERSION</string>
+		<key>CFBundleIconFile</key>
+		<string>ioquake3.icns</string>
+		<key>CFBundleIdentifier</key>
+		<string>org.icculus.quake3</string>
+		<key>CFBundleInfoDictionaryVersion</key>
+		<string>6.0</string>
+		<key>CFBundleName</key>
+		<string>ioquake3</string>
+		<key>CFBundlePackageType</key>
+		<string>APPL</string>
+		<key>CFBundleShortVersionString</key>
+		<string>$Q3_VERSION</string>
+		<key>CFBundleSignature</key>
+		<string>$PKGINFO</string>
+		<key>CFBundleVersion</key>
+		<string>$Q3_VERSION</string>
+		<key>NSExtensions</key>
+		<dict/>
+		<key>NSPrincipalClass</key>
+		<string>NSApplication</string>
+	</dict>
+	</plist>
+	" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
 
-echo "Installing Universal Binaries in $DESTDIR"
-lipo -create -o $DESTDIR/ioquake3.ub $BIN_OBJ
-cp $BASE_OBJ $DESTDIR/$BASEDIR/
-cp $MPACK_OBJ $DESTDIR/$MPACKDIR/
-cp code/libs/macosx/*.dylib $DESTDIR/
+lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
+cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
+cp $MPACK_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR/
+cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
 




More information about the quake3-commits mailing list