]> git.xonotic.org Git - xonotic/netradiant.git/blob - contrib/bobtoolz/DEntity.h
Merge pull request #6 from bnoordhuis/cleanup
[xonotic/netradiant.git] / contrib / bobtoolz / DEntity.h
1 /*
2    BobToolz plugin for GtkRadiant
3    Copyright (C) 2001 Gordon Biggans
4
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9
10    This library 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 GNU
13    Lesser General Public License for more details.
14
15    You should have received a copy of the GNU Lesser General Public
16    License along with this library; if not, write to the Free Software
17    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20 // DEntity.h: interface for the DEntity class.
21 //
22 //////////////////////////////////////////////////////////////////////
23
24 #if !defined( AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_ )
25 #define AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_
26
27 #include "DBrush.h"
28 #include "DEPair.h"
29 #include "DPatch.h"
30 #include "StdAfx.h" // Added by ClassView
31
32 #if _MSC_VER > 1000
33 #pragma once
34 #endif // _MSC_VER > 1000
35
36 class DEntity
37 {
38 public:
39 void RemoveFromRadiant();
40 entity_t* QER_Entity;
41 int m_nID;
42
43 //      Constrcution/Destruction
44 DEntity( char* classname = "worldspawn", int ID = -1 );     // sets classname
45 virtual ~DEntity();
46 //      ---------------------------------------------
47
48 //      epair functions........
49 void LoadEPairList( epair_t* epl );
50 void AddEPair( const char* key, const char* value );
51 void ClearEPairs();
52 DEPair* FindEPairByKey( const char* keyname );
53 //      ---------------------------------------------
54
55 //      random functions........
56 bool ResetTextures( const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation, bool rebuild );
57 void SaveToFile( FILE* pFile );
58 void SetClassname( char* classname );
59 int GetIDMax();
60
61 void BuildInRadiant( bool allowDestruction );
62 void ResetChecks( list<Str>* exclusionList );
63 void RemoveNonCheckBrushes( list<Str>* exclusionList, bool useDetail );
64
65 DPlane* AddFaceToBrush( vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* faceData, int ID );      // slow, try not to use much
66 int GetBrushCount( void );
67 DBrush* FindBrushByPointer( brush_t* brush );
68 //      ---------------------------------------------
69
70
71 //      bool list functions
72 void SelectBrushes( bool* selectList );
73 bool* BuildDuplicateList();
74 bool* BuildIntersectList();
75 //      ---------------------------------------------
76
77
78 //      brush operations
79 void ClearBrushes();        // clears brush list and frees memory for brushes
80
81 DBrush* GetBrushForID( int ID );
82 DBrush* NewBrush( int ID = -1 );
83 //      ---------------------------------------------
84
85 //      patch operations
86 void ClearPatches();
87
88 DPatch* NewPatch();
89 //      ---------------------------------------------
90
91 //      vars
92 list<DEPair*> epairList;
93 list<DBrush*> brushList;
94 // new patches, wahey!!!
95 list<DPatch*> patchList;
96 Str m_Classname;
97 //      ---------------------------------------------
98
99
100 int FixBrushes( bool rebuild );
101
102 bool LoadFromEntity( int id, bool bLoadPatches = FALSE );
103 bool LoadFromEntity( entity_t* ent, bool bLoadPatches = FALSE );
104 void LoadSelectedBrushes();
105 void LoadSelectedPatches();
106
107 bool LoadFromPrt( char* filename );
108 //      ---------------------------------------------
109 void SpawnString( const char* key, const char* defaultstring, const char** out );
110 void SpawnInt( const char* key, const char* defaultstring, int* out );
111 void SpawnFloat( const char* key, const char* defaultstring, float* out );
112 void SpawnVector( const char* key, const char* defaultstring, vec_t* out );
113 };
114
115 #endif // !defined(AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_)