mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 01:11:44 +00:00
Tweak the code that adds the Steam and GOG Duke3D paths a little. This changes things so that we add the DOSBox version provided on Steam as a source for the GRP instead of their main content dir, bypassing loading their screwed up duke3d.def.
git-svn-id: https://svn.eduke32.com/eduke32@3622 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
ba1ac9d89a
commit
1f490a6fc3
1 changed files with 25 additions and 8 deletions
|
@ -217,6 +217,23 @@ void G_ExtPreInit(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
const char * G_GetSteamPath(void)
|
||||
{
|
||||
static char spath[BMAX_PATH];
|
||||
static int32_t success = -1;
|
||||
int32_t siz = BMAX_PATH;
|
||||
|
||||
if (success == -1)
|
||||
success = SHGetValueA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 225140", "InstallLocation", NULL, spath, (LPDWORD)&siz);
|
||||
|
||||
if (success == ERROR_SUCCESS)
|
||||
return spath;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
void G_AddSearchPaths(void)
|
||||
{
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
|
@ -232,19 +249,19 @@ void G_AddSearchPaths(void)
|
|||
char buf[BMAX_PATH];
|
||||
int32_t siz = BMAX_PATH, ret;
|
||||
|
||||
ret = SHGetValueA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 225140", "InstallLocation", NULL, buf, (LPDWORD)&siz);
|
||||
|
||||
if (ret == ERROR_SUCCESS)
|
||||
Bstrcat(buf, "/gameroot");
|
||||
else
|
||||
if (G_GetSteamPath())
|
||||
{
|
||||
siz = BMAX_PATH;
|
||||
ret = SHGetValueA(HKEY_LOCAL_MACHINE, "SOFTWARE\\GOG.com\\GOGDUKE3D", "PATH", NULL, buf, (LPDWORD)&siz);
|
||||
Bsprintf(buf, "%s/gameroot/classic", G_GetSteamPath());
|
||||
addsearchpath(buf);
|
||||
|
||||
Bsprintf(buf, "%s/gameroot/addons", G_GetSteamPath());
|
||||
addsearchpath(buf);
|
||||
}
|
||||
|
||||
ret = SHGetValueA(HKEY_LOCAL_MACHINE, "SOFTWARE\\GOG.com\\GOGDUKE3D", "PATH", NULL, buf, (LPDWORD)&siz);
|
||||
|
||||
if (ret == ERROR_SUCCESS)
|
||||
addsearchpath(buf);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue