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

ENTITY.H File Reference

Go to the source code of this file.

Data Structures

struct  entity_s

Typedefs

typedef entity_s entity_t

Functions

void DeleteKey (epair_t *&e, const char *key)
void DeleteKey (entity_t *ent, const char *key)
eclass_tEclass_ForName (char *name, qboolean has_brushes)
qboolean Eclass_hasModel (eclass_t *e, vec3_t &vMin, vec3_t &vMax)
void Eclass_InitForSourceDirectory (char *path)
void Entity_AddToList (entity_t *e, entity_t *list)
entity_tEntity_Clone (entity_t *e)
entity_tEntity_Create (eclass_t *c)
void Entity_Free (entity_t *e)
void Entity_FreeEpairs (entity_t *e)
void Entity_LinkBrush (entity_t *e, brush_t *b)
int Entity_MemorySize (entity_t *e)
entity_tEntity_Parse (qboolean onlypairs, brush_t *pList=NULL)
void Entity_RemoveFromList (entity_t *e)
void Entity_UnlinkBrush (brush_t *b)
void Entity_Write (entity_t *e, FILE *f, qboolean use_region)
void Entity_WriteSelected (entity_t *e, CMemFile *)
void Entity_WriteSelected (entity_t *e, FILE *f)
entity_tFindEntity (char *pszKey, char *pszValue)
entity_tFindEntityInt (char *pszKey, int iValue)
float FloatForKey (entity_t *ent, const char *key)
eclass_tGetCachedModel (entity_t *pEntity, const char *pName, vec3_t &vMin, vec3_t &vMax)
int GetUniqueTargetId (int iHint)
void GetVectorForKey (entity_t *ent, const char *key, vec3_t vec)
int IntForKey (entity_t *ent, const char *key)
epair_tParseEpair (void)
void SetKeyValue (epair_t *&e, const char *key, const char *value)
void SetKeyValue (entity_t *ent, const char *key, const char *value)
char * ValueForKey (epair_t *&e, const char *key)
char * ValueForKey (entity_t *ent, const char *key)


Typedef Documentation

typedef struct entity_s entity_t
 


Function Documentation

void DeleteKey epair_t *&  e,
const char *  key
 

Definition at line 109 of file ENTITY.CPP.

References epair_t, free(), epair_s::key, epair_s::next, next, strcmp(), and epair_s::value.

Referenced by DeleteKey(), DelProp(), Group_RemoveBrush(), Group_RemoveListFromWorld(), ProjectDlgProc(), and Select_Clone().

00110 {
00111     epair_t **ep, *next;
00112     
00113     ep = &e;
00114     while (*ep)
00115     {
00116         next = *ep;
00117         if ( !strcmp (next->key, key) )
00118         {
00119             *ep = next->next;
00120             free(next->key);
00121             free(next->value);
00122             free(next);
00123             return;
00124         }
00125         ep = &next->next;
00126     }
00127 }

Here is the call graph for this function:

void DeleteKey entity_t ent,
const char *  key
 

Definition at line 130 of file ENTITY.CPP.

References DeleteKey(), and entity_t::epairs.

00131 {
00132   DeleteKey(ent->epairs, key);
00133 }

Here is the call graph for this function:

eclass_t* Eclass_ForName char *  name,
qboolean  has_brushes
 

Definition at line 847 of file ECLASS.CPP.

References e, Eclass_InitFromText(), Eclass_InsertAlphabetized(), eclass_t, init(), eclass_s::name, name, eclass_s::next, sprintf(), strcmp(), and Sys_Printf().

Referenced by CPlugInManager::CommitEntityHandleToMap(), CreateEntity(), CreateEntityFromName(), Entity_Parse(), Map_New(), Patch_BrushToMesh(), Patch_CapCurrent(), and Patch_Thicken().

00848 {
00849     eclass_t    *e;
00850     char        init[1024];
00851 
00852 #ifdef _DEBUG
00853   // grouping stuff, not an eclass
00854   if (strcmp(name, "group_info")==0)
00855     Sys_Printf("WARNING: unexpected group_info entity in Eclass_ForName\n");
00856 #endif
00857 
00858     if (!name)
00859         return eclass_bad;
00860 
00861     for (e=eclass ; e ; e=e->next)
00862         if (!strcmp (name, e->name))
00863             return e;
00864 
00865     // create a new class for it
00866     if (has_brushes)
00867     {
00868         sprintf (init, "/*QUAKED %s (0 0.5 0) ?\nNot found in source.\n", name);
00869         e = Eclass_InitFromText (init);
00870     }
00871     else
00872     {
00873         sprintf (init, "/*QUAKED %s (0 0.5 0) (-8 -8 -8) (8 8 8)\nNot found in source.\n", name);
00874         e = Eclass_InitFromText (init);
00875     }
00876 
00877     Eclass_InsertAlphabetized (e);
00878 
00879     return e;
00880 }

Here is the call graph for this function:

qboolean Eclass_hasModel eclass_t e,
vec3_t vMin,
vec3_t vMax
 

Definition at line 554 of file ECLASS.CPP.

References e, eclass_t, entitymodel, free(), i, j, LoadModel(), eclass_s::model, eclass_s::modelpath, entitymodel_t::nTriCount, NULL, entitymodel_t::pNext, qboolean, qmalloc(), eclass_s::skinpath, strtok(), vec3_t, VectorAdd, VectorScale, and VectorSnap().

Referenced by GetCachedModel(), and HasModel().

00555 {
00556   if (e->modelpath != NULL)
00557   {
00558     if (e->model == NULL)
00559     {
00560       e->model = reinterpret_cast<entitymodel_t*>(qmalloc(sizeof(entitymodel_t)));
00561     }
00562     char *pModelBuff = strdup(e->modelpath);
00563     char *pSkinBuff = NULL;
00564     if (e->skinpath)
00565     {
00566       pSkinBuff = strdup(e->skinpath);
00567     }
00568 
00569     CStringList Models;
00570     CStringList Skins;
00571     char* pToken = strtok(pModelBuff, ";\0");
00572     while (pToken != NULL)
00573     {
00574       Models.AddTail(pToken);
00575       pToken = strtok(NULL, ";\0");
00576     }
00577 
00578     if (pSkinBuff != NULL)
00579     {
00580       pToken = strtok(pSkinBuff, ";\0");
00581       while (pToken != NULL)
00582       {
00583         Skins.AddTail(pToken);
00584         pToken = strtok(NULL, ";\0");
00585       }
00586     }
00587 
00588     entitymodel *model = e->model;
00589     for (int i = 0; i < Models.GetCount(); i++)
00590     {
00591       char *pSkin = NULL;
00592       if (i < Skins.GetCount())
00593       {
00594         pSkin = Skins.GetAt(Skins.FindIndex(i)).GetBuffer(0);
00595       }
00596       LoadModel(Models.GetAt(Models.FindIndex(i)), e, vMin, vMax, model, pSkin);
00597       model->pNext = reinterpret_cast<entitymodel_t*>(qmalloc(sizeof(entitymodel_t)));
00598       model = model->pNext;
00599     }
00600 
00601     // at this poitn vMin and vMax contain the min max of the model
00602     // which needs to be centered at origin 0, 0, 0
00603 
00604     VectorSnap(vMin);
00605     VectorSnap(vMax);
00606 
00607     if (vMax[0] - vMin[0] < 2)
00608     {
00609       vMin[0] -= 1;
00610       vMax[0] += 1;
00611     }
00612 
00613     if (vMin[1] - vMax[1] < 2)
00614     {
00615       vMin[1] -= 1;
00616       vMax[1] += 1;
00617     }
00618 
00619     if (vMax[2] - vMin[2] < 2)
00620     {
00621       vMax[2] -= 1;
00622       vMax[2] += 1;
00623     }
00624 
00625     vec3_t vTemp;
00626     VectorAdd(vMin, vMax, vTemp);
00627     VectorScale(vTemp, 0.5, vTemp);
00628     model = e->model;
00629     while (model != NULL)
00630     {
00631       for (i = 0; i < model->nTriCount; i++)
00632       {
00633         for (int j = 0; j < 3; j++)
00634         {
00635           ;//VectorSubtract(model->pTriList[i].v[j], vTemp, model->pTriList[i].v[j]);
00636         }
00637       }
00638       model = model->pNext;
00639     }
00640 
00641     free(pModelBuff);
00642     free(e->modelpath);
00643     e->modelpath = NULL;
00644       
00645     if(e->skinpath)
00646       {
00647           free(e->skinpath);
00648           e->skinpath = NULL;
00649       free(pSkinBuff);
00650       }
00651 
00652   }
00653   return (e->model != NULL && e->model->nTriCount > 0);
00654 }

Here is the call graph for this function:

void Eclass_InitForSourceDirectory char *  path  ) 
 

Definition at line 795 of file ECLASS.CPP.

References CleanUpEntities(), eclass, eclass_bad, Eclass_InitFromText(), Eclass_ScanFile(), file, QE_ConvertDOSToUnixName(), s, sprintf(), strcpy(), strDefFile, strlen(), and Sys_Printf().

Referenced by QE_LoadProject().

00796 {
00797     struct _finddata_t fileinfo;
00798     int     handle;
00799     char    filename[1024];
00800     char    filebase[1024];
00801     char    temp[1024];
00802     char    *s;
00803 
00804     QE_ConvertDOSToUnixName( temp, path );
00805 
00806     Sys_Printf ("Eclass_InitForSourceDirectory: %s\n", temp );
00807 
00808     strcpy (filebase, path);
00809     s = filebase + strlen(filebase)-1;
00810     while (*s != '\\' && *s != '/' && s!=filebase)
00811         s--;
00812     *s = 0;
00813 
00814   CleanUpEntities();
00815     eclass = NULL;
00816 //#ifdef BUILD_LIST
00817   if (g_bBuildList)
00818     strDefFile = "";
00819 //#endif
00820     handle = _findfirst (path, &fileinfo);
00821     if (handle != -1)
00822     {
00823         do
00824         {
00825             sprintf (filename, "%s\\%s", filebase, fileinfo.name);
00826             Eclass_ScanFile (filename);
00827         } while (_findnext( handle, &fileinfo ) != -1);
00828 
00829         _findclose (handle);
00830     }
00831 
00832 //#ifdef BUILD_LIST
00833   if (g_bBuildList)
00834   {
00835     CFile file;
00836     if (file.Open("c:\\entities.def", CFile::modeCreate | CFile::modeWrite)) 
00837     {
00838       file.Write(strDefFile.GetBuffer(0), strDefFile.GetLength());
00839       file.Close();
00840     }
00841   }
00842 //#endif
00843 
00844     eclass_bad = Eclass_InitFromText ("/*QUAKED UNKNOWN_CLASS (0 0.5 0) ?");
00845 }

Here is the call graph for this function:

void Entity_AddToList entity_t e,
entity_t list
 

Definition at line 188 of file ENTITY.CPP.

References e, and Error().

Referenced by Entity_Clone(), Entity_Create(), Undo_AddEntity(), Undo_Redo(), and Undo_Undo().

00189 {
00190     if (e->next || e->prev)
00191         Error ("Entity_AddToList: allready linked");
00192     e->next = list->next;
00193     list->next->prev = e;
00194     list->next = e;
00195     e->prev = list;
00196 }

Here is the call graph for this function:

entity_t* Entity_Clone entity_t e  ) 
 

Definition at line 852 of file ENTITY.CPP.

References entity_t::brushes, copystring(), e, entities, Entity_AddToList(), epair_t, entity_t::epairs, g_entityId, epair_s::key, n, nlist::next, epair_s::next, np, qmalloc(), and epair_s::value.

Referenced by CXYWnd::Paste(), Select_Clone(), and Undo_AddEntity().

00853 {
00854     entity_t    *n;
00855     epair_t     *ep, *np;
00856 
00857     n = (entity_t*)qmalloc(sizeof(*n));
00858     n->entityId = g_entityId++;
00859     n->brushes.onext = n->brushes.oprev = &n->brushes;
00860     n->eclass = e->eclass;
00861 
00862     // add the entity to the entity list
00863     Entity_AddToList(n, &entities);
00864 
00865     for (ep = e->epairs ; ep ; ep=ep->next)
00866     {
00867         np = (epair_t*)qmalloc(sizeof(*np));
00868         np->key = copystring(ep->key);
00869         np->value = copystring(ep->value);
00870         np->next = n->epairs;
00871         n->epairs = np;
00872     }
00873     return n;
00874 }

Here is the call graph for this function:

entity_t* Entity_Create eclass_t c  ) 
 

Definition at line 697 of file ENTITY.CPP.

References b, Brush_Build(), Brush_Create(), brush_t, entity_t::brushes, c, CPlugIn::CreatePluginEntity(), e, eclass_t, entities, Entity_AddToList(), Entity_LinkBrush(), Entity_UnlinkBrush(), eclass_s::fixedsize, g_entityId, g_pParentWnd, IPluginEntity::GetBounds(), CMainFrame::GetPlugInMgr(), eclass_s::hPlug, i, eclass_s::maxs, eclass_s::mins, brush_s::mins, eclass_s::name, brush_s::next, eclass_s::nShowFlags, brush_s::owner, CPlugInManager::PluginForModule(), brush_s::prev, qmalloc(), Select_Delete(), selected_brushes, SetKeyValue(), Sys_Beep(), Sys_Printf(), Sys_UpdateWindows(), eclass_s::texdef, vec3_t, VectorAdd, and W_ALL.

Referenced by CreateEntity(), CreateEntityFromName(), Patch_BrushToMesh(), Patch_CapCurrent(), and Patch_Thicken().

00698 {
00699     entity_t    *e;
00700     brush_t     *b;
00701     vec3_t      mins, maxs;
00702     int         i;
00703 
00704     // check to make sure the brushes are ok
00705 
00706     for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
00707   {
00708         if (b->owner != world_entity)
00709         {
00710             Sys_Printf ("Entity NOT created, brushes not all from world\n");
00711             Sys_Beep ();
00712             return NULL;
00713         }
00714   }
00715 
00716     // create it
00717 
00718     e = (entity_t*)qmalloc(sizeof(*e));
00719     e->entityId = g_entityId++;
00720     e->brushes.onext = e->brushes.oprev = &e->brushes;
00721     e->eclass = c;
00722     SetKeyValue (e, "classname", c->name);
00723 
00724     // add the entity to the entity list
00725   Entity_AddToList(e, &entities);
00726 
00727     // plugin entity ?
00728     if (c->nShowFlags & ECLASS_PLUGINENTITY)
00729     {
00730         // locate the plugin
00731         CPlugIn * pPlug = g_pParentWnd->GetPlugInMgr().PluginForModule( c->hPlug );
00732         if (pPlug)
00733         {
00734             //
00735             // just use the selection for positioning
00736             //
00737             b = selected_brushes.next;
00738             for (i=0 ; i<3 ; i++)
00739                 e->origin[i] = b->mins[i] - c->mins[i];
00740 
00741             // create the plugin entity
00742             IPluginEntity* pPlugEnt = pPlug->CreatePluginEntity( e );
00743             
00744             if (pPlugEnt)
00745             {
00746                 e->pPlugEnt = pPlugEnt;
00747                 // the brush is used to select and move
00748                 pPlugEnt->GetBounds( mins, maxs );
00749                 b = Brush_Create (mins, maxs, &c->texdef);
00750                 
00751                 Entity_LinkBrush (e, b);
00752                 
00753                 // delete the current selection
00754                 Select_Delete ();
00755                 
00756                 // select the new brush
00757                 b->next = b->prev = &selected_brushes;
00758                 selected_brushes.next = selected_brushes.prev = b;
00759                 
00760                 Brush_Build( b );
00761             }
00762         }
00763         else
00764         {
00765             Sys_Printf( "WARNING: plugin lookup failed while creating a plugin entitiy in Entity_Create\n" );
00766             return NULL;
00767         }
00768     }
00769     else if (c->fixedsize)
00770     {
00771         //
00772         // just use the selection for positioning
00773         //
00774         b = selected_brushes.next;
00775         for (i=0 ; i<3 ; i++)
00776             e->origin[i] = b->mins[i] - c->mins[i];
00777 
00778         // create a custom brush
00779         VectorAdd (c->mins, e->origin, mins);
00780         VectorAdd (c->maxs, e->origin, maxs);
00781 
00782       b = Brush_Create (mins, maxs, &c->texdef);
00783 
00784         Entity_LinkBrush (e, b);
00785 
00786         // delete the current selection
00787         Select_Delete ();
00788 
00789         // select the new brush
00790         b->next = b->prev = &selected_brushes;
00791         selected_brushes.next = selected_brushes.prev = b;
00792 
00793         Brush_Build( b );
00794     }
00795     else
00796     {
00797         //
00798         // change the selected brushes over to the new entity
00799         //
00800         for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
00801         {
00802             Entity_UnlinkBrush (b);
00803             Entity_LinkBrush (e, b);
00804             Brush_Build( b );   // so the key brush gets a name
00805         }
00806     }
00807 
00808     Sys_UpdateWindows (W_ALL);
00809     return e;
00810 }

Here is the call graph for this function:

void Entity_Free entity_t e  ) 
 

Definition at line 222 of file ENTITY.CPP.

References Brush_Free(), entity_t::brushes, e, Entity_FreeEpairs(), and free().

Referenced by CPlugInManager::Cleanup(), CPlugInManager::CommitEntityHandleToMap(), Map_Free(), Map_LoadFile(), Map_SaveFile(), CMainFrame::OnDestroy(), Select_Ungroup(), Undo_Clear(), Undo_ClearRedo(), Undo_FreeFirstUndo(), Undo_Redo(), and Undo_Undo().

00223 {
00224     // do we have a plugin entity ?
00225     if ( e->pPlugEnt )
00226     {
00227         e->pPlugEnt->DecRef();
00228         e->pPlugEnt = NULL;
00229     }
00230 
00231     while (e->brushes.onext != &e->brushes)
00232         Brush_Free (e->brushes.onext);
00233 
00234     if (e->next)
00235     {
00236         e->next->prev = e->prev;
00237         e->prev->next = e->next;
00238     }
00239 
00240     Entity_FreeEpairs(e);
00241 
00242     free (e);
00243 }

Here is the call graph for this function:

void Entity_FreeEpairs entity_t e  ) 
 

Definition at line 169 of file ENTITY.CPP.

References e, epair_t, entity_t::epairs, free(), epair_s::key, epair_s::next, next, and epair_s::value.

Referenced by Entity_Free(), Undo_Redo(), and Undo_Undo().

00170 {
00171     epair_t *ep, *next;
00172 
00173     for (ep = e->epairs; ep; ep = next)
00174     {
00175         next = ep->next;
00176         free (ep->key);
00177         free (ep->value);
00178         free (ep);
00179     }
00180     e->epairs = NULL;
00181 }

Here is the call graph for this function:

void Entity_LinkBrush entity_t e,
brush_t b
 

Definition at line 818 of file ENTITY.CPP.

References b, brush_t, entity_t::brushes, e, Error(), brush_s::onext, brush_s::oprev, and brush_s::owner.

