From 57e3dfb72185b0101b529c2ce0162017432f97e1 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 13 May 2015 08:57:11 +0000 Subject: [PATCH] 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 --- polymer/eduke32/source/common.c | 18 ++++++++++++++++-- polymer/eduke32/source/common_game.h | 3 ++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/source/common.c b/polymer/eduke32/source/common.c index d0449628d..e639df883 100644 --- a/polymer/eduke32/source/common.c +++ b/polymer/eduke32/source/common.c @@ -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); diff --git a/polymer/eduke32/source/common_game.h b/polymer/eduke32/source/common_game.h index 7f07d5776..4e9077528 100644 --- a/polymer/eduke32/source/common_game.h +++ b/polymer/eduke32/source/common_game.h @@ -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,