| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef __QE3_H__ |
| 24 |
#define __QE3_H__ |
| 25 |
|
| 26 |
|
| 27 |
#if GDEF_COMPILER_MSVC |
| 28 |
#pragma warning(disable : 4244) // MIPS |
| 29 |
#pragma warning(disable : 4136) // X86 |
| 30 |
#pragma warning(disable : 4051) // ALPHA |
| 31 |
#endif |
| 32 |
|
| 33 |
#include <windows.h> |
| 34 |
|
| 35 |
#include <gl/gl.h> |
| 36 |
#include <gl/glu.h> |
| 37 |
#include <gl/glaux.h> |
| 38 |
#include "glingr.h" |
| 39 |
#include <math.h> |
| 40 |
#include <stdlib.h> |
| 41 |
|
| 42 |
#include "cmdlib.h" |
| 43 |
#include "mathlib.h" |
| 44 |
#include "parse.h" |
| 45 |
#include "lbmlib.h" |
| 46 |
|
| 47 |
#include <commctrl.h> |
| 48 |
#include "afxres.h" |
| 49 |
#include "resource.h" |
| 50 |
|
| 51 |
#include "qedefs.h" |
| 52 |
|
| 53 |
typedef struct |
| 54 |
{ |
| 55 |
vec3_t normal; |
| 56 |
double dist; |
| 57 |
int type; |
| 58 |
} plane_t; |
| 59 |
|
| 60 |
#include "qfiles.h" |
| 61 |
|
| 62 |
#include "textures.h" |
| 63 |
#include "brush.h" |
| 64 |
#include "entity.h" |
| 65 |
#include "map.h" |
| 66 |
#include "select.h" |
| 67 |
|
| 68 |
#include "camera.h" |
| 69 |
#include "xy.h" |
| 70 |
#include "z.h" |
| 71 |
#include "mru.h" |
| 72 |
|
| 73 |
typedef struct |
| 74 |
{ |
| 75 |
int p1, p2; |
| 76 |
face_t *f1, *f2; |
| 77 |
} pedge_t; |
| 78 |
|
| 79 |
typedef struct |
| 80 |
{ |
| 81 |
int iSize; |
| 82 |
int iTexMenu; |
| 83 |
float fGamma; |
| 84 |
char szProject[256]; |
| 85 |
vec3_t colors[COLOR_LAST]; |
| 86 |
qboolean show_names, |
| 87 |
show_coordinates; |
| 88 |
int exclude; |
| 89 |
} SavedInfo_t; |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
void Sys_UpdateStatusBar( void ); |
| 95 |
void Sys_UpdateWindows (int bits); |
| 96 |
void Sys_Beep (void); |
| 97 |
void Sys_ClearPrintf (void); |
| 98 |
void Sys_Printf (char *text, ...); |
| 99 |
double Sys_DoubleTime (void); |
| 100 |
void Sys_GetCursorPos (int *x, int *y); |
| 101 |
void Sys_SetCursorPos (int x, int y); |
| 102 |
void Sys_SetTitle (char *text); |
| 103 |
void Sys_BeginWait (void); |
| 104 |
void Sys_EndWait (void); |
| 105 |
void Sys_Status(const char *psz, int part); |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
typedef struct |
| 111 |
{ |
| 112 |
qboolean d_showgrid; |
| 113 |
int d_gridsize; |
| 114 |
|
| 115 |
int d_num_entities; |
| 116 |
|
| 117 |
entity_t *d_project_entity; |
| 118 |
|
| 119 |
float d_new_brush_bottom_z, |
| 120 |
d_new_brush_top_z; |
| 121 |
|
| 122 |
HINSTANCE d_hInstance; |
| 123 |
|
| 124 |
HGLRC d_hglrcBase; |
| 125 |
HDC d_hdcBase; |
| 126 |
|
| 127 |
HWND d_hwndMain; |
| 128 |
HWND d_hwndCamera; |
| 129 |
HWND d_hwndEdit; |
| 130 |
HWND d_hwndEntity; |
| 131 |
HWND d_hwndTexture; |
| 132 |
HWND d_hwndXY; |
| 133 |
HWND d_hwndZ; |
| 134 |
HWND d_hwndStatus; |
| 135 |
|
| 136 |
vec3_t d_points[MAX_POINTS]; |
| 137 |
int d_numpoints; |
| 138 |
pedge_t d_edges[MAX_EDGES]; |
| 139 |
int d_numedges; |
| 140 |
|
| 141 |
int d_num_move_points; |
| 142 |
float *d_move_points[1024]; |
| 143 |
|
| 144 |
qtexture_t *d_qtextures; |
| 145 |
|
| 146 |
texturewin_t d_texturewin; |
| 147 |
|
| 148 |
int d_pointfile_display_list; |
| 149 |
|
| 150 |
xy_t d_xy; |
| 151 |
|
| 152 |
LPMRUMENU d_lpMruMenu; |
| 153 |
|
| 154 |
SavedInfo_t d_savedinfo; |
| 155 |
|
| 156 |
int d_workcount; |
| 157 |
|
| 158 |
|
| 159 |
int d_select_count; |
| 160 |
brush_t *d_select_order[2]; |
| 161 |
vec3_t d_select_translate; |
| 162 |
select_t d_select_mode; |
| 163 |
|
| 164 |
int d_font_list; |
| 165 |
|
| 166 |
int d_parsed_brushes; |
| 167 |
|
| 168 |
qboolean show_blocks; |
| 169 |
} QEGlobals_t; |
| 170 |
|
| 171 |
void *qmalloc (int size); |
| 172 |
char *copystring (char *s); |
| 173 |
char *ExpandReletivePath (char *p); |
| 174 |
|
| 175 |
void Pointfile_Delete (void); |
| 176 |
void Pointfile_Check (void); |
| 177 |
void Pointfile_Next (void); |
| 178 |
void Pointfile_Prev (void); |
| 179 |
void Pointfile_Clear (void); |
| 180 |
void Pointfile_Draw( void ); |
| 181 |
void Pointfile_Load( void ); |
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
void Drag_Begin (int x, int y, int buttons, |
| 187 |
vec3_t xaxis, vec3_t yaxis, |
| 188 |
vec3_t origin, vec3_t dir); |
| 189 |
void Drag_MouseMoved (int x, int y, int buttons); |
| 190 |
void Drag_MouseUp (void); |
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
void CSG_MakeHollow (void); |
| 196 |
void CSG_Subtract (void); |
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
void SetupVertexSelection (void); |
| 203 |
void SelectEdgeByRay (vec3_t org, vec3_t dir); |
| 204 |
void SelectVertexByRay (vec3_t org, vec3_t dir); |
| 205 |
|
| 206 |
void ConnectEntities (void); |
| 207 |
|
| 208 |
extern int update_bits; |
| 209 |
|
| 210 |
extern int screen_width; |
| 211 |
extern int screen_height; |
| 212 |
|
| 213 |
extern HANDLE bsp_process; |
| 214 |
|
| 215 |
char *TranslateString (char *buf); |
| 216 |
|
| 217 |
void ProjectDialog (void); |
| 218 |
|
| 219 |
void FillTextureMenu (void); |
| 220 |
void FillBSPMenu (void); |
| 221 |
|
| 222 |
BOOL CALLBACK Win_Dialog ( |
| 223 |
HWND hwndDlg, |
| 224 |
UINT uMsg, |
| 225 |
WPARAM wParam, |
| 226 |
LPARAM lParam |
| 227 |
); |
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
void WCam_Create (HINSTANCE hInstance); |
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
void WXY_Create (HINSTANCE hInstance); |
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
void WZ_Create (HINSTANCE hInstance); |
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
void Main_Create (HINSTANCE hInstance); |
| 255 |
extern BOOL SaveWindowState(HWND hWnd, const char *pszName); |
| 256 |
extern BOOL LoadWindowState(HWND hWnd, const char *pszName); |
| 257 |
|
| 258 |
extern BOOL SaveRegistryInfo(const char *pszName, void *pvBuf, long lSize); |
| 259 |
extern BOOL loadRegistryInfo(const char *pszName, void *pvBuf, long *plSize); |
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
BOOL CreateEntityWindow(HINSTANCE hInstance); |
| 265 |
void FillClassList (void); |
| 266 |
BOOL UpdateEntitySel(eclass_t *pec); |
| 267 |
void SetInspectorMode(int iType); |
| 268 |
int DrawTexControls(HWND hWnd); |
| 269 |
void SetSpawnFlags(void); |
| 270 |
void GetSpawnFlags(void); |
| 271 |
void SetKeyValuePairs(void); |
| 272 |
extern void BuildGammaTable(float g); |
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
void DoGamma(void); |
| 278 |
void DoFind(void); |
| 279 |
void DoRotate(void); |
| 280 |
void DoSides(void); |
| 281 |
void DoAbout(void); |
| 282 |
void DoSurface(void); |
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
void QE_CheckAutoSave( void ); |
| 288 |
void QE_ConvertDOSToUnixName( char *dst, const char *src ); |
| 289 |
void QE_CountBrushesAndUpdateStatusBar( void ); |
| 290 |
void QE_CheckOpenGLForErrors(void); |
| 291 |
void QE_ExpandBspString (char *bspaction, char *out, char *mapname); |
| 292 |
void QE_Init (void); |
| 293 |
qboolean QE_KeyDown (int key); |
| 294 |
qboolean QE_LoadProject (char *projectfile); |
| 295 |
qboolean QE_SingleBrush (void); |
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
int QEW_SetupPixelFormat(HDC hDC, qboolean zbuffer ); |
| 301 |
void QEW_StopGL( HWND hWnd, HGLRC hGLRC, HDC hDC ); |
| 302 |
|
| 303 |
|
| 304 |
|
| 305 |
|
| 306 |
extern QEGlobals_t g_qeglobals; |
| 307 |
|
| 308 |
#endif |