SplineTest.cpp 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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. // SplineTest.cpp : Defines the class behaviors for the application.
  19. //
  20. #include "stdafx.h"
  21. #include "SplineTest.h"
  22. #include "MainFrm.h"
  23. #include "SplineTestDoc.h"
  24. #include "SplineTestView.h"
  25. #ifdef _DEBUG
  26. #define new DEBUG_NEW
  27. #undef THIS_FILE
  28. static char THIS_FILE[] = __FILE__;
  29. #endif
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CSplineTestApp
  32. BEGIN_MESSAGE_MAP(CSplineTestApp, CWinApp)
  33. //{{AFX_MSG_MAP(CSplineTestApp)
  34. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  35. // NOTE - the ClassWizard will add and remove mapping macros here.
  36. // DO NOT EDIT what you see in these blocks of generated code!
  37. //}}AFX_MSG_MAP
  38. // Standard file based document commands
  39. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  40. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  41. END_MESSAGE_MAP()
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CSplineTestApp construction
  44. CSplineTestApp::CSplineTestApp()
  45. {
  46. // TODO: add construction code here,
  47. // Place all significant initialization in InitInstance
  48. }
  49. /////////////////////////////////////////////////////////////////////////////
  50. // The one and only CSplineTestApp object
  51. CSplineTestApp theApp;
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CSplineTestApp initialization
  54. BOOL CSplineTestApp::InitInstance()
  55. {
  56. AfxEnableControlContainer();
  57. // Standard initialization
  58. // If you are not using these features and wish to reduce the size
  59. // of your final executable, you should remove from the following
  60. // the specific initialization routines you do not need.
  61. #ifdef _AFXDLL
  62. Enable3dControls(); // Call this when using MFC in a shared DLL
  63. #else
  64. Enable3dControlsStatic(); // Call this when linking to MFC statically
  65. #endif
  66. // Change the registry key under which our settings are stored.
  67. // TODO: You should modify this string to be something appropriate
  68. // such as the name of your company or organization.
  69. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  70. LoadStdProfileSettings(); // Load standard INI file options (including MRU)
  71. // Register the application's document templates. Document templates
  72. // serve as the connection between documents, frame windows and views.
  73. CSingleDocTemplate* pDocTemplate;
  74. pDocTemplate = new CSingleDocTemplate(
  75. IDR_MAINFRAME,
  76. RUNTIME_CLASS(CSplineTestDoc),
  77. RUNTIME_CLASS(CMainFrame), // main SDI frame window
  78. RUNTIME_CLASS(CSplineTestView));
  79. AddDocTemplate(pDocTemplate);
  80. // Parse command line for standard shell commands, DDE, file open
  81. CCommandLineInfo cmdInfo;
  82. ParseCommandLine(cmdInfo);
  83. // Dispatch commands specified on the command line
  84. if (!ProcessShellCommand(cmdInfo))
  85. return FALSE;
  86. // The one and only window has been initialized, so show and update it.
  87. m_pMainWnd->ShowWindow(SW_SHOW);
  88. m_pMainWnd->UpdateWindow();
  89. return TRUE;
  90. }
  91. /////////////////////////////////////////////////////////////////////////////
  92. // CAboutDlg dialog used for App About
  93. class CAboutDlg : public CDialog
  94. {
  95. public:
  96. CAboutDlg();
  97. // Dialog Data
  98. //{{AFX_DATA(CAboutDlg)
  99. enum { IDD = IDD_ABOUTBOX };
  100. //}}AFX_DATA
  101. // ClassWizard generated virtual function overrides
  102. //{{AFX_VIRTUAL(CAboutDlg)
  103. protected:
  104. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  105. //}}AFX_VIRTUAL
  106. // Implementation
  107. protected:
  108. //{{AFX_MSG(CAboutDlg)
  109. // No message handlers
  110. //}}AFX_MSG
  111. DECLARE_MESSAGE_MAP()
  112. };
  113. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  114. {
  115. //{{AFX_DATA_INIT(CAboutDlg)
  116. //}}AFX_DATA_INIT
  117. }
  118. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  119. {
  120. CDialog::DoDataExchange(pDX);
  121. //{{AFX_DATA_MAP(CAboutDlg)
  122. //}}AFX_DATA_MAP
  123. }
  124. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  125. //{{AFX_MSG_MAP(CAboutDlg)
  126. // No message handlers
  127. //}}AFX_MSG_MAP
  128. END_MESSAGE_MAP()
  129. // App command to run the dialog
  130. void CSplineTestApp::OnAppAbout()
  131. {
  132. CAboutDlg aboutDlg;
  133. aboutDlg.DoModal();
  134. }
  135. /////////////////////////////////////////////////////////////////////////////
  136. // CSplineTestApp message handlers