MainFrm.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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. // MainFrm.h : interface of the CMainFrame class
  19. //
  20. /////////////////////////////////////////////////////////////////////////////
  21. #if !defined(AFX_MAINFRM_H__6D711A27_651E_11D2_9FC8_00104B791122__INCLUDED_)
  22. #define AFX_MAINFRM_H__6D711A27_651E_11D2_9FC8_00104B791122__INCLUDED_
  23. #if _MSC_VER >= 1000
  24. #pragma once
  25. #endif // _MSC_VER >= 1000
  26. #include "formtoolbar.h"
  27. #include "maindialogbar.h"
  28. #include "vector.h"
  29. #include "wwstring.h"
  30. //////////////////////////////////////////////////////////////////////////////////////////
  31. // Forward declarations
  32. //////////////////////////////////////////////////////////////////////////////////////////
  33. class Vector3;
  34. class CLevelEditDoc;
  35. //////////////////////////////////////////////////////////////////////////////////////////
  36. //
  37. // CMainFrame
  38. //
  39. //////////////////////////////////////////////////////////////////////////////////////////
  40. class CMainFrame : public CFrameWnd
  41. {
  42. protected: // create from serialization only
  43. CMainFrame();
  44. DECLARE_DYNCREATE(CMainFrame)
  45. // Attributes
  46. public:
  47. // Operations
  48. public:
  49. // Overrides
  50. // ClassWizard generated virtual function overrides
  51. //{{AFX_VIRTUAL(CMainFrame)
  52. public:
  53. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  54. virtual void OnFinalRelease();
  55. protected:
  56. virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
  57. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  58. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  59. //}}AFX_VIRTUAL
  60. // Implementation
  61. public:
  62. virtual ~CMainFrame();
  63. #ifdef _DEBUG
  64. virtual void AssertValid() const;
  65. virtual void Dump(CDumpContext& dc) const;
  66. #endif
  67. protected: // control bar embedded members
  68. CStatusBar m_wndStatusBar;
  69. CToolBar m_wndToolBar;
  70. // Generated message map functions
  71. protected:
  72. //{{AFX_MSG(CMainFrame)
  73. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  74. afx_msg void OnClose();
  75. afx_msg void OnObjectManipulate();
  76. afx_msg void OnUpdateObjectManipulate(CCmdUI* pCmdUI);
  77. afx_msg void OnModeCamera();
  78. afx_msg void OnUpdateModeCamera(CCmdUI* pCmdUI);
  79. afx_msg void OnDeleteSelection();
  80. afx_msg void OnModeOrbit();
  81. afx_msg void OnUpdateModeOrbit(CCmdUI* pCmdUI);
  82. afx_msg void OnCoordWorld();
  83. afx_msg void OnUpdateCoordWorld(CCmdUI* pCmdUI);
  84. afx_msg void OnCoordView();
  85. afx_msg void OnUpdateCoordView(CCmdUI* pCmdUI);
  86. afx_msg void OnCoordObject();
  87. afx_msg void OnUpdateCoordObject(CCmdUI* pCmdUI);
  88. afx_msg void OnRestrictX();
  89. afx_msg void OnRestrictY();
  90. afx_msg void OnRestrictZ();
  91. afx_msg void OnUpdateRestrictZ(CCmdUI* pCmdUI);
  92. afx_msg void OnUpdateRestrictY(CCmdUI* pCmdUI);
  93. afx_msg void OnUpdateRestrictX(CCmdUI* pCmdUI);
  94. afx_msg void OnCameraFront();
  95. afx_msg void OnCameraBack();
  96. afx_msg void OnCameraLeft();
  97. afx_msg void OnCameraRight();
  98. afx_msg void OnCameraTop();
  99. afx_msg void OnCameraBottom();
  100. afx_msg void OnDropToGround();
  101. afx_msg void OnUpdateDropToGround(CCmdUI* pCmdUI);
  102. afx_msg void OnModeWalkthrough();
  103. afx_msg void OnUpdateModeWalkthrough(CCmdUI* pCmdUI);
  104. afx_msg void OnViewChangeDevice();
  105. afx_msg void OnLevelExport();
  106. afx_msg void OnViewFullscreen();
  107. afx_msg void OnUpdateViewFullscreen(CCmdUI* pCmdUI);
  108. afx_msg void OnViewAmbientLightDlg();
  109. afx_msg void OnUpdateViewAmbientLightDlg(CCmdUI* pCmdUI);
  110. afx_msg void OnUpdateViewToolbarCameraSettings(CCmdUI* pCmdUI);
  111. afx_msg void OnViewToolbarCameraSettings();
  112. afx_msg void OnCameraDepthLess();
  113. afx_msg void OnCameraDepthMore();
  114. afx_msg void OnSavePresets();
  115. afx_msg void OnUpdateSavePresets(CCmdUI* pCmdUI);
  116. afx_msg void OnToggleSnappoints();
  117. afx_msg void OnUpdateToggleSnappoints(CCmdUI* pCmdUI);
  118. afx_msg void OnAlwaysExport();
  119. afx_msg void OnDestroy();
  120. afx_msg void OnChangeBase();
  121. afx_msg void OnCamSpeedIncrease();
  122. afx_msg void OnCamSpeedDecrease();
  123. afx_msg void OnCamReset();
  124. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  125. afx_msg void OnGenVis();
  126. afx_msg void OnToggleVisWindow();
  127. afx_msg void OnAniBackFrame();
  128. afx_msg void OnAniFirstFrame();
  129. afx_msg void OnAniFwdFrame();
  130. afx_msg void OnAniLastFrame();
  131. afx_msg void OnAniPause();
  132. afx_msg void OnAniPlay();
  133. afx_msg void OnAniStop();
  134. afx_msg void OnEditUndo();
  135. afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
  136. afx_msg void OnEditCopy();
  137. afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
  138. afx_msg void OnEditCut();
  139. afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
  140. afx_msg void OnEditPaste();
  141. afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
  142. afx_msg void OnCreateGroup();
  143. afx_msg void OnUpdateCreateGroup(CCmdUI* pCmdUI);
  144. afx_msg void OnToggleLights();
  145. afx_msg void OnUpdateToggleLights(CCmdUI* pCmdUI);
  146. afx_msg void OnRepartition();
  147. afx_msg void OnAllowAutoUpdates();
  148. afx_msg void OnUpdateAllowAutoUpdates(CCmdUI* pCmdUI);
  149. afx_msg void OnRotateLeft();
  150. afx_msg void OnRotateRight();
  151. afx_msg void OnCalcAllLights();
  152. afx_msg void OnCalcSelLights();
  153. afx_msg void OnUpdateCalcSelLights(CCmdUI* pCmdUI);
  154. afx_msg void OnLockObjects();
  155. afx_msg void OnUnlockObjects();
  156. afx_msg void OnUpdateLockObjects(CCmdUI* pCmdUI);
  157. afx_msg void OnUpdateUnlockObjects(CCmdUI* pCmdUI);
  158. afx_msg void OnEditIncludes();
  159. afx_msg void OnVolDec();
  160. afx_msg void OnVolInc();
  161. afx_msg void OnBackgroundSettings();
  162. afx_msg void OnToggleMusic();
  163. afx_msg void OnUpdateToggleMusic(CCmdUI* pCmdUI);
  164. afx_msg void OnToggleSounds();
  165. afx_msg void OnUpdateToggleSounds(CCmdUI* pCmdUI);
  166. afx_msg void OnViewAggregateChildren();
  167. afx_msg void OnUpdateViewAggregateChildren(CCmdUI* pCmdUI);
  168. afx_msg void OnToggleSunlight();
  169. afx_msg void OnUpdateToggleSunlight(CCmdUI* pCmdUI);
  170. afx_msg void OnEditSunlight();
  171. afx_msg void OnAutoGenVis();
  172. afx_msg void OnVisualOptions();
  173. afx_msg void OnVisInvert();
  174. afx_msg void OnViewVisPoints();
  175. afx_msg void OnUpdateViewVisPoints(CCmdUI* pCmdUI);
  176. afx_msg void OnSpecifyAssetDatabase();
  177. afx_msg void OnUpdateVisInvert(CCmdUI* pCmdUI);
  178. afx_msg void OnToggleBackfaces();
  179. afx_msg void OnUpdateToggleBackfaces(CCmdUI* pCmdUI);
  180. afx_msg void OnToggleWireframeMode();
  181. afx_msg void OnUpdateToggleWireframeMode(CCmdUI* pCmdUI);
  182. afx_msg void OnViewVisErrors();
  183. afx_msg void OnUseVisCamera();
  184. afx_msg void OnUpdateUseVisCamera(CCmdUI* pCmdUI);
  185. afx_msg void OnGenerateObstacleVolumes();
  186. afx_msg void OnVisDisable();
  187. afx_msg void OnUpdateVisDisable(CCmdUI* pCmdUI);
  188. afx_msg void OnDisplayPaths();
  189. afx_msg void OnUpdateDisplayPaths(CCmdUI* pCmdUI);
  190. afx_msg void OnTestPathfind();
  191. afx_msg void OnDisplayPathfindSectors();
  192. afx_msg void OnUpdateDisplayPathfindSectors(CCmdUI* pCmdUI);
  193. afx_msg void OnDisplayPathfindPortals();
  194. afx_msg void OnUpdateDisplayPathfindPortals(CCmdUI* pCmdUI);
  195. afx_msg void OnDisplayPathfindRawData();
  196. afx_msg void OnUpdateDisplayPathfindRawData(CCmdUI* pCmdUI);
  197. afx_msg void OnExportPathfind();
  198. afx_msg void OnImportPathfind();
  199. afx_msg void OnImportVis();
  200. afx_msg void OnExportVis();
  201. afx_msg void OnViewVisWindow();
  202. afx_msg void OnUpdateViewVisWindow(CCmdUI* pCmdUI);
  203. afx_msg void OnToggleManVisPoints();
  204. afx_msg void OnUpdateToggleManVisPoints(CCmdUI* pCmdUI);
  205. afx_msg void OnDiscardPathfind();
  206. afx_msg void OnDoDebug1();
  207. afx_msg void OnDoDebug2();
  208. afx_msg void OnImportDynObjs();
  209. afx_msg void OnExportDynObjs();
  210. afx_msg void OnTestGoto();
  211. afx_msg void OnImportStatic();
  212. afx_msg void OnExportStatic();
  213. afx_msg void OnDisplayWeb();
  214. afx_msg void OnUpdateDisplayWeb(CCmdUI* pCmdUI);
  215. afx_msg void OnUpdateDisplayFullPaths(CCmdUI* pCmdUI);
  216. afx_msg void OnDisplayFullPaths();
  217. afx_msg void OnEscape();
  218. afx_msg void OnDisplayVisGrid();
  219. afx_msg void OnUpdateDisplayVisGrid(CCmdUI* pCmdUI);
  220. afx_msg void OnDisplayVisSectors();
  221. afx_msg void OnUpdateDisplayVisSectors(CCmdUI* pCmdUI);
  222. afx_msg void OnPrelitMultipass();
  223. afx_msg void OnUpdatePrelitMultipass(CCmdUI* pCmdUI);
  224. afx_msg void OnPrelitMultitex();
  225. afx_msg void OnUpdatePrelitMultitex(CCmdUI* pCmdUI);
  226. afx_msg void OnPrelitVertex();
  227. afx_msg void OnUpdatePrelitVertex(CCmdUI* pCmdUI);
  228. afx_msg void OnDebugScriptsMode();
  229. afx_msg void OnUpdateDebugScriptsMode(CCmdUI* pCmdUI);
  230. afx_msg void OnImportLights();
  231. afx_msg void OnViewSoundSpheres();
  232. afx_msg void OnUpdateViewSoundSpheres(CCmdUI* pCmdUI);
  233. afx_msg void OnViewLightSpheres();
  234. afx_msg void OnUpdateViewLightSpheres(CCmdUI* pCmdUI);
  235. afx_msg void OnImportSunlight();
  236. afx_msg void OnDiscardVis();
  237. afx_msg void OnIncreaseSphere();
  238. afx_msg void OnUpdateIncreaseSphere(CCmdUI* pCmdUI);
  239. afx_msg void OnDecreaseSphere();
  240. afx_msg void OnUpdateDecreaseSphere(CCmdUI* pCmdUI);
  241. afx_msg void OnRunJob();
  242. afx_msg void OnGotoLocation();
  243. afx_msg void OnExportThumbnails();
  244. afx_msg void OnVisStats();
  245. afx_msg void OnSetNodeIdStart();
  246. afx_msg void OnBuildDynaCullsys();
  247. afx_msg void OnImportVisRemapData();
  248. afx_msg void OnExportVisRemapData();
  249. afx_msg void OnUpdateBulkReplace(CCmdUI* pCmdUI);
  250. afx_msg void OnBulkReplace();
  251. afx_msg void OnCheckIds();
  252. afx_msg void OnExportLights();
  253. afx_msg void OnOptimizeVisData();
  254. afx_msg void OnDisplayVisGridLittleBoxes();
  255. afx_msg void OnUpdateDisplayVisGridLittleBoxes(CCmdUI* pCmdUI);
  256. afx_msg void OnEditStringsTable();
  257. afx_msg void OnExportStringIds();
  258. afx_msg void OnImportStringIds();
  259. afx_msg void OnBuildFlightInfo();
  260. afx_msg void OnToggleAttenuationSpheres();
  261. afx_msg void OnUpdateToggleAttenuationSpheres(CCmdUI* pCmdUI);
  262. afx_msg void OnFixIdCollisions();
  263. afx_msg void OnResetDynaCullSystem();
  264. afx_msg void OnDisplayLightVectors();
  265. afx_msg void OnUpdateDisplayLightVectors(CCmdUI* pCmdUI);
  266. afx_msg void OnDisplayStaticAnimObjects();
  267. afx_msg void OnUpdateDisplayStaticAnimObjects(CCmdUI* pCmdUI);
  268. afx_msg void OnEditConversations();
  269. afx_msg void OnBuildingPowerOn();
  270. afx_msg void OnUpdateBuildingPowerOn(CCmdUI* pCmdUI);
  271. afx_msg void OnCreateProxies();
  272. afx_msg void OnUpdateCreateProxies(CCmdUI* pCmdUI);
  273. afx_msg void OnCheckInPresetChanges();
  274. afx_msg void OnUpdateCheckInPresetChanges(CCmdUI* pCmdUI);
  275. afx_msg void OnImmediatePresetCheckin();
  276. afx_msg void OnUpdateImmediatePresetCheckin(CCmdUI* pCmdUI);
  277. afx_msg void OnRemapIds();
  278. afx_msg void OnUpdateRemapIds(CCmdUI* pCmdUI);
  279. afx_msg void OnVerifyCulling();
  280. afx_msg void OnEnableVisSectorFallback();
  281. afx_msg void OnUpdateEnableVisSectorFallback(CCmdUI* pCmdUI);
  282. afx_msg void OnRunManualVisPoints();
  283. afx_msg void OnShowEditorObjects();
  284. afx_msg void OnUpdateShowEditorObjects(CCmdUI* pCmdUI);
  285. afx_msg void OnAddChildNode();
  286. afx_msg void OnUpdateAddChildNode(CCmdUI* pCmdUI);
  287. afx_msg void OnCheckMemlog();
  288. afx_msg void OnMakeVisPoint();
  289. afx_msg void OnExportStringTable();
  290. afx_msg void OnGotoObject();
  291. afx_msg void OnExportPresets();
  292. afx_msg void OnImportPresets();
  293. afx_msg void OnBatchExport();
  294. afx_msg void OnLockVisSamplePoint();
  295. afx_msg void OnUpdateLockVisSamplePoint(CCmdUI* pCmdUI);
  296. afx_msg void OnToggleTerrainSelection();
  297. afx_msg void OnUpdateToggleTerrainSelection(CCmdUI* pCmdUI);
  298. afx_msg void OnExportPresetFileDependencies();
  299. afx_msg void OnImportStrings();
  300. afx_msg void OnExportTileList();
  301. afx_msg void OnRemapUnimportantIds();
  302. afx_msg void OnEditLevelSettings();
  303. afx_msg void OnExportTranslationData();
  304. afx_msg void OnImportTranslationData();
  305. afx_msg void OnCompressTextures();
  306. afx_msg void OnUpdateCompressTextures(CCmdUI* pCmdUI);
  307. afx_msg void OnExportFileUsageReport();
  308. afx_msg void OnExportMissingTranslationReport();
  309. afx_msg void OnExportLanguage();
  310. afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
  311. afx_msg void OnAlwaysLocalExport();
  312. afx_msg void OnExportInstallerLanguageVersion();
  313. afx_msg void OnExtractInstallerRcStrings();
  314. afx_msg void OnExtractRcStrings();
  315. afx_msg void OnCameraPerspective();
  316. afx_msg void OnCameraOrthographic();
  317. afx_msg void OnUpdateCameraOrthographic(CCmdUI* pCmdUI);
  318. afx_msg void OnUpdateCameraPerspective(CCmdUI* pCmdUI);
  319. afx_msg void OnModExport();
  320. afx_msg void OnSaveLevel();
  321. afx_msg void OnComputeVertexSolve();
  322. afx_msg void OnModeHeightEdit();
  323. afx_msg void OnUpdateModeHeightEdit(CCmdUI* pCmdUI);
  324. //}}AFX_MSG
  325. DECLARE_MESSAGE_MAP()
  326. public:
  327. /////////////////////////////////////////////////////////////////////////
  328. // Public methods
  329. /////////////////////////////////////////////////////////////////////////
  330. FormToolbarClass & Get_Output_Toolbar (void) { return m_OutputToolbar; }
  331. FormToolbarClass & Get_Camera_Toolbar (void) { return m_CameraSettingsToolbar; }
  332. FormToolbarClass & Get_Ambient_Light_Toolbar (void) { return m_AmbientLightToolbar; }
  333. MainDialogBarClass & Get_Main_Dialog_Bar (void) { return m_TestBar; }
  334. CLevelEditDoc * Get_Current_Document (void) { return m_pCurrentDoc; }
  335. void Show_Ani_Toolbar (bool bshow);
  336. void Update_Ani_Frame (int frame, int max_frames);
  337. void Update_Poly_Count (void);
  338. void Update_Texture_Mem (void);
  339. void Update_Camera_Location (const Vector3 &position);
  340. CImageList * Get_Image_List (void) { return &m_ImageList; }
  341. void Expand_Attenuation_Spheres (float amount);
  342. void Toggle_Static_Anims (void) { OnDisplayStaticAnimObjects (); }
  343. protected:
  344. /////////////////////////////////////////////////////////////////////////
  345. // Protected methods
  346. /////////////////////////////////////////////////////////////////////////
  347. void Create_Toolbars (void);
  348. void Adjust_Growth_Rate (void);
  349. void Restore_Window_State (void);
  350. void Configure_File_Factories (void);
  351. void Create_Camera_Menu (void);
  352. private:
  353. /////////////////////////////////////////////////////////////////////////
  354. // Private member data
  355. /////////////////////////////////////////////////////////////////////////
  356. FormToolbarClass m_OutputToolbar;
  357. FormToolbarClass m_AmbientLightToolbar;
  358. FormToolbarClass m_CameraSettingsToolbar;
  359. CToolBar m_wndBottomToolBar;
  360. CToolBar m_AniToolbar;
  361. CReBar m_DialogBar;
  362. CLevelEditDoc * m_pCurrentDoc;
  363. CImageList m_ImageList;
  364. MainDialogBarClass m_TestBar;
  365. DWORD m_UpdateTimer;
  366. float m_GrowthRate;
  367. int m_MaxCamProfiles;
  368. DynamicVectorClass<StringClass> m_CameraProfiles;
  369. };
  370. /////////////////////////////////////////////////////////////////////////////
  371. //{{AFX_INSERT_LOCATION}}
  372. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  373. #endif // !defined(AFX_MAINFRM_H__6D711A27_651E_11D2_9FC8_00104B791122__INCLUDED_)