Files
DoomRTX/neo/engine/tools/radiant/EditorEntity.h
T
2026-05-24 11:54:07 -07:00

98 lines
4.0 KiB
C++

/*
===========================================================================
IceTech GPL Source Code
Copyright (C) 2026 Justin Marshall
This file is part of the IceTech GPL Source Code (?IceTech Source Code?).
IceTech Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
IceTech Source Code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with IceTech Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the IceTech 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 IceTech Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing Justin Marshall, justinmarshall20@gmail.com
===========================================================================
*/
void Eclass_InitForSourceDirectory( const char *path );
eclass_t * Eclass_ForName( const char *name, bool has_brushes );
bool Eclass_hasModel(eclass_t *e, idVec3 &vMin, idVec3 &vMax);
class idEditorEntity {
public:
idEditorEntity *prev, *next;
idEditorBrush brushes; // head/tail of list
int undoId, redoId, entityId; // used for undo/redo
idVec3 origin;
qhandle_t lightDef;
qhandle_t modelDef;
idSoundEmitter *soundEmitter;
eclass_t * eclass;
idDict epairs;
eclass_t * md3Class;
idMat3 rotation;
idVec3 lightOrigin; // for lights that have been combined with models
idMat3 lightRotation; // ''
bool trackLightOrigin;
idCurve<idVec3> *curve;
const char *ValueForKey(const char *key);
int GetNumKeys();
const char *GetKeyString(int iIndex);
const idMaterial* GetKeyMaterial(const char* key, const char *defaultMaterial);
void SetKeyValue(const char *key, const char *value, bool trackAngles = true);
void DeleteKey(const char *key);
float FloatForKey(const char *key);
int IntForKey(const char *key);
bool GetVectorForKey(const char *key, idVec3 &vec);
bool GetVector4ForKey(const char *key, idVec4 &vec);
bool GetFloatForKey(const char *key, float *f);
void SetKeyVec3(const char *key, idVec3 v);
void SetKeyMat3(const char *key, idMat3 m);
bool GetMatrixForKey(const char *key, idMat3 &mat);
void Entity_UpdateSoundEmitter();
idCurve<idVec3> *Entity_MakeCurve();
void Entity_UpdateCurveData();
void Entity_SetCurveData();
static void Entity_Free(idEditorEntity *e);
void Entity_FreeEpairs();
int Entity_MemorySize();
static idEditorEntity *Entity_Parse(bool onlypairs, idEditorBrush* pList = NULL);
idEditorEntity *Entity_PostParse(idEditorBrush *pList);
void Entity_Write(FILE *f, bool use_region);
void Entity_WriteSelected(FILE *f);
void Entity_WriteSelected(CMemFile*);
static idEditorEntity *Entity_Create(eclass_t *c, bool forceFixed = false);
static idEditorEntity *Entity_Clone(idEditorEntity *e);
void Entity_AddToList(idEditorEntity *list);
void Entity_RemoveFromList();
bool EntityHasModel();
void Entity_LinkBrush(idEditorBrush *b);
static void Entity_UnlinkBrush(idEditorBrush *b);
static idEditorEntity *FindEntity(const char *pszKey, const char *pszValue);
static idEditorEntity *FindEntityInt(const char *pszKey, int iValue);
static idEditorEntity *Entity_New();
void Entity_SetName(const char *name);
static int GetUniqueTargetId(int iHint);
void Entity_Name(bool force);
};
void ParseEpair(idDict *dict);
eclass_t * GetCachedModel(idEditorEntity *pEntity, const char *pName, idVec3 &vMin, idVec3 &vMax);
bool IsBrushSelected(idEditorBrush* bSel);