]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - include/ibrush.h
Merge pull request #21 from merlin1991/Q3-gamepack-fix
[xonotic/netradiant.git] / include / ibrush.h
1 /*
2    Copyright (C) 1999-2007 id Software, Inc. and contributors.
3    For a list of contributors, see the accompanying CONTRIBUTORS file.
4
5    This file is part of GtkRadiant.
6
7    GtkRadiant is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    GtkRadiant is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with GtkRadiant; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20  */
21
22 #ifndef _IBRUSH_H_
23 #define _IBRUSH_H_
24
25 //
26 // API for brush stuff
27 //
28
29 #define BRUSH_MAJOR "brush"
30 // {c1c3f567-2541-4aa3-9d5b-031fbe2a013b}
31 static const GUID QERBrushTable_GUID =
32 { 0xc1c3f567, 0x2541, 0x4aa3, { 0x9d, 0x5b, 0x03, 0x1f, 0xbe, 0x2a, 0x01, 0x3b } };
33
34 typedef void ( *PFN_BRUSHADDTOLIST )( brush_t *b, brush_t *lst );
35 typedef void ( *PFN_BRUSHBUILD )( brush_t *b, bool bSnap, bool bMarkMap, bool bConvert, bool bFilterTest );
36 typedef brush_t*  ( *PFN_BRUSHCREATE )( vec3_t mins, vec3_t maxs, texdef_t *texdef );
37 typedef void ( *PFN_BRUSHFREE )( brush_t *b, bool bRemoveNode );
38 typedef void ( *PFN_BRUSHROTATE )( brush_t *b, vec3_t vAngle, vec3_t vOrigin, bool bBuild );
39 typedef brush_t*  ( *PFN_BRUSHALLOC )();
40 typedef int ( *PFN_BPMESSAGEBOX )( int );
41 typedef face_t*   ( *PFN_FACEALLOC )( void );
42 typedef eclass_t* ( *PFN_HASMODEL )( brush_t *b );
43
44 struct _QERBrushTable
45 {
46         int m_nSize;
47         PFN_BRUSHADDTOLIST m_pfnBrush_AddToList;
48         PFN_BRUSHBUILD m_pfnBrush_Build;
49         PFN_BRUSHCREATE m_pfnBrush_Create;
50         PFN_BRUSHFREE m_pfnBrush_Free;
51         PFN_BRUSHROTATE m_pfnBrush_Rotate;
52         PFN_BRUSHALLOC m_pfnBrushAlloc;
53         PFN_BPMESSAGEBOX m_pfnBP_MessageBox;
54         PFN_FACEALLOC m_pfnFace_Alloc;
55         PFN_HASMODEL m_pfnHasModel;
56 };
57
58 #ifdef USE_BRUSHTABLE_DEFINE
59 #ifndef __BRUSHTABLENAME
60 #define __BRUSHTABLENAME g_BrushTable
61 #endif
62 #define Brush_AddToList __BRUSHTABLENAME.m_pfnBrush_AddToList
63 #define Brush_Build __BRUSHTABLENAME.m_pfnBrush_Build
64 #define Brush_Create __BRUSHTABLENAME.m_pfnBrush_Create
65 #define Brush_Free __BRUSHTABLENAME.m_pfnBrush_Free
66 #define Brush_Rotate __BRUSHTABLENAME.m_pfnBrush_Rotate
67 #define Brush_Alloc __BRUSHTABLENAME.m_pfnBrushAlloc
68 #define BP_MessageBox __BRUSHTABLENAME.m_pfnBP_MessageBox
69 #define Face_Alloc __BRUSHTABLENAME.m_pfnFace_Alloc
70 #define HasModel __BRUSHTABLENAME.m_pfnHasModel
71 #endif
72
73 #endif