Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

CPlugInManager Class Reference

#include <PlugInManager.h>

Collaboration diagram for CPlugInManager:

Collaboration graph
[legend]

Public Member Functions

void AddFaceToBrushHandle (void *vp, vec3_t v1, vec3_t v2, vec3_t v3)
int AllocateActivePatchHandles ()
int AllocateSelectedPatchHandles ()
void Cleanup ()
void CommitBrushHandleToEntity (LPVOID vpBrush, LPVOID vpEntity)
void CommitBrushHandleToMap (void *vp)
void CommitEntityHandleToMap (LPVOID vpEntity)
void CommitPatchHandleToMap (int index, patchMesh_t *pMesh, char *texName)
 CPlugInManager ()
LPVOID CreateBrushHandle ()
int CreatePatchHandle ()
void DeleteBrushHandle (LPVOID vp)
void Dispatch (int n, const char *p)
brush_tFindBrushHandle (void *vp)
patchMesh_tFindPatchHandle (int index)
CPtrArray & GetActiveHandles ()
CPtrArray & GetEntityBrushHandles ()
CPtrArray & GetEntityHandles ()
CPtrArray & GetPluginPatches ()
CPtrArray & GetSelectedHandles ()
LPVOID GetSurfaceFlags ()
_QERTextureInfoGetTextureInfo ()
void Init (const char *pPath)
void LoadTexture (const char *pFilename)
CPlugInPluginForModule (HMODULE hPlug)
void ReleasePatchesHandles ()
virtual ~CPlugInManager ()

Protected Member Functions

int FillFuncTable (CPlugIn *pPlug)

Private Types

enum  EPatchesMode { EActivePatches, ESelectedPatches, EAllocatedPatches }

Private Attributes

CPtrArray m_ActiveBrushHandles
CPtrArray m_BrushHandles
CPtrArray m_EntityBrushHandles
CPtrArray m_EntityHandles
CPtrArray m_PatchesHandles
CPtrArray m_PluginPatches
CObArray m_PlugIns
CPlugInm_pSurfaceListPlug
CPlugInm_pTexturePlug
CPtrArray m_SelectedBrushHandles
enum CPlugInManager::EPatchesMode PatchesMode

Member Enumeration Documentation

enum EPatchesMode [private]
 

Enumeration values:
EActivePatches 
ESelectedPatches 
EAllocatedPatches 

Definition at line 53 of file PlugInManager.h.

00053 { EActivePatches, ESelectedPatches, EAllocatedPatches } PatchesMode;


Constructor & Destructor Documentation

CPlugInManager  ) 
 

Definition at line 44 of file PlugInManager.cpp.

References m_pSurfaceListPlug, m_pTexturePlug, and PatchesMode.

00045 {
00046   m_pTexturePlug = NULL;
00047   m_pSurfaceListPlug = NULL;
00048   PatchesMode = EActivePatches;
00049 }

~CPlugInManager  )  [virtual]
 

Definition at line 51 of file PlugInManager.cpp.

References Cleanup().

00052 {
00053   Cleanup();
00054 }

Here is the call graph for this function:


Member Function Documentation

void AddFaceToBrushHandle void *  vp,
vec3_t  v1,
vec3_t  v2,
vec3_t  v3
 

Definition at line 266 of file PlugInManager.cpp.

References brush_s::brush_faces, brush_t, texdef_t::contents, QEGlobals_t::d_texturewin, f, Face_Alloc(), face_t, FindBrushHandle(), texdef_t::flags, g_qeglobals, face_s::next, face_s::planepts, texturewin_t::texdef, face_s::texdef, v1, v2, VectorCopy, and vp.

Referenced by QERApp_AddFace().

00267 {
00268   brush_t *bp = FindBrushHandle(vp);
00269   if (bp != NULL)
00270   {
00271         face_t *f = Face_Alloc();
00272         f->texdef = g_qeglobals.d_texturewin.texdef;
00273         f->texdef.flags &= ~SURF_KEEP;
00274         f->texdef.contents &= ~CONTENTS_KEEP;
00275         f->next = bp->brush_faces;
00276         bp->brush_faces = f;
00277         VectorCopy (v1, f->planepts[0]);
00278         VectorCopy (v2, f->planepts[1]);
00279         VectorCopy (v3, f->planepts[2]);
00280   }
00281 }

Here is the call graph for this function:

int AllocateActivePatchHandles  ) 
 

Definition at line 1255 of file PlugInManager.cpp.

References active_brushes, brush_t, m_PatchesHandles, n, brush_s::next, and brush_s::patchBrush.

Referenced by QERApp_AllocateActivePatchHandles().

01256 {
01257     int n = 0;
01258     for (brush_t *pb = active_brushes.next ; pb != &active_brushes ; pb = pb->next)
01259     {
01260         if (pb->patchBrush)
01261         {
01262             n++;
01263             m_PatchesHandles.Add(pb);
01264         }
01265     }
01266     return n;
01267 }

