]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - tools/quake2/extra/qe4/qe3.h
Merge branch 'master' into divVerent/farplanedist-sky-fix
[xonotic/netradiant.git] / tools / quake2 / extra / qe4 / qe3.h
1 /*
2 ===========================================================================
3 Copyright (C) 1997-2006 Id Software, Inc.
4
5 This file is part of Quake 2 Tools source code.
6
7 Quake 2 Tools source code is free software; you can redistribute it
8 and/or modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the License,
10 or (at your option) any later version.
11
12 Quake 2 Tools source code is distributed in the hope that it will be
13 useful, 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 Quake 2 Tools source code; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20 ===========================================================================
21 */
22
23 #ifndef __QE3_H__
24 #define __QE3_H__
25
26 // disable data conversion warnings for gl
27 #pragma warning(disable : 4244)     // MIPS
28 #pragma warning(disable : 4136)     // X86
29 #pragma warning(disable : 4051)     // ALPHA
30
31 #include <windows.h>
32
33 #include <gl/gl.h>
34 #include <gl/glu.h>
35 #include <gl/glaux.h>
36 #include "glingr.h"
37 #include <math.h>
38 #include <stdlib.h>
39
40 #include "cmdlib.h"
41 #include "mathlib.h"
42 #include "parse.h"
43 #include "lbmlib.h"
44
45 #include <commctrl.h>
46 #include "afxres.h"
47 #include "resource.h"
48
49 #include "qedefs.h"
50
51 typedef struct
52 {
53     vec3_t      normal;
54     double      dist;
55     int         type;
56 } plane_t;
57
58 #include "qfiles.h"
59
60 #include "textures.h"
61 #include "brush.h"
62 #include "entity.h"
63 #include "map.h"
64 #include "select.h"
65
66 #include "camera.h"
67 #include "xy.h"
68 #include "z.h"
69 #include "mru.h"
70
71 typedef struct
72 {
73         int             p1, p2;
74         face_t  *f1, *f2;
75 } pedge_t;
76
77 typedef struct
78 {
79         int               iSize;
80         int               iTexMenu;             // nearest, linear, etc
81         float     fGamma;                       // gamma for textures
82         char      szProject[256];       // last project loaded
83         vec3_t    colors[COLOR_LAST];
84         qboolean  show_names,
85                           show_coordinates;
86         int       exclude;
87 } SavedInfo_t;
88
89 //
90 // system functions
91 //
92 void    Sys_UpdateStatusBar( void );
93 void    Sys_UpdateWindows (int bits);
94 void    Sys_Beep (void);
95 void    Sys_ClearPrintf (void);
96 void    Sys_Printf (char *text, ...);
97 double  Sys_DoubleTime (void);
98 void    Sys_GetCursorPos (int *x, int *y);
99 void    Sys_SetCursorPos (int x, int y);
100 void    Sys_SetTitle (char *text);
101 void    Sys_BeginWait (void);
102 void    Sys_EndWait (void);
103 void    Sys_Status(const char *psz, int part);
104
105 /*
106 ** most of the QE globals are stored in this structure
107 */
108 typedef struct
109 {
110         qboolean d_showgrid;
111         int      d_gridsize;
112
113         int      d_num_entities;
114
115         entity_t *d_project_entity;
116
117         float     d_new_brush_bottom_z,
118                       d_new_brush_top_z;
119
120         HINSTANCE d_hInstance;
121
122         HGLRC     d_hglrcBase;
123         HDC       d_hdcBase;
124
125         HWND      d_hwndMain;
126         HWND      d_hwndCamera;
127         HWND      d_hwndEdit;
128         HWND      d_hwndEntity;
129         HWND      d_hwndTexture;
130         HWND      d_hwndXY;
131         HWND      d_hwndZ;
132         HWND      d_hwndStatus;
133
134         vec3_t    d_points[MAX_POINTS];
135         int       d_numpoints;
136         pedge_t   d_edges[MAX_EDGES];
137         int       d_numedges;
138
139         int       d_num_move_points;
140         float    *d_move_points[1024];
141
142         qtexture_t      *d_qtextures;
143
144         texturewin_t d_texturewin;
145
146         int              d_pointfile_display_list;
147
148         xy_t         d_xy;
149
150         LPMRUMENU    d_lpMruMenu;
151
152         SavedInfo_t  d_savedinfo;
153
154         int          d_workcount;
155
156         // connect entities uses the last two brushes selected
157         int                      d_select_count;
158         brush_t         *d_select_order[2];
159         vec3_t       d_select_translate;    // for dragging w/o making new display lists
160         select_t     d_select_mode;
161
162         int                  d_font_list;
163
164         int          d_parsed_brushes;
165
166         qboolean        show_blocks;
167 } QEGlobals_t;
168
169 void *qmalloc (int size);
170 char *copystring (char *s);
171 char *ExpandReletivePath (char *p);
172
173 void Pointfile_Delete (void);
174 void Pointfile_Check (void);
175 void Pointfile_Next (void);
176 void Pointfile_Prev (void);
177 void Pointfile_Clear (void);
178 void Pointfile_Draw( void );
179 void Pointfile_Load( void );
180
181 //
182 // drag.c
183 //
184 void Drag_Begin (int x, int y, int buttons,
185                    vec3_t xaxis, vec3_t yaxis,
186                    vec3_t origin, vec3_t dir);
187 void Drag_MouseMoved (int x, int y, int buttons);
188 void Drag_MouseUp (void);
189
190 //
191 // csg.c
192 //
193 void CSG_MakeHollow (void);
194 void CSG_Subtract (void);
195
196 //
197 // vertsel.c
198 //
199
200 void SetupVertexSelection (void);
201 void SelectEdgeByRay (vec3_t org, vec3_t dir);
202 void SelectVertexByRay (vec3_t org, vec3_t dir);
203
204 void ConnectEntities (void);
205
206 extern  int     update_bits;
207
208 extern  int     screen_width;
209 extern  int     screen_height;
210
211 extern  HANDLE  bsp_process;
212
213 char    *TranslateString (char *buf);
214
215 void ProjectDialog (void);
216
217 void FillTextureMenu (void);
218 void FillBSPMenu (void);
219
220 BOOL CALLBACK Win_Dialog (
221     HWND hwndDlg,       // handle to dialog box
222     UINT uMsg,  // message
223     WPARAM wParam,      // first message parameter
224     LPARAM lParam       // second message parameter
225 );
226
227
228 //
229 // win_cam.c
230 //
231 void WCam_Create (HINSTANCE hInstance);
232
233
234 //
235 // win_xy.c
236 //
237 void WXY_Create (HINSTANCE hInstance);
238
239 //
240 // win_z.c
241 //
242 void WZ_Create (HINSTANCE hInstance);
243
244 //
245 // win_ent.c
246 //
247
248
249 //
250 // win_main.c
251 //
252 void Main_Create (HINSTANCE hInstance);
253 extern BOOL SaveWindowState(HWND hWnd, const char *pszName);
254 extern BOOL LoadWindowState(HWND hWnd, const char *pszName);
255
256 extern BOOL SaveRegistryInfo(const char *pszName, void *pvBuf, long lSize);
257 extern BOOL loadRegistryInfo(const char *pszName, void *pvBuf, long *plSize);
258
259 //
260 // entityw.c
261 //
262 BOOL CreateEntityWindow(HINSTANCE hInstance);
263 void FillClassList (void);
264 BOOL UpdateEntitySel(eclass_t *pec);
265 void SetInspectorMode(int iType);
266 int DrawTexControls(HWND hWnd);
267 void SetSpawnFlags(void);
268 void GetSpawnFlags(void);
269 void SetKeyValuePairs(void);
270 extern void BuildGammaTable(float g);
271
272
273 // win_dlg.c
274
275 void DoGamma(void);
276 void DoFind(void);
277 void DoRotate(void);
278 void DoSides(void);
279 void DoAbout(void);
280 void DoSurface(void);
281
282 /*
283 ** QE function declarations
284 */
285 void     QE_CheckAutoSave( void );
286 void     QE_ConvertDOSToUnixName( char *dst, const char *src );
287 void     QE_CountBrushesAndUpdateStatusBar( void );
288 void     QE_CheckOpenGLForErrors(void);
289 void     QE_ExpandBspString (char *bspaction, char *out, char *mapname);
290 void     QE_Init (void);
291 qboolean QE_KeyDown (int key);
292 qboolean QE_LoadProject (char *projectfile);
293 qboolean QE_SingleBrush (void);
294
295 /*
296 ** QE Win32 function declarations
297 */
298 int  QEW_SetupPixelFormat(HDC hDC, qboolean zbuffer );
299 void QEW_StopGL( HWND hWnd, HGLRC hGLRC, HDC hDC );
300
301 /*
302 ** extern declarations
303 */
304 extern QEGlobals_t   g_qeglobals;
305
306 #endif