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

StdAfx.h File Reference

#include <afxwin.h>
#include <afxext.h>
#include <afxdisp.h>
#include <afxcmn.h>
#include "MainFrm.h"
#include "PrefsDlg.h"
#include "FindTextureDlg.h"

Include dependency graph for StdAfx.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define AFX_STDAFX_H__330BBF08_731C_11D1_B539_00AA00A410FC__INCLUDED_
#define QR_4WAY   2
#define QR_QE4   1
#define QR_SPLIT   0
#define QR_SPLITZ   3
#define VC_EXTRALEAN

Functions

void AcquirePath (int nCount, PFNPathCallback *pFunc)
void AddProp (void)
void AddSlash (CString &)
void Brush_Print (brush_t *b)
int BuildShortPathName (const char *pPath, char *pBuffer, int nBufferLen)
bool ByeByeSurfaceDialog ()
void CheckBspProcess ()
void Clamp (float &f, int nClamp)
void CleanUpEntities ()
qboolean ConfirmModified (void)
void CSG_SplitBrushByFace (brush_t *in, face_t *f, brush_t **front, brush_t **back)
void DLLBuildDone ()
qboolean DoColor (int iIndex)
BOOL DoMru (HWND, WORD)
void DoNewColor (int *i1, int *i2, int *i3)
void DoPatchInspector ()
void DoProjectSettings ()
bool ExtractPath_and_Filename (const char *pPath, CString &strPath, CString &strFilename)
void FindReplace (CString &strContents, const char *pTag, const char *pValue)
void FindReplaceTextures (const char *pFind, const char *pReplace, bool bSelected, bool bForce)
void HandlePopup (CWnd *pWindow, unsigned int uId)
BOOL Init3Dfx ()
bool LoadWindowPlacement (HWND hwnd, const char *pName)
void Map_ImportFile (char *filename)
void Map_SaveSelected (char *pFilename)
void Map_Snapshot ()
void MemFile_fprintf (CMemFile *pMemFile, const char *pText,...)
void MFCCreate (HINSTANCE)
void NewBSP (char *pCommandLine, HWND)
void NewRAD (char *pCommandLine, HWND)
void NewVIS (char *pCommandLine, HWND)
void QE_CheckAutoSave ()
void QE_CountBrushesAndUpdateStatusBar ()
qboolean QE_SaveProject (const char *pProjectFile)
void RunBsp (char *command)
void RunScript (char *pBuffer)
void RunScriptByName (char *, bool)
void RunTools (char *pCommandLine, HWND, const char *)
void SaveWindowPlacement (HWND hwnd, const char *pName)
BOOL SaveWindowState (HWND hWnd, const char *pszName)
void Select_GetTrueMid (vec3_t mid)
void Select_RotateTexture (int amt)
void Select_Scale (float x, float y, float z)
void Select_ScaleTexture (int x, int y)
void Select_ShiftTexture (int x, int y)
void Texture_ShowDirectory (char *pPath, bool Linked=false)
void TextureAxisFromPlane (plane_t *pln, vec3_t xv, vec3_t yv)
void UpdatePatchInspector ()
void UpdateSurfaceDialog ()
void VectorRotate (vec3_t vIn, vec3_t vRotation, vec3_t vOrigin, vec3_t out)
void VectorRotate (vec3_t va, vec3_t vb, vec3_t out)
void WXY_Print ()

Variables

char * bsp_commands [256]
qtexture_tcurrent_texture
entity_tedit_entity
bool g_bClipMode
bool g_bNewFace
bool g_bPathMode
brush_t g_brBackSplits
brush_t g_brFrontSplits
bool g_bRotateMode
bool g_bScaleMode
bool g_bScreenUpdates
bool g_bSwitch
CClipPoint g_Clip1
CClipPoint g_Clip2
SCommandInfo g_Commands []
CFindTextureDlgg_dlgFind
HINSTANCE g_hOpenGL32
SKeyInfo g_Keys []
int g_nBrushId
int g_nCommandCount
int g_nKeyCount
int g_nScaleHow
CClipPoint g_PathPoints [256]
CMainFrameg_pParentWnd
CPrefsDlgg_PrefsDlg
brush_tg_pSplitList
CString g_strAppPath
CString g_strProject
int inspector_mode
qtexture_tnotexture
qboolean region_active
z_t z


