EditorEntity.h 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. void Eclass_InitForSourceDirectory( const char *path );
  21. eclass_t * Eclass_ForName( const char *name, bool has_brushes );
  22. bool Eclass_hasModel(eclass_t *e, idVec3 &vMin, idVec3 &vMax);
  23. typedef struct entity_s {
  24. struct entity_s *prev, *next;
  25. brush_t brushes; // head/tail of list
  26. int undoId, redoId, entityId; // used for undo/redo
  27. idVec3 origin;
  28. qhandle_t lightDef;
  29. qhandle_t modelDef;
  30. idSoundEmitter *soundEmitter;
  31. eclass_t * eclass;
  32. idDict epairs;
  33. eclass_t * md3Class;
  34. idMat3 rotation;
  35. idVec3 lightOrigin; // for lights that have been combined with models
  36. idMat3 lightRotation; // ''
  37. bool trackLightOrigin;
  38. idCurve<idVec3> *curve;
  39. } entity_t;
  40. void ParseEpair(idDict *dict);
  41. const char *ValueForKey(entity_t *ent, const char *key);
  42. int GetNumKeys(entity_t *ent);
  43. const char *GetKeyString(entity_t *ent, int iIndex);
  44. void SetKeyValue (entity_t *ent, const char *key, const char *value, bool trackAngles = true);
  45. void DeleteKey (entity_t *ent, const char *key);
  46. float FloatForKey (entity_t *ent, const char *key);
  47. int IntForKey (entity_t *ent, const char *key);
  48. bool GetVectorForKey (entity_t *ent, const char *key, idVec3 &vec);
  49. bool GetVector4ForKey (entity_t *ent, const char *key, idVec4 &vec);
  50. bool GetFloatForKey(entity_t *end, const char *key, float *f);
  51. void SetKeyVec3(entity_t *ent, const char *key, idVec3 v);
  52. void SetKeyMat3(entity_t *ent, const char *key, idMat3 m);
  53. bool GetMatrixForKey(entity_t *ent, const char *key, idMat3 &mat);
  54. void Entity_UpdateSoundEmitter( entity_t *ent );
  55. idCurve<idVec3> *Entity_MakeCurve( entity_t *e );
  56. void Entity_UpdateCurveData( entity_t *e );
  57. void Entity_SetCurveData( entity_t *e );
  58. void Entity_Free (entity_t *e);
  59. void Entity_FreeEpairs(entity_t *e);
  60. int Entity_MemorySize(entity_t *e);
  61. entity_t * Entity_Parse (bool onlypairs, brush_t* pList = NULL);
  62. void Entity_Write (entity_t *e, FILE *f, bool use_region);
  63. void Entity_WriteSelected(entity_t *e, FILE *f);
  64. void Entity_WriteSelected(entity_t *e, CMemFile*);
  65. entity_t * Entity_Create (eclass_t *c, bool forceFixed = false);
  66. entity_t * Entity_Clone (entity_t *e);
  67. void Entity_AddToList(entity_t *e, entity_t *list);
  68. void Entity_RemoveFromList(entity_t *e);
  69. bool EntityHasModel(entity_t *ent);
  70. void Entity_LinkBrush (entity_t *e, brush_t *b);
  71. void Entity_UnlinkBrush (brush_t *b);
  72. entity_t * FindEntity(const char *pszKey, const char *pszValue);
  73. entity_t * FindEntityInt(const char *pszKey, int iValue);
  74. entity_t * Entity_New();
  75. void Entity_SetName(entity_t *e, const char *name);
  76. int GetUniqueTargetId(int iHint);
  77. eclass_t * GetCachedModel(entity_t *pEntity, const char *pName, idVec3 &vMin, idVec3 &vMax);
  78. //Timo : used for parsing epairs in brush primitive
  79. void Entity_Name(entity_t *e, bool force);
  80. bool IsBrushSelected(brush_t* bSel);