]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/tools/radiant/EditorEntity.h
Various Mac OS X tweaks to get this to build. Probably breaking things.
[icculus/iodoom3.git] / neo / tools / radiant / EditorEntity.h
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
37         idVec3          origin;
38         qhandle_t       lightDef;
39         qhandle_t       modelDef;
40         idSoundEmitter *soundEmitter;
41         eclass_t *      eclass;
42         idDict          epairs;
43         eclass_t *      md3Class;
44         idMat3          rotation;
45         idVec3          lightOrigin;            // for lights that have been combined with models
46         idMat3          lightRotation;          // ''
47         bool            trackLightOrigin;       
48         idCurve<idVec3> *curve;
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
66 void            Entity_UpdateSoundEmitter( entity_t *ent );
67 idCurve<idVec3> *Entity_MakeCurve( entity_t *e );
68 void            Entity_UpdateCurveData( entity_t *e );
69 void            Entity_SetCurveData( entity_t *e );
70 void            Entity_Free (entity_t *e);
71 void            Entity_FreeEpairs(entity_t *e);
72 int                     Entity_MemorySize(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);
78 entity_t *      Entity_Clone (entity_t *e);
79 void            Entity_AddToList(entity_t *e, entity_t *list);
80 void            Entity_RemoveFromList(entity_t *e);
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);
87 entity_t *      Entity_New();
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);