Added engine support for Blade Symphony (bug 5949, r=asherkin).

This commit is contained in:
Nicholas Hastings 2013-10-13 14:15:29 -04:00
parent 3e15966c3e
commit 5e1d207eae
5 changed files with 24 additions and 8 deletions

View File

@ -74,15 +74,18 @@ class SM:
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': '16',
self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '17',
'name': 'CSGO', 'platform': ['windows', 'linux', 'darwin'],
'dir': 'hl2sdk-csgo'}
self.possibleSdks['dota'] = {'sdk': 'HL2SDKDOTA', 'ext': '2.dota', 'def': '17',
self.possibleSdks['dota'] = {'sdk': 'HL2SDKDOTA', 'ext': '2.dota', 'def': '18',
'name': 'DOTA', 'platform': ['windows'],
'dir': 'hl2sdk-dota'}
self.possibleSdks['portal2'] = {'sdk': 'HL2SDKPORTAL2','ext': '2.portal2', 'def': '15',
'name': 'PORTAL2', 'platform': [],
'dir': 'hl2sdk-portal2'}
self.possibleSdks['blade'] = {'sdk': 'HL2SDKBLADE', 'ext': '2.blade', 'def': '16',
'name': 'BLADE', 'platform': ['windows', 'linux'],
'dir': 'hl2sdk-blade'}
self.sdkInfo = { }
@ -333,9 +336,9 @@ class SM:
libs = []
if sdk in ['css', 'hl2dm', 'dods', 'tf2', 'l4d2']:
libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib_srv.so', 'libtier0_srv.so']
elif sdk in ['l4d', 'nd', 'csgo']:
elif sdk in ['l4d', 'nd', 'blade', 'csgo']:
libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.so', 'libtier0.so']
if sdk == 'csgo':
if sdk in ['blade', 'csgo']:
libs.append('interfaces_i486.a')
elif sdk == 'sdk2013':
libs = ['tier1.a', 'mathlib.a', 'libvstdlib_srv.so', 'libtier0_srv.so']
@ -368,7 +371,7 @@ class SM:
job.AddCommand(SymlinkCommand(link, target))
elif AMBuild.target['platform'] == 'windows':
libs = ['tier0', 'tier1', 'vstdlib', 'mathlib']
if sdk in ['swarm', 'csgo', 'dota']:
if sdk in ['swarm', 'blade', 'csgo', 'dota']:
libs.append('interfaces')
for lib in libs:
libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'
@ -382,7 +385,7 @@ class SM:
else:
builder.AddObjectFiles(['tier1_i486.a', 'mathlib_i486.a'])
if sdk == 'csgo':
if sdk in ['blade', 'csgo']:
builder.AddObjectFiles(['interfaces_i486.a'])
def DefaultHL2Compiler(self, path, sdk, noLink = False, oldMms = '-legacy'):
@ -421,7 +424,7 @@ class SM:
compiler['CDEFINES'].remove('_snprintf=snprintf')
compiler['CDEFINES'].remove('_vsnprintf=vsnprintf')
if sdk in ['swarm','csgo','dota']:
if sdk in ['swarm', 'blade', 'csgo', 'dota']:
if AMBuild.target['platform'] == 'windows':
compiler['CDEFINES'].extend(['COMPILER_MSVC', 'COMPILER_MSVC32'])
else:
@ -456,7 +459,7 @@ class SM:
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', 'csgo']:
elif sdk in ['l4d', 'nd', 'blade', 'csgo']:
compiler['POSTLINKFLAGS'][0:0] = ['libtier0.so']
compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.so']
else:

View File

@ -233,6 +233,8 @@ static const char *get_source_engine_name()
return "alienswarm";
#elif SOURCE_ENGINE == SE_PORTAL2
return "portal2";
#elif SOURCE_ENGINE == SE_BLADE
return "blade";
#elif SOURCE_ENGINE == SE_CSGO
return "csgo";
#elif SOURCE_ENGINE == SE_DOTA
@ -250,6 +252,7 @@ static bool symbols_are_hidden()
|| (SOURCE_ENGINE == SE_LEFT4DEAD) \
|| (SOURCE_ENGINE == SE_NUCLEARDAWN) \
|| (SOURCE_ENGINE == SE_LEFT4DEAD2) \
|| (SOURCE_ENGINE == SE_BLADE) \
|| (SOURCE_ENGINE == SE_CSGO) \
|| (SOURCE_ENGINE == SE_DOTA)
return true;
@ -364,6 +367,8 @@ void do_global_plugin_loads()
#define GAMEFIX "2.darkm"
#elif SOURCE_ENGINE == SE_PORTAL2
#define GAMEFIX "2.portal2"
#elif SOURCE_ENGINE == SE_BLADE
#define GAMEFIX "2.blade"
#elif SOURCE_ENGINE == SE_CSGO
#define GAMEFIX "2.csgo"
#elif SOURCE_ENGINE == SE_DOTA

View File

@ -137,6 +137,7 @@ static cell_t PrepSDKCall_SetSignature(IPluginContext *pContext, const cell_t *p
|| SOURCE_ENGINE == SE_LEFT4DEAD \
|| SOURCE_ENGINE == SE_LEFT4DEAD2 \
|| SOURCE_ENGINE == SE_NUCLEARDAWN \
|| SOURCE_ENGINE == SE_BLADE \
|| SOURCE_ENGINE == SE_CSGO
s_call_addr = memutils->ResolveSymbol(handle, &sig[1]);
#else

View File

@ -84,6 +84,7 @@
#define FILENAME_1_6_TF2 "sourcemod.2.tf2" PLATFORM_EXT
#define FILENAME_1_6_ND "sourcemod.2.nd" PLATFORM_EXT
#define FILENAME_1_6_DOTA "sourcemod.2.dota" PLATFORM_EXT
#define FILENAME_1_6_BLADE "sourcemod.2.blade" PLATFORM_EXT
HINSTANCE g_hCore = NULL;
bool load_attempted = false;
@ -334,6 +335,11 @@ DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, co
filename = FILENAME_1_6_DOTA;
break;
}
case SOURCE_ENGINE_BLADE:
{
filename = FILENAME_1_6_BLADE;
break;
}
default:
{
return NULL;

View File

@ -85,6 +85,7 @@ enum EngineVersion
Engine_TF2, /**< Team Fortress 2 */
Engine_NuclearDawn, /**< Nuclear Dawn */
Engine_SDK2013, /**< Source SDK 2013 */
Engine_Blade, /**< Blade Symphony */
};
#define INVALID_ENT_REFERENCE 0xFFFFFFFF