int AllocateSelectedPatchHandles  ) 
 

Definition at line 1275 of file PlugInManager.cpp.

References brush_t, m_PatchesHandles, n, brush_s::next, brush_s::patchBrush, and selected_brushes.

Referenced by QERApp_AllocateSelectedPatchHandles().

01276 {
01277     int n = 0;
01278     for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next)
01279     {
01280         if (pb->patchBrush)
01281         {
01282             n++;
01283             m_PatchesHandles.Add(pb);
01284         }
01285     }
01286     return n;
01287 }

void Cleanup  ) 
 

Definition at line 126 of file PlugInManager.cpp.

References Brush_Free(), brush_t, Entity_Free(), CPlugIn::free(), i, m_BrushHandles, m_EntityHandles, m_PatchesHandles, m_PluginPatches, m_PlugIns, and Sys_Printf().

Referenced by Init(), and ~CPlugInManager().

00127 {
00128     int i;
00129     for (i = 0; i < m_PlugIns.GetSize(); i++)
00130     {
00131         CPlugIn *plug = reinterpret_cast<CPlugIn*>(m_PlugIns.GetAt(i));
00132         plug->free();
00133         delete plug;
00134     }
00135     m_PlugIns.RemoveAll();
00136     
00137     for (i = 0; i < m_BrushHandles.GetSize(); i++)
00138     {
00139         brush_t *pb = reinterpret_cast<brush_t*>(m_BrushHandles.GetAt(i));
00140         Brush_Free(pb);
00141     }
00142     m_BrushHandles.RemoveAll();
00143     
00144     for (i = 0; i < m_EntityHandles.GetSize(); i++)
00145     {
00146         entity_t *pe = reinterpret_cast<entity_t*>(m_EntityHandles.GetAt(i));
00147         Entity_Free(pe);
00148     }
00149     m_EntityHandles.RemoveAll();
00150     
00151     // patches
00152     // these are linked into the map
00153     m_PatchesHandles.RemoveAll();
00154     // these patches were allocated by Radiant on plugin request
00155     // if the list is not empty, it means either the plugin asked for allocation and never commited them to the map
00156     // in which case we are supposed to delete them
00157     // or it commited them but never called m_pfnReleasePatchHandles, in case the patches may have already been
00158     // erased and we are trying a second time, therefore crashing ..
00159     //++timo FIXME: for now I leave a leak warning, we'd need a table to keep track of commited patches
00160 #ifdef _DEBUG
00161     if (m_PluginPatches.GetSize() != 0)
00162         Sys_Printf("WARNING: m_PluginPatches.GetSize() != 0 in CPlugInManager::Cleanup, possible leak\n");
00163 #endif
00164 /*  for (i = 0; i < m_PluginPatches.GetSize(); i++)
00165     {
00166         patchMesh_t *pMesh = reinterpret_cast<patchMesh_t*>(m_PluginPatches.GetAt(i));
00167         if (pMesh->pSymbiot)
00168             delete pMesh;
00169     }
00170     m_PluginPatches.RemoveAll(); */
00171 }

Here is the call graph for this function:

void CommitBrushHandleToEntity LPVOID  vpBrush,
LPVOID  vpEntity
 

Definition at line 963 of file PlugInManager.cpp.

References brush_t, Entity_LinkBrush(), i, m_BrushHandles, Sys_UpdateWindows(), and W_ALL.

Referenced by QERApp_CommitBrushHandleToEntity().

00964 {
00965     brush_t* pb;
00966     entity_t* pe;
00967     for (int i=0 ; i < m_BrushHandles.GetSize() ; i++)
00968     {
00969         if (vpBrush == m_BrushHandles.GetAt(i))
00970         {
00971             m_BrushHandles.RemoveAt(i);
00972             pb = reinterpret_cast<brush_t*>(vpBrush);
00973             pe = reinterpret_cast<entity_t *>(vpEntity);
00974             Entity_LinkBrush (pe, pb);
00975         }
00976     }
00977     Sys_UpdateWindows(W_ALL);
00978 }

Here is the call graph for this function:

void CommitBrushHandleToMap void *  vp  ) 
 

Definition at line 247 of file PlugInManager.cpp.

References active_brushes, Brush_AddToList(), Brush_Build(), brush_t, Entity_LinkBrush(), g_bScreenUpdates, i, m_BrushHandles, Select_Brush(), Sys_UpdateWindows(), W_ALL, and world_entity.

Referenced by QERApp_CommitBrushHandleToMap().

00248 {
00249   g_bScreenUpdates = false; 
00250   for (int i = 0; i < m_BrushHandles.GetSize(); i++)
00251   {
00252     brush_t *pb = reinterpret_cast<brush_t*>(m_BrushHandles.GetAt(i));
00253     if (pb == reinterpret_cast<brush_t*>(vp))
00254     {
00255       m_BrushHandles.RemoveAt(i);
00256       Entity_LinkBrush (world_entity, pb);
00257       Brush_Build(pb);
00258       Brush_AddToList (pb, &active_brushes);
00259       Select_Brush(pb);
00260     }
00261   }
00262   g_bScreenUpdates = true; 
00263   Sys_UpdateWindows(W_ALL);
00264 }

Here is the call graph for this function:

void CommitEntityHandleToMap LPVOID  vpEntity  ) 
 

Definition at line 1045 of file PlugInManager.cpp.

References a, active_brushes, b, Brush_Build(), Brush_Create(), Brush_Rotate(), brush_t, entity_t::brushes, QEGlobals_t::d_num_entities, e, Eclass_ForName(), eclass_t, entities, Entity_Free(), eclass_s::fixedsize, FloatForKey(), g_qeglobals, GetCachedModel(), GetVectorForKey(), i, QEGlobals_t::m_bBrushPrimitMode, m_EntityHandles, eclass_s::maxs, eclass_s::mins, brush_s::next, eclass_s::nShowFlags, NULL, brush_s::onext, brush_s::oprev, entity_t::origin, brush_s::owner, p, brush_s::prev, SetKeyValue(), strcmp(), strlen(), Sys_Printf(), eclass_s::texdef, ValueForKey(), vec3_t, VectorAdd, and world_entity.

Referenced by QERApp_CommitEntityHandleToMap().

01046 {
01047     entity_t *pe;
01048     eclass_t *e;
01049     brush_t     *b;
01050     vec3_t mins,maxs;
01051     bool has_brushes;
01052     for (int i=0 ; i < m_EntityHandles.GetSize() ; i++ )
01053     {
01054         if (vpEntity == m_EntityHandles.GetAt(i))
01055         {
01056             m_EntityHandles.RemoveAt(i);
01057             pe = reinterpret_cast<entity_t*>(vpEntity);
01058             // fill additional fields
01059             // straight copy from Entity_Parse
01060             // entity_t::origin
01061             GetVectorForKey (pe, "origin", pe->origin);
01062             // entity_t::eclass
01063             if (pe->brushes.onext == &pe->brushes)
01064                 has_brushes = false;
01065             else
01066                 has_brushes = true;
01067             e = Eclass_ForName (ValueForKey (pe, "classname"), has_brushes);
01068             pe->eclass = e;
01069             // fixedsize
01070             if (e->fixedsize)
01071             {
01072                 if (pe->brushes.onext != &pe->brushes)
01073                 {
01074                     Sys_Printf("Warning : Fixed size entity with brushes in CPlugInManager::CommitEntityHandleToMap\n");
01075                 }
01076                 // create a custom brush
01077                 VectorAdd(e->mins, pe->origin, mins);
01078                 VectorAdd(e->maxs, pe->origin, maxs);
01079                 float a = 0;
01080                 if (e->nShowFlags & ECLASS_MISCMODEL)
01081                 {
01082                     char* p = ValueForKey(pe, "model");
01083                     if (p != NULL && strlen(p) > 0)
01084                     {
01085                         vec3_t vMin, vMax;
01086                         a = FloatForKey (pe, "angle");
01087                         if (GetCachedModel(pe, p, vMin, vMax))
01088                         {
01089                               // create a custom brush
01090                               VectorAdd (pe->md3Class->mins, pe->origin, mins);
01091                               VectorAdd (pe->md3Class->maxs, pe->origin, maxs);
01092                         }
01093                     }
01094                 }
01095         
01096                 b = Brush_Create (mins, maxs, &e->texdef);
01097 
01098                 if (a)
01099                 {
01100                     vec3_t vAngle;
01101                     vAngle[0] = vAngle[1] = 0;
01102                     vAngle[2] = a;
01103                     Brush_Rotate(b, vAngle, pe->origin, false);
01104                 }
01105 
01106                 b->owner = pe;
01107 
01108                 b->onext = pe->brushes.onext;
01109                 b->oprev = &pe->brushes;
01110                 pe->brushes.onext->oprev = b;
01111                 pe->brushes.onext = b;
01112             }
01113             else
01114             {   // brush entity
01115                 if (pe->brushes.next == &pe->brushes)
01116                     Sys_Printf ("Warning: Brush entity with no brushes in CPlugInManager::CommitEntityHandleToMap\n");
01117             }
01118 
01119             // add brushes to the active brushes list
01120             // and build them along the way
01121             for (b=pe->brushes.onext ; b != &pe->brushes ; b=b->onext)
01122             {
01123                 // convert between old brushes and brush primitive
01124                 if (g_qeglobals.m_bBrushPrimitMode)
01125                 {
01126                     // we only filled the shift scale rot fields, needs conversion
01127                     Brush_Build( b, true, true, true );
01128                 }
01129                 else
01130                 {
01131                     // we are using old brushes
01132                     Brush_Build( b );
01133                 }
01134                 b->next = active_brushes.next;
01135                 active_brushes.next->prev = b;
01136                 b->prev = &active_brushes;
01137                 active_brushes.next = b;
01138             }
01139 
01140             // handle worldspawn entities
01141             // if worldspawn has no brushes, use the new one
01142             if (!strcmp(ValueForKey (pe, "classname"), "worldspawn"))
01143             {
01144                 if ( world_entity && ( world_entity->brushes.onext != &world_entity->brushes ) )
01145                 {
01146                     // worldspawn already has brushes
01147                     Sys_Printf ("Commiting worldspawn as func_group\n");
01148                     SetKeyValue(pe, "classname", "func_group");
01149                     // add the entity to the end of the entity list
01150                     pe->next = &entities;
01151                     pe->prev = entities.prev;
01152                     entities.prev->next = pe;
01153                     entities.prev = pe;
01154                     g_qeglobals.d_num_entities++;
01155                 }
01156                 else
01157                 {
01158                     // there's a worldspawn with no brushes, we assume the map is empty
01159                     if ( world_entity )
01160                     {
01161                         Entity_Free( world_entity );
01162                         world_entity = pe;
01163                     }
01164                     else
01165                         Sys_Printf("Warning : unexpected world_entity == NULL in CommitEntityHandleToMap\n");
01166                 }
01167             }
01168             else
01169             {
01170                 // add the entity to the end of the entity list
01171                 pe->next = &entities;
01172                 pe->prev = entities.prev;
01173                 entities.prev->next = pe;
01174                 entities.prev = pe;
01175                 g_qeglobals.d_num_entities++;
01176             }
01177         }
01178     }
01179 }

Here is the call graph for this function:

void CommitPatchHandleToMap int  index,
patchMesh_t pMesh,
char *  texName
 

Definition at line 1346 of file PlugInManager.cpp.

References AddBrushForPatch(), patchMesh_t::bDirty, brush_t, patchMesh_t::contents, patchMesh_t::ctrl, patchMesh_t::d_texture, QEGlobals_t::d_texturewin, patchMesh_t::flags, g_bScreenUpdates, g_qeglobals, patchMesh_t::height, m_PatchesHandles, m_PluginPatches, MAX_PATCH_HEIGHT, MAX_PATCH_WIDTH, memcpy(), texdef_t::name, PatchesMode, pMesh, brush_s::pPatch, Select_Brush(), Sys_Printf(), Sys_UpdateWindows(), texturewin_t::texdef, texName, Texture_ForName(), patchMesh_t::type, patchMesh_t::value, W_ALL, and patchMesh_t::width.

Referenced by QERApp_CommitPatchHandleToMap().

01347 {
01348     if (PatchesMode==EAllocatedPatches)
01349     {
01350         patchMesh_t *pPatch = reinterpret_cast<patchMesh_t *>( m_PluginPatches.GetAt(index) );
01351         memcpy( pPatch, pMesh, sizeof( patchMesh_t ) );
01352         // patch texturing, if none given use current texture
01353         if (texName)
01354             pPatch->d_texture = Texture_ForName(texName);
01355         if ( !pPatch->d_texture )
01356         {
01357             pPatch->d_texture = Texture_ForName(g_qeglobals.d_texturewin.texdef.name);
01358             // checking .. just in case
01359             if (!pPatch->d_texture)
01360             {
01361 #ifdef _DEBUG
01362                 Sys_Printf("WARNING: failed to set patch to current texture in CPlugInManager::CommitPatchHandleToMap\n");
01363 #endif
01364                 pPatch->d_texture = notexture;
01365             }
01366         }
01367         g_bScreenUpdates = false;
01368         // the bLinkToWorld flag in AddBrushForPatch takes care of Brush_AddToList Entity_linkBrush and Brush_Build
01369         brush_t *pb = AddBrushForPatch( pPatch, true );
01370         Select_Brush( pb );
01371         g_bScreenUpdates = true;
01372         Sys_UpdateWindows(W_ALL);
01373     }
01374     else
01375     {
01376         brush_t *pBrush = reinterpret_cast<brush_t *>( m_PatchesHandles.GetAt(index) );
01377         patchMesh_t *pPatch = pBrush->pPatch;
01378         pPatch->width = pMesh->width;
01379         pPatch->height = pMesh->height;
01380         pPatch->contents = pMesh->contents;
01381         pPatch->flags = pMesh->flags;
01382         pPatch->value = pMesh->value;
01383         pPatch->type = pMesh->type;
01384         memcpy( pPatch->ctrl, pMesh->ctrl, sizeof(drawVert_t)*MAX_PATCH_HEIGHT*MAX_PATCH_WIDTH );
01385         pPatch->bDirty = true;
01386     }
01387 }

Here is the call graph for this function:

LPVOID CreateBrushHandle  ) 
 

Definition at line 210 of file PlugInManager.cpp.

References Brush_Alloc(), brush_t, g_nBrushId, LPVOID, m_BrushHandles, and brush_s::numberId.

Referenced by QERApp_CreateBrushHandle().

00211 {
00212     brush_t *pb = Brush_Alloc();
00213     pb->numberId = g_nBrushId++;
00214   m_BrushHandles.Add(pb);
00215   return (LPVOID)pb;
00216 }

