#include "stdafx.h"
#include "qe3.h"
#include "mru.h"
#include "PrefsDlg.h"
Include dependency graph for WIN_QE3.CPP:

Go to the source code of this file.
Defines | |
| #define | SCROLLBACK_DEL_CHARS 500 |
| #define | SCROLLBACK_MAX_LINES 600 |
Functions | |
| void | AddSlash (CString &strPath) |
| void | CheckBspProcess (void) |
| void * | Com_Allocate (int bytes) |
| void | Com_Dealloc (void *ptr) |
| void | Com_DPrintf (const char *msg,...) |
| void | Com_Error (int level, const char *error,...) |
| void | Com_Printf (const char *msg,...) |
| qboolean | ConfirmModified (void) |
| void | Error (char *error,...) |
| bool | ExtractPath_and_Filename (const char *pPath, CString &strPath, CString &strFilename) |
| void | FillBSPMenu (void) |
| void | FindReplace (CString &strContents, const char *pTag, const char *pValue) |
| void | FS_FCloseFile (fileHandle_t f) |
| fileHandle_t | FS_FOpenFileWrite (const char *filename) |
| void | FS_FreeFile (void *buffer) |
| int | FS_ReadFile (const char *qpath, void **buffer) |
| int | FS_Write (const void *buffer, int len, fileHandle_t h) |
| void | OpenDialog (void) |
| void | PrintPixels (HDC hDC) |
| void | ProjectDialog (void) |
| int WINAPI | QEW_SetupPixelFormat (HDC hDC, qboolean zbuffer) |
| void | QEW_StopGL (HWND hWnd, HGLRC hGLRC, HDC hDC) |
| void | SaveAsDialog (bool bRegion) |
| 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) |
| char * | TranslateString (char *buf) |
| void | Warning (char *error,...) |
Variables | |
| char * | bsp_commands [256] |
| HANDLE | bsp_process |
| int | cambuttonstate |
| int | cbString |
| char | chReplace |
| CStringArray | g_BSPFrontendCommands |
| _QERPlugBSPFrontendTable | g_BSPFrontendTable |
| CEdit * | g_pEdit |
| CTime | g_tBegin |
| qboolean | have_quit |
| HANDLE | hf |
| int | i |
| OPENFILENAME | ofn |
| int | screen_height |
| int | screen_width |
| char | szDirName [MAX_PATH] |
| char | szFile [260] |
| char | szFileTitle [260] |
| char | szFilter [260] |
| char | szProjectFilter [260] |
| int | update_bits |
| HCURSOR | waitcursor |
|
|
Definition at line 136 of file WIN_QE3.CPP. Referenced by Sys_Printf(). |
|
|
Definition at line 135 of file WIN_QE3.CPP. |
|
|
|
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:

|
|
Definition at line 681 of file WIN_QE3.CPP. References malloc(). Referenced by Com_AddToGrowList(), and Com_InitGrowList(). 00681 {
00682 return malloc(bytes);
00683 }
|
Here is the call graph for this function:

|
|
Definition at line 685 of file WIN_QE3.CPP. Referenced by Com_AddToGrowList(), and FS_FreeFile(). 00685 {
00686 free(ptr);
00687 }
|
Here is the call graph for this function:

|
||||||||||||
Here is the call graph for this function:

|
||||||||||||||||
Here is the call graph for this function:

|
||||||||||||
Here is the call graph for this function:

|
|
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 }
|
|
||||||||||||
Here is the call graph for this function:

|
||||||||||||||||
|
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 }
|
|
|
Definition at line 502 of file WIN_QE3.CPP. References QEGlobals_t::bBSPFrontendPlugin, bsp_commands, CMD_BSPCOMMAND, count, QEGlobals_t::d_hwndMain, QEGlobals_t::d_project_entity, epair_t, entity_t::epairs, g_BSPFrontendCommands, g_BSPFrontendTable, g_qeglobals, i, epair_s::key, _QERPlugBSPFrontendTable::m_pfnGetBSPMenu, MENU_BSP, epair_s::next, NULL, strcpy(), strtok(), and token. Referenced by AddCommandDlgProc(), EditCommandDlgProc(), QE_LoadProject(), and CMainFrame::SetButtonMenuStates(). 00503 {
00504 HMENU hmenu;
00505 epair_t *ep;
00506 int i;
00507 static int count;
00508
00509 hmenu = GetSubMenu (GetMenu(g_qeglobals.d_hwndMain), MENU_BSP);
00510
00511 for (i=0 ; i<count ; i++)
00512 DeleteMenu (hmenu, CMD_BSPCOMMAND+i, MF_BYCOMMAND);
00513 count = 0;
00514
00515 if ( g_qeglobals.bBSPFrontendPlugin )
00516 {
00517 CString str = g_BSPFrontendTable.m_pfnGetBSPMenu();
00518 char cTemp[1024];
00519 strcpy(cTemp, str);
00520 char* token = strtok(cTemp, ",;");
00521 if (token && *token == ' ')
00522 {
00523 while (*token == ' ')
00524 token++;
00525 }
00526 i = 0;
00527 // first token is menu name
00528 ModifyMenu( GetMenu(g_qeglobals.d_hwndMain), MENU_BSP, MF_BYPOSITION, MENU_BSP, (LPCTSTR)token );
00529 // redraw the menu bar
00530 DrawMenuBar( g_qeglobals.d_hwndMain );
00531 token = strtok(NULL, ",;");
00532 while (token != NULL)
00533 {
00534 g_BSPFrontendCommands.Add(token);
00535 AppendMenu (hmenu, MF_ENABLED|MF_STRING, CMD_BSPCOMMAND+i, (LPCTSTR)token );
00536 token = strtok(NULL, ",;");
00537 i++;
00538 }
00539 count = i;
00540 }
00541 else
00542 {
00543 i = 0;
00544 for (ep = g_qeglobals.d_project_entity->epairs ; ep ; ep=ep->next)
00545 {
00546 if (ep->key[0] == 'b' && ep->key[1] == 's' && ep->key[2] == 'p')
00547 {
00548 bsp_commands[i] = ep->key;
00549 AppendMenu (hmenu, MF_ENABLED|MF_STRING,
00550 CMD_BSPCOMMAND+i, (LPCTSTR)ep->key);
00551 i++;
00552 }
00553 }
00554 count = i;
00555 }
00556 }
|
Here is the call graph for this function:

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

|
|
Definition at line 746 of file WIN_QE3.CPP. References Com_Error(), Com_Memset(), ERR_FATAL, f, fclose(), qfile_us::file, fsh, fileHandleData_t::handleFiles, qfile_gus::o, fileHandleData_t::streamed, Sys_EndStreamedFile(), qfile_us::unique, unzClose(), unzCloseCurrentFile(), and fileHandleData_t::zipFile. Referenced by CL_CgameSystemCalls(), CL_Disconnect(), |