- 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:
Randy Heit 2009-09-02 03:47:48 +00:00
commit c24c31cc9f
7 changed files with 191 additions and 52 deletions

View file

@ -1235,7 +1235,7 @@ void D_AddFile (const char *file, bool check)
return;
}
if (check && !FileExists (file))
if (check && !DirEntryExists (file))
{
const char *f = BaseFileSearch (file, ".wad");
if (f == NULL)
@ -1405,13 +1405,13 @@ static const char *BaseFileSearch (const char *file, const char *ext, bool lookf
if (lookfirstinprogdir)
{
mysnprintf (wad, countof(wad), "%s%s%s", progdir.GetChars(), progdir[progdir.Len() - 1] != '/' ? "/" : "", file);
if (FileExists (wad))
if (DirEntryExists (wad))
{
return wad;
}
}
if (FileExists (file))
if (DirEntryExists (file))
{
mysnprintf (wad, countof(wad), "%s", file);
return wad;
@ -1454,7 +1454,7 @@ static const char *BaseFileSearch (const char *file, const char *ext, bool lookf
if (dir != NULL)
{
mysnprintf (wad, countof(wad), "%s%s%s", dir, dir[strlen (dir) - 1] != '/' ? "/" : "", file);
if (FileExists (wad))
if (DirEntryExists (wad))
{
return wad;
}
@ -1748,11 +1748,8 @@ void D_DoomMain (void)
files2->Destroy();
files3->Destroy();
const char *loaddir = Args->CheckValue("-dir");
// FIXME: consider the search path list for directory, too.
Printf ("W_Init: Init WADfiles.\n");
Wads.InitMultipleFiles (&wadfiles, loaddir);
Wads.InitMultipleFiles (&wadfiles);
// [RH] Initialize localizable strings.
GStrings.LoadStrings (false);