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

Win_main.cpp File Reference

#include "stdafx.h"
#include "qe3.h"
#include <process.h>
#include "mru.h"
#include "entityw.h"
#include "PrefsDlg.h"

Include dependency graph for Win_main.cpp:

Include dependency graph

Go to the source code of this file.

Data Structures

class  CMyColorDialog

Defines

#define NUMBUTTONS   15
#define SECTION   _T("Custom Colors")

Functions

 BEGIN_MESSAGE_MAP (CMyColorDialog, CColorDialog) END_MESSAGE_MAP() void DoNewColor(int *i1
qboolean ConfirmModified (void)
HWND CreateMyStatusWindow (HINSTANCE hInst)
HWND CreateToolBar (HINSTANCE hinst)
void DLLBuildDone ()
BOOL CALLBACK EnumChildProc (HWND hwnd, LPARAM lParam)
HWND FindAnyWindow (const char *pTitle)
void FindReplace (CString &strContents, const char *pTag, const char *pValue)
BOOL LoadRegistryInfo (const char *pszName, void *pvBuf, long *plSize)
void OpenDialog (void)
void QE_ExpandBspString (char *bspaction, char *out, char *mapname, bool useTemps)
void RunBsp (char *command)
void SaveAsDialog (bool bRegion)
BOOL SaveRegistryInfo (const char *pszName, void *pvBuf, long lSize)
void Select_Ungroup (void)
void ThreadTools (char *p)
UINT ToolThread (LPVOID pParam)
void WXY_Print (void)

Variables

HANDLE g_hToolThread = NULL
HWND g_hWnd = NULL
HWND g_hwndFoundIt = NULL
CString g_strParams
CTime g_tBegin
int * i2
HWND s_hwndToolbar
const UINT wm_AddCommand = RegisterWindowMessage( "Q3MPC_AddCommand" )


Define Documentation

#define NUMBUTTONS   15
 

#define SECTION   _T("Custom Colors")
 

Definition at line 523 of file Win_main.cpp.

Referenced by CMyColorDialog::InitCustColors(), and CMyColorDialog::SaveCustColors().


Function Documentation

BEGIN_MESSAGE_MAP CMyColorDialog  ,
CColorDialog 
 

qboolean ConfirmModified void   ) 
 

Definition at line 324 of file WIN_QE3.CPP.

References QEGlobals_t::d_hwndMain, g_qeglobals, and qboolean.

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 }

HWND CreateMyStatusWindow HINSTANCE  hInst  )  [static]
 

HWND CreateToolBar HINSTANCE  hinst  )  [static]
 

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:

BOOL CALLBACK EnumChildProc HWND  hwnd,
LPARAM  lParam
 

Definition at line 170 of file Win_main.cpp.

References BOOL, g_hwndFoundIt, and p.

Referenced by FindAnyWindow().

00170                                                       {
00171   char buff[1024];
00172   const char* p = reinterpret_cast<const char*>(lParam);
00173   GetWindowText(hwnd, buff, 1024);
00174   if (!strcmpi(p, buff)) {
00175     g_hwndFoundIt = hwnd;
00176     return 1;
00177   }
00178   return 1;
00179 }

HWND FindAnyWindow const char *  pTitle  ) 
 

Definition at line 182 of file Win_main.cpp.

References EnumChildProc(), and g_hwndFoundIt.

Referenced by RunBsp().

00182                                        {
00183   HWND hwndDesktop = GetDesktopWindow();
00184   g_hwndFoundIt = NULL;
00185   if ( hwndDesktop ) {
00186     EnumChildWindows(hwndDesktop, (WNDENUMPROC)EnumChildProc, reinterpret_cast<LPARAM>(pTitle));
00187   }
00188   return g_hwndFoundIt;
00189 }

Here is the call graph for this function:

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

Definition at line 129 of file Win_main.cpp.

References strcmp(), and strlen().

Referenced by CheckBspProcess(), DLLBuildDone(), CMainFrame::LoadCommandMap(), LoadShader(), PakLoadAnyFile(), QE_LoadProject(), and RunBsp().

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 }

Here is the call graph for this function:

BOOL LoadRegistryInfo const char *  pszName,
void *  pvBuf,
long *  plSize
 

