ChunkView.cpp 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : ChunkView *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/ChunkView/ChunkView.cpp $*
  25. * *
  26. * Author:: Greg Hjelstrom *
  27. * *
  28. * $Modtime:: 9/28/99 9:48a $*
  29. * *
  30. * $Revision:: 2 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. // ChunkView.cpp : Defines the class behaviors for the application.
  36. //
  37. #include "stdafx.h"
  38. #include "ChunkView.h"
  39. #include "MainFrm.h"
  40. #include "ChunkViewDoc.h"
  41. #include "ChunkViewView.h"
  42. #ifdef _DEBUG
  43. #define new DEBUG_NEW
  44. #undef THIS_FILE
  45. static char THIS_FILE[] = __FILE__;
  46. #endif
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CChunkViewApp
  49. BEGIN_MESSAGE_MAP(CChunkViewApp, CWinApp)
  50. //{{AFX_MSG_MAP(CChunkViewApp)
  51. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  52. // NOTE - the ClassWizard will add and remove mapping macros here.
  53. // DO NOT EDIT what you see in these blocks of generated code!
  54. //}}AFX_MSG_MAP
  55. // Standard file based document commands
  56. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  57. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  58. END_MESSAGE_MAP()
  59. /////////////////////////////////////////////////////////////////////////////
  60. // CChunkViewApp construction
  61. CChunkViewApp::CChunkViewApp()
  62. {
  63. // TODO: add construction code here,
  64. // Place all significant initialization in InitInstance
  65. }
  66. /////////////////////////////////////////////////////////////////////////////
  67. // The one and only CChunkViewApp object
  68. CChunkViewApp theApp;
  69. /////////////////////////////////////////////////////////////////////////////
  70. // CChunkViewApp initialization
  71. BOOL CChunkViewApp::InitInstance()
  72. {
  73. AfxEnableControlContainer();
  74. // Standard initialization
  75. // If you are not using these features and wish to reduce the size
  76. // of your final executable, you should remove from the following
  77. // the specific initialization routines you do not need.
  78. #ifdef _AFXDLL
  79. Enable3dControls(); // Call this when using MFC in a shared DLL
  80. #else
  81. Enable3dControlsStatic(); // Call this when linking to MFC statically
  82. #endif
  83. // Change the registry key under which our settings are stored.
  84. // TODO: You should modify this string to be something appropriate
  85. // such as the name of your company or organization.
  86. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  87. LoadStdProfileSettings(6); // Load standard INI file options (including MRU)
  88. // Register the application's document templates. Document templates
  89. // serve as the connection between documents, frame windows and views.
  90. CSingleDocTemplate* pDocTemplate;
  91. pDocTemplate = new CSingleDocTemplate(
  92. IDR_MAINFRAME,
  93. RUNTIME_CLASS(CChunkViewDoc),
  94. RUNTIME_CLASS(CMainFrame), // main SDI frame window
  95. RUNTIME_CLASS(CChunkViewView));
  96. AddDocTemplate(pDocTemplate);
  97. // Parse command line for standard shell commands, DDE, file open
  98. CCommandLineInfo cmdInfo;
  99. ParseCommandLine(cmdInfo);
  100. // Dispatch commands specified on the command line
  101. if (!ProcessShellCommand(cmdInfo))
  102. return FALSE;
  103. // The one and only window has been initialized, so show and update it.
  104. m_pMainWnd->ShowWindow(SW_SHOW);
  105. m_pMainWnd->UpdateWindow();
  106. return TRUE;
  107. }
  108. /////////////////////////////////////////////////////////////////////////////
  109. // CAboutDlg dialog used for App About
  110. class CAboutDlg : public CDialog
  111. {
  112. public:
  113. CAboutDlg();
  114. // Dialog Data
  115. //{{AFX_DATA(CAboutDlg)
  116. enum { IDD = IDD_ABOUTBOX };
  117. //}}AFX_DATA
  118. // ClassWizard generated virtual function overrides
  119. //{{AFX_VIRTUAL(CAboutDlg)
  120. protected:
  121. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  122. //}}AFX_VIRTUAL
  123. // Implementation
  124. protected:
  125. //{{AFX_MSG(CAboutDlg)
  126. // No message handlers
  127. //}}AFX_MSG
  128. DECLARE_MESSAGE_MAP()
  129. };
  130. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  131. {
  132. //{{AFX_DATA_INIT(CAboutDlg)
  133. //}}AFX_DATA_INIT
  134. }
  135. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  136. {
  137. CDialog::DoDataExchange(pDX);
  138. //{{AFX_DATA_MAP(CAboutDlg)
  139. //}}AFX_DATA_MAP
  140. }
  141. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  142. //{{AFX_MSG_MAP(CAboutDlg)
  143. // No message handlers
  144. //}}AFX_MSG_MAP
  145. END_MESSAGE_MAP()
  146. // App command to run the dialog
  147. void CChunkViewApp::OnAppAbout()
  148. {
  149. CAboutDlg aboutDlg;
  150. aboutDlg.DoModal();
  151. }
  152. /////////////////////////////////////////////////////////////////////////////
  153. // CChunkViewApp message handlers