]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - contrib/prtview/portals.h
uncrustify! now the code is only ugly on the *inside*
[xonotic/netradiant.git] / contrib / prtview / portals.h
1 /*
2    PrtView plugin for GtkRadiant
3    Copyright (C) 2001 Geoffrey Dewan, Loki software and qeradiant.com
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 #ifndef _PORTALS_H_
21 #define _PORTALS_H_
22
23 class CBspPoint {
24 public:
25 float p[3];
26 };
27
28 class CBspPortal {
29 public:
30 CBspPortal();
31 ~CBspPortal();
32
33 protected:
34
35 public:
36 CBspPoint center;
37 unsigned point_count;
38 CBspPoint *point;
39 CBspPoint *inner_point;
40 float fp_color_random[4];
41 float min[3];
42 float max[3];
43 float dist;
44 qboolean hint;
45
46 qboolean Build( char *def );
47 };
48
49 class CPortals {
50 public:
51
52 CPortals();
53 ~CPortals();
54
55 protected:
56
57
58 public:
59
60 void Load();     // use filename in fn
61 void Purge();
62
63 void FixColors();
64
65 char fn[_MAX_PATH];
66
67 int zbuffer;
68 int polygons;
69 int lines;
70 qboolean show_3d;
71 qboolean aa_3d;
72 qboolean fog;
73 COLORREF color_3d;
74 float width_3d;      // in 8'ths
75 float fp_color_3d[4];
76 COLORREF color_fog;
77 float fp_color_fog[4];
78 float trans_3d;
79 float clip_range;
80 qboolean clip;
81
82 qboolean show_2d;
83 qboolean aa_2d;
84 COLORREF color_2d;
85 float width_2d;      // in 8'ths
86 float fp_color_2d[4];
87
88 CBspPortal *portal;
89 int *portal_sort;
90 qboolean hint_flags;
91 //      CBspNode *node;
92
93 unsigned int node_count;
94 unsigned int portal_count;
95 };
96
97 class CPortalsRender : public IGL2DWindow, public IGL3DWindow {
98 public:
99
100 CPortalsRender();
101 virtual ~CPortalsRender();
102
103 protected:
104
105 int refCount;
106 #ifdef _WIN32
107 CRITICAL_SECTION protect;
108 #endif
109
110 public:
111
112 // IGL2DWindow IGL3DWindow interface
113 void IncRef() { refCount++; }
114 void DecRef() {
115         refCount--; if ( refCount <= 0 ) {
116                 delete this;
117         }
118 }
119 void Draw2D( VIEWTYPE vt );
120 void Draw3D();
121 void Register();
122 };
123
124 // void Sys_Printf (char *text, ...);
125
126 extern CPortals portals;
127 extern CPortalsRender render;
128
129 #endif // _PORTALS_H_