Referenced by DoPatchInspector(), DoSurface(), LoadWindowPlacement(), CMainFrame::OnCreateClient(), CFindTextureDlg::show(), and showCameraInspector().

void OpenDialog void   ) 
 

Definition at line 347 of file WIN_QE3.CPP.

References AddNewItem(), QEGlobals_t::d_hwndCamera, QEGlobals_t::d_hwndMain, QEGlobals_t::d_lpMruMenu, QEGlobals_t::d_project_entity, g_qeglobals, ID_FILE_EXIT, Map_LoadFile(), ofn, PlaceMenuMRUItem(), strcat(), strcpy(), strlen(), szDirName, szFile, and ValueForKey().

00348 {
00349     /* 
00350      * Obtain the system directory name and 
00351      * store it in szDirName. 
00352      */ 
00353  
00354     strcpy (szDirName, ValueForKey (g_qeglobals.d_project_entity, "mapspath") );
00355   if (strlen(szDirName) == 0)
00356   {
00357       strcpy (szDirName, ValueForKey (g_qeglobals.d_project_entity, "basepath") );
00358       strcat (szDirName, "\\maps");
00359   }
00360 
00361     /* Place the terminating null character in the szFile. */ 
00362  
00363     szFile[0] = '\0'; 
00364  
00365     /* Set the members of the OPENFILENAME structure. */ 
00366  
00367     ofn.lStructSize = sizeof(OPENFILENAME); 
00368     ofn.hwndOwner = g_qeglobals.d_hwndCamera;
00369     ofn.lpstrFilter = szFilter; 
00370     ofn.nFilterIndex = 1; 
00371     ofn.lpstrFile = szFile; 
00372     ofn.nMaxFile = sizeof(szFile); 
00373     ofn.lpstrFileTitle = szFileTitle; 
00374     ofn.nMaxFileTitle = sizeof(szFileTitle); 
00375     ofn.lpstrInitialDir = szDirName; 
00376     ofn.Flags = OFN_SHOWHELP | OFN_PATHMUSTEXIST | 
00377         OFN_FILEMUSTEXIST; 
00378 
00379     /* Display the Open dialog box. */ 
00380  
00381     if (!GetOpenFileName(&ofn))
00382         return; // canceled
00383  
00384     // Add the file in MRU.
00385   //FIXME
00386     AddNewItem( g_qeglobals.d_lpMruMenu, ofn.lpstrFile);
00387 
00388     // Refresh the File menu.
00389   //FIXME
00390     PlaceMenuMRUItem(g_qeglobals.d_lpMruMenu,GetSubMenu(GetMenu(g_qeglobals.d_hwndMain),0), 
00391             ID_FILE_EXIT);
00392 
00393     /* Open the file. */ 
00394  
00395     Map_LoadFile (ofn.lpstrFile);   
00396 }

Here is the call graph for this function:

void QE_ExpandBspString char *  bspaction,
char *  out,
char *  mapname,
bool  useTemps
 

Definition at line 52 of file Win_main.cpp.

References QEGlobals_t::d_project_entity, ExtractFileName(), FALSE, g_qeglobals, in, QE_ConvertDOSToUnixName(), sprintf(), src, strcpy(), strlen(), strlwr(), strstr(), and ValueForKey().

Referenced by RunBsp().

