iwad: Search Steam-on-Linux paths for WAD files
Windows games can now be installed via the Linux version of Steam, so let’s automatically find any installed copies of the games.
This commit is contained in:
parent
3bf06ab27b
commit
02fc812eff
1 changed files with 33 additions and 1 deletions
34
src/d_iwad.c
34
src/d_iwad.c
|
|
@ -650,7 +650,36 @@ static void AddXdgDirs(void)
|
|||
// Classic WADs.
|
||||
AddIWADPath(env, "/games/doom3bfg/base/wads");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __MACOSX__
|
||||
// Steam on Linux allows installing some select Windows games,
|
||||
// including the classic Doom series (running DOSBox via Wine). We
|
||||
// could parse *.vdf files to more accurately detect installation
|
||||
// locations, but the defaults are likely to be good enough for just
|
||||
// about everyone.
|
||||
static void AddSteamDirs(void)
|
||||
{
|
||||
char *homedir, *steampath;
|
||||
|
||||
homedir = getenv("HOME");
|
||||
if (homedir == NULL)
|
||||
{
|
||||
homedir = "/";
|
||||
}
|
||||
steampath = M_StringJoin(homedir, "/.steam/root/steamapps/common", NULL);
|
||||
|
||||
AddIWADPath(steampath, "/Doom 2/base");
|
||||
AddIWADPath(steampath, "/Master Levels of Doom/doom2");
|
||||
AddIWADPath(steampath, "/Ultimate Doom/base");
|
||||
AddIWADPath(steampath, "/Final Doom/base");
|
||||
AddIWADPath(steampath, "/DOOM 3 BFG Edition/base/wads");
|
||||
AddIWADPath(steampath, "/Heretic Shadow of the Serpent Riders/base");
|
||||
AddIWADPath(steampath, "/Hexen/base");
|
||||
AddIWADPath(steampath, "/Hexen Deathkings of the Dark Citadel/base");
|
||||
AddIWADPath(steampath, "/Strife");
|
||||
}
|
||||
#endif // __MACOSX__
|
||||
#endif // !_WIN32
|
||||
|
||||
//
|
||||
// Build a list of IWAD files
|
||||
|
|
@ -701,6 +730,9 @@ static void BuildIWADDirList(void)
|
|||
|
||||
#else
|
||||
AddXdgDirs();
|
||||
#ifndef __MACOSX__
|
||||
AddSteamDirs();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Don't run this function again.
|
||||
|
|
|
|||
Loading…
Reference in a new issue