[quake3] pk3 limit
Ludwig Nussel
ludwig.nussel at suse.de
Sat Sep 2 09:05:30 EDT 2006
panter at gmx.de wrote:
> in the mod defrag its normal to have more than 500 pk3 files.
> is there a way to increase the pk3 count? i want quake to be able to handle up to 2000.
The pk3 file limit seems to be artificial. Try the following patch.
cu
Ludwig
Index: code/qcommon/files.c
===================================================================
--- code/qcommon/files.c (Revision 883)
+++ code/qcommon/files.c (Arbeitskopie)
@@ -2483,7 +2483,6 @@
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 @@
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 @@
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( pakfiles, numfiles, sizeof(char*), paksort );
- qsort( sorted, 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);
--
(o_ Ludwig Nussel
//\ SUSE LINUX Products GmbH, Development
V_/_ http://www.suse.de/
More information about the quake3
mailing list