Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

QE3.H File Reference

#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:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  group_s
struct  pedge_t
struct  QEGlobals_t
struct  SavedInfo_t

Defines

#define MAX_NUM_ARGVS   32
#define myoffsetof(type, identifier)   ((size_t)&((type *)0)->identifier)
#define QERTYPES_USE_MFC

Typedefs

typedef group_s group_t

Functions

brush_tAddBrushForPatch (patchMesh_t *pm, bool bLinkToWorld=true)
bool WINAPI AnyPatchesSelected ()
void Brush_RebuildBrush (brush_t *b, vec3_t vMins, vec3_t vMaxs)
void BrushPrimit_Parse (brush_t *)
void BuildGammaTable (float g)
int CheckParm (char *check)
char * COM_Parse (char *data)
void ComputeAxisBase (vec3_t normal, vec3_t texS, vec3_t texT)
void ComputeBest2DVector (vec3_t v, vec3_t X, vec3_t Y, int &x, int &y)
void ConnectEntities (void)
void ConvertTexMatWithQTexture (brushprimit_texdef_t *texMat1, qtexture_t *qtex1, brushprimit_texdef_t *texMat2, qtexture_t *qtex2)
char * copystring (char *s)
BOOL CreateEntityWindow (HINSTANCE hInstance)
void CSG_MakeHollow (void)
void CSG_Merge (void)
void CSG_Subtract (void)
void Curve_AddFakePlanes (brush_t *B)
void Curve_BuildPoints (brush_t *b)
void Curve_CameraDraw (brush_t *b)
void Curve_Invert (void)
void Curve_MakeCurvedBrush (qboolean negative, qboolean top, qboolean bottom, qboolean s1, qboolean s2, qboolean s3, qboolean s4)
void Curve_StripFakePlanes (brush_t *B)
void Curve_WriteFile (char *name)
void Curve_XYDraw (brush_t *b)
bool DispatchOnLButtonDown (UINT nFlags, int x, int y)
bool DispatchOnLButtonUp (UINT nFlags, int x, int y)
void DispatchOnMouseMove (UINT nFlags, int x, int y)
void DispatchRadiantMsg (int Msg)
void DoAbout (void)
void DoFind (void)
void DoGamma (void)
void DoRotate (void)
void DoSides (bool bCone=false, bool bSphere=false, bool bTorus=false)
void DoSurface ()
void Drag_Begin (int x, int y, int buttons, vec3_t xaxis, vec3_t yaxis, vec3_t origin, vec3_t dir)
void Drag_MouseMoved (int x, int y, int buttons)
void Drag_MouseUp (int nButtons=0)
void DrawPluginEntities (VIEWTYPE vt)
int DrawTexControls (HWND hWnd)
void Eclass_ScanFile (char *filename)
void EmitBrushPrimitTextureCoordinates (face_t *, winding_t *)
void EmitTextureCoordinates (float *xyzst, qtexture_t *q, face_t *f)
void Error (char *error,...)
char * ExpandReletivePath (char *p)
void Face_MoveTexture_BrushPrimit (face_t *f, vec3_t delta)
void FaceToBrushPrimitFace (face_t *f)
void FakeTexCoordsToTexMat (float shift[2], float rot, float scale[2], vec_t texMat[2][3])
void FillBSPMenu (void)
void FillClassList (void)
void FillTextureMenu (CStringArray *pArray=NULL)
BOOL GetSelectAllCriteria (CString &strKey, CString &strVal)
void GetSpawnFlags (void)
void Group_Add (entity_t *e)
void Group_AddToProperGroup (brush_t *b)
void Group_AddToSelected (brush_t *b)
void Group_AddToWorld (brush_t *b)
group_tGroup_Alloc (const char *name)
group_tGroup_ForName (const char *name)
void Group_Init ()
void Group_RemoveBrush (brush_t *b)
void Group_RemoveListFromWorld ()
void Group_Save (FILE *f)
CShaderInfohasShader (const char *pName)
double I_FloatTime (void)
qboolean IsBrushSelected (brush_t *bSel)
BOOL LoadRegistryInfo (const char *pszName, void *pvBuf, long *plSize)
BOOL LoadWindowState (HWND hWnd, const char *pszName)
void Main_Create (HINSTANCE hInstance)
patchMesh_tMakeNewPatch ()
bool WINAPI OnlyPatchesSelected ()
void ParseCommandLine (char *lpCmdLine)
int ParseNum (char *str)
void Patch_AddRow (patchMesh_t *p)
void Patch_AdjustColumns (patchMesh_t *p, int nCols)
void Patch_AdjustRows (patchMesh_t *p, int nRows)
void Patch_AdjustSelected (bool bInsert, bool bColumn, bool bFlag)
void Patch_ApplyMatrix (patchMesh_t *p, const vec3_t vOrigin, const vec3_t vMatrix[3], bool bSnap=false)
void Patch_BendHandleENTER ()
void Patch_BendHandleTAB ()
void Patch_BendToggle ()
void Patch_BrushToMesh (bool bCone=false, bool bBevel=false, bool bEndcap=false, bool bSquare=false, int nHeight=3)
void Patch_BuildPoints (brush_t *b)
void Patch_CapCurrent (bool bInvertedBevel=false, bool bInvertedEndcap=false)
void Patch_Cleanup ()
void Patch_ClearOverlays ()
void Patch_Delete (patchMesh_t *p)
void Patch_Deselect (patchMesh_t *p)
void Patch_Deselect ()
void Patch_DisperseColumns ()
void Patch_DisperseRows ()
bool Patch_DragScale (patchMesh_t *p, vec3_t vAmt, vec3_t vMove)
void Patch_DrawCam (patchMesh_t *p)
void Patch_DrawXY (patchMesh_t *p)
patchMesh_tPatch_Duplicate (patchMesh_t *pFrom)
void Patch_EditPatch ()
void Patch_FindReplaceTexture (brush_t *pb, const char *pFind, const char *pReplace, bool bForce)
void Patch_FitTexturing ()
void Patch_Freeze ()
void Patch_FromTriangle (vec5_t vx, vec5_t vy, vec5_t vz)
brush_tPatch_GenericMesh (int nWidth, int nHeight, int nOrientation=2, bool bDeleteSource=true, bool bOverride=false)
const char * Patch_GetKeyValue (patchMesh_t *p, const char *pKey)
const char * Patch_GetTextureName ()
void Patch_InsDelHandleENTER ()
void Patch_InsDelHandleTAB ()
void Patch_InsDelToggle ()
void Patch_InsertColumn (patchMesh_t *p, bool bAdd)
void Patch_InsertRow (patchMesh_t *p, bool bAdd)
void Patch_InvertTexture (bool bY)
int Patch_MemorySize (patchMesh_t *p)
void Patch_Move (patchMesh_t *p, const vec3_t vMove, bool bRebuild=false)
void Patch_NaturalizeSelected (bool bCap=false, bool bCycleCap=false)
void Patch_NaturalTexturing ()
brush_tPatch_Parse (bool bOld)
void Patch_ReadBuffer (char *pBuff, bool bSelect=false)
void Patch_ReadFile (char *name)
void WINAPI Patch_Rebuild (patchMesh_t *p)
void Patch_RemoveColumn (patchMesh_t *p, bool bFirst)
void Patch_RemoveRow (patchMesh_t *p, bool bFirst)
void Patch_ReplaceQTexture (brush_t *pb, qtexture_t *pOld, qtexture_t *pNew)
void Patch_ResetTexturing (float fx, float fy)
void Patch_Restore (patchMesh_t *p)
void Patch_RotateTexture (patchMesh_t *p, float fAngle)
void Patch_Save (patchMesh_t *p)
void Patch_Scale (patchMesh_t *p, const vec3_t vOrigin, const vec3_t vAmt, bool bRebuilt=true)
void Patch_ScaleTexture (patchMesh_t *p, float fx, float fy, bool bFixup=true)
void Patch_Select (patchMesh_t *p)
void Patch_SelectAreaPoints ()
void Patch_SelectBendAxis ()
void Patch_SelectBendNormal ()
void Patch_SetEpair (patchMesh_t *p, const char *pKey, const char *pValue)
void Patch_SetOverlays ()
void Patch_SetTexture (patchMesh_t *p, texdef_t *tex_def, IPluginTexdef *pPlugTexdef=NULL)
void Patch_SetTextureInfo (texdef_t *pt)
void Patch_SetView (int n)
void Patch_ShiftTexture (patchMesh_t *p, float fx, float fy)
void Patch_StartInsDel ()
void Patch_Thicken (int nAmount, bool bSeam)
void Patch_ToggleInverted ()
void Patch_Transpose ()
void Patch_UnFreeze (bool bAll)
void Patch_UpdateSelected (vec3_t vMove)
void Patch_Write (patchMesh_t *p, CMemFile *file)
void Patch_Write (patchMesh_t *p, FILE *f)
void Patch_WriteFile (CMemFile *pMemFile)
void Patch_WriteFile (char *name)
void WINAPI Pointfile_Check (void)
void Pointfile_Clear (void)
void Pointfile_Delete (void)
void Pointfile_Draw (void)
void Pointfile_Load (void)
void Pointfile_Next (void)
void Pointfile_Prev (void)
void ProjectDialog (void)
void QE_CheckAutoSave (void)
void WINAPI QE_CheckOpenGLForErrors (void)
void WINAPI QE_ConvertDOSToUnixName (char *dst, const char *src)
void QE_CountBrushesAndUpdateStatusBar (void)
void QE_ExpandBspString (char *bspaction, char *out, char *mapname, bool useTemps)
void QE_Init (void)
qboolean QE_KeyDown (int key, int nFlags=0)
qboolean QE_LoadProject (char *projectfile)
qboolean QE_SingleBrush (bool bQuiet=false)
int WINAPI QERApp_EClassScanDir (char *dir, HMODULE plugID)
int WINAPI QERApp_GetFaceInfo (_QERFaceData *pFaceData, winding_t *pWinding)
HGLRC WINAPI QERApp_GetQeglobalsHGLRC ()
void WINAPI QERApp_GetTextureSize (int Size[2])
void WINAPI QERApp_GetTwoSelectedPatch (patchMesh_t **p1, patchMesh_t **p2)
IXYWndWrapper *WINAPI QERApp_GetXYWndWrapper ()
void WINAPI QERApp_HookListener (IListener *pListen, int Msg)
void WINAPI QERApp_HookWindow (IWindowListener *pListen)
void WINAPI QERApp_HookXYGLWindow (IGLWindow *pGLW)
int WINAPI QERApp_ISelectedFace_GetTextureNumber ()
void WINAPI QERApp_MapPrintf_FILE (char *text,...)
int WINAPI QERApp_SetFaceInfo (_QERFaceData *pFaceData)
qtexture_t *WINAPI QERApp_TryTextureForName (const char *name)
void WINAPI QERApp_UnHookGLWindow (IGLWindow *pGLW)
int WINAPI QERApp_UnHookListener (IListener *pListen)
void WINAPI QERApp_UnHookWindow (IWindowListener *pListen)
int WINAPI QEW_SetupPixelFormat (HDC hDC, qboolean zbuffer)
void QEW_StopGL (HWND hWnd, HGLRC hGLRC, HDC hDC)
void RotateFaceTexture_BrushPrimit (face_t *f, int nAxis, float fDeg, vec3_t vOrigin)
BOOL SaveRegistryInfo (const char *pszName, void *pvBuf, long lSize)
BOOL SaveWindowState (HWND hWnd, const char *pszName)
void Select_ShiftTexture_BrushPrimit (face_t *f, int x, int y)
void Select_SnapToGrid ()
void SelectEdgeByRay (vec3_t org, vec3_t dir)
void SelectVertexByRay (vec3_t org, vec3_t dir)
void SetInspectorMode (int iType)
void SetKeyValuePairs (bool bClearMD3=false)
CShaderInfoSetNameShaderInfo (qtexture_t *q, const char *pPath, const char *pName)
void SetSpawnFlags (void)
void SetupVertexSelection (void)
patchMesh_tSinglePatchSelected ()
void Sys_Beep (void)
void Sys_BeginWait (void)
void Sys_ClearPrintf (void)
double Sys_DoubleTime (void)
void Sys_EndWait (void)
void Sys_GetCursorPos (int *x, int *y)
void Sys_MarkMapModified (void)
void Sys_Printf (char *text,...)
void Sys_SetCursorPos (int x, int y)
void Sys_SetTitle (char *text)
void Sys_Status (const char *psz, int part)
void Sys_UpdateStatusBar (void)
void WINAPI Sys_UpdateWindows (int bits)
void TexMatToFakeTexCoords (vec_t texMat[2][3], float shift[2], float *rot, float scale[2])
qtexture_tTexture_LoadTGATexture (unsigned char *pPixels, int nWidth, int nHeight, char *pPath, int nFlags, int nContents, int nValue)
char * TranslateString (char *buf)
BOOL UpdateEntitySel (eclass_t *pec)
void Warning (char *error,...)
void WCam_Create (HINSTANCE hInstance)
BOOL CALLBACK Win_Dialog (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
bool within (vec3_t vTest, vec3_t vTL, vec3_t vBR)
void WXY_Create (HINSTANCE hInstance)
void WZ_Create (HINSTANCE hInstance)

Variables

int argc
char * argv [MAX_NUM_ARGVS]
HANDLE bsp_process
qboolean com_eof
char com_token [1024]
eclass_teclass_e
qboolean eclass_found
bool g_bPatchBendMode
bool g_bPatchDrillDown
bool g_bPatchInsertMode
bool g_bPatchShowBounds
bool g_bPatchWeld
bool g_bPatchWireFrame
bool g_bSameView
CStringArray g_BSPFrontendCommands
_QERPlugBSPFrontendTable g_BSPFrontendTable
FILEg_File
HANDLE g_hBSPInput
HANDLE g_hBSPOutput
int g_nPatchClickedView
QEGlobals_t g_qeglobals
_QERPlugSurfaceTable g_SurfaceTable
vec3_t g_vBendOrigin
int myargc
char ** myargv
qboolean parsing_single
int screen_height
int screen_width
int update_bits


Define Documentation

#define MAX_NUM_ARGVS   32
 

Definition at line 97 of file QE3.H.

#define myoffsetof type,
identifier   )     ((size_t)&((type *)0)->identifier)
 

Definition at line 74 of file QE3.H.

#define QERTYPES_USE_MFC
 

Definition at line 42 of file QE3.H.


Typedef Documentation

typedef struct group_s group_t
 

Referenced by Group_Add(), Group_AddToProperGroup(), Group_Alloc(), Group_ForName(), Group_Init(), Group_Save(), and CGroupDlg::OnBtnAdd().


Function Documentation

brush_t* AddBrushForPatch patchMesh_t pm,
bool  bLinkToWorld = true
 

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:

bool WINAPI AnyPatchesSelected  ) 
 

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 }

void Brush_RebuildBrush brush_t b,
vec3_t  vMins,
vec3_t  vMaxs
 

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:

void BrushPrimit_Parse brush_t  ) 
 

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:

void BuildGammaTable float  g  ) 
 

int CheckParm char *  check  ) 
 

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:

char* COM_Parse char *  data  ) 
 

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 }

void ComputeAxisBase vec3_t  normal,
vec3_t  texS,
vec3_t  texT
 

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: