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

Add support for Insurgency (bug 5950, r=asherkin).

This commit is contained in:
Nicholas Hastings 2013-10-09 09:00:23 -04:00
parent c8a3fd5959
commit d4ffbd8710
7 changed files with 24 additions and 9 deletions

View File

@ -51,10 +51,10 @@ class MMS:
self.possibleSdks['eye'] = {'sdk': 'HL2SDK-EYE', 'ext': '2.eye', 'def': '5',
'name': 'EYE', 'platform': ['windows'],
'dir': 'hl2sdk-eye'}
self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '17',
self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '18',
'name': 'CSGO', 'platform': ['windows', 'linux', 'darwin'],
'dir': 'hl2sdk-csgo'}
self.possibleSdks['dota'] = {'sdk': 'HL2SDKDOTA', 'ext': '2.dota', 'def': '18',
self.possibleSdks['dota'] = {'sdk': 'HL2SDKDOTA', 'ext': '2.dota', 'def': '19',
'name': 'DOTA', 'platform': ['windows'],
'dir': 'hl2sdk-dota'}
self.possibleSdks['portal2'] = {'sdk': 'HL2SDKPORTAL2','ext': '2.portal2', 'def': '15',
@ -63,6 +63,9 @@ class MMS:
self.possibleSdks['blade'] = {'sdk': 'HL2SDKBLADE', 'ext': '2.blade', 'def': '16',
'name': 'BLADE', 'platform': ['windows', 'linux'],
'dir': 'hl2sdk-blade'}
self.possibleSdks['insurgency'] = {'sdk': 'HL2SDKINSURGENCY', 'ext': '2.insurgency', 'def': '17',
'name': 'INSURGENCY', 'platform': ['windows', 'linux', 'darwin'],
'dir': 'hl2sdk-insurgency'}
self.sdkInfo = { }
@ -280,9 +283,9 @@ class MMS:
libs = []
if sdk in ['css', 'hl2dm', 'dods', 'tf2', 'l4d2']:
libs = ['tier1_i486.a', 'libvstdlib_srv.so', 'libtier0_srv.so']
elif sdk in ['l4d', 'nd', 'blade', 'csgo']:
elif sdk in ['l4d', 'nd', 'blade', 'insurgency', 'csgo']:
libs = ['tier1_i486.a', 'libvstdlib.so', 'libtier0.so']
if sdk in ['blade', 'csgo']:
if sdk in ['blade', 'insurgency', 'csgo']:
libs.insert(0, 'interfaces_i486.a')
elif sdk == 'sdk2013':
libs = ['tier1.a', 'libvstdlib_srv.so', 'libtier0_srv.so']
@ -304,7 +307,7 @@ class MMS:
staticLibs = os.path.join(sdkPath, 'lib', 'mac')
libs = ['tier1_i486.a', 'libvstdlib.dylib', 'libtier0.dylib']
workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
if sdk == 'csgo':
if sdk in ['insurgency', 'csgo']:
libs.append('interfaces_i486.a')
for lib in libs:
link = os.path.join(workFolder, lib)
@ -315,7 +318,7 @@ class MMS:
job.AddCommand(SymlinkCommand(link, target))
elif AMBuild.target['platform'] == 'windows':
libs = ['tier0', 'tier1', 'vstdlib']
if sdk in ['swarm', 'blade', 'csgo', 'dota']:
if sdk in ['swarm', 'blade', 'insurgency', 'csgo', 'dota']:
libs.append('interfaces')
for lib in libs:
libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'
@ -329,7 +332,7 @@ class MMS:
else:
builder.AddObjectFiles(['tier1_i486.a'])
if( sdk in ['blade', 'csgo', 'dota'] ):
if( sdk in ['blade', 'insurgency', 'csgo', 'dota'] ):
builder.AddObjectFiles(['interfaces_i486.a'])
def DefaultHL2Compiler(self, path, sdk, noLink = False):
@ -364,7 +367,7 @@ class MMS:
compiler['CDEFINES'].remove('_snprintf=snprintf')
compiler['CDEFINES'].remove('_vsnprintf=vsnprintf')
if sdk in ['swarm', 'blade', 'csgo', 'dota']:
if sdk in ['swarm', 'blade', 'insurgency', 'csgo', 'dota']:
if AMBuild.target['platform'] == 'windows':
compiler['CDEFINES'].extend(['COMPILER_MSVC', 'COMPILER_MSVC32'])
else:
@ -397,7 +400,7 @@ class MMS:
if sdk in ['css', 'hl2dm', 'dods', 'tf2', 'sdk2013', 'l4d2']:
compiler['POSTLINKFLAGS'][0:0] = ['libtier0_srv.so']
compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib_srv.so']
elif sdk in ['l4d', 'nd', 'blade', 'csgo']:
elif sdk in ['l4d', 'nd', 'blade', 'insurgency', 'csgo']:
compiler['POSTLINKFLAGS'][0:0] = ['libtier0.so']
compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.so']
else:

View File

@ -63,6 +63,7 @@ enum
#define SOURCE_ENGINE_NUCLEARDAWN 18 /**< Nuclear Dawn */
#define SOURCE_ENGINE_SDK2013 19 /**< Source SDK 2013 */
#define SOURCE_ENGINE_BLADE 20 /**< Blade Symphony */
#define SOURCE_ENGINE_INSURGENCY 21 /**< Insurgency */
#define METAMOD_PLAPI_VERSION 15 /**< Version of this header file */
#define METAMOD_PLAPI_NAME "ISmmPlugin" /**< Name of the plugin interface */

View File

@ -141,6 +141,8 @@ bool Command_Meta(IMetamodSourceCommandInfo *info)
CONMSG(" Engine: Portal 2 (2011)\n");
#elif SOURCE_ENGINE == SE_BLADE
CONMSG(" Engine: Blade Symphony (2013)\n");
#elif SOURCE_ENGINE == SE_INSURGENCY
CONMSG(" Engine: Insurgency (2013)\n");
#elif SOURCE_ENGINE == SE_CSGO
CONMSG(" Engine: Counter-Strike: Global Offensive (2012)\n");
#elif SOURCE_ENGINE == SE_DOTA

View File

@ -401,6 +401,8 @@ int BaseProvider::DetermineSourceEngine(const char *game)
return SOURCE_ENGINE_PORTAL2;
#elif SOURCE_ENGINE == SE_BLADE
return SOURCE_ENGINE_BLADE;
#elif SOURCE_ENGINE == SE_INSURGENCY
return SOURCE_ENGINE_INSURGENCY;
#elif SOURCE_ENGINE == SE_CSGO
return SOURCE_ENGINE_CSGO;
#elif SOURCE_ENGINE == SE_DOTA

View File

@ -87,6 +87,7 @@ static const char *backend_names[] =
"2.nd",
"2.sdk2013",
"2.blade",
"2.insurgency",
};
#if defined _WIN32
@ -276,6 +277,10 @@ mm_DetermineBackend(QueryValveInterface engineFactory, const char *game_name)
}
else if (engineFactory("VEngineServer023", NULL) != NULL)
{
if (strcmp(game_name, "insurgency") == 0)
{
return MMBackend_Insurgency;
}
return MMBackend_CSGO;
}
else if (engineFactory("VEngineServer022", NULL) != NULL &&

View File

@ -99,6 +99,7 @@ enum MetamodBackend
MMBackend_NuclearDawn,
MMBackend_SDK2013,
MMBackend_Blade,
MMBackend_Insurgency,
MMBackend_UNKNOWN
};

View File

@ -137,6 +137,7 @@ public:
if (mm_backend != MMBackend_AlienSwarm
&& mm_backend != MMBackend_Portal2
&& mm_backend != MMBackend_Blade
&& mm_backend != MMBackend_Insurgency
&& mm_backend != MMBackend_CSGO
&& mm_backend != MMBackend_DOTA)
{