#include <windows.h>
#include "qgl.h"
#include <math.h>
#include <stdlib.h>
#include <malloc.h>
#include "qertypes.h"
#include "../libs/cmdlib.h"
#include "mathlib.h"
#include "parse.h"
#include "lbmlib.h"
#include <commctrl.h>
#include "afxres.h"
#include "resource.h"
#include "qedefs.h"
#include "qfiles.h"
#include "textures.h"
#include "brush.h"
#include "entity.h"
#include "map.h"
#include "select.h"
#include "splines/splines.h"
#include "camera.h"
#include "xy.h"
#include "z.h"
#include "mru.h"
#include "undo.h"
#include "terrain.h"
#include "qerplugin.h"
#include "isurfaceplugin.h"
#include "igl.h"
#include "ISelectedFace.h"
#include "IEpairs.h"
#include "EpairsWrapper.h"
#include "IPluginEntities.h"
#include "ShaderInfo.h"
#include "IScriplib.h"
#include "IBSPFrontend.h"
#include "IMessaging.h"
#include "Messaging.h"
#include "IShaders.h"
Include dependency graph for QE3.H:

Go to the source code of this file.
|
|
|
|
|
|
|
|
|
|
|
Referenced by Group_Add(), Group_AddToProperGroup(), Group_Alloc(), Group_ForName(), Group_Init(), Group_Save(), and CGroupDlg::OnBtnAdd(). |
|
||||||||||||
|
Definition at line 542 of file PMESH.CPP. References active_brushes, b, Brush_AddToList(), Brush_Build(), Brush_Create(), brush_s::brush_faces, brush_t, QEGlobals_t::d_texturewin, Entity_LinkBrush(), f, face_t, texdef_t::flags, g_qeglobals, j, face_s::next, Patch_CalcBounds(), pm, brush_s::pPatch, face_s::texdef, texturewin_t::texdef, vec3_t, and world_entity. Referenced by CPlugInManager::CommitPatchHandleToMap(), Patch_BrushToMesh(), Patch_Duplicate(), Patch_FromTriangle(), Patch_GenericMesh(), and Patch_Parse(). 00543 {
00544 // find the farthest points in x,y,z
00545 vec3_t vMin, vMax;
00546 Patch_CalcBounds(pm, vMin, vMax);
00547
00548 for (int j = 0; j < 3; j++)
00549 {
00550 if (vMin[j] == vMax[j])
00551 {
00552 vMin[j] -= 4;
00553 vMax[j] += 4;
00554 }
00555 }
00556
00557 brush_t *b = Brush_Create(vMin, vMax, &g_qeglobals.d_texturewin.texdef);
00558 face_t *f;
00559 for (f=b->brush_faces ; f ; f=f->next)
00560 {
00561 f->texdef.flags |= SURF_PATCH;
00562 }
00563
00564 // FIXME: this entire type of linkage needs to be fixed
00565 b->pPatch = pm;
00566 pm->pSymbiot = b;
00567 pm->bSelected = false;
00568 pm->bOverlay = false;
00569 pm->bDirty = true;
00570 pm->nListID = -1;
00571
00572 if (bLinkToWorld)
00573 {
00574 Brush_AddToList (b, &active_brushes);
00575 Entity_LinkBrush (world_entity, b);
00576 Brush_Build(b);
00577 }
00578
00579 return b;
00580 }
|
Here is the call graph for this function:

|
|
Definition at line 4068 of file PMESH.CPP. References brush_t, g_ptrSelectedFaces, brush_s::next, brush_s::patchBrush, and selected_brushes. Referenced by CMainFrame::OnSelectionDragvertecies(), and CXYWnd::ProduceSplitLists(). 04069 {
04070 if (g_ptrSelectedFaces.GetSize() > 0 || selected_brushes.next == &selected_brushes)
04071 return false;
04072 for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next)
04073 {
04074 if (pb->patchBrush)
04075 {
04076 return true;
04077 }
04078 }
04079 return false;
04080 }
|
|
||||||||||||||||
|
Definition at line 419 of file PMESH.CPP. References b, Brush_Build(), brush_s::brush_faces, brush_t, texdef_t::contents, Error(), f, Face_Alloc(), Face_Free(), face_t, texdef_t::flags, i, j, face_s::next, next, brush_s::patchBrush, face_s::planepts, face_s::texdef, vec3_t, and VectorCopy. Referenced by GenerateEndCaps(), Patch_AddRow(), Patch_AdjustSelected(), Patch_ApplyMatrix(), Patch_Rebuild(), Patch_Scale(), Patch_Thicken(), Patch_UpdateSelected(), Select_SnapToGrid(), Terrain_Scale(), and Terrain_UpdateSelected(). 00420 {
00421 //
00422 // Total hack job
00423 // Rebuilds a brush
00424 int i, j;
00425 face_t *f, *next;
00426 vec3_t pts[4][2];
00427 texdef_t texdef;
00428 // free faces
00429
00430 for (j = 0; j < 3; j++)
00431 {
00432 if ((int)vMins[j] == (int)vMaxs[j])
00433 {
00434 vMins[j] -= 4;
00435 vMaxs[j] += 4;
00436 }
00437 }
00438
00439
00440 for (f=b->brush_faces ; f ; f=next)
00441 {
00442 next = f->next;
00443 if (f)
00444 texdef = f->texdef;
00445 Face_Free( f );
00446 }
00447
00448 b->brush_faces = NULL;
00449
00450 // left the last face so we can use its texdef
00451
00452 for (i=0 ; i<3 ; i++)
00453 if (vMaxs[i] < vMins[i])
00454 Error ("Brush_RebuildBrush: backwards");
00455
00456 pts[0][0][0] = vMins[0];
00457 pts[0][0][1] = vMins[1];
00458
00459 pts[1][0][0] = vMins[0];
00460 pts[1][0][1] = vMaxs[1];
00461
00462 pts[2][0][0] = vMaxs[0];
00463 pts[2][0][1] = vMaxs[1];
00464
00465 pts[3][0][0] = vMaxs[0];
00466 pts[3][0][1] = vMins[1];
00467
00468 for (i=0 ; i<4 ; i++)
00469 {
00470 pts[i][0][2] = vMins[2];
00471 pts[i][1][0] = pts[i][0][0];
00472 pts[i][1][1] = pts[i][0][1];
00473 pts[i][1][2] = vMaxs[2];
00474 }
00475
00476 for (i=0 ; i<4 ; i++)
00477 {
00478 f = Face_Alloc();
00479 f->texdef = texdef;
00480 f->texdef.flags &= ~SURF_KEEP;
00481 f->texdef.contents &= ~CONTENTS_KEEP;
00482 if ( b->patchBrush )
00483 {
00484 f->texdef.flags |= SURF_PATCH;
00485 }
00486 f->next = b->brush_faces;
00487 b->brush_faces = f;
00488 j = (i+1)%4;
00489
00490 VectorCopy (pts[j][1], f->planepts[0]);
00491 VectorCopy (pts[i][1], f->planepts[1]);
00492 VectorCopy (pts[i][0], f->planepts[2]);
00493 }
00494
00495 f = Face_Alloc();
00496 f->texdef = texdef;
00497 f->texdef.flags &= ~SURF_KEEP;
00498 f->texdef.contents &= ~CONTENTS_KEEP;
00499 if ( b->patchBrush )
00500 {
00501 f->texdef.flags |= SURF_PATCH;
00502 }
00503 f->next = b->brush_faces;
00504 b->brush_faces = f;
00505
00506 VectorCopy (pts[0][1], f->planepts[0]);
00507 VectorCopy (pts[1][1], f->planepts[1]);
00508 VectorCopy (pts[2][1], f->planepts[2]);
00509
00510 f = Face_Alloc();
00511 f->texdef = texdef;
00512 f->texdef.flags &= ~SURF_KEEP;
00513 f->texdef.contents &= ~CONTENTS_KEEP;
00514 if ( b->patchBrush )
00515 {
00516 f->texdef.flags |= SURF_PATCH;
00517 }
00518 f->next = b->brush_faces;
00519 b->brush_faces = f;
00520
00521 VectorCopy (pts[2][0], f->planepts[0]);
00522 VectorCopy (pts[1][0], f->planepts[1]);
00523 VectorCopy (pts[0][0], f->planepts[2]);
00524
00525 Brush_Build(b);
00526 }
|
Here is the call graph for this function:

|
|
Definition at line 150 of file brush_primit.cpp. References atof(), atoi, b, brush_s::brush_faces, brush_t, face_s::brushprimit_texdef, texdef_t::contents, brushprimit_texdef_s::coords, epair_t, brush_s::epairs, f, Face_Alloc(), face_t, texdef_t::flags, GetToken(), i, j, face_s::next, epair_s::next, ParseEpair(), face_s::planepts, texdef_t::SetName(), strcmp(), face_s::texdef, TokenAvailable(), texdef_t::value, and Warning(). Referenced by Brush_Parse(). 00151 {
00152 epair_t *ep;
00153 face_t *f;
00154 int i,j;
00155 GetToken (true);
00156 if (strcmp (token, "{"))
00157 {
00158 Warning ("parsing brush primitive");
00159 return;
00160 }
00161 do
00162 {
00163 if (!GetToken (true))
00164 break;
00165 if (!strcmp (token, "}") )
00166 break;
00167 // reading of b->epairs if any
00168 if (strcmp (token, "(") )
00169 {
00170 ep = ParseEpair();
00171 ep->next = b->epairs;
00172 b->epairs = ep;
00173 }
00174 else
00175 // it's a face
00176 {
00177 f = Face_Alloc();
00178 f->next = NULL;
00179 if (!b->brush_faces)
00180 b->brush_faces = f;
00181 else
00182 {
00183 face_t *scan;
00184 for (scan=b->brush_faces ; scan->next ; scan=scan->next)
00185 ;
00186 scan->next = f;
00187 }
00188
00189 // read the three point plane definition
00190 for (i=0 ; i<3 ; i++)
00191 {
00192 if (i != 0)
00193 GetToken (true);
00194 if (strcmp (token, "(") )
00195 {
00196 Warning ("parsing brush");
00197 return;
00198 }
00199 for (j=0 ; j<3 ; j++)
00200 {
00201 GetToken (false);
00202 f->planepts[i][j] = atof(token);
00203 }
00204 GetToken (false);
00205 if (strcmp (token, ")") )
00206 {
00207 Warning ("parsing brush");
00208 return;
00209 }
00210 }
00211 // texture coordinates
00212 GetToken (false);
00213 if (strcmp(token, "("))
00214 {
00215 Warning ("parsing brush primitive");
00216 return;
00217 }
00218 GetToken (false);
00219 if (strcmp(token, "("))
00220 {
00221 Warning ("parsing brush primitive");
00222 return;
00223 }
00224 for (j=0;j<3;j++)
00225 {
00226 GetToken(false);
00227 f->brushprimit_texdef.coords[0][j]=atof(token);
00228 }
00229 GetToken (false);
00230 if (strcmp(token, ")"))
00231 {
00232 Warning ("parsing brush primitive");
00233 return;
00234 }
00235 GetToken (false);
00236 if (strcmp(token, "("))
00237 {
00238 Warning ("parsing brush primitive");
00239 return;
00240 }
00241 for (j=0;j<3;j++)
00242 {
00243 GetToken(false);
00244 f->brushprimit_texdef.coords[1][j]=atof(token);
00245 }
00246 GetToken (false);
00247 if (strcmp(token, ")"))
00248 {
00249 Warning ("parsing brush primitive");
00250 return;
00251 }
00252 GetToken (false);
00253 if (strcmp(token, ")"))
00254 {
00255 Warning ("parsing brush primitive");
00256 return;
00257 }
00258 // read the texturedef
00259 GetToken (false);
00260 //strcpy(f->texdef.name, token);
00261 f->texdef.SetName(token);
00262 if (TokenAvailable ())
00263 {
00264 GetToken (false);
00265 f->texdef.contents = atoi(token);
00266 GetToken (false);
00267 f->texdef.flags = atoi(token);
00268 GetToken (false);
00269 f->texdef.value = atoi(token);
00270 }
00271 }
00272 } while (1);
00273 }
|
Here is the call graph for this function:

|
|
|
|
|
Definition at line 595 of file l_cmd.c. References argv, check(), i, myargv, and Q_strcasecmp(). 00596 {
00597 int i;
00598
00599 for (i = 1;i<myargc;i++)
00600 {
00601 if ( !Q_strcasecmp(check, myargv[i]) )
00602 return i;
00603 }
00604
00605 return 0;
00606 }
|
Here is the call graph for this function:

|
|
Definition at line 438 of file l_cmd.c. References c, com_eof, com_token, and data. Referenced by CG_NewParticleArea(), CG_ParseAnimationFile(), CG_StartMusic(), COM_MatchToken(), Eclass_InitFromText(), G_ParseInfos(), Parse1DMatrix(), R_GetEntityToken(), SV_GameSystemCalls(), UI_ParseAnimationFile(), UI_ParseInfos(), and VM_LoadSymbols(). 00439 {
00440 int c;
00441 int len;
00442
00443 len = 0;
00444 com_token[0] = 0;
00445
00446 if (!data)
00447 return NULL;
00448
00449 // skip whitespace
00450 skipwhite:
00451 while ( (c = *data) <= ' ')
00452 {
00453 if (c == 0)
00454 {
00455 com_eof = true;
00456 return NULL; // end of file;
00457 }
00458 data++;
00459 }
00460
00461 // skip // comments
00462 if (c=='/' && data[1] == '/')
00463 {
00464 while (*data && *data != '\n')
00465 data++;
00466 goto skipwhite;
00467 }
00468
00469
00470 // handle quoted strings specially
00471 if (c == '\"')
00472 {
00473 data++;
00474 do
00475 {
00476 c = *data++;
00477 if (c=='\"')
00478 {
00479 com_token[len] = 0;
00480 return data;
00481 }
00482 com_token[len] = c;
00483 len++;
00484 } while (1);
00485 }
00486
00487 // parse single characters
00488 if (c=='{' || c=='}'|| c==')'|| c=='(' || c=='\'' || c==':')
00489 {
00490 com_token[len] = c;
00491 len++;
00492 com_token[len] = 0;
00493 return data+1;
00494 }
00495
00496 // parse a regular word
00497 do
00498 {
00499 com_token[len] = c;
00500 data++;
00501 len++;
00502 c = *data;
00503 if (c=='{' || c=='}'|| c==')'|| c=='(' || c=='\'' || c==':')
00504 break;
00505 } while (c>32);
00506
00507 com_token[len] = 0;
00508 return data;
00509 }
|
|
||||||||||||||||
|
Definition at line 31 of file brush_primit.c. References atan2(), cos(), e, fabs(), sin(), sqrt(), and vec_t. Referenced by ChopFaceByBrush(), DrawSurfaceForSide(), EmitBrushPrimitTextureCoordinates(), Face_MoveTexture_BrushPrimit(), FaceToBrushPrimitFace(), RotateFaceTexture_BrushPrimit(), Select_ShiftTexture_BrushPrimit(), and CCamWnd::ShiftTexture_BrushPrimit(). 00032 {
00033 vec_t RotY,RotZ;
00034 // do some cleaning
00035 if (fabs(normal[0])<1e-6)
00036 normal[0]=0.0f;
00037 if (fabs(normal[1])<1e-6)
00038 normal[1]=0.0f;
00039 if (fabs(normal[2])<1e-6)
00040 normal[2]=0.0f;
00041 // compute the two rotations around Y and Z to rotate X to normal
00042 RotY=-atan2(normal[2],sqrt(normal[1]*normal[1]+normal[0]*normal[0]));
00043 RotZ=atan2(normal[1],normal[0]);
00044 // rotate (0,1,0) and (0,0,1) to compute texX and texY
00045 texX[0]=-sin(RotZ);
00046 texX[1]=cos(RotZ);
00047 texX[2]=0;
00048 // the texY vector is along -Z ( T texture coorinates axis )
00049 texY[0]=-sin(RotY)*cos(RotZ);
00050 texY[1]=-sin(RotY)*sin(RotZ);
00051 texY[2]=-cos(RotY);
00052 }
|
Here is the call graph for this function:
