PlugIn.h (2794B)
1 /* 2 =========================================================================== 3 Copyright (C) 1999-2005 Id Software, Inc. 4 5 This file is part of Quake III Arena source code. 6 7 Quake III Arena source code is free software; you can redistribute it 8 and/or modify it under the terms of the GNU General Public License as 9 published by the Free Software Foundation; either version 2 of the License, 10 or (at your option) any later version. 11 12 Quake III Arena source code is distributed in the hope that it will be 13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with Foobar; if not, write to the Free Software 19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 =========================================================================== 21 */ 22 // PlugIn.h: interface for the CPlugIn class. 23 // 24 ////////////////////////////////////////////////////////////////////// 25 26 #if !defined(AFX_PLUGIN_H__B501A832_5755_11D2_B084_00AA00A410FC__INCLUDED_) 27 #define AFX_PLUGIN_H__B501A832_5755_11D2_B084_00AA00A410FC__INCLUDED_ 28 29 #if _MSC_VER >= 1000 30 #pragma once 31 #endif // _MSC_VER >= 1000 32 33 class CPlugIn : public CObject 34 { 35 private: 36 HMODULE m_hDLL; 37 PFN_QERPLUG_INIT m_pfnInit; 38 PFN_QERPLUG_GETNAME m_pfnGetName; 39 PFN_QERPLUG_GETCOMMANDLIST m_pfnGetCommandList; 40 PFN_QERPLUG_DISPATCH m_pfnDispatch; 41 PFN_QERPLUG_GETFUNCTABLE m_pfnGetFuncTable; 42 PFN_QERPLUG_GETTEXTUREINFO m_pfnGetTextureInfo; 43 PFN_QERPLUG_LOADTEXTURE m_pfnLoadTexture; 44 PFN_QERPLUG_GETSURFACEFLAGS m_pfnGetSurfaceFlags; 45 PFN_QERPLUG_REGISTERPLUGINENTITIES m_pfnRegisterPluginEntities; 46 PFN_QERPLUG_INITSURFACEPROPERTIES m_pfnInitSurfaceProperties; 47 PFN_QERPLUG_REQUESTINTERFACE m_pfnRequestInterface; 48 CWordArray m_CommandIDs; 49 CStringArray m_CommandStrings; 50 CString m_strName; 51 CString m_strVersion; 52 53 // for plugins that provide plugin entities 54 _QERPlugEntitiesFactory* m_pQERPlugEntitiesFactory; 55 56 public: 57 void InitBSPFrontendPlugin(); 58 IPluginEntity * CreatePluginEntity( entity_t * ); 59 HMODULE GetDLLModule() { return m_hDLL; } 60 void InitSurfacePlugin(); 61 void RegisterPluginEntities(); 62 void* getFuncTable(); 63 bool ownsCommandID(int n); 64 void addMenuID(int n); 65 CPlugIn(); 66 virtual ~CPlugIn(); 67 bool load(const char *p); 68 void free(); 69 const char* getVersionStr(); 70 const char* getMenuName(); 71 int getCommandCount(); 72 const char* getCommand(int n); 73 void dispatchCommand(const char* p, vec3_t vMin, vec3_t vMax, BOOL bSingleBrush); 74 75 _QERTextureInfo *getTextureInfo(); 76 void loadTexture(LPCSTR pFilename); 77 78 LPVOID getSurfaceFlags(); 79 80 }; 81 82 #endif // !defined(AFX_PLUGIN_H__B501A832_5755_11D2_B084_00AA00A410FC__INCLUDED_)