]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - contrib/prtview/portals.h
transfer from internal tree r5311 branches/1.4-gpl
[xonotic/netradiant.git] / contrib / prtview / portals.h
1 /*\r
2 PrtView plugin for GtkRadiant\r
3 Copyright (C) 2001 Geoffrey Dewan, Loki software and qeradiant.com\r
4 \r
5 This library is free software; you can redistribute it and/or\r
6 modify it under the terms of the GNU Lesser General Public\r
7 License as published by the Free Software Foundation; either\r
8 version 2.1 of the License, or (at your option) any later version.\r
9 \r
10 This library is distributed in the hope that it will be useful,\r
11 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
13 Lesser General Public License for more details.\r
14 \r
15 You should have received a copy of the GNU Lesser General Public\r
16 License along with this library; if not, write to the Free Software\r
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
18 */\r
19 \r
20 #ifndef _PORTALS_H_\r
21 #define _PORTALS_H_\r
22 \r
23 class CBspPoint {\r
24 public:\r
25         float p[3];\r
26 };\r
27 \r
28 class CBspPortal {\r
29 public:\r
30         CBspPortal();\r
31         ~CBspPortal();\r
32 \r
33 protected:\r
34 \r
35 public:\r
36         CBspPoint center;\r
37         unsigned point_count;\r
38         CBspPoint *point;\r
39         CBspPoint *inner_point;\r
40         float fp_color_random[4];\r
41         float min[3];\r
42         float max[3];\r
43         float dist;\r
44         qboolean hint;\r
45 \r
46         qboolean Build(char *def);\r
47 };\r
48 \r
49 class CPortals {\r
50 public:\r
51 \r
52   CPortals();\r
53   ~CPortals();\r
54 \r
55 protected:\r
56 \r
57 \r
58 public:\r
59 \r
60         void Load(); // use filename in fn\r
61         void Purge();\r
62 \r
63         void FixColors();\r
64 \r
65         char fn[_MAX_PATH];\r
66 \r
67         int zbuffer;\r
68         int polygons;\r
69         int lines;\r
70         qboolean show_3d;\r
71         qboolean aa_3d;\r
72         qboolean fog;\r
73         COLORREF color_3d;\r
74         float width_3d;  // in 8'ths\r
75         float fp_color_3d[4];\r
76         COLORREF color_fog;\r
77         float fp_color_fog[4];\r
78         float trans_3d;\r
79         float clip_range;\r
80         qboolean clip;\r
81 \r
82         qboolean show_2d;\r
83         qboolean aa_2d;\r
84         COLORREF color_2d;\r
85         float width_2d;  // in 8'ths\r
86         float fp_color_2d[4];\r
87 \r
88         CBspPortal *portal;\r
89         int *portal_sort;\r
90         qboolean hint_flags;\r
91 //      CBspNode *node;\r
92 \r
93         unsigned int node_count;\r
94         unsigned int portal_count;\r
95 };\r
96 \r
97 class CPortalsRender : public IGL2DWindow, public IGL3DWindow {\r
98 public:\r
99 \r
100   CPortalsRender();\r
101   virtual ~CPortalsRender();\r
102 \r
103 protected:\r
104 \r
105         int refCount;\r
106 #ifdef _WIN32\r
107         CRITICAL_SECTION protect;\r
108 #endif\r
109 \r
110 public:\r
111 \r
112   // IGL2DWindow IGL3DWindow interface\r
113         void IncRef() { refCount++; }\r
114         void DecRef() { refCount--; if (refCount <= 0) delete this; }\r
115         void Draw2D( VIEWTYPE vt );\r
116         void Draw3D();\r
117         void Register();\r
118 };\r
119 \r
120 // void Sys_Printf (char *text, ...);\r
121 \r
122 extern CPortals portals;\r
123 extern CPortalsRender render;\r
124 \r
125 #endif // _PORTALS_H_\r