Here is the call graph for this function:

int CreatePatchHandle  ) 
 

Definition at line 1330 of file PlugInManager.cpp.

References m_PluginPatches, MakeNewPatch(), and PatchesMode.

Referenced by QERApp_CreatePatchHandle().

01331 {
01332     // NOTE: we can't call the AddBrushForPatch until we have filled the patchMesh_t structure
01333     patchMesh_t *pPatch = MakeNewPatch();
01334     m_PluginPatches.Add( pPatch );
01335     // change mode
01336     PatchesMode = EAllocatedPatches;
01337     return m_PluginPatches.GetSize()-1;
01338 }

Here is the call graph for this function:

void DeleteBrushHandle LPVOID  vp  ) 
 

Referenced by QERApp_DeleteBrushHandle().

void Dispatch int  n,
const char *  p
 

Definition at line 173 of file PlugInManager.cpp.

References CPlugIn::dispatchCommand(), i, m_PlugIns, n, brush_s::next, CPlugIn::ownsCommandID(), p, QE_SingleBrush(), Select_GetBounds(), selected_brushes, vec3_t, and VectorCopy.

Referenced by CMainFrame::OnPlugIn().

00174 {
00175   for (int i = 0; i < m_PlugIns.GetSize(); i++)
00176   {
00177     CPlugIn *plug = reinterpret_cast<CPlugIn*>(m_PlugIns.GetAt(i));
00178     if (plug->ownsCommandID(n))
00179     {
00180       vec3_t vMin, vMax;
00181         if (selected_brushes.next == &selected_brushes)
00182       {
00183         vMin[0] = vMin[1] = vMin[2] = 0;
00184         VectorCopy(vMin, vMax);
00185       }
00186       else
00187       {
00188         Select_GetBounds (vMin, vMax);
00189       }
00190       plug->dispatchCommand(p, vMin, vMax, QE_SingleBrush(true));   // PGM -- added quiet
00191       break;
00192     }
00193   }
00194 }

Here is the call graph for this function:

int FillFuncTable CPlugIn pPlug  )  [protected]
 

Definition at line 1554 of file PlugInManager.cpp.

References CPlugIn::getFuncTable(), CPlugIn::getVersionStr(), _QERFuncTable_1::m_fVersion, _QERFuncTable_1::m_pfnActiveBrushCount, _QERFuncTable_1::m_pfnAddFace, _QERFuncTable_1::m_pfnAddFaceData, _QERFuncTable_1::m_pfnAllocateActiveBrushHandles, _QERFuncTable_1::m_pfnAllocateActivePatchHandles, _QERFuncTable_1::m_pfnAllocateEntityBrushHandles, _QERFuncTable_1::m_pfnAllocateEpair, _QERFuncTable_1::m_pfnAllocateSelectedBrushHandles, _QERFuncTable_1::m_pfnAllocateSelectedPatchHandles, _QERFuncTable_1::m_pfnBuildBrush, _QERFuncTable_1::m_pfnBuildBrush2, _QERFuncTable_1::m_pfnCommitBrushHandle, _QERFuncTable_1::m_pfnCommitBrushHandleToEntity, _QERFuncTable_1::m_pfnCommitEntityHandleToMap, _QERFuncTable_1::m_pfnCommitPatchHandleToMap, _QERFuncTable_1::m_pfnCreateBrush, _QERFuncTable_1::m_pfnCreateBrushHandle, _QERFuncTable_1::m_pfnCreateEntityHandle, _QERFuncTable_1::m_pfnCreatePatchHandle, _QERFuncTable_1::m_pfnDeleteBrushHandle, _QERFuncTable_1::m_pfnDeleteFace, _QERFuncTable_1::m_pfnDeletePatch, _QERFuncTable_1::m_pfnDeleteSelection, _QERFuncTable_1::m_pfnDeselectAllBrushes, _QERFuncTable_1::m_pfnDeselectBrush, _QERFuncTable_1::m_pfnErrorMsg, _QERFuncTable_1::m_pfnExpandReletivePath, _QERFuncTable_1::m_pfnGetActiveBrushHandle, _QERFuncTable_1::m_pfnGetCurrentTexture, _QERFuncTable_1::m_pfnGetEClass, _QERFuncTable_1::m_pfnGetEClassCount, _QERFuncTable_1::m_pfnGetEntityBrushHandle, _QERFuncTable_1::m_pfnGetEntityCount, _QERFuncTable_1::m_pfnGetEntityHandle, _QERFuncTable_1::m_pfnGetEntityKeyValList, _QERFuncTable_1::m_pfnGetFaceCount, _QERFuncTable_1::m_pfnGetFaceData, _QERFuncTable_1::m_pfnGetGamePath, _QERFuncTable_1::m_pfnGetPatchData, _QERFuncTable_1::m_pfnGetPoints, _QERFuncTable_1::m_pfnGetQERPath, _QERFuncTable_1::m_pfnGetSelectedBrushHandle, _QERFuncTable_1::m_pfnGetTexture, _QERFuncTable_1::m_pfnHasShader, _QERFuncTable_1::m_pfnHideInfoMsg, _QERFuncTable_1::m_pfnInfoMsg, _QERFuncTable_1::m_pfnLoadFile, _QERFuncTable_1::m_pfnLoadTextureRGBA, _QERFuncTable_1::m_pfnPositionView, _QERFuncTable_1::m_pfnQE_ConvertDOSToUnixName, _QERFuncTable_1::m_pfnRadiantFree, _QERFuncTable_1::m_pfnReadProjectKey, _QERFuncTable_1::m_pfnReleaseActiveBrushHandles, _QERFuncTable_1::m_pfnReleaseEntityBrushHandles, _QERFuncTable_1::m_pfnReleasePatchHandles, _QERFuncTable_1::m_pfnReleaseSelectedBrushHandles, _QERFuncTable_1::m_pfnRequestInterface, _QERFuncTable_1::m_pfnResetPlugins, _QERFuncTable_1::m_pfnScanFileForEClass, _QERFuncTable_1::m_pfnSelectBrush, _QERFuncTable_1::m_pfnSelectedBrushCount, _QERFuncTable_1::m_pfnSetCurrentTexture, _QERFuncTable_1::m_pfnSetEntityKeyValList, _QERFuncTable_1::m_pfnSetFaceData, _QERFuncTable_1::m_pfnSetScreenUpdate, _QERFuncTable_1::m_pfnSysMsg, _QERFuncTable_1::m_pfnSysUpdateWindows, _QERFuncTable_1::m_pfnTexture_LoadSkin, _QERFuncTable_1::m_pfnTextureBrush, _QERFuncTable_1::m_pfnTextureCount, QER_PLUG_VERSION, and Sys_Printf().

Referenced by Init().

01555 {
01556   _QERFuncTable_1 *pTable = reinterpret_cast<_QERFuncTable_1*>(pPlug->getFuncTable());
01557   if (pTable != NULL)
01558   {
01559     if (pTable->m_fVersion != QER_PLUG_VERSION)
01560     {
01561       Sys_Printf("Radiant plugin manager was built with version %.2f, Plugin %s is version %.2f\n", QER_PLUG_VERSION, pPlug->getVersionStr() , pTable->m_fVersion);
01562     }
01563     if (pTable->m_fVersion >= QER_PLUG_VERSION_1)
01564     {
01565       pTable->m_pfnCreateBrush = &QERApp_CreateBrush;
01566       pTable->m_pfnCreateBrushHandle = &QERApp_CreateBrushHandle;
01567       pTable->m_pfnDeleteBrushHandle = &QERApp_DeleteBrushHandle;
01568       pTable->m_pfnCommitBrushHandle = &QERApp_CommitBrushHandleToMap;
01569       pTable->m_pfnAddFace = &QERApp_AddFace;
01570       pTable->m_pfnAddFaceData = &QERApp_AddFaceData;
01571       pTable->m_pfnGetFaceData = &QERApp_GetFaceData;
01572       pTable->m_pfnGetFaceCount = &QERApp_GetFaceCount;
01573       pTable->m_pfnSetFaceData = &QERApp_SetFaceData;
01574       pTable->m_pfnDeleteFace = &QERApp_DeleteFace;
01575       pTable->m_pfnTextureBrush = &QERApp_TextureBrush;
01576       pTable->m_pfnBuildBrush = &QERApp_BuildBrush;                     // PGM
01577       pTable->m_pfnSelectBrush = &QERApp_SelectBrush;                   // PGM
01578       pTable->m_pfnDeselectBrush = &QERApp_DeselectBrush;               // PGM
01579       pTable->m_pfnDeselectAllBrushes = &QERApp_DeselectAllBrushes;     // PGM
01580       pTable->m_pfnDeleteSelection = &QERApp_DeleteSelection;
01581       pTable->m_pfnGetPoints = &QERApp_GetPoints;
01582       pTable->m_pfnSysMsg = &QERApp_SysMsg;
01583       pTable->m_pfnInfoMsg = &QERApp_InfoMsg;
01584       pTable->m_pfnHideInfoMsg = &QERApp_HideInfoMsg;
01585       pTable->m_pfnPositionView = &QERApp_PositionView;                 // PGM
01586       pTable->m_pfnSelectedBrushCount = &QERApp_SelectedBrushCount;
01587       pTable->m_pfnAllocateSelectedBrushHandles  = &QERApp_AllocateSelectedBrushHandles;
01588       pTable->m_pfnReleaseSelectedBrushHandles  = &QERApp_ReleaseSelectedBrushHandles;
01589       pTable->m_pfnGetSelectedBrushHandle = &QERApp_GetSelectedBrushHandle;
01590       pTable->m_pfnActiveBrushCount = &QERApp_ActiveBrushCount;
01591       pTable->m_pfnAllocateActiveBrushHandles = &QERApp_AllocateActiveBrushHandles;
01592       pTable->m_pfnReleaseActiveBrushHandles = &QERApp_ReleaseActiveBrushHandles;
01593       pTable->m_pfnGetActiveBrushHandle = &QERApp_GetActiveBrushHandle;
01594       pTable->m_pfnTextureCount = &QERApp_TextureCount;
01595       pTable->m_pfnGetTexture = &QERApp_GetTexture;
01596       pTable->m_pfnGetCurrentTexture = &QERApp_GetCurrentTexture;
01597       pTable->m_pfnSetCurrentTexture = &QERApp_SetCurrentTexture;
01598       pTable->m_pfnGetEClassCount = &QERApp_GetEClassCount;
01599       pTable->m_pfnGetEClass = &QERApp_GetEClass;
01600       pTable->m_pfnResetPlugins = &QERApp_ResetPlugins;
01601     }
01602     // end of v1.00
01603     if (pTable->m_fVersion >= 1.5f)
01604     {
01605       // v1.50 starts
01606       pTable->m_pfnLoadTextureRGBA = &QERApp_LoadTextureRGBA;
01607       // end of v1.50
01608     }
01609     if (pTable->m_fVersion >= 1.7f)
01610     {
01611         pTable->m_pfnGetEntityCount = &QERApp_GetEntityCount;
01612         pTable->m_pfnGetEntityHandle = &QERApp_GetEntityHandle;
01613         pTable->m_pfnGetEntityKeyValList = &QERApp_GetEntityKeyValList;
01614         pTable->m_pfnAllocateEpair = &QERApp_AllocateEpair;
01615         pTable->m_pfnSetEntityKeyValList = &QERApp_SetEntityKeyValList;
01616         pTable->m_pfnAllocateEntityBrushHandles = &QERApp_AllocateEntityBrushHandles;
01617         pTable->m_pfnReleaseEntityBrushHandles = &QERApp_ReleaseEntityBrushHandles;
01618         pTable->m_pfnGetEntityBrushHandle = &QERApp_GetEntityBrushHandle;
01619         pTable->m_pfnCreateEntityHandle = &QERApp_CreateEntityHandle;
01620         pTable->m_pfnCommitBrushHandleToEntity = &QERApp_CommitBrushHandleToEntity;
01621         pTable->m_pfnCommitEntityHandleToMap = &QERApp_CommitEntityHandleToMap;
01622         pTable->m_pfnSetScreenUpdate = &QERApp_SetScreenUpdate;
01623         pTable->m_pfnSysUpdateWindows = &Sys_UpdateWindows;
01624         pTable->m_pfnBuildBrush2 = &QERApp_BuildBrush2;
01625         pTable->m_pfnReadProjectKey = &QERApp_ReadProjectKey;
01626         pTable->m_pfnScanFileForEClass = &QERApp_ScanFileForEClass;
01627         pTable->m_pfnRequestInterface = &QERApp_RequestInterface;
01628         pTable->m_pfnErrorMsg = &QERApp_ErrorMsg;
01629         pTable->m_pfnLoadFile = &QERApp_LoadFile;
01630         pTable->m_pfnExpandReletivePath = &QERApp_ExpandReletivePath;
01631         pTable->m_pfnQE_ConvertDOSToUnixName = &QE_ConvertDOSToUnixName;
01632         pTable->m_pfnHasShader = &QERApp_HasShader;
01633         pTable->m_pfnTexture_LoadSkin = &Texture_LoadSkin;
01634         pTable->m_pfnRadiantFree = &QERApp_RadiantFree;
01635         pTable->m_pfnGetGamePath = &QERApp_GetGamePath;
01636         pTable->m_pfnGetQERPath = &QERApp_GetQERPath;
01637         // patches
01638         pTable->m_pfnAllocateActivePatchHandles = &QERApp_AllocateActivePatchHandles;
01639         pTable->m_pfnAllocateSelectedPatchHandles = &QERApp_AllocateSelectedPatchHandles;
01640         pTable->m_pfnReleasePatchHandles = &QERApp_ReleasePatchHandles;
01641         pTable->m_pfnGetPatchData = &QERApp_GetPatchData;
01642         pTable->m_pfnDeletePatch = &QERApp_DeletePatch;
01643         pTable->m_pfnCreatePatchHandle = &QERApp_CreatePatchHandle;
01644         pTable->m_pfnCommitPatchHandleToMap = &QERApp_CommitPatchHandleToMap;
01645     }
01646     return true;
01647   }
01648   else
01649   {
01650     Sys_Printf("Unable to load %s because the function tables are not the same size\n", pPlug->getVersionStr());
01651   }
01652   return false;
01653 }

