mirror of
https://github.com/DrBeef/Raze.git
synced 2025-05-30 00:40:53 +00:00
Linux: Add detection of the Steam releases of Duke 3D and NAM. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4804 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
9f52fb1d21
commit
828382c290
1 changed files with 19 additions and 4 deletions
|
@ -603,8 +603,8 @@ static void G_LoadAddon(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#if defined __APPLE__ || defined __linux__
|
||||||
static void G_AddSteamPathsApple(const char *basepath)
|
static void G_AddSteamPaths(const char *basepath)
|
||||||
{
|
{
|
||||||
char buf[BMAX_PATH];
|
char buf[BMAX_PATH];
|
||||||
|
|
||||||
|
@ -620,7 +620,11 @@ static void G_AddSteamPathsApple(const char *basepath)
|
||||||
Bsnprintf(buf, sizeof(buf), "%s/steamapps/common/Duke Nukem 3D/gameroot/addons/vacation", basepath);
|
Bsnprintf(buf, sizeof(buf), "%s/steamapps/common/Duke Nukem 3D/gameroot/addons/vacation", basepath);
|
||||||
addsearchpath(buf);
|
addsearchpath(buf);
|
||||||
|
|
||||||
|
#if defined __APPLE__
|
||||||
Bsnprintf(buf, sizeof(buf), "%s/steamapps/common/Nam/Nam.app/Contents/Resources/Nam.boxer/C.harddisk/NAM", basepath);
|
Bsnprintf(buf, sizeof(buf), "%s/steamapps/common/Nam/Nam.app/Contents/Resources/Nam.boxer/C.harddisk/NAM", basepath);
|
||||||
|
#else
|
||||||
|
Bsnprintf(buf, sizeof(buf), "%s/steamapps/common/Nam/NAM", basepath);
|
||||||
|
#endif
|
||||||
addsearchpath(buf);
|
addsearchpath(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -785,7 +789,7 @@ static void G_ParseSteamKeyValuesForPaths(const char *vdf)
|
||||||
char *result;
|
char *result;
|
||||||
vdfbuf++;
|
vdfbuf++;
|
||||||
while ((result = KeyValues_FindKeyValue(&vdfbuf, vdfbufend, NULL)) != NULL)
|
while ((result = KeyValues_FindKeyValue(&vdfbuf, vdfbufend, NULL)) != NULL)
|
||||||
G_AddSteamPathsApple(result);
|
G_AddSteamPaths(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
Bfree(vdfbufstart);
|
Bfree(vdfbufstart);
|
||||||
|
@ -795,6 +799,17 @@ static void G_ParseSteamKeyValuesForPaths(const char *vdf)
|
||||||
void G_AddSearchPaths(void)
|
void G_AddSearchPaths(void)
|
||||||
{
|
{
|
||||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
|
char buf[BMAX_PATH];
|
||||||
|
char *homepath = Bgethomedir();
|
||||||
|
|
||||||
|
Bsnprintf(buf, sizeof(buf), "%s/.steam/steam", homepath);
|
||||||
|
G_AddSteamPaths(buf);
|
||||||
|
|
||||||
|
Bsnprintf(buf, sizeof(buf), "%s/.steam/steam/steamapps/libraryfolders.vdf", homepath);
|
||||||
|
G_ParseSteamKeyValuesForPaths(buf);
|
||||||
|
|
||||||
|
Bfree(homepath);
|
||||||
|
|
||||||
addsearchpath("/usr/share/games/jfduke3d");
|
addsearchpath("/usr/share/games/jfduke3d");
|
||||||
addsearchpath("/usr/local/share/games/jfduke3d");
|
addsearchpath("/usr/local/share/games/jfduke3d");
|
||||||
addsearchpath("/usr/share/games/eduke32");
|
addsearchpath("/usr/share/games/eduke32");
|
||||||
|
@ -808,7 +823,7 @@ void G_AddSearchPaths(void)
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
Bsnprintf(buf, sizeof(buf), "%s/Steam", support[i]);
|
Bsnprintf(buf, sizeof(buf), "%s/Steam", support[i]);
|
||||||
G_AddSteamPathsApple(buf);
|
G_AddSteamPaths(buf);
|
||||||
|
|
||||||
Bsnprintf(buf, sizeof(buf), "%s/Steam/steamapps/libraryfolders.vdf", support[i]);
|
Bsnprintf(buf, sizeof(buf), "%s/Steam/steamapps/libraryfolders.vdf", support[i]);
|
||||||
G_ParseSteamKeyValuesForPaths(buf);
|
G_ParseSteamKeyValuesForPaths(buf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue