#include <PlugInManager.h>
Collaboration diagram for CPlugInManager:

|
|
Definition at line 53 of file PlugInManager.h. 00053 { EActivePatches, ESelectedPatches, EAllocatedPatches } PatchesMode;
|
|
|
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 }
|
|
|
Definition at line 51 of file PlugInManager.cpp. References Cleanup(). 00052 {
00053 Cleanup();
00054 }
|
Here is the call graph for this function:

|
||||||||||||||||||||
|
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:

|
|
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 }
|
|
|
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 }
|
|
|
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:

|
||||||||||||
|
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:

|
|
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:

|
|
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:

|
||||||||||||||||
|
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:

|
|
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:

|
|
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:

|
|
Referenced by QERApp_DeleteBrushHandle(). |
|
||||||||||||
|
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:

|
Here is the call graph for this function:

|
|
Definition at line 283 of file PlugInManager.cpp. 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 }
|
|
|
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:

|
|
Definition at line 61 of file PlugInManager.h. Referenced by QERApp_AllocateActiveBrushHandles(), QERApp_GetActiveBrushHandle(), and QERApp_ReleaseActiveBrushHandles(). 00061 {return m_ActiveBrushHandles; };
|
|
|
Definition at line 89 of file PlugInManager.h. Referenced by QERApp_AllocateEntityBrushHandles(), QERApp_GetEntityBrushHandle(), and QERApp_ReleaseEntityBrushHandles(). 00089 {return m_EntityBrushHandles; };
|
|
|
Definition at line 90 of file PlugInManager.h. Referenced by QERApp_CreateEntityHandle(). 00090 {return m_EntityHandles; };
|
|
|
Definition at line 63 of file PlugInManager.h. 00063 {return m_PluginPatches; };
|
|
|
Definition at line 62 of file PlugInManager.h. Referenced by QERApp_AllocateSelectedBrushHandles(), QERApp_GetSelectedBrushHandle(), and QERApp_ReleaseSelectedBrushHandles(). 00062 {return m_SelectedBrushHandles; };
|
|
|
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:

|
|
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:

|
|