Skip to content

Commit

Permalink
FS|libdoomsday: Allow reinitializing the /local/wads folder
Browse files Browse the repository at this point in the history
The attached feeds where WAD files are acquired from are not populated
to full depth.

Todo: Add an option for the user to include full file tree.
  • Loading branch information
skyjake committed Jan 24, 2016
1 parent e4b7e93 commit a608cf2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
6 changes: 6 additions & 0 deletions doomsday/apps/libdoomsday/include/doomsday/doomsdayapp.h
Expand Up @@ -73,6 +73,12 @@ class LIBDOOMSDAY_PUBLIC DoomsdayApp
*/
void initialize();

/**
* Initializes the /local/wads folder that contains all the WAD files that
* Doomsday will access.
*/
void initWadFolders();

void identifyDataBundles();

void determineGlobalPaths();
Expand Down
14 changes: 13 additions & 1 deletion doomsday/apps/libdoomsday/src/doomsdayapp.cpp
Expand Up @@ -129,7 +129,8 @@ DENG2_PIMPL_NOREF(DoomsdayApp)
if(path.exists())
{
LOG_RES_NOTE("Using %s WAD folder: %s") << description << path.pretty();
App::rootFolder().locate<Folder>(PATH_LOCAL_WADS).attach(new DirectoryFeed(path));
App::rootFolder().locate<Folder>(PATH_LOCAL_WADS).attach(
new DirectoryFeed(path, DirectoryFeed::OnlyThisFolder));
}
else
{
Expand Down Expand Up @@ -368,6 +369,17 @@ void DoomsdayApp::initialize()
d->dataBundles.identify();
}

void DoomsdayApp::initWadFolders()
{
d->initWadFolders();
d->dataBundles.identify();

if(d->initialized)
{
games().checkReadiness();
}
}

void DoomsdayApp::determineGlobalPaths()
{
d->determineGlobalPaths();
Expand Down
9 changes: 8 additions & 1 deletion doomsday/apps/libdoomsday/src/resource/databundle.cpp
Expand Up @@ -305,7 +305,14 @@ void DataBundle::setFormat(Format format)

void DataBundle::identifyPackages() const
{
d->identify();
try
{
d->identify();
}
catch(Error const &er)
{
LOG_RES_WARNING("Failed to identify %s") << description();
}
}

bool DataBundle::isNested() const
Expand Down

0 comments on commit a608cf2

Please sign in to comment.