From 2fdd0625f580f8a254e7f0a55f95046ec1fcb891 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Wed, 6 May 2015 17:51:54 -0400 Subject: [PATCH] Update MM:S to support Black Mesa. Uses new bms branch in our hl2sdk repo. --- AMBuildScript | 23 ++++++++++++----------- core/ISmmPluginExt.h | 1 + core/metamod_console.cpp | 2 ++ core/provider/provider_ep2.cpp | 2 ++ loader/loader.cpp | 6 ++++++ loader/loader.h | 1 + 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/AMBuildScript b/AMBuildScript index 08880be..5fcb26c 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -23,20 +23,21 @@ PossibleSDKs = { 'hl2dm': SDK('HL2SDKHL2DM', '2.hl2dm', '7', 'HL2DM', WinLinuxMac, 'hl2dm'), 'dods': SDK('HL2SDKDODS', '2.dods', '8', 'DODS', WinLinuxMac, 'dods'), 'sdk2013': SDK('HL2SDK2013', '2.sdk2013', '9', 'SDK2013', WinLinuxMac, 'sdk2013'), - 'tf2': SDK('HL2SDKTF2', '2.tf2', '10', 'TF2', WinLinuxMac, 'tf2'), - 'l4d': SDK('HL2SDKL4D', '2.l4d', '11', 'LEFT4DEAD', WinLinuxMac, 'l4d'), - 'nucleardawn': SDK('HL2SDKND', '2.nd', '12', 'NUCLEARDAWN', WinLinuxMac, 'nucleardawn'), - 'l4d2': SDK('HL2SDKL4D2', '2.l4d2', '14', 'LEFT4DEAD2', WinLinuxMac, 'l4d2'), + 'tf2': SDK('HL2SDKTF2', '2.tf2', '11', 'TF2', WinLinuxMac, 'tf2'), + 'l4d': SDK('HL2SDKL4D', '2.l4d', '12', 'LEFT4DEAD', WinLinuxMac, 'l4d'), + 'nucleardawn': SDK('HL2SDKND', '2.nd', '13', 'NUCLEARDAWN', WinLinuxMac, 'nucleardawn'), + 'l4d2': SDK('HL2SDKL4D2', '2.l4d2', '15', 'LEFT4DEAD2', WinLinuxMac, 'l4d2'), 'darkm': SDK('HL2SDK-DARKM', '2.darkm', '2', 'DARKMESSIAH', WinOnly, 'darkm'), - 'swarm': SDK('HL2SDK-SWARM', '2.swarm', '15', 'ALIENSWARM', WinOnly, 'swarm'), + 'swarm': SDK('HL2SDK-SWARM', '2.swarm', '16', 'ALIENSWARM', WinOnly, 'swarm'), 'bgt': SDK('HL2SDK-BGT', '2.bgt', '4', 'BLOODYGOODTIME', WinOnly, 'bgt'), 'eye': SDK('HL2SDK-EYE', '2.eye', '5', 'EYE', WinOnly, 'eye'), - 'csgo': SDK('HL2SDKCSGO', '2.csgo', '19', 'CSGO', WinLinuxMac, 'csgo'), - 'dota': SDK('HL2SDKDOTA', '2.dota', '20', 'DOTA', WinLinuxMac, 'dota'), - 'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '16', 'PORTAL2', [], 'portal2'), - 'blade': SDK('HL2SDKBLADE', '2.blade', '17', 'BLADE', WinLinux, 'blade'), - 'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '18', 'INSURGENCY', WinLinuxMac, 'insurgency'), - 'contagion': SDK('HL2SDKCONTAGION', '2.contagion', '13', 'CONTAGION', WinOnly, 'contagion'), + 'csgo': SDK('HL2SDKCSGO', '2.csgo', '20', 'CSGO', WinLinuxMac, 'csgo'), + 'dota': SDK('HL2SDKDOTA', '2.dota', '21', 'DOTA', WinLinuxMac, 'dota'), + 'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '17', 'PORTAL2', [], 'portal2'), + 'blade': SDK('HL2SDKBLADE', '2.blade', '18', 'BLADE', WinLinux, 'blade'), + 'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '19', 'INSURGENCY', WinLinuxMac, 'insurgency'), + 'contagion': SDK('HL2SDKCONTAGION', '2.contagion', '14', 'CONTAGION', WinOnly, 'contagion'), + 'bms': SDK('HL2SDKBMS', '2.bms', '10', 'BMS', WinLinux, 'bms'), } def ResolveEnvPath(env, folder): diff --git a/core/ISmmPluginExt.h b/core/ISmmPluginExt.h index 5e24284..4f245a5 100644 --- a/core/ISmmPluginExt.h +++ b/core/ISmmPluginExt.h @@ -58,6 +58,7 @@ #define SOURCE_ENGINE_BLADE 20 /**< Blade Symphony */ #define SOURCE_ENGINE_INSURGENCY 21 /**< Insurgency */ #define SOURCE_ENGINE_CONTAGION 22 /**< Contagion */ +#define SOURCE_ENGINE_BMS 23 /**< Black Mesa Multiplayer */ #define METAMOD_PLAPI_VERSION 15 /**< Version of this header file */ #define METAMOD_PLAPI_NAME "ISmmPlugin" /**< Name of the plugin interface */ diff --git a/core/metamod_console.cpp b/core/metamod_console.cpp index 4f42e83..28cea80 100644 --- a/core/metamod_console.cpp +++ b/core/metamod_console.cpp @@ -137,6 +137,8 @@ bool Command_Meta(IMetamodSourceCommandInfo *info) CONMSG(" Engine: Day of Defeat: Source (Valve Orange Box)\n"); #elif SOURCE_ENGINE == SE_SDK2013 CONMSG(" Engine: Source SDK 2013 (2013)\n"); +#elif SOURCE_ENGINE == SE_BMS + CONMSG(" Engine: Black Mesa (2015)\n"); #elif SOURCE_ENGINE == SE_TF2 CONMSG(" Engine: Team Fortress 2 (Valve Orange Box)\n"); #elif SOURCE_ENGINE == SE_DARKMESSIAH diff --git a/core/provider/provider_ep2.cpp b/core/provider/provider_ep2.cpp index 7474676..b5c2c2c 100644 --- a/core/provider/provider_ep2.cpp +++ b/core/provider/provider_ep2.cpp @@ -414,6 +414,8 @@ int BaseProvider::DetermineSourceEngine() return SOURCE_ENGINE_CSGO; #elif SOURCE_ENGINE == SE_DOTA return SOURCE_ENGINE_DOTA; +#elif SOURCE_ENGINE == SE_BMS + return SOURCE_ENGINE_BMS; #else #error "SOURCE_ENGINE not defined to a known value" #endif diff --git a/loader/loader.cpp b/loader/loader.cpp index 5cfa396..f2a696b 100644 --- a/loader/loader.cpp +++ b/loader/loader.cpp @@ -89,6 +89,7 @@ static const char *backend_names[] = "2.blade", "2.insurgency", "2.contagion", + "2.bms", }; #if defined _WIN32 @@ -379,6 +380,11 @@ mm_DetermineBackend(QueryValveInterface engineFactory, QueryValveInterface serve { return MMBackend_HL2DM; } + else if (strcmp(game_name, "bms") == 0 + || (addr = mm_FindPattern(lib, "DT_BlackMesaPlayer", sizeof("DT_BlackMesaPlayer") - 1))) + { + return MMBackend_BMS; + } else { return MMBackend_SDK2013; diff --git a/loader/loader.h b/loader/loader.h index a96c88c..9c11681 100644 --- a/loader/loader.h +++ b/loader/loader.h @@ -101,6 +101,7 @@ enum MetamodBackend MMBackend_Blade, MMBackend_Insurgency, MMBackend_Contagion, + MMBackend_BMS, MMBackend_UNKNOWN };