From 95f20333416dfd12eeebe7c779db9b0bae7afb8c Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Thu, 9 Jul 2015 16:30:13 -0500 Subject: [PATCH] Support loading Source 2 game DLL from different paths based on OS and arch. --- loader/gamedll.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/loader/gamedll.cpp b/loader/gamedll.cpp index e04a669..1216b68 100644 --- a/loader/gamedll.cpp +++ b/loader/gamedll.cpp @@ -58,10 +58,25 @@ static bool g_is_source2 = false; #if defined _WIN32 #define SERVER_NAME "server.dll" +#if defined _WIN64 +#define PLATFORM_NAME "win64" +#else +#define PLATFORM_NAME "win32" +#endif #elif defined __APPLE__ #define SERVER_NAME "server.dylib" +#if defined __amd64__ +#define PLATFORM_NAME "osx64" +#else +#define PLATFORM_NAME "osx32" +#endif #elif defined __linux__ #define SERVER_NAME "server" LIB_SUFFIX +#if defined __amd64__ +#define PLATFORM_NAME "linuxsteamrt64" +#else +#define PLATFORM_NAME "linuxsteamrt32" +#endif #endif static bool @@ -146,7 +161,7 @@ mm_DetectGameInformation() } char *pRelPath = is_source2 ? "../../" : ""; - char *pOSDir = is_source2 ? "win32/" : ""; + char *pOSDir = is_source2 ? PLATFORM_NAME "/" : ""; if (stricmp(key, "GameBin") == 0) mm_PathFormat(temp_path, sizeof(temp_path), "%s/%s%s/%s" SERVER_NAME, lptr, pRelPath, ptr, pOSDir); else if (!ptr[0])