00053 {
00054     char    *in;
00055     char    src[2048];
00056     char    rsh[2048];
00057     char    base[2048];
00058 
00059     strcpy(src, mapname);
00060     strlwr(src);
00061     in = strstr(src, "maps/");
00062     if (!in)
00063     {
00064         in = strstr(src, "maps\\");
00065     }
00066     if (in)
00067     {
00068         in += 5;
00069         strcpy(base, in);
00070         in = base;
00071         while (*in)
00072         {
00073             if (*in == '\\')
00074             {
00075                 *in = '/';
00076             }
00077             in++;
00078         }
00079     }
00080     else
00081     {
00082         ExtractFileName (mapname, base);
00083     }
00084 
00085   if (useTemps) {
00086     CString str;
00087     CString strExt = "map";
00088     if ( strstr(mapname, ".reg") ) {
00089       strExt = "reg";
00090     }
00091     str.Format("%s/maps/%i.%s", ValueForKey(g_qeglobals.d_project_entity, "remotebasepath"), ::GetTickCount(), strExt);
00092     CopyFile(mapname, str, FALSE);
00093       sprintf (src, "-tempname %s %s/maps/%s", str, ValueForKey(g_qeglobals.d_project_entity, "remotebasepath"), base);
00094   } else {
00095       sprintf (src, "%s/maps/%s", ValueForKey(g_qeglobals.d_project_entity, "remotebasepath"), base);
00096   }
00097     strcpy (rsh, ValueForKey(g_qeglobals.d_project_entity, "rshcmd"));
00098 
00099   QE_ConvertDOSToUnixName(src, src);
00100 
00101     in = ValueForKey( g_qeglobals.d_project_entity, bspaction );
00102     while (*in)
00103     {
00104         if (in[0] == '!')
00105         {
00106             strcpy (out, rsh);
00107             out += strlen(rsh);
00108             in++;
00109             continue;
00110         }
00111         if (in[0] == '$')
00112         {
00113             strcpy (out, src);
00114             out += strlen(src);
00115             in++;
00116             continue;
00117         }
00118         if (in[0] == '@')
00119         {
00120             *out++ = '"';
00121             in++;
00122             continue;
00123         }
00124         *out++ = *in++;
00125     }
00126     *out = 0;
00127 }

Here is the call graph for this function:

void RunBsp char *  command  ) 
 

Definition at line 195 of file Win_main.cpp.

References a, AddSlash(), BOOL, bsp_process, BuildShortPathName(), currentmap, QEGlobals_t::d_hwndMain, QEGlobals_t::d_project_entity, DWORD, Error(), ExtractPath_and_Filename(), FALSE, fclose(), FindAnyWindow(), FindReplace(), fopen(), fprintf(), g_hToolThread, g_hWnd, g_pParentWnd, g_PrefsDlg, g_qeglobals, g_tBegin, LPARAM, CPrefsDlg::m_bInternalBSP, Map_SaveFile(), name, NULL, p, Pointfile_Delete(), QE_ExpandBspString(), region_active, remove(), SetInspectorMode(), sprintf(), strcat(), strcpy(), StripExtension(), strlen(), strncpy(), strstr(), Sys_ClearPrintf(), Sys_Printf(), ThreadTools(), ValueForKey(), W_CONSOLE, and wm_AddCommand.

Referenced by CMainFrame::OnBspCommand().

