extensions/bintools/sdk/smsdk_ext.cpp
changeset 943 a4fa40b1a151
parent 757 b799caa9a190
child 1226 478550a4d5ec
     1.1 --- a/extensions/bintools/sdk/smsdk_ext.cpp	Sat Jun 16 01:34:41 2007 +0000
     1.2 +++ b/extensions/bintools/sdk/smsdk_ext.cpp	Sat Jun 16 01:35:13 2007 +0000
     1.3 @@ -25,11 +25,29 @@
     1.4   * @brief Contains wrappers for making Extensions easier to write.
     1.5   */
     1.6  
     1.7 +IExtension *myself = NULL;				/**< Ourself */
     1.8  IShareSys *g_pShareSys = NULL;			/**< Share system */
     1.9 -IExtension *myself = NULL;				/**< Ourself */
    1.10 +IShareSys *sharesys = NULL;				/**< Share system */
    1.11 +ISourceMod *g_pSM = NULL;				/**< SourceMod helpers */
    1.12 +ISourceMod *smutils = NULL;				/**< SourceMod helpers */
    1.13 +
    1.14 +#if defined SMEXT_ENABLE_FORWARDSYS
    1.15 +IForwardManager *g_pForwards = NULL;	/**< Forward system */
    1.16 +IForwardManager *forwards = NULL;		/**< Forward system */
    1.17 +#endif
    1.18 +#if defined SMEXT_ENABLE_HANDLESYS
    1.19  IHandleSys *g_pHandleSys = NULL;		/**< Handle system */
    1.20 -ISourceMod *g_pSM = NULL;				/**< SourceMod helpers */
    1.21 -IForwardManager *g_pForwards = NULL;	/**< Forward system */
    1.22 +IHandleSys *handlesys = NULL;			/**< Handle system */
    1.23 +#endif
    1.24 +#if defined SMEXT_ENABLE_PLAYERHELPERS
    1.25 +IPlayerManager *playerhelpers = NULL;	/**< Player helpers */
    1.26 +#endif //SMEXT_ENABLE_PLAYERHELPERS
    1.27 +#if defined SMEXT_ENABLE_DBMANAGER
    1.28 +IDBManager *dbi = NULL;					/**< DB Manager */
    1.29 +#endif //SMEXT_ENABLE_DBMANAGER
    1.30 +#if defined SMEXT_ENABLE_GAMECONF
    1.31 +IGameConfigManager *gameconfs = NULL;	/**< Game config manager */
    1.32 +#endif //SMEXT_ENABLE_DBMANAGER
    1.33  
    1.34  /** Exports the main interface */
    1.35  PLATFORM_EXTERN_C IExtensionInterface *GetSMExtAPI()
    1.36 @@ -48,7 +66,7 @@
    1.37  
    1.38  bool SDKExtension::OnExtensionLoad(IExtension *me, IShareSys *sys, char *error, size_t maxlength, bool late)
    1.39  {
    1.40 -	g_pShareSys = sys;
    1.41 +	g_pShareSys = sharesys = sys;
    1.42  	myself = me;
    1.43  
    1.44  #if defined SMEXT_CONF_METAMOD
    1.45 @@ -63,10 +81,25 @@
    1.46  		return false;
    1.47  	}
    1.48  #endif
    1.49 -
    1.50 +	SM_GET_IFACE(SOURCEMOD, g_pSM);
    1.51 +	smutils = g_pSM;
    1.52 +#if defined SMEXT_ENABLE_HANDLESYS
    1.53  	SM_GET_IFACE(HANDLESYSTEM, g_pHandleSys);
    1.54 -	SM_GET_IFACE(SOURCEMOD, g_pSM);
    1.55 +	handlesys = g_pHandleSys;
    1.56 +#endif
    1.57 +#if defined SMEXT_ENABLE_FORWARDSYS
    1.58  	SM_GET_IFACE(FORWARDMANAGER, g_pForwards);
    1.59 +	forwards = g_pForwards;
    1.60 +#endif
    1.61 +#if defined SMEXT_ENABLE_PLAYERHELPERS
    1.62 +	SM_GET_IFACE(PLAYERMANAGER, playerhelpers);
    1.63 +#endif
    1.64 +#if defined SMEXT_ENABLE_DBMANAGER
    1.65 +	SM_GET_IFACE(DBI, dbi);
    1.66 +#endif
    1.67 +#if defined SMEXT_ENABLE_GAMECONF
    1.68 +	SM_GET_IFACE(GAMECONFIG, gameconfs);
    1.69 +#endif
    1.70  
    1.71  	if (SDK_OnLoad(error, maxlength, late))
    1.72  	{