Add autodetection support for Duke 3D as part of the Steam release of the 3D Realms Anthology.

git-svn-id: https://svn.eduke32.com/eduke32@5184 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-05-13 08:57:11 +00:00
parent 2ec4ce91b4
commit 57e3dfb721
2 changed files with 18 additions and 3 deletions

View file

@ -539,9 +539,12 @@ const char * G_GetInstallPath(int32_t insttype)
{
switch (insttype)
{
case INSTPATH_STEAM_DUKE3D:
case INSTPATH_STEAM_DUKE3D_MEGATON:
success[insttype] = SHGetValueA(HKLM32, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 225140", "InstallLocation", NULL, spath[insttype], (LPDWORD)&siz);
break;
case INSTPATH_STEAM_DUKE3D_3DR:
success[insttype] = SHGetValueA(HKLM32, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 359850", "InstallLocation", NULL, spath[insttype], (LPDWORD)&siz);
break;
case INSTPATH_GOG_DUKE3D:
success[insttype] = SHGetValueA(HKLM32, "SOFTWARE\\GOG.com\\GOGDUKE3D", "PATH", NULL, spath[insttype], (LPDWORD)&siz);
break;
@ -618,6 +621,11 @@ static void G_AddSteamPaths(const char *basepath)
Bsnprintf(buf, sizeof(buf), "%s/steamapps/common/Duke Nukem 3D/gameroot/music/vacation", basepath);
addsearchpath(buf);
#if defined EDUKE32_OSX
Bsnprintf(buf, sizeof(buf), "%s/steamapps/common/Duke Nukem 3D/Duke Nukem 3D.app/drive_c/Program Files/Duke Nukem 3D", basepath);
addsearchpath_user(buf, SEARCHPATH_REMOVE);
#endif
#if defined EDUKE32_OSX
Bsnprintf(buf, sizeof(buf), "%s/steamapps/common/Nam/Nam.app/Contents/Resources/Nam.boxer/C.harddisk/NAM", basepath);
#else
@ -847,7 +855,7 @@ void G_AddSearchPaths(void)
char buf[BMAX_PATH];
const char* instpath;
if ((instpath = G_GetInstallPath(INSTPATH_STEAM_DUKE3D)))
if ((instpath = G_GetInstallPath(INSTPATH_STEAM_DUKE3D_MEGATON)))
{
Bsnprintf(buf, sizeof(buf), "%s/gameroot", instpath);
addsearchpath_user(buf, SEARCHPATH_REMOVE);
@ -871,6 +879,12 @@ void G_AddSearchPaths(void)
addsearchpath(buf);
}
if ((instpath = G_GetInstallPath(INSTPATH_STEAM_DUKE3D_3DR)))
{
Bsnprintf(buf, sizeof(buf), "%s/Duke Nukem 3D", instpath);
addsearchpath_user(buf, SEARCHPATH_REMOVE);
}
if ((instpath = G_GetInstallPath(INSTPATH_GOG_DUKE3D)))
addsearchpath_user(instpath, SEARCHPATH_REMOVE);

View file

@ -48,7 +48,8 @@ enum Games_t {
};
enum instpath_t {
INSTPATH_STEAM_DUKE3D,
INSTPATH_STEAM_DUKE3D_MEGATON,
INSTPATH_STEAM_DUKE3D_3DR,
INSTPATH_GOG_DUKE3D,
INSTPATH_3DR_DUKE3D,
INSTPATH_3DR_ANTH,