doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EditorEntity.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 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.
23 
24 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.
25 
26 ===========================================================================
27 */
28 
29 void Eclass_InitForSourceDirectory( const char *path );
30 eclass_t * Eclass_ForName( const char *name, bool has_brushes );
31 bool Eclass_hasModel(eclass_t *e, idVec3 &vMin, idVec3 &vMax);
32 
33 typedef struct entity_s {
34  struct entity_s *prev, *next;
35  brush_t brushes; // head/tail of list
36  int undoId, redoId, entityId; // used for undo/redo
41  eclass_t * eclass;
43  eclass_t * md3Class;
45  idVec3 lightOrigin; // for lights that have been combined with models
49 } entity_t;
50 
51 void ParseEpair(idDict *dict);
52 const char *ValueForKey(entity_t *ent, const char *key);
53 int GetNumKeys(entity_t *ent);
54 const char *GetKeyString(entity_t *ent, int iIndex);
55 void SetKeyValue (entity_t *ent, const char *key, const char *value, bool trackAngles = true);
56 void DeleteKey (entity_t *ent, const char *key);
57 float FloatForKey (entity_t *ent, const char *key);
58 int IntForKey (entity_t *ent, const char *key);
59 bool GetVectorForKey (entity_t *ent, const char *key, idVec3 &vec);
60 bool GetVector4ForKey (entity_t *ent, const char *key, idVec4 &vec);
61 bool GetFloatForKey(entity_t *end, const char *key, float *f);
62 void SetKeyVec3(entity_t *ent, const char *key, idVec3 v);
63 void SetKeyMat3(entity_t *ent, const char *key, idMat3 m);
64 bool GetMatrixForKey(entity_t *ent, const char *key, idMat3 &mat);
65 
69 void Entity_SetCurveData( entity_t *e );
70 void Entity_Free (entity_t *e);
73 entity_t * Entity_Parse (bool onlypairs, brush_t* pList = NULL);
74 void Entity_Write (entity_t *e, FILE *f, bool use_region);
75 void Entity_WriteSelected(entity_t *e, FILE *f);
76 void Entity_WriteSelected(entity_t *e, CMemFile*);
77 entity_t * Entity_Create (eclass_t *c, bool forceFixed = false);
79 void Entity_AddToList(entity_t *e, entity_t *list);
81 bool EntityHasModel(entity_t *ent);
82 
83 void Entity_LinkBrush (entity_t *e, brush_t *b);
84 void Entity_UnlinkBrush (brush_t *b);
85 entity_t * FindEntity(const char *pszKey, const char *pszValue);
86 entity_t * FindEntityInt(const char *pszKey, int iValue);
88 void Entity_SetName(entity_t *e, const char *name);
89 
90 int GetUniqueTargetId(int iHint);
91 eclass_t * GetCachedModel(entity_t *pEntity, const char *pName, idVec3 &vMin, idVec3 &vMax);
92 
93 //Timo : used for parsing epairs in brush primitive
94 void Entity_Name(entity_t *e, bool force);
95 
96 bool IsBrushSelected(brush_t* bSel);
idCurve< idVec3 > * Entity_MakeCurve(entity_t *e)
int entityId
Definition: EditorEntity.h:36
entity_t * Entity_Parse(bool onlypairs, brush_t *pList=NULL)
GLsizei const GLfloat * value
Definition: glext.h:3614
int qhandle_t
Definition: Lib.h:81
idVec3 lightOrigin
Definition: EditorEntity.h:45
bool GetMatrixForKey(entity_t *ent, const char *key, idMat3 &mat)
void Entity_FreeEpairs(entity_t *e)
const GLdouble * v
Definition: glext.h:2936
void Entity_WriteSelected(entity_t *e, FILE *f)
void DeleteKey(entity_t *ent, const char *key)
void Entity_AddToList(entity_t *e, entity_t *list)
bool trackLightOrigin
Definition: EditorEntity.h:47
void ParseEpair(idDict *dict)
idVec3 origin
Definition: EditorEntity.h:37
Definition: Vector.h:316
void Eclass_InitForSourceDirectory(const char *path)
int undoId
Definition: EditorEntity.h:36
void Entity_UpdateCurveData(entity_t *e)
idMat3 lightRotation
Definition: EditorEntity.h:46
brush_t brushes
Definition: EditorEntity.h:35
float FloatForKey(entity_t *ent, const char *key)
void Entity_UpdateSoundEmitter(entity_t *ent)
int IntForKey(entity_t *ent, const char *key)
entity_t * Entity_New()
idMat3 rotation
Definition: EditorEntity.h:44
entity_t * Entity_Create(eclass_t *c, bool forceFixed=false)
bool GetFloatForKey(entity_t *end, const char *key, float *f)
void SetKeyMat3(entity_t *ent, const char *key, idMat3 m)
qhandle_t lightDef
Definition: EditorEntity.h:38
const GLubyte * c
Definition: glext.h:4677
Definition: Vector.h:808
eclass_t * md3Class
Definition: EditorEntity.h:43
GLuint GLuint end
Definition: glext.h:2845
int Entity_MemorySize(entity_t *e)
Definition: Dict.h:65
struct entity_s * prev
Definition: EditorEntity.h:34
const char * ValueForKey(entity_t *ent, const char *key)
#define NULL
Definition: Lib.h:88
struct entity_s * next
Definition: EditorEntity.h:34
void Entity_SetCurveData(entity_t *e)
bool GetVector4ForKey(entity_t *ent, const char *key, idVec4 &vec)
const char * path
Definition: sws.c:117
entity_t * FindEntityInt(const char *pszKey, int iValue)
struct entity_s entity_t
void Entity_Write(entity_t *e, FILE *f, bool use_region)
void Entity_SetName(entity_t *e, const char *name)
bool EntityHasModel(entity_t *ent)
void Entity_Name(entity_t *e, bool force)
qhandle_t modelDef
Definition: EditorEntity.h:39
void SetKeyValue(entity_t *ent, const char *key, const char *value, bool trackAngles=true)
int GetUniqueTargetId(int iHint)
void Entity_UnlinkBrush(brush_t *b)
idCurve< idVec3 > * curve
Definition: EditorEntity.h:48
GLubyte GLubyte b
Definition: glext.h:4662
idSoundEmitter * soundEmitter
Definition: EditorEntity.h:40
Definition: Matrix.h:333
int redoId
Definition: EditorEntity.h:36
bool GetVectorForKey(entity_t *ent, const char *key, idVec3 &vec)
tuple f
Definition: idal.py:89
bool IsBrushSelected(brush_t *bSel)
const GLcharARB * name
Definition: glext.h:3629
void Entity_RemoveFromList(entity_t *e)
entity_t * Entity_Clone(entity_t *e)
int GetNumKeys(entity_t *ent)
idDict epairs
Definition: EditorEntity.h:42
void Entity_Free(entity_t *e)
entity_t * FindEntity(const char *pszKey, const char *pszValue)
void SetKeyVec3(entity_t *ent, const char *key, idVec3 v)
const char * GetKeyString(entity_t *ent, int iIndex)
eclass_t * GetCachedModel(entity_t *pEntity, const char *pName, idVec3 &vMin, idVec3 &vMax)
bool Eclass_hasModel(eclass_t *e, idVec3 &vMin, idVec3 &vMax)
eclass_t * eclass
Definition: EditorEntity.h:41
eclass_t * Eclass_ForName(const char *name, bool has_brushes)
void Entity_LinkBrush(entity_t *e, brush_t *b)