Referenced by AddBrushForPatch(), AddBrushForTerrain(), AddProp(), AddRegionBrushes(), Brush_MakeSided(), Brush_MakeSidedCone(), Brush_MakeSidedSphere(), Brush_Merge(), Brush_MergeList(), Brush_SplitBrushByFace(), CPlugInManager::CommitBrushHandleToEntity(), CPlugInManager::CommitBrushHandleToMap(), CXYWnd::Copy(), CopyAndSelect(), CopyToMap(), CreateEntityBrush(), CreateEntityFromName(), Entity_Create(), Entity_Parse(), Map_ImportBuffer(), CXYWnd::NewBrushDrag(), CMainFrame::OnCreate(), CXYWnd::Paste(), QERApp_CreateBrush(), Select_Clone(), Select_Ungroup(), Undo_Redo(), and Undo_Undo().

00819 {
00820     if (b->oprev || b->onext)
00821         Error ("Entity_LinkBrush: Allready linked");
00822     b->owner = e;
00823 
00824     b->onext = e->brushes.onext;
00825     b->oprev = &e->brushes;
00826     e->brushes.onext->oprev = b;
00827     e->brushes.onext = b;
00828 }

Here is the call graph for this function:

int Entity_MemorySize entity_t e  ) 
 

Definition at line 250 of file ENTITY.CPP.

References e, epair_t, entity_t::epairs, epair_s::key, epair_s::next, and epair_s::value.

Referenced by Undo_AddEntity(), Undo_Clear(), Undo_FreeFirstUndo(), Undo_Redo(), and Undo_Undo().

00251 {
00252     epair_t *ep;
00253     int size = 0;
00254 
00255     for (ep = e->epairs; ep; ep = ep->next)
00256     {
00257         size += _msize(ep->key);
00258         size += _msize(ep->value);
00259         size += _msize(ep);
00260     }
00261     size += _msize(e);
00262     return size;
00263 }

entity_t* Entity_Parse qboolean  onlypairs,
brush_t pList = NULL
 

Definition at line 295 of file ENTITY.CPP.

References a, b, Brush_Build(), Brush_Create(), Brush_Free(), Brush_Parse(), Brush_Rotate(), brush_t, entity_t::brushes, CPlugIn::CreatePluginEntity(), e, Eclass_ForName(), eclass_t, Entity_LinkBrush(), epair_t, Error(), eclass_s::fixedsize, FloatForKey(), g_entityId, g_pParentWnd, IPluginEntity::GetBounds(), GetCachedModel(), CMainFrame::GetPlugInMgr(), GetToken(), GetVectorForKey(), eclass_s::hPlug, eclass_s::maxs, eclass_s::mins, n, brush_s::next, epair_s::next, eclass_s::nShowFlags, NULL, brush_s::onext, brush_s::oprev, brush_s::owner, p, ParseEpair(), CPlugInManager::PluginForModule(), brush_s::prev, printf(), qboolean, qmalloc(), SetKeyValue(), strcmp(), strlen(), Sys_Printf(), eclass_s::texdef, ValueForKey(), vec3_t, VectorAdd, and Warning().

Referenced by Map_ImportBuffer(), Map_LoadFile(), and QE_LoadProject().

00296 {
00297     entity_t    *ent;
00298     eclass_t    *e;
00299     brush_t     *b;
00300     vec3_t      mins, maxs;
00301     epair_t     *ep;
00302     qboolean    has_brushes;
00303     
00304     if (!GetToken (true))
00305         return NULL;
00306     
00307     if (strcmp (token, "{") )
00308         Error ("ParseEntity: { not found");
00309     
00310     ent = (entity_t*)qmalloc (sizeof(*ent));
00311     ent->entityId = g_entityId++;
00312     ent->brushes.onext = ent->brushes.oprev = &ent->brushes;
00313 
00314   int n = 0;
00315     do
00316     {
00317         if (!GetToken (true))
00318         {
00319             Warning ("ParseEntity: EOF without closing brace");
00320             return NULL;
00321         }
00322         if (!strcmp (token, "}") )
00323             break;
00324         if (!strcmp (token, "{") )
00325         {
00326             b = Brush_Parse ();
00327             if (b != NULL)
00328             {
00329                 b->owner = ent;
00330                 // add to the end of the entity chain
00331                 b->onext = &ent->brushes;
00332                 b->oprev = ent->brushes.oprev;
00333                 ent->brushes.oprev->onext = b;
00334                 ent->brushes.oprev = b;
00335             }
00336             else
00337             {
00338                 break;
00339             }
00340         }
00341         else
00342         {
00343             ep = ParseEpair ();
00344             ep->next = ent->epairs;
00345             ent->epairs = ep;
00346         }
00347     } while (1);
00348     
00349   // group info entity?
00350   if (strcmp(ValueForKey (ent, "classname"), "group_info") == 0)
00351     return ent;
00352 
00353     if (onlypairs)
00354         return ent;
00355     
00356     if (ent->brushes.onext == &ent->brushes)
00357         has_brushes = false;
00358     else
00359         has_brushes = true;
00360     
00361     GetVectorForKey (ent, "origin", ent->origin);
00362     
00363     e = Eclass_ForName (ValueForKey (ent, "classname"), has_brushes);
00364     ent->eclass = e;
00365     if ( e->nShowFlags & ECLASS_PLUGINENTITY )
00366     {
00367         // locate the plugin
00368         CPlugIn * pPlug = g_pParentWnd->GetPlugInMgr().PluginForModule( e->hPlug );
00369         if (pPlug)
00370         {
00371             // create the plugin entity
00372             IPluginEntity* pPlugEnt = pPlug->CreatePluginEntity( ent );
00373             if (pPlugEnt)
00374             {
00375                 ent->pPlugEnt = pPlugEnt;
00376                 // the brush is used to select and move
00377                 pPlugEnt->GetBounds( mins, maxs );
00378             }
00379             else
00380             {
00381                 // give it a default bounding box
00382                 SetKeyValue (ent, "model", "");
00383                 mins[0] = -4; mins[1] = -4; mins[2] = -4;
00384                 maxs[0] = 4; maxs[1] = 4; maxs[2] = 4;
00385                 VectorAdd( mins, ent->origin, mins );
00386                 VectorAdd( maxs, ent->origin, maxs );
00387             }
00388             b = Brush_Create (mins, maxs, &ent->eclass->texdef);
00389             Entity_LinkBrush (ent, b);
00390             Brush_Build( b, true );
00391         }
00392         else
00393             Sys_Printf("WARNING: plugin lookup failed for plugin entities\n");
00394     }
00395     else if (e->fixedsize)
00396     {   // fixed size entity
00397         if (ent->brushes.onext != &ent->brushes)
00398         {
00399             printf ("Warning: Fixed size entity with brushes\n");
00400 #if 0
00401             while (ent->brushes.onext != &ent->brushes)
00402             {   // FIXME: this will free the entity and crash!
00403                 Brush_Free (b);
00404             }
00405 #endif
00406             ent->brushes.next = ent->brushes.prev = &ent->brushes;
00407         }
00408         
00409         // create a custom brush
00410         VectorAdd (e->mins, ent->origin, mins);
00411         VectorAdd (e->maxs, ent->origin, maxs);
00412         
00413         float a = 0;
00414         if (e->nShowFlags & ECLASS_MISCMODEL)
00415         {
00416             char* p = ValueForKey(ent, "model");
00417             if (p != NULL && strlen(p) > 0)
00418             {
00419                 vec3_t vMin, vMax;
00420                 a = FloatForKey (ent, "angle");
00421                 if (GetCachedModel(ent, p, vMin, vMax))
00422                 {
00423                     // create a custom brush
00424                     VectorAdd (ent->md3Class->mins, ent->origin, mins);
00425                     VectorAdd (ent->md3Class->maxs, ent->origin, maxs);
00426                 }
00427             }
00428         }
00429         
00430         b = Brush_Create (mins, maxs, &e->texdef);
00431         
00432         if (a)
00433         {
00434             vec3_t vAngle;
00435             vAngle[0] = vAngle[1] = 0;
00436             vAngle[2] = a;
00437             Brush_Rotate(b, vAngle, ent->origin, false);
00438         }
00439         
00440         
00441         b->owner = ent;
00442         
00443         b->onext = ent->brushes.onext;
00444         b->oprev = &ent->brushes;
00445         ent->brushes.onext->oprev = b;
00446         ent->brushes.onext = b;
00447     }
00448     else
00449     {   // brush entity
00450         if (ent->brushes.next == &ent->brushes)
00451             printf ("Warning: Brush entity with no brushes\n");
00452     }
00453     
00454     // add all the brushes to the main list
00455     if (pList)
00456     {
00457         for (b=ent->brushes.onext ; b != &ent->brushes ; b=b->onext)
00458         {
00459             b->next = pList->next;
00460             pList->next->prev = b;
00461             b->prev = pList;
00462             pList->next = b;
00463         }
00464     }
00465     
00466     return ent;
00467 }