Define Documentation

#define AFX_STDAFX_H__330BBF08_731C_11D1_B539_00AA00A410FC__INCLUDED_
 

Definition at line 28 of file StdAfx.h.

#define QR_4WAY   2
 

Definition at line 65 of file StdAfx.h.

#define QR_QE4   1
 

Definition at line 64 of file StdAfx.h.

Referenced by CTexWnd::UpdateFilter().

#define QR_SPLIT   0
 

Definition at line 63 of file StdAfx.h.

Referenced by SetInspectorMode().

#define QR_SPLITZ   3
 

Definition at line 66 of file StdAfx.h.

#define VC_EXTRALEAN
 

Definition at line 37 of file StdAfx.h.


Function Documentation

void AcquirePath int  nCount,
PFNPathCallback pFunc
 

Definition at line 93 of file XYWnd.cpp.

References g_bPathMode, g_nPathCount, g_nPathLimit, and g_pPathFunc.

Referenced by _3DPointInput(), CreateSmartEntity(), and QERApp_GetPoints().

00094 {
00095   g_nPathCount = 0;
00096   g_nPathLimit = nCount;
00097   g_pPathFunc = pFunc;
00098   g_bPathMode = true;
00099 }

void AddProp void   ) 
 

Definition at line 749 of file Win_ent.cpp.

References b, Brush_AddToList(), Brush_Build(), Brush_Create(), Brush_Free(), brush_t, entity_t::brushes, edit_entity, Entity_LinkBrush(), EntKeyField, EntValueField, hwndEnt, LPARAM, brush_s::next, brush_s::owner, Select_Deselect(), selected_brushes, SetKeyValue(), SetKeyValuePairs(), value, and vec3_t.

Referenced by AssignModel(), AssignSound(), FieldWndProc(), and CMainFrame::OnMiscSelectentitycolor().

00750 {
00751     char    key[4096];
00752     char    value[4096];
00753 
00754     if (edit_entity == NULL)
00755         return;
00756 
00757     // Get current selection text
00758 
00759     SendMessage(hwndEnt[EntKeyField], WM_GETTEXT, sizeof(key)-1, (LPARAM)key);  
00760     SendMessage(hwndEnt[EntValueField], WM_GETTEXT, sizeof(value)-1, (LPARAM)value);    
00761 
00762     if (multiple_entities)
00763     {
00764         brush_t *b;
00765 
00766         for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
00767             SetKeyValue(b->owner, key, value);
00768     }
00769     else
00770         SetKeyValue(edit_entity, key, value);
00771 
00772     // refresh the prop listbox
00773     SetKeyValuePairs(); 
00774 
00775     // if it's a plugin entity, perhaps we need to update some drawing parameters
00776     // NOTE: perhaps moving this code to a seperate func would help if we need it in other places
00777     // TODO: we need to call some update func in the IPluginEntity in case model name changes etc.
00778     // ( for the moment only bounding brush is updated ), see UpdateModelBrush in Ritual's Q3Radiant
00779     if (edit_entity->eclass->nShowFlags & ECLASS_PLUGINENTITY)
00780     {
00781         vec3_t  mins, maxs;
00782         edit_entity->pPlugEnt->GetBounds( mins, maxs );
00783         // replace old bounding brush by newly computed one
00784         // NOTE: this part is similar to Entity_BuildModelBrush in Ritual's Q3Radiant, it can be
00785         // usefull moved into a seperate func
00786         brush_t *b,*oldbrush;
00787         if (edit_entity->brushes.onext != &edit_entity->brushes)
00788             oldbrush = edit_entity->brushes.onext;
00789         b = Brush_Create (mins, maxs, &edit_entity->eclass->texdef);
00790         Entity_LinkBrush (edit_entity, b);
00791         Brush_Build( b, true );
00792         Select_Deselect();
00793         Brush_AddToList (edit_entity->brushes.onext, &selected_brushes);
00794         if (oldbrush)
00795             Brush_Free( oldbrush );
00796     }
00797 
00798 }

Here is the call graph for this function:

void AddSlash CString &   ) 
 

Definition at line 559 of file WIN_QE3.CPP.

00560 {
00561   if (strPath.GetLength() > 0)
00562   {
00563     if (strPath.GetAt(strPath.GetLength()-1) != '\\')
00564       strPath += '\\';
00565   }
00566 }

