Pick up iwads from folders
This commit is contained in:
parent
156d7e7af2
commit
33b2c792cd
1 changed files with 24 additions and 1 deletions
|
|
@ -493,6 +493,7 @@ void FIWadManager::CollectSearchPaths()
|
|||
void FIWadManager::AddIWADCandidates(const char *dir)
|
||||
{
|
||||
FileSys::FileList list;
|
||||
FString iwadinfoName = "iwadinfo";
|
||||
|
||||
if (FileSys::ScanDirectory(list, dir, "*", true))
|
||||
{
|
||||
|
|
@ -517,6 +518,23 @@ void FIWadManager::AddIWADCandidates(const char *dir)
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FileSys::FileList list;
|
||||
if (FileSys::ScanDirectory(list, entry.FilePath.c_str(), "*", true))
|
||||
{
|
||||
for (auto& entry2 : list)
|
||||
{
|
||||
std::string s = entry2.FileName;
|
||||
s.resize(std::min(s.size(), iwadinfoName.Len()));
|
||||
if (iwadinfoName.CompareNoCase(s.c_str()) == 0)
|
||||
{
|
||||
mFoundWads.Push(FFoundWadInfo{ entry.FilePath.c_str(), "", -1 });
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -543,7 +561,12 @@ void FIWadManager::ValidateIWADs()
|
|||
}
|
||||
else
|
||||
{
|
||||
index = ScanIWAD(p.mFullPath.GetChars());
|
||||
bool isdir = false;
|
||||
bool exists = FileSys::FS_DirEntryExists(p.mFullPath.GetChars(), &isdir);
|
||||
if (exists && isdir)
|
||||
index = CheckIWADInfo(p.mFullPath.GetChars());
|
||||
else
|
||||
index = ScanIWAD(p.mFullPath.GetChars());
|
||||
}
|
||||
p.mInfoIndex = index;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue