Quake-III-Arena

Quake III Arena GPL Source Release
Log | Files | Refs

ENTITY.H (3213B)


      1 /*
      2 ===========================================================================
      3 Copyright (C) 1999-2005 Id Software, Inc.
      4 
      5 This file is part of Quake III Arena source code.
      6 
      7 Quake III Arena source code is free software; you can redistribute it
      8 and/or modify it under the terms of the GNU General Public License as
      9 published by the Free Software Foundation; either version 2 of the License,
     10 or (at your option) any later version.
     11 
     12 Quake III Arena source code is distributed in the hope that it will be
     13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 GNU General Public License for more details.
     16 
     17 You should have received a copy of the GNU General Public License
     18 along with Foobar; if not, write to the Free Software
     19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     20 ===========================================================================
     21 */
     22     // entity.h
     23 
     24     void Eclass_InitForSourceDirectory (char *path);
     25     eclass_t *Eclass_ForName (char *name, qboolean has_brushes);
     26     
     27     // forward declare this one
     28     class IPluginEntity;
     29     
     30     typedef struct entity_s
     31     {
     32     	struct entity_s	*prev, *next;
     33     	brush_t		brushes;					// head/tail of list
     34      	int			undoId, redoId, entityId;	// used for undo/redo
     35     	vec3_t		origin;
     36     	eclass_t	*eclass;
     37     	epair_t		*epairs;
     38     	eclass_t  *md3Class;
     39     	IPluginEntity *pPlugEnt;
     40       vec3_t vRotation;   // valid for misc_models only
     41       vec3_t vScale;      // valid for misc_models only
     42     } entity_t;
     43     
     44     char 	*ValueForKey (entity_t *ent, const char *key);
     45     void	SetKeyValue (entity_t *ent, const char *key, const char *value);
     46     void 	SetKeyValue (epair_t *&e, const char *key, const char *value);
     47     void 	DeleteKey (entity_t *ent, const char *key);
     48     void 	DeleteKey (epair_t *&e, const char *key);
     49     float	FloatForKey (entity_t *ent, const char *key);
     50     int		IntForKey (entity_t *ent, const char *key);
     51     void 	GetVectorForKey (entity_t *ent, const char *key, vec3_t vec);
     52     
     53     void		Entity_Free (entity_t *e);
     54     void		Entity_FreeEpairs(entity_t *e);
     55     int			Entity_MemorySize(entity_t *e);
     56     entity_t	*Entity_Parse (qboolean onlypairs, brush_t* pList = NULL);
     57     void		Entity_Write (entity_t *e, FILE *f, qboolean use_region);
     58     void		Entity_WriteSelected(entity_t *e, FILE *f);
     59     void		Entity_WriteSelected(entity_t *e, CMemFile*);
     60     entity_t	*Entity_Create (eclass_t *c);
     61     entity_t	*Entity_Clone (entity_t *e);
     62     void		Entity_AddToList(entity_t *e, entity_t *list);
     63     void		Entity_RemoveFromList(entity_t *e);
     64     
     65     void		Entity_LinkBrush (entity_t *e, brush_t *b);
     66     void		Entity_UnlinkBrush (brush_t *b);
     67     entity_t	*FindEntity(char *pszKey, char *pszValue);
     68     entity_t	*FindEntityInt(char *pszKey, int iValue);
     69     
     70     int GetUniqueTargetId(int iHint);
     71     qboolean Eclass_hasModel(eclass_t *e, vec3_t &vMin, vec3_t &vMax);
     72     eclass_t* GetCachedModel(entity_t *pEntity, const char *pName, vec3_t &vMin, vec3_t &vMax);
     73     
     74     //Timo : used for parsing epairs in brush primitive
     75     epair_t* ParseEpair(void);
     76     char *ValueForKey ( epair_t *&e, const char *key);