void Brush_Print brush_t b  ) 
 

Definition at line 4269 of file Brush.cpp.

References b, brush_s::brush_faces, brush_t, f, face_t, face_s::next, face_s::planepts, and Sys_Printf().

Referenced by CMainFrame::OnSelectionPrint().

04270 {
04271   int nFace = 0;
04272   for (face_t* f = b->brush_faces ; f ; f=f->next)
04273   {
04274     Sys_Printf("Face %i\n", nFace++);
04275     Sys_Printf("%f %f %f\n", f->planepts[0][0], f->planepts[0][1], f->planepts[0][2]);
04276     Sys_Printf("%f %f %f\n", f->planepts[1][0], f->planepts[1][1], f->planepts[1][2]);
04277     Sys_Printf("%f %f %f\n", f->planepts[2][0], f->planepts[2][1], f->planepts[2][2]);
04278   }
04279  }

Here is the call graph for this function:

int BuildShortPathName const char *  pPath,
char *  pBuffer,
int  nBufferLen
 

Definition at line 192 of file QE3.CPP.

References strcpy().

Referenced by QE_LoadProject(), and RunBsp().

00193 {
00194   char *pFile = NULL;
00195   int nResult = GetFullPathName(pPath, nBufferLen, pBuffer, &pFile); 
00196   nResult = GetShortPathName(pPath, pBuffer, nBufferLen);
00197   if (nResult == 0)
00198     strcpy(pBuffer, pPath);                     // Use long filename
00199   return nResult;
00200 }

Here is the call graph for this function:

bool ByeByeSurfaceDialog  ) 
 

Definition at line 744 of file SurfaceDlg.cpp.

References QEGlobals_t::bSurfacePropertiesPlugin, g_qeglobals, g_SurfaceTable, g_surfwin, IDAPPLY, and _QERPlugSurfaceTable::m_pfnByeByeSurfaceDialog.

Referenced by CMainFrame::OnSelectionDeselect().

00745 {
00746     // surface properties plugin ?
00747     if (g_qeglobals.bSurfacePropertiesPlugin)
00748     {
00749         return g_SurfaceTable.m_pfnByeByeSurfaceDialog();
00750     }
00751 
00752   if (g_surfwin)
00753   {
00754     if (g_bGatewayhack)
00755       PostMessage(g_surfwin, WM_COMMAND, IDAPPLY, 0);
00756     else
00757       PostMessage(g_surfwin, WM_COMMAND, IDCANCEL, 0);
00758     return true;
00759   }
00760   else return false;
00761 }

void CheckBspProcess  ) 
 

Definition at line 593 of file WIN_QE3.CPP.

References _MAX_PATH, AddSlash(), BOOL, bsp_process, currentmap, QEGlobals_t::d_pointfile_display_list, QEGlobals_t::d_project_entity, DWORD, Error(), ExtractPath_and_Filename(), FALSE, FindReplace(), free(), g_PrefsDlg, g_qeglobals, LoadFile(), CPrefsDlg::m_bRunQuake, CPrefsDlg::m_bSetGame, CPrefsDlg::m_strQuake2, Pointfile_Check(), sprintf(), Sys_Beep(), Sys_Printf(), TRUE, and ValueForKey().

Referenced by CMainFrame::RoutineProcessing().

00594 {
00595     char    outputpath[1024];
00596     char    temppath[512];
00597     DWORD   exitcode;
00598     char    *out;
00599     BOOL    ret;
00600 
00601     if (!bsp_process)
00602         return;
00603 
00604     ret = GetExitCodeProcess (bsp_process, &exitcode);
00605     if (!ret)
00606         Error ("GetExitCodeProcess failed");
00607     if (exitcode == STILL_ACTIVE)
00608         return;
00609 
00610     bsp_process = 0;
00611 
00612     GetTempPath(512, temppath);
00613     sprintf (outputpath, "%sjunk.txt", temppath);
00614 
00615     LoadFile (outputpath, (void **)&out);
00616     Sys_Printf ("%s", out);
00617     Sys_Printf ("\ncompleted.\n");
00618     free (out);
00619 
00620     CTime tEnd = CTime::GetCurrentTime();
00621     CTimeSpan tElapsed = tEnd - g_tBegin;
00622     CString strElapsed;
00623     strElapsed.Format("Run time was %i hours, %i minutes and %i seconds", tElapsed.GetHours(), tElapsed.GetMinutes(), tElapsed.GetSeconds());
00624     Sys_Printf(strElapsed.GetBuffer(0));
00625 
00626 
00627     Sys_Beep ();
00628     Pointfile_Check();
00629     // run game if no PointFile and pref is set
00630     //++timo needs to stop after BSP if leaked .. does run through vis and light instead ..
00631     if (g_PrefsDlg.m_bRunQuake == TRUE  && !g_qeglobals.d_pointfile_display_list)
00632     {
00633         char cCurDir[1024];
00634         GetCurrentDirectory(1024, cCurDir);
00635         CString strExePath = g_PrefsDlg.m_strQuake2;
00636         CString strOrgPath;
00637         CString strOrgFile;
00638         ExtractPath_and_Filename(currentmap, strOrgPath, strOrgFile);
00639         if (g_PrefsDlg.m_bSetGame == TRUE) // run in place with set game.. don't copy map
00640         {
00641             CString strBasePath = ValueForKey(g_qeglobals.d_project_entity, "basepath");
00642             strExePath += " +set game ";
00643             strExePath += strBasePath;
00644             WinExec(strExePath, SW_SHOW);
00645         }
00646         else
00647         {
00648             CString strCopyPath = strExePath;
00649             char* pBuffer = strCopyPath.GetBufferSetLength(_MAX_PATH + 1);
00650             pBuffer[strCopyPath.ReverseFind('\\') + 1] = '\0';
00651             strCopyPath.ReleaseBuffer();
00652             SetCurrentDirectory(strCopyPath);
00653             CString strOrgPath;
00654             CString strOrgFile;
00655             ExtractPath_and_Filename(currentmap, strOrgPath, strOrgFile);
00656             AddSlash(strCopyPath);
00657             FindReplace(strOrgFile, ".map", ".bsp");
00658             //++timo modified for Quake3 !!
00659             strCopyPath += "baseq3\\maps\\";
00660             strCopyPath += strOrgFile;
00661             AddSlash(strOrgPath);
00662             strOrgPath += strOrgFile;
00663             bool bRun = (strOrgPath.CompareNoCase(strCopyPath) == 0);
00664             if (!bRun)
00665                 bRun = (CopyFile(strOrgPath, strCopyPath, FALSE) == TRUE);
00666             if (bRun)
00667             {
00668                 FindReplace(strOrgFile, ".bsp", "");
00669                 strExePath += " +map ";
00670                 strExePath += strOrgFile;
00671                 WinExec(strExePath, SW_SHOW);
00672             }
00673         }
00674         SetCurrentDirectory(cCurDir);
00675     }
00676 }

Here is the call graph for this function:

void Clamp float &  f,
int  nClamp
 

Definition at line 257 of file Brush.cpp.

References f.

Referenced by AbsoluteToLocal(), and Face_MoveTexture().

00258 {
00259   float fFrac = f - static_cast<int>(f);
00260   f = static_cast<int>(f) % nClamp;
00261   f += fFrac;
00262 }

void CleanUpEntities  ) 
 

Definition at line 78 of file ECLASS.CPP.

References CleanEntityList(), eclass_s::comments, eclass, eclass_bad, free(), g_md3Cache, and eclass_s::name.

Referenced by Eclass_InitForSourceDirectory(), and CMainFrame::OnDestroy().

00079 {
00080   CleanEntityList(eclass);
00081   CleanEntityList(g_md3Cache);
00082 /*
00083   while (eclass)
00084   {
00085     eclass_t* pTemp = eclass->next;
00086     delete []eclass->pTriList;
00087     
00088     if (eclass->modelpath)
00089       free(eclass->modelpath);
00090       if (eclass->skinpath)         // PGM
00091           free(eclass->skinpath);       // PGM
00092     
00093     free(eclass->name);
00094     free(eclass->comments);
00095     free(eclass);
00096     eclass = pTemp;
00097   }
00098 
00099   eclass = NULL;
00100 */
00101   if (eclass_bad)
00102   {
00103     free(eclass_bad->name);
00104     free(eclass_bad->comments);
00105     free(eclass_bad);
00106     eclass_bad = NULL;
00107   }
00108 }

Here is the call graph for this function:

qboolean ConfirmModified void   ) 
 

