- Added directory detection to the -file parameter. This obsoletes -dir, so
that parameter is now gone. - Removed automatic ".wad" appending from FWadCollection::InitMultipleFiles() since it isn't needed and prevented files without extensions from being loaded. D_AddFile() already takes care of adding the extension if the name as-given does not exist. - Fixed: Loading single files did not print a newline in the startup text. SVN r1784 (trunk)
This commit is contained in:
parent
6c6ce41b7e
commit
c24c31cc9f
7 changed files with 191 additions and 52 deletions
|
|
@ -160,7 +160,7 @@ void FWadCollection::DeleteAll ()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void FWadCollection::InitMultipleFiles (wadlist_t **filenames, const char *loaddir)
|
||||
void FWadCollection::InitMultipleFiles (wadlist_t **filenames)
|
||||
{
|
||||
int numfiles;
|
||||
|
||||
|
|
@ -172,18 +172,10 @@ void FWadCollection::InitMultipleFiles (wadlist_t **filenames, const char *loadd
|
|||
{
|
||||
wadlist_t *next = (*filenames)->next;
|
||||
int baselump = NumLumps;
|
||||
char name[PATH_MAX];
|
||||
|
||||
// [RH] Automatically append .wad extension if none is specified.
|
||||
strcpy (name, (*filenames)->name);
|
||||
FixPathSeperator (name);
|
||||
DefaultExtension (name, ".wad");
|
||||
|
||||
AddFile (name);
|
||||
AddFile ((*filenames)->name);
|
||||
M_Free (*filenames);
|
||||
*filenames = next;
|
||||
}
|
||||
if (loaddir != NULL) AddFile(loaddir, NULL, true);
|
||||
|
||||
NumLumps = LumpInfo.Size();
|
||||
if (NumLumps == 0)
|
||||
|
|
@ -230,9 +222,20 @@ int FWadCollection::AddExternalFile(const char *filename)
|
|||
// [RH] Removed reload hack
|
||||
//==========================================================================
|
||||
|
||||
void FWadCollection::AddFile (const char *filename, FileReader *wadinfo, bool isdir)
|
||||
void FWadCollection::AddFile (const char *filename, FileReader *wadinfo)
|
||||
{
|
||||
int startlump;
|
||||
int startlump;
|
||||
bool isdir;
|
||||
|
||||
// Does this exist? If so, is it a directory?
|
||||
struct stat info;
|
||||
if (stat(filename, &info) != 0)
|
||||
{
|
||||
Printf(TEXTCOLOR_RED "Could not stat %s\n", filename);
|
||||
PrintLastError();
|
||||
return;
|
||||
}
|
||||
isdir = (info.st_mode & S_IFDIR) != 0;
|
||||
|
||||
if (wadinfo == NULL && !isdir)
|
||||
{
|
||||
|
|
@ -253,8 +256,10 @@ void FWadCollection::AddFile (const char *filename, FileReader *wadinfo, bool is
|
|||
|
||||
FResourceFile *resfile;
|
||||
|
||||
if (!isdir) resfile = FResourceFile::OpenResourceFile(filename, wadinfo);
|
||||
else resfile = FResourceFile::OpenDirectory(filename);
|
||||
if (!isdir)
|
||||
resfile = FResourceFile::OpenResourceFile(filename, wadinfo);
|
||||
else
|
||||
resfile = FResourceFile::OpenDirectory(filename);
|
||||
|
||||
if (resfile != NULL)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue