Skip to content

Commit

Permalink
Removed fixed 64 file limit in multiple init.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Aug 8, 2006
1 parent 29f9e24 commit 099b75e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions doomsday/engine/portable/src/dd_wad.c
Expand Up @@ -723,8 +723,13 @@ int W_IsIWAD(char *fn)
void W_InitMultipleFiles(char **filenames)
{
char **ptr;
byte loaded[64]; // Enough?
int numLoaded = 0;
byte *loaded = 0;

// Count number of files.
for(ptr = filenames; *ptr; ptr++, numLoaded++);
loaded = calloc(numLoaded, 1);

iwadLoaded = false;

// Open all the files, load headers, and count lumps
Expand All @@ -734,8 +739,6 @@ void W_InitMultipleFiles(char **filenames)
// This'll force the loader NOT the flag new records Runtime. (?)
loadingForStartup = true;

memset(loaded, 0, sizeof(loaded));

// IWAD(s) must be loaded first. Let's see if one has been specified
// with -iwad or -file options.
for(ptr = filenames; *ptr; ptr++)
Expand All @@ -754,9 +757,13 @@ void W_InitMultipleFiles(char **filenames)
if(!loaded[ptr - filenames])
W_AddFile(*ptr, false);

// Bookkeeping no longer needed.
free(loaded);
loaded = NULL;

if(!numlumps)
{
Con_Error("W_InitMultipleFiles: no files found");
Con_Error("W_InitMultipleFiles: no files found.\n");
}
}

Expand Down

0 comments on commit 099b75e

Please sign in to comment.