00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _QERTYPE_H
00028 #define _QERTYPE_H
00029
00030 #ifndef __BYTEBOOL__
00031 #define __BYTEBOOL__
00032 typedef boolean qboolean;
00033
00034 #endif
00035
00036 #define MAXPOINTS 16
00037
00038 typedef float vec_t;
00039 typedef vec_t vec2_t[2];
00040 typedef vec_t vec3_t[3];
00041
00042 #include "splines/math_vector.h"
00043
00044 #ifndef M_PI
00045 #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
00046 #endif
00047
00048 class texdef_t
00049 {
00050 public:
00051 texdef_t()
00052 {
00053 name = new char[1];
00054 name[0] = '\0';
00055 }
00056 ~texdef_t()
00057 {
00058 delete []name;
00059 name = NULL;
00060 }
00061
00062 const char *Name( void )
00063 {
00064 if ( name ) {
00065 return name;
00066 }
00067
00068 return "";
00069 }
00070
00071 void SetName(const char *p)
00072 {
00073 if (name)
00074 {
00075 delete []name;
00076 }
00077 if (p)
00078 {
00079 name = strcpy(new char[strlen(p)+1], p);
00080 }
00081 else
00082 {
00083 name = new char[1];
00084 name[0] = '\0';
00085 }
00086 }
00087
00088 texdef_t& operator =(const texdef_t& rhs)
00089 {
00090 if (&rhs != this)
00091 {
00092 SetName(rhs.name);
00093 shift[0] = rhs.shift[0];
00094 shift[1] = rhs.shift[1];
00095 rotate = rhs.rotate;
00096 scale[0] = rhs.scale[0];
00097 scale[1] = rhs.scale[1];
00098 contents = rhs.contents;
00099 flags = rhs.flags;
00100 value = rhs.value;
00101 }
00102 return *this;
00103 }
00104
00105 char *name;
00106 float shift[2];
00107 float rotate;
00108 float scale[2];
00109 int contents;
00110 int flags;
00111 int value;
00112 };
00113
00114
00115
00116 typedef struct brushprimit_texdef_s
00117 {
00118 vec_t coords[2][3];
00119 } brushprimit_texdef_t;
00120
00121 class texturewin_t
00122 {
00123 public:
00124 texturewin_t()
00125 {
00126 }
00127 ~texturewin_t()
00128 {
00129 }
00130 int width, height;
00131 int originy;
00132
00133 brushprimit_texdef_t brushprimit_texdef;
00134 int m_nTotalHeight;
00135
00136 void* pTexdef;
00137 texdef_t texdef;
00138 };
00139
00140 #define QER_TRANS 0x00000001
00141 #define QER_NOCARVE 0x00000002
00142
00143 typedef struct qtexture_s
00144 {
00145 struct qtexture_s *next;
00146 char name[64];
00147 int width, height;
00148 int contents;
00149 int flags;
00150 int value;
00151 int texture_number;
00152
00153
00154 char shadername[1024];
00155 qboolean bFromShader;
00156 float fTrans;
00157 int nShaderFlags;
00158 vec3_t color;
00159 qboolean inuse;
00160
00161
00162
00163
00164 void *pData;
00165
00166
00167
00168 char filename[64];
00169
00170 } qtexture_t;
00171
00172
00173
00174
00175 #define MAX_POINTS_ON_WINDING 64
00176 typedef struct
00177 {
00178 int numpoints;
00179 int maxpoints;
00180 float points[8][5];
00181 } winding_t;
00182
00183 typedef struct
00184 {
00185 vec3_t normal;
00186 double dist;
00187 int type;
00188 } plane_t;
00189
00190
00191
00192 typedef struct face_s
00193 {
00194 struct face_s *next;
00195 struct face_s *original;
00196 vec3_t planepts[3];
00197 texdef_t texdef;
00198 plane_t plane;
00199
00200 winding_t *face_winding;
00201
00202 vec3_t d_color;
00203 qtexture_t *d_texture;
00204
00205
00206 brushprimit_texdef_t brushprimit_texdef;
00207
00208
00209
00210
00211 void *pData;
00212 } face_t;
00213
00214 typedef struct {
00215 vec3_t xyz;
00216 float sideST[2];
00217 float capST[2];
00218 } curveVertex_t;
00219
00220 typedef struct {
00221 curveVertex_t v[2];
00222 } sideVertex_t;
00223
00224
00225 #define MIN_PATCH_WIDTH 3
00226 #define MIN_PATCH_HEIGHT 3
00227
00228 #define MAX_PATCH_WIDTH 16
00229 #define MAX_PATCH_HEIGHT 16
00230
00231
00232
00233
00234
00235
00236 #define PATCH_GENERIC 0x00000000 // generic flat patch
00237 #define PATCH_CYLINDER 0x00000001 // cylinder
00238 #define PATCH_BEVEL 0x00000002 // bevel
00239 #define PATCH_ENDCAP 0x00000004 // endcap
00240 #define PATCH_HEMISPHERE 0x00000008 // hemisphere
00241 #define PATCH_CONE 0x00000010 // cone
00242 #define PATCH_TRIANGLE 0x00000020 // simple tri, assumes 3x3 patch
00243
00244
00245 #define PATCH_CAP 0x00001000 // flat patch applied as a cap
00246 #define PATCH_SEAM 0x00002000 // flat patch applied as a seam
00247 #define PATCH_THICK 0x00004000 // patch applied as a thick portion
00248
00249
00250 #define PATCH_BEZIER 0x00000000 // default bezier
00251 #define PATCH_BSPLINE 0x10000000 // bspline
00252
00253 #define PATCH_TYPEMASK 0x00000fff //
00254 #define PATCH_BTYPEMASK 0x0000f000 //
00255 #define PATCH_STYLEMASK 0xffff0000 //
00256
00257 typedef struct {
00258 vec3_t xyz;
00259 float st[2];
00260 float lightmap[2];
00261 vec3_t normal;
00262 } drawVert_t;
00263
00264
00265 typedef struct epair_s
00266 {
00267 struct epair_s *next;
00268 char *key;
00269 char *value;
00270 } epair_t;
00271
00272 struct brush_s;
00273 typedef struct brush_s brush_t;
00274
00275 typedef struct {
00276 int width, height;
00277 int contents, flags, value, type;
00278 qtexture_t *d_texture;
00279 drawVert_t ctrl[MAX_PATCH_WIDTH][MAX_PATCH_HEIGHT];
00280 brush_t *pSymbiot;
00281 qboolean bSelected;
00282 qboolean bOverlay;
00283 qboolean bDirty;
00284 int nListID;
00285 epair_t *epairs;
00286
00287
00288
00289 void *pData;
00290 } patchMesh_t;
00291
00292 typedef struct {
00293 int index;
00294 qtexture_t *texture;
00295 texdef_t texdef;
00296 } terrainFace_t;
00297
00298 typedef struct {
00299 float height;
00300 float scale;
00301 terrainFace_t tri;
00302 vec4_t rgba;
00303 vec3_t normal;
00304 vec3_t xyz;
00305 } terrainVert_t;
00306
00307 #define MAX_TERRAIN_TEXTURES 128
00308 typedef struct {
00309 int width, height;
00310
00311 vec3_t mins, maxs;
00312 vec3_t origin;
00313 float scale_x;
00314 float scale_y;
00315
00316 int numtextures;
00317 qtexture_t *textures[ MAX_TERRAIN_TEXTURES ];
00318
00319 terrainVert_t *heightmap;
00320
00321 epair_t *epairs;
00322
00323 brush_s *pSymbiot;
00324 bool bSelected;
00325 bool bDirty;
00326 int nListID;
00327 } terrainMesh_t;
00328
00329 typedef struct brush_s
00330 {
00331 struct brush_s *prev, *next;
00332 struct brush_s *oprev, *onext;
00333 struct entity_s *owner;
00334 vec3_t mins, maxs;
00335 face_t *brush_faces;
00336
00337 qboolean bModelFailed;
00338
00339
00340
00341 qboolean patchBrush;
00342 qboolean hiddenBrush;
00343 qboolean terrainBrush;
00344
00345
00346
00347 patchMesh_t *pPatch;
00348 terrainMesh_t *pTerrain;
00349
00350 struct entity_s *pUndoOwner;
00351
00352 int undoId;
00353 int redoId;
00354 int ownerId;
00355
00356
00357 #ifdef QERTYPES_USE_MFC
00358 int numberId;
00359 HTREEITEM itemOwner;
00360 #else
00361 int numberId;
00362 DWORD itemOwner;
00363 #endif
00364
00365
00366 epair_t *epairs;
00367
00368 } brush_t;
00369
00370
00371 #define MAX_FLAGS 8
00372
00373
00374 typedef struct trimodel_t
00375 {
00376 vec3_t v[3];
00377 float st[3][2];
00378 } trimodel;
00379
00380 typedef struct entitymodel_t
00381 {
00382 struct entitymodel_t *pNext;
00383 int nTriCount;
00384 trimodel *pTriList;
00385 int nTextureBind;
00386 int nSkinWidth;
00387 int nSkinHeight;
00388 int nModelPosition;
00389 } entitymodel;
00390
00391
00392
00393
00394 #define ECLASS_LIGHT 0x00000001
00395 #define ECLASS_ANGLE 0x00000002
00396 #define ECLASS_PATH 0x00000004
00397 #define ECLASS_MISCMODEL 0x00000008
00398 #define ECLASS_PLUGINENTITY 0x00000010
00399
00400 typedef struct eclass_s
00401 {
00402 struct eclass_s *next;
00403 char *name;
00404 qboolean fixedsize;
00405 qboolean unknown;
00406 vec3_t mins, maxs;
00407 vec3_t color;
00408 texdef_t texdef;
00409 char *comments;
00410 char flagnames[MAX_FLAGS][32];
00411
00412
00413
00414
00415
00416
00417
00418 entitymodel *model;
00419 char *modelpath;
00420 char *skinpath;
00421 int nFrame;
00422 unsigned int nShowFlags;
00423
00424 HMODULE hPlug;
00425 } eclass_t;
00426
00427 extern eclass_t *eclass;
00428
00429
00430
00431
00432 #define W_CAMERA 0x0001
00433 #define W_XY 0x0002
00434 #define W_XY_OVERLAY 0x0004
00435 #define W_Z 0x0008
00436 #define W_TEXTURE 0x0010
00437 #define W_Z_OVERLAY 0x0020
00438 #define W_CONSOLE 0x0040
00439 #define W_ENTITY 0x0080
00440 #define W_CAMERA_IFON 0x0100
00441 #define W_XZ 0x0200 //--| only used for patch vertex manip stuff
00442 #define W_YZ 0x0400 //--|
00443 #define W_GROUP 0x0800
00444 #define W_MEDIA 0x1000
00445 #define W_ALL 0xFFFFFFFF
00446
00447
00448 enum VIEWTYPE {YZ, XZ, XY};
00449
00450 enum terrainnoise_t { NOISE_NONE, NOISE_PLUS, NOISE_PLUSMINUS };
00451 enum terrainbrush_t { TERRAIN_BRUSH_CIRCLE, TERRAIN_BRUSH_SQUARE };
00452 enum terrainfalloff_t { TERRAIN_FALLOFF_LINEAR, TERRAIN_FALLOFF_CURVED };
00453
00454 #endif