Adding vscript implementation

This commit is contained in:
James Mitchell
2020-05-15 19:17:08 +10:00
parent d840c57b4a
commit 9223601321
156 changed files with 27754 additions and 0 deletions

View File

@@ -969,6 +969,11 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
if ( !CommandLine()->CheckParm( "-noscripting") )
{
scriptmanager = (IScriptManager *)appSystemFactory( VSCRIPT_INTERFACE_VERSION, NULL );
if (scriptmanager == nullptr)
{
scriptmanager = (IScriptManager*)Sys_GetFactoryThis()(VSCRIPT_INTERFACE_VERSION, NULL);
}
}
#ifdef WORKSHOP_IMPORT_ENABLED

View File

@@ -11,6 +11,8 @@ $Configuration
$PreprocessorDefinitions "$BASE;ASW_PROJECTED_TEXTURES;DYNAMIC_RTT_SHADOWS"
$PreprocessorDefinitions "$BASE;MAPBASE_RPC;DISCORD_RPC;STEAM_RPC" [$MAPBASE_RPC]
$PreprocessorDefinitions "$BASE;MAPBASE_VSCRIPT" [$MAPBASE_VSCRIPT]
}
}
@@ -51,4 +53,9 @@ $Project
}
}
}
$Folder "Link Libraries"
{
$Lib "vscript" [$MAPBASE_VSCRIPT]
}
}

View File

@@ -634,6 +634,11 @@ bool CServerGameDLL::DLLInit( CreateInterfaceFn appSystemFactory,
if (!CommandLine()->CheckParm("-noscripting"))
{
scriptmanager = (IScriptManager*)appSystemFactory(VSCRIPT_INTERFACE_VERSION, NULL);
if (scriptmanager == nullptr)
{
scriptmanager = (IScriptManager*)Sys_GetFactoryThis()(VSCRIPT_INTERFACE_VERSION, NULL);
}
}
// If not running dedicated, grab the engine vgui interface

View File

@@ -9,6 +9,8 @@ $Configuration
$Compiler
{
$PreprocessorDefinitions "$BASE;ASW_PROJECTED_TEXTURES;DYNAMIC_RTT_SHADOWS"
$PreprocessorDefinitions "$BASE;MAPBASE_VSCRIPT" [$MAPBASE_VSCRIPT]
}
}
@@ -81,4 +83,9 @@ $Project
}
}
}
$Folder "Link Libraries"
{
$Lib "vscript" [$MAPBASE_VSCRIPT]
}
}

View File

@@ -31,6 +31,12 @@ extern ScriptClassDesc_t * GetScriptDesc( CBaseEntity * );
#endif // VMPROFILE
#ifdef MAPBASE_VSCRIPT
// This is to ensure a dependency exists between the vscript library and the game DLLs
extern int vscript_token;
int vscript_token_hack = vscript_token;
#endif
HSCRIPT VScriptCompileScript( const char *pszScriptName, bool bWarnMissing )