From d8c7af77a36530f154136150c7914c5f213b4f44 Mon Sep 17 00:00:00 2001 From: Borja Ferrer Date: Fri, 4 May 2007 01:28:08 +0000 Subject: [PATCH] exposed the sourcepawn and JIT interfaces with pointers --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40739 --- core/sourcemod.cpp | 10 ++++++++++ core/sourcemod.h | 2 ++ public/ISourceMod.h | 14 ++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/core/sourcemod.cpp b/core/sourcemod.cpp index af31ef5d..8de6ab61 100644 --- a/core/sourcemod.cpp +++ b/core/sourcemod.cpp @@ -630,6 +630,16 @@ const char *SourceModBase::GetGameFolderName() const return m_ModDir; } +ISourcePawnEngine *SourceModBase::GetScriptingEngine() +{ + return g_pSourcePawn; +} + +IVirtualMachine *SourceModBase::GetScriptingVM() +{ + return g_pVM; +} + SMGlobalClass *SMGlobalClass::head = NULL; SMGlobalClass::SMGlobalClass() diff --git a/core/sourcemod.h b/core/sourcemod.h index 3564ef00..6f3460bf 100644 --- a/core/sourcemod.h +++ b/core/sourcemod.h @@ -95,6 +95,8 @@ public: // ISourceMod HandleType_t GetDataPackHandleType(bool readonly=false); KeyValues *ReadKeyValuesHandle(Handle_t hndl, HandleError *err=NULL, bool root=false); const char *GetGameFolderName() const; + ISourcePawnEngine *GetScriptingEngine(); + IVirtualMachine *GetScriptingVM(); private: /** * @brief Loading plugins diff --git a/public/ISourceMod.h b/public/ISourceMod.h index 1291130d..c983baf0 100644 --- a/public/ISourceMod.h +++ b/public/ISourceMod.h @@ -168,6 +168,20 @@ namespace SourceMod * @return A string containing the name of the game directory. */ virtual const char *GetGameFolderName() const =0; + + /** + * @brief Returns the scripting engine interface. + * + * @return A pointer to the scripting engine interface. + */ + virtual SourcePawn::ISourcePawnEngine *GetScriptingEngine() =0; + + /** + * @brief Returns the JIT interface. + * + * @return A pointer to the JIT interface. + */ + virtual SourcePawn::IVirtualMachine *GetScriptingVM() =0; }; }