diff options
| author | ludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2006-12-30 12:19:53 +0000 | 
|---|---|---|
| committer | ludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2006-12-30 12:19:53 +0000 | 
| commit | ca2cf9c99df7ee76f13b7c9fa2d6ad706a3968fa (patch) | |
| tree | 71011ba541204c0ceedb91010fb9726395df62f2 | |
| parent | 24af7f298cc0a3b1c9a1ffb5b495cb9485ee6870 (diff) | |
| download | ioquake3-aero-ca2cf9c99df7ee76f13b7c9fa2d6ad706a3968fa.tar.gz ioquake3-aero-ca2cf9c99df7ee76f13b7c9fa2d6ad706a3968fa.zip  | |
don't use intermediate array for sorting pakfiles. avoids the
MAX_PAKFILES limitation
git-svn-id: svn://svn.icculus.org/quake3/trunk@1022 edf5b092-35ff-0310-97b2-ce42778d08ea
| -rw-r--r-- | code/qcommon/files.c | 17 | 
1 files changed, 3 insertions, 14 deletions
diff --git a/code/qcommon/files.c b/code/qcommon/files.c index 52fa912..df90588 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -2483,7 +2483,6 @@ Sets fs_gamedir, adds the directory to the head of the path,  then loads the zip headers  ================  */ -#define	MAX_PAKFILES	1024  static void FS_AddGameDirectory( const char *path, const char *dir ) {  	searchpath_t	*sp;  	int				i; @@ -2492,7 +2491,6 @@ static void FS_AddGameDirectory( const char *path, const char *dir ) {  	char			*pakfile;  	int				numfiles;  	char			**pakfiles; -	char			*sorted[MAX_PAKFILES];  	// this fixes the case where fs_basepath is the same as fs_cdpath  	// which happens on full installs @@ -2521,20 +2519,11 @@ static void FS_AddGameDirectory( const char *path, const char *dir ) {  	pakfiles = Sys_ListFiles( pakfile, ".pk3", NULL, &numfiles, qfalse ); -	// sort them so that later alphabetic matches override -	// earlier ones.  This makes pak1.pk3 override pak0.pk3 -	if ( numfiles > MAX_PAKFILES ) { -		numfiles = MAX_PAKFILES; -	} -	for ( i = 0 ; i < numfiles ; i++ ) { -		sorted[i] = pakfiles[i]; -	} - -	qsort( sorted, numfiles, sizeof(char*), paksort ); +	qsort( pakfiles, numfiles, sizeof(char*), paksort );  	for ( i = 0 ; i < numfiles ; i++ ) { -		pakfile = FS_BuildOSPath( path, dir, sorted[i] ); -		if ( ( pak = FS_LoadZipFile( pakfile, sorted[i] ) ) == 0 ) +		pakfile = FS_BuildOSPath( path, dir, pakfiles[i] ); +		if ( ( pak = FS_LoadZipFile( pakfile, pakfiles[i] ) ) == 0 )  			continue;  		// store the game name for downloading  		strcpy(pak->pakGamename, dir);  | 