Here is the call graph for this function:

void Entity_RemoveFromList entity_t e  ) 
 

Definition at line 203 of file ENTITY.CPP.

References e, and Error().

Referenced by Undo_AddEntity(), Undo_Redo(), and Undo_Undo().

00204 {
00205     if (!e->next || !e->prev)
00206         Error ("Entity_RemoveFromList: not linked");
00207     e->next->prev = e->prev;
00208     e->prev->next = e->next;
00209     e->next = e->prev = NULL;
00210 }

Here is the call graph for this function:

void Entity_UnlinkBrush brush_t b  ) 
 

Definition at line 835 of file ENTITY.CPP.

References b, brush_t, Error(), brush_s::onext, brush_s::oprev, and brush_s::owner.

Referenced by Brush_Clone(), Brush_Free(), Brush_FullClone(), Entity_Create(), Map_ImportBuffer(), Select_Ungroup(), Undo_Redo(), and Undo_Undo().

00836 {
00837     //if (!b->owner || !b->onext || !b->oprev)
00838     if (!b->onext || !b->oprev)
00839         Error ("Entity_UnlinkBrush: Not currently linked");
00840     b->onext->oprev = b->oprev;
00841     b->oprev->onext = b->onext;
00842     b->onext = b->oprev = NULL;
00843     b->owner = NULL;
00844 }

Here is the call graph for this function:

void Entity_Write entity_t e,
FILE f,
qboolean  use_region
 

Definition at line 481 of file ENTITY.CPP.

References camera_t::angles, b, brush_t, Brush_Write(), entity_t::brushes, CCamWnd::Camera(), count, e, ECLASS_MISCMODEL, epair_t, entity_t::epairs, f, fprintf(), g_pParentWnd, CMainFrame::GetCamera(), epair_s::key, Map_IsBrushFiltered(), bspbrush_s::mins, epair_s::next, brush_s::onext, entity_t::origin, camera_t::origin, SetKeyValue(), sprintf(), strcmp(), epair_s::value, ValueForKey(), vec3_t, VectorCopy, and VectorSubtract.

Referenced by Map_SaveFile().

00482 {
00483     epair_t     *ep;
00484     brush_t     *b;
00485     vec3_t      origin;
00486     char        text[128];
00487     int         count;
00488 
00489     // if none of the entities brushes are in the region,
00490     // don't write the entity at all
00491     if (use_region)
00492     {
00493         // in region mode, save the camera position as playerstart
00494         if ( !strcmp(ValueForKey (e, "classname"), "info_player_start") )
00495         {
00496             fprintf (f, "{\n");
00497             fprintf (f, "\"classname\" \"info_player_start\"\n");
00498             fprintf (f, "\"origin\" \"%i %i %i\"\n", (int)g_pParentWnd->GetCamera()->Camera().origin[0],
00499                 (int)g_pParentWnd->GetCamera()->Camera().origin[1], (int)g_pParentWnd->GetCamera()->Camera().origin[2]);
00500             fprintf (f, "\"angle\" \"%i\"\n", (int)g_pParentWnd->GetCamera()->Camera().angles[YAW]);
00501             fprintf (f, "}\n");
00502             return;
00503         }
00504 
00505         for (b=e->brushes.onext ; b != &e->brushes ; b=b->onext)
00506             if (!Map_IsBrushFiltered(b))
00507                 break;  // got one
00508 
00509         if (b == &e->brushes)
00510             return;     // nothing visible
00511     }
00512 
00513     if ( e->eclass->nShowFlags & ECLASS_PLUGINENTITY )
00514     {
00515         // NOTE: the whole brush placement / origin stuff is a mess
00516         VectorCopy( e->origin, origin );
00517         sprintf (text, "%i %i %i", (int)origin[0], (int)origin[1], (int)origin[2]);
00518         SetKeyValue (e, "origin", text);
00519     }
00520     // if fixedsize, calculate a new origin based on the current
00521     // brush position
00522     else if (e->eclass->fixedsize)
00523     {
00524         if (e->eclass->nShowFlags & ECLASS_MISCMODEL && e->md3Class != NULL)
00525         {
00526             VectorCopy(e->origin, origin);
00527             //VectorSubtract (e->brushes.onext->mins, e->md3Class->mins, origin);
00528         }
00529         else
00530         {
00531             VectorSubtract (e->brushes.onext->mins, e->eclass->mins, origin);
00532         }
00533         sprintf (text, "%i %i %i", (int)origin[0], (int)origin[1], (int)origin[2]);
00534         SetKeyValue (e, "origin", text);
00535     }
00536 
00537     fprintf (f, "{\n");
00538     for (ep = e->epairs ; ep ; ep=ep->next)
00539         fprintf (f, "\"%s\" \"%s\"\n", ep->key, ep->value);
00540 
00541     if (!e->eclass->fixedsize)
00542     {
00543         count = 0;
00544         for (b=e->brushes.onext ; b != &e->brushes ; b=b->onext)
00545         {
00546             if (!use_region || !Map_IsBrushFiltered (b))
00547       {
00548                 fprintf (f, "// brush %i\n", count);
00549                 count++;
00550                 Brush_Write (b, f);
00551             }
00552         }
00553     }
00554     fprintf (f, "}\n");
00555 }

Here is the call graph for this function:

void Entity_WriteSelected entity_t e,
CMemFile * 
 

Definition at line 632 of file ENTITY.CPP.

References b, brush_t, Brush_Write(), entity_t::brushes, count, e, ECLASS_MISCMODEL, epair_t, entity_t::epairs, IsBrushSelected(), epair_s::key, MemFile_fprintf(), bspbrush_s::mins, epair_s::next, brush_s::onext, entity_t::origin, SetKeyValue(), sprintf(), epair_s::value, vec3_t, VectorCopy, and VectorSubtract.

Referenced by Map_SaveSelected().

00633 {
00634     epair_t     *ep;
00635     brush_t     *b;
00636     vec3_t      origin;
00637     char        text[128];
00638     int         count;
00639 
00640     for (b=e->brushes.onext ; b != &e->brushes ; b=b->onext)
00641         if (IsBrushSelected(b))
00642             break;  // got one
00643 
00644     if (b == &e->brushes)
00645         return;     // nothing selected
00646 
00647     // if fixedsize, calculate a new origin based on the current
00648     // brush position
00649     if (e->eclass->fixedsize)
00650     {
00651     if (e->eclass->nShowFlags & ECLASS_MISCMODEL && e->md3Class != NULL)
00652     {
00653           //VectorSubtract (e->brushes.onext->mins, e->md3Class->mins, origin);
00654       VectorCopy(e->origin, origin);
00655     }
00656     else
00657     {
00658           VectorSubtract (e->brushes.onext->mins, e->eclass->mins, origin);
00659     }
00660     sprintf (text, "%i %i %i", (int)origin[0], (int)origin[1], (int)origin[2]);
00661         SetKeyValue (e, "origin", text);
00662     }
00663 
00664   MemFile_fprintf(pMemFile, "{\n");
00665     for (ep = e->epairs ; ep ; ep=ep->next)
00666       MemFile_fprintf(pMemFile, "\"%s\" \"%s\"\n", ep->key, ep->value);
00667 
00668   if (!e->eclass->fixedsize)
00669   {
00670       count = 0;
00671       for (b=e->brushes.onext ; b != &e->brushes ; b=b->onext)
00672       {
00673           if (IsBrushSelected(b))
00674           {
00675               MemFile_fprintf(pMemFile, "// brush %i\n", count);
00676               count++;
00677               Brush_Write (b, pMemFile);
00678           }
00679       }
00680   }
00681     MemFile_fprintf(pMemFile, "}\n");
00682 }

Here is the call graph for this function:

void Entity_WriteSelected entity_t e,
FILE f
 

Definition at line 574 of file ENTITY.CPP.

References b, brush_t, Brush_Write(), entity_t::brushes, count, e, ECLASS_MISCMODEL, epair_t, entity_t::epairs, f, fprintf(), IsBrushSelected(), epair_s::key, bspbrush_s::mins, epair_s::next, brush_s::onext, entity_t::origin, SetKeyValue(), sprintf(), epair_s::value, vec3_t, VectorCopy, and VectorSubtract.

00575 {
00576     epair_t     *ep;
00577     brush_t     *b;
00578     vec3_t      origin;
00579     char        text[128];
00580     int         count;
00581 
00582     for (b=e->brushes.onext ; b != &e->brushes ; b=b->onext)
00583         if (IsBrushSelected(b))
00584             break;  // got one
00585 
00586     if (b == &e->brushes)
00587         return;     // nothing selected
00588 
00589     // if fixedsize, calculate a new origin based on the current
00590     // brush position
00591     if (e->eclass->fixedsize)
00592     {
00593     if (e->eclass->nShowFlags & ECLASS_MISCMODEL && e->md3Class != NULL)
00594     {
00595       VectorCopy(e->origin, origin);
00596           //VectorSubtract (e->brushes.onext->mins, e->md3Class->mins, origin);
00597     }
00598     else
00599     {
00600           VectorSubtract (e->brushes.onext->mins, e->eclass->mins, origin);
00601     }
00602     sprintf (text, "%i %i %i", (int)origin[0], (int)origin[1], (int)origin[2]);
00603         SetKeyValue (e, "origin", text);
00604     }
00605 
00606   fprintf (f, "{\n");
00607     for (ep = e->epairs ; ep ; ep=ep->next)
00608       fprintf (f, "\"%s\" \"%s\"\n", ep->key, ep->value);
00609 
00610   if (!e->eclass->fixedsize)
00611   {
00612       count = 0;
00613       for (b=e->brushes.onext ; b != &e->brushes ; b=b->onext)
00614       {
00615           if (IsBrushSelected(b))
00616           {
00617               fprintf (f, "// brush %i\n", count);
00618               count++;
00619               Brush_Write (b, f);
00620           }
00621       }
00622   }
00623     fprintf (f, "}\n");
00624 }

Here is the call graph for this function:

entity_t* FindEntity char *  pszKey,
char *  pszValue
 

Definition at line 905 of file ENTITY.CPP.

References entities, NULL, strcmp(), and ValueForKey().

Referenced by Map_ImportBuffer().

00906 {
00907     entity_t *pe;
00908     
00909     pe = entities.next;
00910     
00911     for (; pe != NULL && pe != &entities ; pe = pe->next)
00912     {
00913         if (!strcmp(ValueForKey(pe, pszKey), pszValue))
00914             return pe;
00915     }
00916 
00917     return NULL;
00918 }

Here is the call graph for this function:

entity_t* FindEntityInt char *  pszKey,
int  iValue
 

Definition at line 920 of file ENTITY.CPP.

References entities, IntForKey(), and NULL.

00921 {
00922     entity_t *pe;
00923     
00924     pe = entities.next;
00925     
00926     for (; pe != NULL && pe != &entities ; pe = pe->next)
00927     {
00928         if (IntForKey(pe, pszKey) == iValue)
00929             return pe;
00930     }
00931 
00932     return NULL;
00933 }

Here is the call graph for this function:

float FloatForKey entity_t ent,
const char *  key
 

Definition at line 138 of file ENTITY.CPP.

References atof(), k, and ValueForKey().

Referenced by AAS_PositionBrush(), AAS_PositionFuncRotatingBrush(), AddTriangleModels(), CPlugInManager::CommitEntityHandleToMap(), CreateEntityLights(), DrawBrushEntityName(), Entity_Parse(), CEpairsWrapper::FloatForKey(), LightWorld(), Map_LoadFile(), CMainFrame::OnBrushFlipx(), CMainFrame::OnBrushFlipy(), PaintedModel(), TrackMD3Angles(), VL_CreateEntityLights(), VL_LightWorld(), VS_CreateEntitySpeakers(), and VS_LightWorld().

00139 {
00140     char    *k;
00141     
00142     k = ValueForKey (ent, key);
00143     return atof(k);
00144 }

Here is the call graph for this function:

eclass_t* GetCachedModel entity_t pEntity,
const char *  pName,
vec3_t vMin,
vec3_t vMax
 

Definition at line 883 of file ECLASS.CPP.

References eclass_s::color, e, Eclass_hasModel(), EClass_InsertSortedList(), eclass_t, free(), g_md3Cache, eclass_s::maxs, memset(), eclass_s::mins, eclass_s::modelpath, eclass_s::name, eclass_s::next, NULL, p, qmalloc(), eclass_s::skinpath, strcmp(), strlen(), strncpy(), strstr(), and VectorCopy.

Referenced by CPlugInManager::CommitEntityHandleToMap(), Entity_Parse(), and HasModel().

00884 {
00885 
00886     eclass_t *e = NULL;
00887   if (pName == NULL || strlen(pName) == 0)
00888   {
00889     return NULL;
00890   }
00891 
00892     for (e = g_md3Cache; e ; e = e->next)
00893   {
00894         if (!strcmp (pName, e->name))
00895     {
00896       pEntity->md3Class = e;
00897       VectorCopy(e->mins, vMin);
00898       VectorCopy(e->maxs, vMax);
00899             return e;
00900     }
00901   }
00902 
00903     e = (eclass_t*)qmalloc(sizeof(*e));
00904     memset (e, 0, sizeof(*e));
00905   e->name = strdup(pName);
00906   e->modelpath = strdup(pName);
00907   e->skinpath = strdup(pName);
00908   char *p = strstr(e->skinpath, ".md3");
00909   if (p != NULL)
00910   {
00911     p++;
00912     strncpy(p, "tga", 3);
00913   }
00914   else
00915   {
00916     free(e->skinpath);
00917     e->skinpath = NULL;
00918   }
00919 
00920   e->color[0] = e->color[2] = 0.85;
00921 
00922   if (Eclass_hasModel(e, vMin, vMax))
00923   {
00924     EClass_InsertSortedList(g_md3Cache, e);
00925     VectorCopy(vMin, e->mins);
00926     VectorCopy(vMax, e->maxs);
00927     pEntity->md3Class = e;
00928     return e;
00929   }
00930 
00931   return NULL;
00932 }

Here is the call graph for this function:

int GetUniqueTargetId int  iHint  ) 
 

Definition at line 876 of file ENTITY.CPP.

References BOOL, entities, i, IntForKey(), max, min, and NULL.

Referenced by UpdateTarget().

00877 {
00878     int iMin, iMax, i;
00879     BOOL fFound;
00880     entity_t *pe;
00881     
00882     fFound = FALSE;
00883     pe = entities.next;
00884     iMin = 0; 
00885     iMax = 0;
00886     
00887     for (; pe != NULL && pe != &entities ; pe = pe->next)
00888     {
00889         i = IntForKey(pe, "target");
00890         if (i)
00891         {
00892             iMin = min(i, iMin);
00893             iMax = max(i, iMax);
00894             if (i == iHint)
00895                 fFound = TRUE;
00896         }
00897     }
00898 
00899     if (fFound)
00900         return iMax + 1;
00901     else
00902         return iHint;
00903 }

Here is the call graph for this function:

void GetVectorForKey entity_t ent,
const char *  key,
vec3_t  vec
 

Definition at line 154 of file ENTITY.CPP.

References k, sscanf(), and ValueForKey().

Referenced by AAS_PositionFuncRotatingBrush(), AddTriangleModels(), CalcTerrainSize(), CPlugInManager::CommitEntityHandleToMap(), CreateEntityLights(), DrawLight(), Entity_Parse(), FloodEntities(), LeakFile(), LightWorld(), Map_LoadFile(), ParseMapEntity(), Q2_ParseBSPEntity(), Q2_ParseMapEntity(), Q3_ParseBSPEntity(), SetEntityOrigins(), Sin_ParseBSPEntity(), VL_CreateEntityLights(), VL_LightWorld(), VS_CreateEntitySpeakers(), VS_LightWorld(), and WriteMapFileSafe().

00155 {
00156     char    *k;
00157     
00158     k = ValueForKey (ent, key);
00159     sscanf (k, "%f %f %f", &vec[0], &vec[1], &vec[2]);
00160 }

Here is the call graph for this function:

int IntForKey entity_t ent,
const char *  key
 

Definition at line 146 of file ENTITY.CPP.

References atoi, k, and ValueForKey().

Referenced by FacingVectors(), FindEntityInt(), GetUniqueTargetId(), QE_LoadProject(), and UpdateTarget().

00147 {
00148     char    *k;
00149     
00150     k = ValueForKey (ent, key);
00151     return atoi(k);
00152 }

Here is the call graph for this function:

epair_t* ParseEpair void   ) 
 

Definition at line 378 of file bspfile.c.

References copystring(), e, epair_t, Error(), GetToken(), epair_s::key, malloc(), MAX_KEY, MAX_VALUE, memset(), qfalse, qmalloc(), strcpy(), StripTrailing(), strlen(), and epair_s::value.

00378                             {
00379     epair_t *e;
00380 
00381     e = malloc( sizeof(epair_t) );
00382     memset( e, 0, sizeof(epair_t) );
00383     
00384     if ( strlen(token) >= MAX_KEY-1 ) {
00385         Error ("ParseEpar: token too long");
00386     }
00387     e->key = copystring( token );
00388     GetToken( qfalse );
00389     if ( strlen(token) >= MAX_VALUE-1 ) {
00390         Error ("ParseEpar: token too long");
00391     }
00392     e->value = copystring( token );
00393 
00394     // strip trailing spaces that sometimes get accidentally
00395     // added in the editor
00396     StripTrailing( e->key );
00397     StripTrailing( e->value );
00398 
00399     return e;
00400 }

Here is the call graph for this function:

void SetKeyValue epair_t *&  e,
const char *  key,
const char *  value
 

Definition at line 70 of file ENTITY.CPP.

References e, epair_t, free(), epair_s::key, epair_s::next, qmalloc(), strcmp(), strcpy(), strlen(), value, and epair_s::value.

Referenced by AddCommandDlgProc(), AddProp(), Brush_SetEpair(), CPlugInManager::CommitEntityHandleToMap(), ConnectEntities(), CreateEntityFromName(), Drag_Begin(), EditCommandDlgProc(), Entity_Create(), Entity_Parse(), Entity_Write(), Entity_WriteSelected(), EntityWndProc(), FinishBrush(), GetSpawnFlags(), Group_Alloc(), Map_ImportBuffer(), Map_New(), CMainFrame::OnBrushFlipx(), CMainFrame::OnBrushFlipy(), Patch_CapCurrent(), Patch_SetEpair(), Patch_Thicken(), ProjectDlgProc(), Q2_ParseBrush(), Q2_ParseMapEntity(), QE_LoadProject(), SetKeyValue(), SetLightStyles(), SetModelNumbers(), Terrain_SetEpair(), UpdateTarget(), and WriteMapFileSafe().

00071 {
00072     epair_t *ep;
00073   for (ep=e ; ep ; ep=ep->next)
00074   {
00075         if (!strcmp (ep->key, key) )
00076         {
00077             free (ep->value);
00078             ep->value = (char*)qmalloc(strlen(value)+1);
00079             strcpy (ep->value, value);
00080             return;
00081         }
00082   }
00083     ep = (epair_t*)qmalloc (sizeof(*ep));
00084     ep->next = e;
00085     e = ep;
00086     ep->key = (char*)qmalloc(strlen(key)+1);
00087     strcpy (ep->key, key);
00088     ep->value = (char*)qmalloc(strlen(value)+1);
00089     strcpy (ep->value, value);
00090 
00091 }

Here is the call graph for this function:

void SetKeyValue entity_t ent,
const char *  key,
const char *  value
 

Definition at line 515 of file bspfile.c.

References copystring(), epair_t, entity_t::epairs, free(), epair_s::key, malloc(), epair_s::next, strcmp(), value, and epair_s::value.

00515                                                                          {
00516     epair_t *ep;
00517     
00518     for ( ep=ent->epairs ; ep ; ep=ep->next ) {
00519         if ( !strcmp (ep->key, key) ) {
00520             free (ep->value);
00521             ep->value = copystring(value);
00522             return;
00523         }
00524     }
00525     ep = malloc (sizeof(*ep));
00526     ep->next = ent->epairs;
00527     ent->epairs = ep;
00528     ep->key = copystring(key);
00529     ep->value = copystring(value);
00530 }

Here is the call graph for this function:

char* ValueForKey epair_t *&  e,
const char *  key
 

Definition at line 28 of file ENTITY.CPP.

References epair_t, epair_s::key, epair_s::next, strcmp(), and epair_s::value.

Referenced by AAS_AlwaysTriggered_r(), AAS_PositionBrush(), AAS_ValidEntity(), AddTriangleModels(), AssignModel(), AssignSound(), Brush_GetKeyValue(), CalcTerrainSize(), CheckBspProcess(), CPlugInManager::CommitEntityHandleToMap(), ConnectEntities(), CreateEntityLights(), CMainFrame::CreateQEChildren(), DemandLoadShaderTexture(), DLLBuildDone(), DrawBrushEntityName(), DrawLight(), DrawPathLines(), EditCommandDlgProc(), Entity_Parse(), ExpandReletivePath(), FillTextureMenu(), FindEntity(), FindTargetEntity(), FloatForKey(), FloodEntities(), FS_FOpenFileWrite(), FS_ReadFile(), GetVectorForKey(), Group_Add(), Group_ForName(), Group_GetListFromWorld(), Group_Save(), HasModel(), HL_LoadMapFromBSP(), CPlugInManager::Init(), IntForKey(), LightMain(), LoadAlphaMap(), LoadModel(), LoadShaders(), Map_ImportBuffer(), CMainFrame::OnMiscSelectentitycolor(), Patch_GetKeyValue(), ProjectDialog(), Q1_LoadMapFromBSP(), Q2_ParseBSPEntity(), Q3_ParseBSPEntity(), QE_CheckAutoSave(), QE_ExpandBspString(), QE_LoadProject(), QERApp_LoadFile(), QERApp_ReadProjectKey(), RunBsp(), Select_AllOfType(), SetEntityOrigins(), SetLightStyles(), SetTerrainTextures(), Sin_ParseBSPEntity(), Terrain_GetKeyValue(), UniqueTargetName(), CEpairsWrapper::ValueForKey(), ValueForKey(), VL_CreateEntityLights(), VLightMain(), VS_CreateEntitySpeakers(), VSoundMain(), and WriteMapFileSafe().

00029 {
00030   epair_t *ep;
00031   for (ep=e ; ep ; ep=ep->next)
00032   {
00033         if (!strcmp (ep->key, key) )
00034     {
00035       return ep->value;
00036     }
00037   }
00038   return "";
00039 }

Here is the call graph for this function:

char* ValueForKey entity_t ent,
const char *  key
 

Definition at line 42 of file ENTITY.CPP.

References entity_t::epairs, and ValueForKey().

00043 {
00044   return ValueForKey(ent->epairs, key);
00045 }

Here is the call graph for this function:


Generated on Thu Aug 25 17:36:13 2005 for Quake III Arena by  doxygen 1.3.9.1