Skip to content

Commit

Permalink
Unix: Added system-level config value "iwaddir"
Browse files Browse the repository at this point in the history
/etc/doomsday/paths or ~/.doomsday/paths can now be used to configure
the location of IWAD files. The following config file:

  iwaddir: ~/IWADs/

is equivalent to:

  -iwad ~/IWADs/

on the command line.
  • Loading branch information
skyjake committed Apr 22, 2012
1 parent c4ab30b commit b9dcf49
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion doomsday/engine/portable/src/sys_reslocator.c
Expand Up @@ -586,6 +586,17 @@ static void createPackagesResourceNamespace(void)
FileDirectory* directory;
Uri** searchPaths;

#ifdef UNIX
{
// Check the system-level config files.
filename_t fn;
if(DD_Unix_GetConfigValue("paths", "iwaddir", fn, FILENAME_T_MAXLEN))
{
doomWadDir = Str_Set(Str_New(), fn);
}
}
#endif

// Is the DOOMWADPATH environment variable in use?
if(!ArgCheck("-nodoomwadpath") && getenv("DOOMWADPATH"))
{
Expand Down Expand Up @@ -646,7 +657,7 @@ static void createPackagesResourceNamespace(void)
}

// Is the DOOMWADDIR environment variable in use?
if(!ArgCheck("-nodoomwaddir") && getenv("DOOMWADDIR"))
if(!doomWadDir && !ArgCheck("-nodoomwaddir") && getenv("DOOMWADDIR"))
{
doomWadDir = Str_New(); Str_Set(doomWadDir, getenv("DOOMWADDIR"));
Str_Strip(doomWadDir);
Expand Down

0 comments on commit b9dcf49

Please sign in to comment.