1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-02-26 19:54:14 +01:00

Add support for hl2sdk-mock.

This commit is contained in:
David Anderson 2021-09-20 21:05:21 -07:00
parent 4bdc2182b6
commit cf8547cfa5
6 changed files with 26 additions and 4 deletions

View File

@ -37,6 +37,11 @@ Source2 = {
'windows': ['x86', 'x86_64'],
'linux': ['x86_64'],
}
Mock = {
'windows': ['x86', 'x86_64'],
'linux': ['x86', 'x86_64'],
'mac': ['x86_64']
}
PossibleSDKs = {
'episode1': SDK('HL2SDK', '2.ep1', '1', 'EPISODEONE', WinLinux, 'episode1'),
@ -61,6 +66,7 @@ PossibleSDKs = {
'doi': SDK('HL2SDKDOI', '2.doi', '20', 'DOI', WinLinuxMac, 'doi'),
'contagion': SDK('HL2SDKCONTAGION', '2.contagion', '14', 'CONTAGION', WinOnly, 'contagion'),
'bms': SDK('HL2SDKBMS', '2.bms', '10', 'BMS', WinLinux, 'bms'),
'mock': SDK('HL2SDK-MOCK', '2.mock', '999', 'MOCK', Mock, 'mock'),
}
def ResolveEnvPath(env, folder):
@ -434,10 +440,13 @@ class MMSConfig(object):
lib_folder = os.path.join(sdk.path, 'lib', 'mac')
if compiler.target.platform in ['linux', 'mac']:
if sdk.name in ['sdk2013', 'bms'] or compiler.target.arch == 'x86_64':
compiler.postlink += [os.path.join(lib_folder, 'tier1.a')]
if sdk.name in ['sdk2013', 'bms', 'mock'] or compiler.target.arch == 'x86_64':
tier1 = os.path.join(lib_folder, 'tier1.a')
else:
compiler.postlink += [os.path.join(lib_folder, 'tier1_i486.a')]
tier1 = os.path.join(lib_folder, 'tier1_i486.a')
if sdk.name == 'mock' and compiler.target.platform == 'linux':
compiler.linkflags += ['-Wl,-z,origin']
compiler.postlink += [tier1]
if sdk.name in ['blade', 'insurgency', 'doi', 'csgo', 'dota']:
if compiler.target.arch == 'x86_64':
@ -456,7 +465,7 @@ class MMSConfig(object):
compiler.linkflags[0:0] = ['-lm']
if sdk.name in ['css', 'hl2dm', 'dods', 'tf2', 'sdk2013', 'bms', 'nucleardawn', 'l4d2', 'insurgency', 'doi']:
dynamic_libs = ['libtier0_srv.so', 'libvstdlib_srv.so']
elif compiler.target.arch == 'x86_64' and sdk.name in ['csgo', 'blade']:
elif compiler.target.arch == 'x86_64' and sdk.name in ['csgo', 'blade', 'mock']:
dynamic_libs = ['libtier0_client.so', 'libvstdlib_client.so']
elif sdk.name in ['l4d', 'blade', 'insurgency', 'doi', 'csgo', 'dota']:
dynamic_libs = ['libtier0.so', 'libvstdlib.so']

View File

@ -60,6 +60,7 @@
#define SOURCE_ENGINE_CONTAGION 22 /**< Contagion */
#define SOURCE_ENGINE_BMS 23 /**< Black Mesa Multiplayer */
#define SOURCE_ENGINE_DOI 24 /**< Day of Infamy */
#define SOURCE_ENGINE_MOCK 999 /**< Mock source engine */
#define METAMOD_PLAPI_VERSION 16 /**< Version of this header file */
#define METAMOD_PLAPI_NAME "ISmmPlugin" /**< Name of the plugin interface */

View File

@ -540,6 +540,8 @@ int BaseProvider::DetermineSourceEngine()
return SOURCE_ENGINE_BMS;
#elif SOURCE_ENGINE == SE_EPISODEONE
return g_bOriginalEngine ? SOURCE_ENGINE_ORIGINAL : SOURCE_ENGINE_EPISODEONE;
#elif SOURCE_ENGINE == SE_MOCK
return SOURCE_ENGINE_MOCK;
#else
#error "SOURCE_ENGINE not defined to a known value"
#endif
@ -671,6 +673,8 @@ const char *BaseProvider::GetEngineDescription() const
{
return "Episode 1 (2004)";
}
#elif SOURCE_ENGINE == SE_MOCK
return "Mock";
#else
#error "SOURCE_ENGINE not defined to a known value"
#endif

View File

@ -91,6 +91,7 @@ static const char *backend_names[] =
"2.contagion",
"2.bms",
"2.doi",
"2.mock",
};
#if defined _WIN32
@ -425,6 +426,10 @@ mm_DetermineBackend(QueryValveInterface engineFactory, QueryValveInterface serve
{
return MMBackend_HL2DM;
}
else if (strcmp(game_name, ".") == 0 && engineFactory("MOCK_ENGINE", NULL))
{
return MMBackend_Mock;
}
else
{
return MMBackend_SDK2013;

View File

@ -104,6 +104,7 @@ enum MetamodBackend
MMBackend_BMS,
MMBackend_DOI,
MMBackend_Mock,
MMBackend_UNKNOWN
};

View File

@ -91,6 +91,8 @@ public:
mm_GetGameName(game_name, sizeof(game_name));
mm_backend = mm_DetermineBackend(engineFactory, gsFactory, game_name);
if (mm_backend == MMBackend_Mock)
strcpy(game_name, "mock");
}
if (mm_backend == MMBackend_UNKNOWN)