Definition at line 324 of file WIN_QE3.CPP.

Referenced by CMainFrame::OnClose(), CMainFrame::OnFileLoadproject(), CMainFrame::OnFileNew(), CMainFrame::OnFileOpen(), and Texture_Flush().

00325 {
00326     if (!modified)
00327         return true;
00328 
00329     if (MessageBox (g_qeglobals.d_hwndMain, "This will lose changes to the map"
00330         , "warning", MB_OKCANCEL) == IDCANCEL)
00331         return false;
00332     return true;
00333 }

void CSG_SplitBrushByFace brush_t in,
face_t f,
brush_t **  front,
brush_t **  back
 

void DLLBuildDone  ) 
 

Definition at line 416 of file Win_main.cpp.

References _MAX_PATH, AddSlash(), currentmap, QEGlobals_t::d_project_entity, ExtractPath_and_Filename(), FALSE, FindReplace(), g_hToolThread, g_PrefsDlg, g_qeglobals, CPrefsDlg::m_bRunQuake, CPrefsDlg::m_bSetGame, CPrefsDlg::m_strQuake2, Pointfile_Check(), Sys_Printf(), and ValueForKey().

Referenced by CMainFrame::OnBSPDone().

00417 {
00418   g_hToolThread = NULL;
00419   CTime tEnd = CTime::GetCurrentTime();
00420   CTimeSpan tElapsed = tEnd - g_tBegin;
00421   CString strElapsed;
00422   strElapsed.Format("Run time was %i hours, %i minutes and %i seconds", tElapsed.GetHours(), tElapsed.GetMinutes(), tElapsed.GetSeconds());
00423     Sys_Printf(strElapsed.GetBuffer(0));
00424     Pointfile_Check();
00425 
00426   if (g_PrefsDlg.m_bRunQuake == TRUE)
00427   {
00428     char cCurDir[1024];
00429     GetCurrentDirectory(1024, cCurDir);
00430     CString strExePath = g_PrefsDlg.m_strQuake2;
00431     CString strOrgPath;
00432     CString strOrgFile;
00433     ExtractPath_and_Filename(currentmap, strOrgPath, strOrgFile);
00434     if (g_PrefsDlg.m_bSetGame == TRUE) // run in place with set game.. don't copy map
00435     {
00436         CString strBasePath = ValueForKey(g_qeglobals.d_project_entity, "basepath");
00437       strExePath += " +set game ";
00438       strExePath += strBasePath;
00439       WinExec(strExePath, SW_SHOW);
00440     }
00441     else
00442     {
00443       CString strCopyPath = strExePath;
00444       char* pBuffer = strCopyPath.GetBufferSetLength(_MAX_PATH + 1);
00445       pBuffer[strCopyPath.ReverseFind('\\') + 1] = '\0';
00446       strCopyPath.ReleaseBuffer();
00447       SetCurrentDirectory(strCopyPath);
00448       CString strOrgPath;
00449       CString strOrgFile;
00450       ExtractPath_and_Filename(currentmap, strOrgPath, strOrgFile);
00451       AddSlash(strCopyPath);
00452       FindReplace(strOrgFile, ".map", ".bsp");
00453       strCopyPath += "\\baseq2\\maps\\";
00454       strCopyPath += strOrgFile;
00455       AddSlash(strOrgPath);
00456       strOrgPath += strOrgFile;
00457       bool bRun = (strOrgPath.CompareNoCase(strCopyPath) == 0);
00458       if (!bRun)
00459         bRun = (CopyFile(strOrgPath, strCopyPath, FALSE) == TRUE);
00460       if (bRun)
00461       {
00462         FindReplace(strOrgFile, ".bsp", "");
00463         strExePath += " +map ";
00464         strExePath += strOrgFile;
00465         WinExec(strExePath, SW_SHOW);
00466       }
00467     }
00468     SetCurrentDirectory(cCurDir);
00469   }
00470 
00471 }

Here is the call graph for this function:

qboolean DoColor int  iIndex  ) 
 

Referenced by CMainFrame::OnColorsBrush(), CMainFrame::OnColorsClipper(), CMainFrame::OnColorsGridblock(), CMainFrame::OnColorsGridtext(), CMainFrame::OnColorsMajor(), CMainFrame::OnColorsMinor(), CMainFrame::OnColorsSelectedbrush(), CMainFrame::OnColorsViewname(), CMainFrame::OnColorsXybk(), CMainFrame::OnMiscSelectentitycolor(), and CMainFrame::OnTexturebk().

BOOL DoMru HWND  ,
WORD 
 

Referenced by CMainFrame::OnMru().

void DoNewColor int *  i1,
int *  i2,
int *  i3
 

void DoPatchInspector  ) 
 

Definition at line 218 of file PatchDialog.cpp.

References g_PatchDialog, CPatchDialog::GetPatchInfo(), IDD_DIALOG_PATCH, LoadRegistryInfo(), LONG, and NULL.

Referenced by CMainFrame::OnPatchInspector().

00219 {
00220   if (g_PatchDialog.GetSafeHwnd() == NULL)
00221   {
00222     g_PatchDialog.Create(IDD_DIALOG_PATCH);
00223     CRect rct;
00224       LONG lSize = sizeof(rct);
00225       if (LoadRegistryInfo("Radiant::PatchWindow", &rct, &lSize))
00226     {
00227       g_PatchDialog.SetWindowPos(NULL, rct.left, rct.top, 0,0, SWP_NOSIZE);
00228     }
00229   }
00230   g_PatchDialog.ShowWindow(SW_SHOW);
00231   g_PatchDialog.GetPatchInfo();
00232 }

Here is the call graph for this function:

void DoProjectSettings  ) 
 

Definition at line 245 of file WIN_DLG.CPP.

References QEGlobals_t::d_hInstance, QEGlobals_t::d_hwndMain, g_qeglobals, IDD_PROJECT, and ProjectDlgProc().

Referenced by CMainFrame::OnFileProjectsettings().

00246 {
00247     DialogBox(g_qeglobals.d_hInstance, (char *)IDD_PROJECT, g_qeglobals.d_hwndMain, ProjectDlgProc);
00248 }

Here is the call graph for this function:

bool ExtractPath_and_Filename const char *  pPath,
CString &  strPath,
CString &  strFilename
 

Definition at line 569 of file WIN_QE3.CPP.

Referenced by CheckBspProcess(), DLLBuildDone(), Map_Snapshot(), CMainFrame::OnFileNewproject(), QE_LoadProject(), RunBsp(), and Texture_LoadTGATexture().

00570 {
00571   CString strPathName = pPath;
00572   int nSlash = strPathName.ReverseFind('\\');
00573   if (nSlash >= 0)
00574   {
00575     strPath = strPathName.Left(nSlash+1);
00576     strFilename = strPathName.Right(strPathName.GetLength() - nSlash - 1);
00577   }
00578   else strFilename = pPath;
00579   return true;
00580 }

void FindReplace CString &  strContents,
const char *  pTag,
const char *  pValue
 

Definition at line 129 of file Win_main.cpp.

00130 {
00131   if (strcmp(pTag, pValue) == 0)
00132     return;
00133   for (int nPos = strContents.Find(pTag); nPos >= 0; nPos = strContents.Find(pTag))
00134   {
00135     int nRightLen = strContents.GetLength() - strlen(pTag) - nPos;
00136     CString strLeft = strContents.Left(nPos);
00137     CString strRight = strContents.Right(nRightLen);
00138     strLeft += pValue;
00139     strLeft += strRight;
00140     strContents = strLeft;
00141   }
00142 }

void FindReplaceTextures const char *  pFind,
const char *  pReplace,
bool  bSelected,
bool  bForce
 

Definition at line 1517 of file SELECT.CPP.

References Brush_Build(), brush_s::brush_faces, brush_t, face_s::d_texture, face_t, texdef_t::name, face_s::next, brush_s::next, Patch_FindReplaceTexture(), brush_s::patchBrush, brush_s::pTerrain, Select_Deselect(), selected_brushes, texdef_t::SetName(), Sys_UpdateWindows(), Terrain_FindReplaceTexture(), brush_s::terrainBrush, face_s::texdef, Texture_ForName(), and W_CAMERA.

Referenced by END_MESSAGE_MAP(), and CFindTextureDlg::OnOK().

01518 {
01519     brush_t* pList = (bSelected) ? &selected_brushes : &active_brushes;
01520     if (!bSelected)
01521     {
01522         Select_Deselect();
01523     }
01524  
01525     for (brush_t* pBrush = pList->next ; pBrush != pList; pBrush = pBrush->next)
01526     {
01527         if (pBrush->patchBrush)
01528         {
01529             Patch_FindReplaceTexture(pBrush, pFind, pReplace, bForce);
01530         }
01531 
01532         if (pBrush->terrainBrush)
01533         {
01534             Terrain_FindReplaceTexture(pBrush->pTerrain, pFind, pReplace, bForce);
01535         }
01536         for (face_t* pFace = pBrush->brush_faces; pFace; pFace = pFace->next)
01537         {
01538             if(bForce || strcmpi(pFace->texdef.name, pFind) == 0)
01539             {
01540                 pFace->d_texture = Texture_ForName(pReplace);
01541                 //strcpy(pFace->texdef.name, pReplace);
01542                 pFace->texdef.SetName(pReplace);
01543             }
01544         }
01545         Brush_Build(pBrush);
01546     }
01547     Sys_UpdateWindows (W_CAMERA);
01548 }

Here is the call graph for this function:

void HandlePopup CWnd pWindow,
unsigned int  uId
 

Definition at line 667 of file MainFrm.cpp.

Referenced by CMainFrame::OnPopupSelection(), CMainFrame::OnShowEntities(), CMainFrame::OnSplinesPopup(), and CMainFrame::OnTexturesPopup().

00668 {
00669   // Get the current position of the mouse
00670   CPoint ptMouse;
00671   GetCursorPos(&ptMouse);
00672 
00673   // Load up a menu that has the options we are looking for in it
00674   CMenu mnuPopup;
00675   VERIFY(mnuPopup.LoadMenu(uId));
00676   mnuPopup.GetSubMenu(0)->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON |
00677       TPM_RIGHTBUTTON, ptMouse.x, ptMouse.y,pWindow);
00678   mnuPopup.DestroyMenu();
00679 
00680   // Set focus back to window
00681   pWindow->SetFocus();
00682 }

BOOL Init3Dfx  ) 
 

bool LoadWindowPlacement HWND  hwnd,
const char *  pName
 

Definition at line 1316 of file MainFrm.cpp.

References LoadRegistryInfo(), and LONG.

Referenced by CreateEntityWindow(), and CMainFrame::OnCreateClient().

01317 {
01318   WINDOWPLACEMENT wp;
01319   wp.length = sizeof(WINDOWPLACEMENT);
01320     LONG lSize = sizeof(wp);
01321     if (LoadRegistryInfo(pName, &wp, &lSize))
01322   {
01323     ::SetWindowPlacement(hwnd, &wp);
01324     return true;
01325   }
01326   return false;
01327 }

Here is the call graph for this function:

void Map_ImportFile char *  filename  ) 
 

Definition at line 968 of file MAP.CPP.

References free(), LoadFile(), Map_BuildBrushData(), Map_ImportBuffer(), modified, QE_ConvertDOSToUnixName(), Sys_BeginWait(), Sys_EndWait(), Sys_UpdateWindows(), and W_ALL.

Referenced by CMainFrame::OnEditLoadprefab(), and CMainFrame::OnFileImportmap().

00969 {
00970   char* buf;
00971     char temp[1024];
00972     Sys_BeginWait ();
00973     QE_ConvertDOSToUnixName( temp, filename );
00974   if (LoadFile (filename, (void **)&buf) != -1)
00975   {
00976     Map_ImportBuffer(buf);
00977     free(buf);
00978     Map_BuildBrushData();
00979   }
00980     Sys_UpdateWindows (W_ALL);
00981     modified = true;
00982     Sys_EndWait();
00983 }

Here is the call graph for this function:

void Map_SaveSelected char *  pFilename  ) 
 

Definition at line 992 of file MAP.CPP.

References count, e, entities, Entity_WriteSelected(), f, fclose(), fopen(), fprintf(), next, QE_ConvertDOSToUnixName(), Sys_Printf(), and world_entity.

Referenced by CXYWnd::Copy(), CMainFrame::OnEditSaveprefab(), and CMainFrame::OnFileExportmap().

00993 {
00994     entity_t    *e, *next;
00995     FILE *f;
00996     char temp[1024];
00997     int count;
00998 
00999     QE_ConvertDOSToUnixName(temp, pFilename);
01000     f = fopen(pFilename, "w");
01001 
01002     if (!f)
01003     {
01004         Sys_Printf ("ERROR!!!! Couldn't open %s\n", pFilename);
01005         return;
01006     }
01007 
01008     // write world entity first
01009     Entity_WriteSelected(world_entity, f);
01010 
01011     // then write all other ents
01012     count = 1;
01013     for (e=entities.next ; e != &entities ; e=next)
01014     {
01015     fprintf (f, "// entity %i\n", count);
01016     count++;
01017         Entity_WriteSelected(e, f);
01018         next = e->next;
01019     }
01020     fclose (f);
01021 }

Here is the call graph for this function:

void Map_Snapshot  ) 
 

Definition at line 91 of file QE3.CPP.

References AddSlash(), currentmap, DoesFileExist(), ExtractPath_and_Filename(), g_pParentWnd, Map_SaveFile(), Sys_Printf(), and Sys_SetTitle().

Referenced by CMainFrame::OnBspCommand(), and QE_CheckAutoSave().

00092 {
00093   CString strMsg;
00094   // we need to do the following
00095   // 1. make sure the snapshot directory exists (create it if it doesn't)
00096   // 2. find out what the lastest save is based on number
00097   // 3. inc that and save the map
00098   CString strOrgPath, strOrgFile;
00099   ExtractPath_and_Filename(currentmap, strOrgPath, strOrgFile);
00100   AddSlash(strOrgPath);
00101   strOrgPath += "snapshots";
00102   bool bGo = true;
00103   struct _stat Stat;
00104   if (_stat(strOrgPath, &Stat) == -1)
00105   {
00106     bGo = (_mkdir(strOrgPath) != -1);
00107   }
00108   AddSlash(strOrgPath);
00109   if (bGo)
00110   {
00111     int nCount = 0;
00112     long lSize = 0;
00113     CString strNewPath = strOrgPath;
00114     strNewPath += strOrgFile;
00115     CString strFile;
00116     while (bGo)
00117     {
00118       strFile.Format("%s.%i", strNewPath, nCount);
00119       bGo = DoesFileExist(strFile, lSize);
00120       nCount++;
00121     }
00122     // strFile has the next available slot
00123     Map_SaveFile(strFile.GetBuffer(0), false);
00124         Sys_SetTitle (currentmap);
00125     if (lSize > 12 * 1024 * 1024) // total size of saves > 4 mb
00126     {
00127       Sys_Printf("The snapshot files in the [%s] directory total more than 4 megabytes. You might consider cleaning the directory up.", strOrgPath);
00128     }
00129   }
00130   else
00131   {
00132     strMsg.Format("Snapshot save failed.. unabled to create directory\n%s", strOrgPath);
00133     g_pParentWnd->MessageBox(strMsg);
00134   }
00135 }

Here is the call graph for this function:

void MemFile_fprintf CMemFile *  pMemFile,
const char *  pText,
  ...
 

Definition at line 1055 of file MAP.CPP.

References strlen(), va_list, va_start, and vsprintf().

Referenced by _Write1DMatrix(), _Write2DMatrix(), _Write3DMatrix(), Brush_Write(), Entity_WriteSelected(), Map_SaveSelected(), Patch_Write(), QERApp_MapPrintf_MEMFILE(), and Terrain_Write().

01056 {
01057   char Buffer[4096];
01058   va_list args;
01059     va_start (args,pText);
01060   vsprintf(Buffer, pText, args);
01061   pMemFile->Write(Buffer, strlen(Buffer));
01062 }

Here is the call graph for this function:

void MFCCreate HINSTANCE   ) 
 

Referenced by CMainFrame::OnCreate().

void NewBSP char *  pCommandLine,
HWND 
 

void NewRAD char *  pCommandLine,
HWND 
 

void NewVIS char *  pCommandLine,
HWND 
 

void QE_CheckAutoSave  ) 
 

Definition at line 146 of file QE3.CPP.

References clock(), clock_t, CLOCKS_PER_SEC, currentmap, QEGlobals_t::d_project_entity, g_PrefsDlg, g_qeglobals, CPrefsDlg::m_bAutoSave, CPrefsDlg::m_bSnapShots, CPrefsDlg::m_nAutoSave, Map_SaveFile(), Map_Snapshot(), modified, Sys_Printf(), Sys_Status(), and ValueForKey().

Referenced by CMainFrame::OnTimer().

00147 {
00148     static clock_t