Here is the call graph for this function:

brush_t * FindBrushHandle void *  vp  ) 
 

Definition at line 283 of file PlugInManager.cpp.

References brush_t, i, and j.

Referenced by AddFaceToBrushHandle(), QERApp_AddFaceData(), QERApp_BuildBrush(), QERApp_BuildBrush2(), QERApp_DeleteFace(), QERApp_GetFaceCount(), QERApp_GetFaceData(), QERApp_SelectBrush(), QERApp_SetFaceData(), and QERApp_TextureBrush().

00284 {
00285   CPtrArray* pHandles[4];
00286   pHandles[0] = &m_SelectedBrushHandles;
00287   pHandles[1] = &m_ActiveBrushHandles;
00288   pHandles[2] = &m_BrushHandles;
00289   pHandles[3] = &m_EntityBrushHandles;
00290 
00291   for (int j = 0; j < 4; j++)
00292   {
00293     for (int i = 0; i < pHandles[j]->GetSize(); i++)
00294     {
00295       brush_t *pb = reinterpret_cast<brush_t*>(pHandles[j]->GetAt(i));
00296       if (pb == reinterpret_cast<brush_t*>(vp))
00297       {
00298         return pb;
00299       }
00300     }
00301   }
00302   return NULL;
00303 }

patchMesh_t * FindPatchHandle int  index  ) 
 

Definition at line 305 of file PlugInManager.cpp.

References brush_t, EActivePatches, EAllocatedPatches, ESelectedPatches, m_PatchesHandles, m_PluginPatches, brush_s::pPatch, and Sys_Printf().

Referenced by QERApp_DeletePatch(), and QERApp_GetPatchData().

00306 {
00307     switch (PatchesMode)
00308     {
00309     case EActivePatches:
00310     case ESelectedPatches:
00311         if ( index < m_PatchesHandles.GetSize() )
00312         {
00313             brush_t *pb = reinterpret_cast<brush_t *>(m_PatchesHandles.GetAt(index));
00314             return pb->pPatch;
00315         }
00316 #ifdef _DEBUG
00317         Sys_Printf("WARNING: out of bounds in CPlugInManager::FindPatchHandle\n");
00318 #endif
00319         break;
00320     case EAllocatedPatches:
00321         if ( index < m_PluginPatches.GetSize() )
00322         {
00323             patchMesh_t *pPatch = reinterpret_cast<patchMesh_t *>(m_PluginPatches.GetAt(index));
00324             return pPatch;
00325         }
00326 #ifdef _DEBUG
00327         Sys_Printf("WARNING: out of bounds in CPlugInManager::FindPatchHandle\n");
00328 #endif
00329         break;
00330     }
00331     return NULL;
00332 }

Here is the call graph for this function:

CPtrArray& GetActiveHandles  )  [inline]
 

Definition at line 61 of file PlugInManager.h.

Referenced by QERApp_AllocateActiveBrushHandles(), QERApp_GetActiveBrushHandle(), and QERApp_ReleaseActiveBrushHandles().

00061 {return m_ActiveBrushHandles; };

CPtrArray& GetEntityBrushHandles  )  [inline]
 

Definition at line 89 of file PlugInManager.h.

Referenced by QERApp_AllocateEntityBrushHandles(), QERApp_GetEntityBrushHandle(), and QERApp_ReleaseEntityBrushHandles().

00089 {return m_EntityBrushHandles; };

CPtrArray& GetEntityHandles  )  [inline]
 

Definition at line 90 of file PlugInManager.h.

Referenced by QERApp_CreateEntityHandle().

00090 {return m_EntityHandles; };

CPtrArray& GetPluginPatches  )  [inline]
 

Definition at line 63 of file PlugInManager.h.

00063 {return m_PluginPatches; };

CPtrArray& GetSelectedHandles  )  [inline]
 

Definition at line 62 of file PlugInManager.h.

Referenced by QERApp_AllocateSelectedBrushHandles(), QERApp_GetSelectedBrushHandle(), and QERApp_ReleaseSelectedBrushHandles().

00062 {return m_SelectedBrushHandles; };

LPVOID GetSurfaceFlags  ) 
 

Definition at line 1203 of file PlugInManager.cpp.

References CPlugIn::getSurfaceFlags(), LPVOID, and m_pSurfaceListPlug.

Referenced by CSurfaceDlg::OnInitDialog().

01204 {
01205   if (m_pSurfaceListPlug != NULL)
01206   {
01207     return m_pSurfaceListPlug->getSurfaceFlags();
01208   }
01209   else
01210   {
01211     return NULL;
01212   }
01213 }

Here is the call graph for this function:

_QERTextureInfo * GetTextureInfo  ) 
 

Definition at line 1191 of file PlugInManager.cpp.

References CPlugIn::getTextureInfo(), and m_pTexturePlug.

Referenced by FillTextureMenu(), GetTextureExtension(), Texture_ForName(), and Texture_ShowDirectory().

01192 {
01193   if (m_pTexturePlug != NULL)
01194   {
01195     return m_pTexturePlug->getTextureInfo();
01196   }
01197   else
01198   {
01199     return NULL;
01200   }
01201 }

Here is the call graph for this function: