ENTITY.H 3.1 KB

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