PlugInManager.h (3688B)
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 // PlugInManager.h: interface for the CPlugInManager class. 23 // 24 ////////////////////////////////////////////////////////////////////// 25 26 #if !defined(AFX_PLUGINMANAGER_H__CFB18412_55FE_11D2_B082_00AA00A410FC__INCLUDED_) 27 #define AFX_PLUGINMANAGER_H__CFB18412_55FE_11D2_B082_00AA00A410FC__INCLUDED_ 28 29 #if _MSC_VER >= 1000 30 #pragma once 31 #endif // _MSC_VER >= 1000 32 33 #include "plugin.h" 34 35 class CPlugInManager 36 { 37 private: 38 CObArray m_PlugIns; 39 CPtrArray m_BrushHandles; 40 CPtrArray m_SelectedBrushHandles; 41 CPtrArray m_ActiveBrushHandles; 42 43 CPlugIn *m_pTexturePlug; 44 CPlugIn *m_pSurfaceListPlug; 45 46 // v1.70 47 // brushes of the current entity ( see m_SelectedBrushHandles and m_ActiveBrushHandles ) 48 CPtrArray m_EntityBrushHandles; 49 // allocated entities, not commited yet ( see m_BrushHandles ) 50 CPtrArray m_EntityHandles; 51 52 // tells in which array to look when given a patch index 53 enum EPatchesMode { EActivePatches, ESelectedPatches, EAllocatedPatches } PatchesMode; 54 // patches handles (brush_t*) 55 CPtrArray m_PatchesHandles; 56 // plugin-allocated patches, not commited yet (patchMesh_t*) 57 CPtrArray m_PluginPatches; 58 59 public: 60 CPlugIn * PluginForModule( HMODULE hPlug ); 61 CPtrArray& GetActiveHandles() {return m_ActiveBrushHandles; }; 62 CPtrArray& GetSelectedHandles() {return m_SelectedBrushHandles; }; 63 CPtrArray& GetPluginPatches() {return m_PluginPatches; }; 64 brush_t* FindBrushHandle(void *vp); 65 patchMesh_t* FindPatchHandle(int index); 66 int CreatePatchHandle(); 67 int AllocateActivePatchHandles(); 68 int AllocateSelectedPatchHandles(); 69 void CommitPatchHandleToMap(int index, patchMesh_t *pMesh, char *texName); 70 void ReleasePatchesHandles() { m_PatchesHandles.RemoveAll(); m_PluginPatches.RemoveAll(); } 71 void AddFaceToBrushHandle(void *vp, vec3_t v1, vec3_t v2, vec3_t v3); 72 void CommitBrushHandleToMap(void *vp); 73 void DeleteBrushHandle(LPVOID vp); 74 LPVOID CreateBrushHandle(); 75 void Dispatch(int n, const char *p); 76 void Cleanup(); 77 void Init(const char* pPath); 78 CPlugInManager(); 79 virtual ~CPlugInManager(); 80 81 // the texture manager front ends the single load 82 // addins (texture, model, map formats.. etc.) 83 _QERTextureInfo* GetTextureInfo(); 84 void LoadTexture(const char *pFilename); 85 86 LPVOID GetSurfaceFlags(); 87 88 // v1.70 89 CPtrArray& GetEntityBrushHandles() {return m_EntityBrushHandles; }; 90 CPtrArray& GetEntityHandles() {return m_EntityHandles; }; 91 // the vpBrush needs to be in m_BrushHandles 92 void CommitBrushHandleToEntity( LPVOID vpBrush, LPVOID vpEntity ); 93 // the vpEntity needs to be in m_EntityHandles 94 void CommitEntityHandleToMap( LPVOID vpEntity ); 95 96 protected: 97 int FillFuncTable(CPlugIn *pPlug); // PGM 98 }; 99 100 #endif // !defined(AFX_PLUGINMANAGER_H__CFB18412_55FE_11D2_B082_00AA00A410FC__INCLUDED_)