00196 {
00197     char    sys[2048];
00198     char    batpath[2048];
00199     char    outputpath[2048];
00200     char    temppath[1024];
00201     char    name[2048];
00202     char    cWork[2048];
00203     FILE    *hFile;
00204     BOOL    ret;
00205     PROCESS_INFORMATION ProcessInformation;
00206     STARTUPINFO startupinfo;
00207   HWND hwndPClient = NULL;
00208 
00209   g_hWnd = g_pParentWnd->GetSafeHwnd();
00210     SetInspectorMode(W_CONSOLE);
00211   g_tBegin = CTime::GetCurrentTime();
00212 
00213     
00214     DWORD   dwExitcode;
00215   ret = GetExitCodeProcess (g_hToolThread, &dwExitcode);
00216   if (dwExitcode != STILL_ACTIVE)
00217     g_hToolThread = NULL;
00218 
00219     if (bsp_process || g_hToolThread)
00220     {
00221         Sys_Printf ("BSP is still going...\n");
00222         return;
00223     }
00224 
00225   outputpath[0] = '\0';
00226     GetTempPath(512, temppath);
00227 
00228   CString strOutFile = temppath;
00229   AddSlash(strOutFile);
00230   strOutFile += "junk.txt";
00231 
00232     sprintf (outputpath, " >>%s\r\n", strOutFile);
00233 
00234   strcpy (name, currentmap);
00235     if (region_active)
00236     {
00237         Map_SaveFile (name, false);
00238         StripExtension (name);
00239         strcat (name, ".reg");
00240     }
00241 
00242     Map_SaveFile (name, region_active);
00243 
00244   // FIXME: this code just gets worse and worse
00245   CString strPath, strFile;
00246 
00247   char *rsh = ValueForKey(g_qeglobals.d_project_entity, "rshcmd");
00248   if (rsh == NULL)
00249   {
00250     ExtractPath_and_Filename(name, strPath, strFile);
00251     AddSlash(strPath);
00252     BuildShortPathName(strPath, cWork, 1024);
00253     strcat(cWork, strFile);
00254   }
00255   else
00256   {
00257     strcpy(cWork, name);
00258   }
00259 
00260   hwndPClient = FindWindow(NULL, "Q3Map Process Client");
00261   if ( hwndPClient == NULL ) {
00262     hwndPClient = FindAnyWindow("Q3Map Process Client");
00263   }
00264 
00265   Sys_Printf("Window info for Process Client %i\n", reinterpret_cast<int>(hwndPClient));
00266 
00267   bool processServer = (rsh && strlen(rsh) > 0 && hwndPClient);
00268 
00269   QE_ExpandBspString (command, sys, cWork, processServer);
00270 
00271   // if we can find the q3map process server running 
00272   // we will submit maps to it instead of via createprocess
00273   //
00274   if (processServer)
00275   {
00276     CString str;
00277     char cBuff[2048];
00278     char *pStart = sys;
00279     char *pEnd = strstr(pStart, "&&");
00280     while (pEnd)
00281     {
00282       int nLen = pEnd-pStart-1;
00283       strncpy(cBuff, pStart, nLen);
00284       cBuff[nLen] = 0;
00285       str = cBuff;
00286       FindReplace(str, rsh, "");
00287       str.TrimLeft(' ');
00288       str.TrimRight(' ');
00289       ATOM a = GlobalAddAtom(str);
00290       PostMessage(hwndPClient, wm_AddCommand, 0, (LPARAM)a);
00291       pStart = pEnd+2;
00292       pEnd = strstr(pStart, "&&");
00293     }
00294     str = pStart;
00295     FindReplace(str, rsh, "");
00296     str.TrimLeft(' ');
00297     str.TrimRight(' ');
00298     ATOM a = GlobalAddAtom(str);
00299     PostMessage(hwndPClient, wm_AddCommand, 0, (LPARAM)a);
00300     Sys_Printf("Commands sent to Q3Map Process Client\n");
00301     return;
00302   }
00303 
00304   CString strSys = sys;
00305 
00306   FindReplace(strSys, "&&", outputpath);
00307   strcpy(sys, strSys);
00308   strcat(sys, outputpath);
00309 
00310   if (g_PrefsDlg.m_bInternalBSP)
00311   {
00312     g_tBegin = CTime::GetCurrentTime();
00313     strSys.MakeLower();
00314     char* p = new char[strSys.GetLength()+1];
00315     strcpy(p, strSys.GetBuffer(0));
00316     ThreadTools(p);
00317   }
00318   else
00319   {
00320       Sys_ClearPrintf ();
00321       Sys_Printf ("==================\nRunning bsp command...\n");
00322       Sys_Printf ("\n%s\n", sys);
00323 
00324       //++timo removed the old way BSP commands .. dumping to junk.txt doesn't work on my win98 box
00325       // FIXME : will most likely break Quake2 BSP commands, is fitted to a one-lined sys command
00326       //
00327       // write qe3bsp.bat
00328       //
00329 
00330       sprintf (batpath, "%sqe3bsp.bat", temppath);
00331       hFile = fopen(batpath, "w");
00332       if (!hFile)
00333           Error ("Can't write to %s", batpath);
00334       fprintf (hFile, sys);
00335       fclose (hFile);
00336 
00337       Pointfile_Delete ();
00338 
00339       // delete junk.txt file
00340       remove(strOutFile);
00341 
00342       GetStartupInfo (&startupinfo);
00343 
00344       ret = CreateProcess(
00345           batpath,
00346           NULL,
00347           NULL,
00348           NULL,
00349           FALSE,
00350           0,
00351           NULL,
00352           NULL,
00353           &startupinfo,
00354           &ProcessInformation
00355           );
00356 
00357       if (!ret)
00358           Error ("CreateProcess failed");
00359 
00360       bsp_process = ProcessInformation.hProcess;
00361 
00362       Sleep (100);  // give the new process a chance to open it's window
00363 
00364       BringWindowToTop( g_qeglobals.d_hwndMain );   // pop us back on top
00365 #if 0
00366       //
00367       // write qe3bsp.bat
00368       //
00369       sprintf (batpath, "%sqe3bsp.bat", temppath);
00370       hFile = fopen(batpath, "w");
00371       if (!hFile)
00372           Error ("Can't write to %s", batpath);
00373       fprintf (hFile, sys);
00374       fclose (hFile);
00375 
00376       //
00377       // write qe3bsp2.bat
00378       //
00379       sprintf (batpath, "%sqe3bsp2.bat", temppath);
00380       hFile = fopen(batpath, "w");
00381       if (!hFile)
00382           Error ("Can't write to %s", batpath);
00383       fprintf (hFile, "%sqe3bsp.bat > %s", temppath, outputpath);
00384       fclose (hFile);
00385 
00386       Pointfile_Delete ();
00387 
00388       GetStartupInfo (&startupinfo);
00389 
00390       ret = CreateProcess(
00391       batpath,      // pointer to name of executable module 
00392       NULL,         // pointer to command line string
00393       NULL,         // pointer to process security attributes 
00394       NULL,         // pointer to thread security attributes 
00395       FALSE,            // handle inheritance flag 
00396       0 /*DETACHED_PROCESS*/,       // creation flags
00397       NULL,         // pointer to new environment block 
00398       NULL,         // pointer to current directory name 
00399       &startupinfo, // pointer to STARTUPINFO 
00400       &ProcessInformation   // pointer to PROCESS_INFORMATION  
00401      );
00402 
00403       if (!ret)
00404           Error ("CreateProcess failed");
00405 
00406       bsp_process = ProcessInformation.hProcess;
00407 
00408       Sleep (100);  // give the new process a chance to open it's window
00409 
00410       //BringWindowToTop( g_qeglobals.d_hwndMain ); // pop us back on top
00411       //SetFocus (g_qeglobals.d_hwndCamera);
00412 #endif
00413   }
00414 }

Here is the call graph for this function:

void SaveAsDialog bool  bRegion  ) 
 

Definition at line 442 of file WIN_QE3.CPP.

References AddNewItem(), AddSlash(), currentmap, QEGlobals_t::d_hwndCamera, QEGlobals_t::d_hwndMain, QEGlobals_t::d_lpMruMenu, QEGlobals_t::d_project_entity, DefaultExtension(), g_qeglobals, ID_FILE_EXIT, Map_SaveFile(), ofn, PlaceMenuMRUItem(), strcpy(), szDirName, szFile, and ValueForKey().

Referenced by CMainFrame::OnFileSave(), CMainFrame::OnFileSaveas(), and CMainFrame::OnFileSaveregion().

00443 { 
00444     strcpy (szDirName, ValueForKey (g_qeglobals.d_project_entity, "basepath") );
00445   CString strPath = szDirName;
00446   AddSlash(strPath);
00447   strPath += "maps";
00448 
00449     /* Place the terminating null character in the szFile. */ 
00450  
00451     szFile[0] = '\0'; 
00452  
00453     /* Set the members of the OPENFILENAME structure. */ 
00454  
00455     ofn.lStructSize = sizeof(OPENFILENAME); 
00456     ofn.hwndOwner = g_qeglobals.d_hwndCamera;
00457     ofn.lpstrFilter = szFilter; 
00458     ofn.nFilterIndex = 1; 
00459     ofn.lpstrFile = szFile; 
00460     ofn.nMaxFile = sizeof(szFile); 
00461     ofn.lpstrFileTitle = szFileTitle; 
00462     ofn.nMaxFileTitle = sizeof(szFileTitle); 
00463     ofn.lpstrInitialDir = strPath; 
00464     ofn.Flags = OFN_SHOWHELP | OFN_PATHMUSTEXIST | 
00465         OFN_FILEMUSTEXIST | OFN_OVERWRITEPROMPT; 
00466 
00467     /* Display the Open dialog box. */ 
00468  
00469     if (!GetSaveFileName(&ofn))
00470         return; // canceled
00471 
00472   if (bRegion)
00473       DefaultExtension (ofn.lpstrFile, ".reg");
00474   else
00475       DefaultExtension (ofn.lpstrFile, ".map");
00476 
00477   if (!bRegion)
00478   {
00479       strcpy (currentmap, ofn.lpstrFile);
00480     AddNewItem(g_qeglobals.d_lpMruMenu, ofn.lpstrFile);
00481       PlaceMenuMRUItem(g_qeglobals.d_lpMruMenu,GetSubMenu(GetMenu(g_qeglobals.d_hwndMain),0),   ID_FILE_EXIT);
00482   }
00483     Map_SaveFile (ofn.lpstrFile, bRegion);  // ignore region
00484 }

Here is the call graph for this function:

BOOL SaveRegistryInfo const char *  pszName,
void *  pvBuf,
long  lSize
 

Referenced by END_MESSAGE_MAP(), CFindTextureDlg::OnCancel(), CSurfaceDlg::OnDestroy(), CPatchDialog::OnDestroy(), CMainFrame::OnDestroy(), CDlgCamera::OnDestroy(), CFindTextureDlg::OnOK(), and SaveWindowPlacement().

void Select_Ungroup void   ) 
 

Definition at line 1232 of file SELECT.CPP.

References b, Brush_Build(), brush_t, entity_t::brushes, e, Entity_Free(), Entity_LinkBrush(), Entity_UnlinkBrush(), brush_s::next, brush_s::owner, selected_brushes, Sys_Printf(), Sys_UpdateWindows(), W_ALL, and world_entity.

01233 {
01234     int numselectedgroups;
01235     entity_t    *e;
01236     brush_t     *b, *sb;
01237 
01238     numselectedgroups = 0;
01239     for (sb = selected_brushes.next; sb != &selected_brushes; sb = sb->next)
01240     {
01241         e = sb->owner;
01242 
01243         if (!e || e == world_entity || e->eclass->fixedsize)
01244         {
01245             continue;
01246         }
01247 
01248         for (b = e->brushes.onext; b != &e->brushes; b = e->brushes.onext)
01249         {
01250             //Brush_RemoveFromList (b);
01251             //Brush_AddToList (b, &active_brushes);
01252             Entity_UnlinkBrush (b);
01253             Entity_LinkBrush (world_entity, b);
01254             Brush_Build( b );
01255             b->owner = world_entity;
01256         }
01257         Entity_Free (e);
01258         numselectedgroups++;
01259     }
01260 
01261     if (numselectedgroups <= 0)
01262     {
01263         Sys_Printf("No grouped entities selected.\n");
01264         return;
01265     }
01266     Sys_Printf("Ungrouped %d entit%s.\n", numselectedgroups, (numselectedgroups == 1)?"y":"ies");
01267     Sys_UpdateWindows (W_ALL);
01268 }

Here is the call graph for this function:

void ThreadTools char *  p  ) 
 

Definition at line 162 of file Win_main.cpp.

References g_hToolThread, p, and ToolThread().

Referenced by RunBsp().

00163 {
00164   CWinThread* pThread = AfxBeginThread(ToolThread, reinterpret_cast<LPVOID>(p));
00165   g_hToolThread = pThread->m_hThread;
00166 }

Here is the call graph for this function:

UINT ToolThread LPVOID  pParam  ) 
 

Definition at line 150 of file Win_main.cpp.

References g_hToolThread, g_hWnd, g_PrefsDlg, CPrefsDlg::m_bPAK, CPrefsDlg::m_strPAKFile, p, RunTools(), and UINT.

Referenced by ThreadTools().

00151 {
00152   char* p = reinterpret_cast<char*>(pParam);
00153   if (g_PrefsDlg.m_bPAK)
00154     RunTools(p, g_hWnd, g_PrefsDlg.m_strPAKFile);
00155   else
00156     RunTools(p, g_hWnd, "");
00157   g_hToolThread = NULL;
00158   delete []p;
00159   return 0;
00160 }

Here is the call graph for this function:

void WXY_Print void   ) 
 

Definition at line 229 of file WIN_XY.CPP.

References QEGlobals_t::d_hwndMain, QEGlobals_t::d_hwndXY, g_qeglobals, memset(), r, and s_hdcXY.

00230 {
00231     DOCINFO di;
00232 
00233     PRINTDLG pd;
00234 
00235     /*
00236     ** initialize the PRINTDLG struct and execute it
00237     */
00238     memset( &pd, 0, sizeof( pd ) );
00239     pd.lStructSize = sizeof( pd );
00240     pd.hwndOwner = g_qeglobals.d_hwndXY;
00241     pd.Flags = PD_RETURNDC;
00242     pd.hInstance = 0;
00243     if ( !PrintDlg( &pd ) || !pd.hDC )
00244     {
00245         MessageBox( g_qeglobals.d_hwndMain, "Could not PrintDlg()", "QE4 Print Error", MB_OK | MB_ICONERROR );
00246         return;
00247     }
00248 
00249     /*
00250     ** StartDoc
00251     */
00252     memset( &di, 0, sizeof( di ) );
00253     di.cbSize = sizeof( di );
00254     di.lpszDocName = "QE4";
00255     if ( StartDoc( pd.hDC, &di ) <= 0 )
00256     {
00257         MessageBox( g_qeglobals.d_hwndMain, "Could not StartDoc()", "QE4 Print Error", MB_OK | MB_ICONERROR );
00258         return;
00259     }
00260 
00261     /*
00262     ** StartPage
00263     */
00264     if ( StartPage( pd.hDC ) <= 0 )
00265     {
00266         MessageBox( g_qeglobals.d_hwndMain, "Could not StartPage()", "QE4 Print Error", MB_OK | MB_ICONERROR );
00267         return;
00268     }
00269 
00270     /*
00271     ** read pixels from the XY window
00272     */
00273     {
00274         int bmwidth = 320, bmheight = 320;
00275         int pwidth, pheight;
00276 
00277         RECT r;
00278 
00279         GetWindowRect( g_qeglobals.d_hwndXY, &r );
00280 
00281         bmwidth  = r.right - r.left;
00282         bmheight = r.bottom - r.top;
00283 
00284         pwidth  = GetDeviceCaps( pd.hDC, PHYSICALWIDTH ) - GetDeviceCaps( pd.hDC, PHYSICALOFFSETX );
00285         pheight = GetDeviceCaps( pd.hDC, PHYSICALHEIGHT ) - GetDeviceCaps( pd.hDC, PHYSICALOFFSETY );
00286 
00287         StretchBlt( pd.hDC,
00288             0, 0,
00289             pwidth, pheight,
00290             s_hdcXY,
00291             0, 0,
00292             bmwidth, bmheight,
00293             SRCCOPY );
00294     }
00295 
00296     /*
00297     ** EndPage and EndDoc
00298     */
00299     if ( EndPage( pd.hDC ) <= 0 )
00300     {
00301         MessageBox( g_qeglobals.d_hwndMain, "QE4 Print Error", "Could not EndPage()", MB_OK | MB_ICONERROR );
00302         return;
00303     }
00304 
00305     if ( EndDoc( pd.hDC ) <= 0 )
00306     {
00307         MessageBox( g_qeglobals.d_hwndMain, "QE4 Print Error", "Could not EndDoc()", MB_OK | MB_ICONERROR );
00308         return;
00309     }
00310 }

Here is the call graph for this function:


Variable Documentation

HANDLE g_hToolThread = NULL
 

Definition at line 147 of file Win_main.cpp.

Referenced by DLLBuildDone(), RunBsp(), ThreadTools(), and ToolThread().

HWND g_hWnd = NULL
 

Definition at line 146 of file Win_main.cpp.

Referenced by RunBsp(), and ToolThread().

HWND g_hwndFoundIt = NULL
 

Definition at line 168 of file Win_main.cpp.

Referenced by EnumChildProc(), and FindAnyWindow().

CString g_strParams
 

Definition at line 148 of file Win_main.cpp.

CTime g_tBegin
 

Definition at line 194 of file Win_main.cpp.

Referenced by RunBsp().

int* i2
 

Definition at line 577 of file Win_main.cpp.

HWND s_hwndToolbar [static]
 

Definition at line 29 of file Win_main.cpp.

const UINT wm_AddCommand = RegisterWindowMessage( "Q3MPC_AddCommand" )
 

Definition at line 192 of file Win_main.cpp.

Referenced by RunBsp().


Generated on Thu Aug 25 18:43:24 2005 for Quake III Arena by  doxygen 1.3.9.1