LevelEditDoc.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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. // LevelEditDoc.h : interface of the CLevelEditDoc class
  19. //
  20. /////////////////////////////////////////////////////////////////////////////
  21. #if !defined(AFX_LEVELEDITDOC_H__6D711A29_651E_11D2_9FC8_00104B791122__INCLUDED_)
  22. #define AFX_LEVELEDITDOC_H__6D711A29_651E_11D2_9FC8_00104B791122__INCLUDED_
  23. #if _MSC_VER >= 1000
  24. #pragma once
  25. #endif // _MSC_VER >= 1000
  26. #include "Vector3.H"
  27. #include "Matrix3D.h"
  28. ///////////////////////////////////////////////////////////
  29. //
  30. // Constants
  31. //
  32. ///////////////////////////////////////////////////////////
  33. const int MODE_MOD_DROP_TO_GROUND = 0x000000001;
  34. ///////////////////////////////////////////////////////////
  35. //
  36. // CLevelEditDoc
  37. //
  38. ///////////////////////////////////////////////////////////
  39. class CLevelEditDoc : public CDocument
  40. {
  41. protected: // create from serialization only
  42. CLevelEditDoc();
  43. DECLARE_DYNCREATE(CLevelEditDoc)
  44. // Attributes
  45. public:
  46. // Operations
  47. public:
  48. // Overrides
  49. // ClassWizard generated virtual function overrides
  50. //{{AFX_VIRTUAL(CLevelEditDoc)
  51. public:
  52. virtual BOOL OnNewDocument();
  53. virtual void Serialize(CArchive& ar);
  54. virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
  55. virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
  56. virtual void PreCloseFrame( CFrameWnd* pFrame );
  57. //}}AFX_VIRTUAL
  58. // Implementation
  59. public:
  60. virtual ~CLevelEditDoc();
  61. #ifdef _DEBUG
  62. virtual void AssertValid() const;
  63. virtual void Dump(CDumpContext& dc) const;
  64. #endif
  65. protected:
  66. // Generated message map functions
  67. protected:
  68. //{{AFX_MSG(CLevelEditDoc)
  69. afx_msg void OnFileSave();
  70. afx_msg void OnFileSaveAs();
  71. //}}AFX_MSG
  72. DECLARE_MESSAGE_MAP()
  73. public:
  74. ///////////////////////////////////////////////
  75. //
  76. // Public data types
  77. //
  78. typedef enum {
  79. RESTRICT_NONE = 0,
  80. RESTRICT_X,
  81. RESTRICT_Y,
  82. RESTRICT_Z
  83. } AXIS_RESTRICTION;
  84. typedef enum {
  85. COORD_WORLD = 0,
  86. COORD_OBJECT,
  87. COORD_VIEW
  88. } COORD_SYSTEM;
  89. ///////////////////////////////////////////////
  90. //
  91. // Public methods
  92. //
  93. void Init_Scene (void);
  94. class SceneEditorClass * Get_Scene (void) const { return m_pScene; }
  95. //
  96. // Save methods
  97. //
  98. void Set_Current_Path (const char *path);
  99. //
  100. // Operation modifiers
  101. //
  102. AXIS_RESTRICTION Get_Axis_Restriction (void) const { return m_AxisRestriction; }
  103. void Set_Axis_Restriction (AXIS_RESTRICTION restriction) { m_AxisRestriction = restriction; }
  104. COORD_SYSTEM Get_Coord_System (void) const { return m_CoordSystem; }
  105. void Set_Coord_System (COORD_SYSTEM system) { m_CoordSystem = system; }
  106. Matrix3D Get_Coord_System_Transform (class NodeClass *node);
  107. //
  108. // Mode modifiers
  109. //
  110. int Get_Mode_Modifiers () const { return m_ModeModifiers; }
  111. void Set_Mode_Modifiers (int modifiers) { m_ModeModifiers = modifiers; }
  112. //
  113. // Cleanup routines
  114. //
  115. void CleanupResources (void);
  116. //
  117. // Performance sampling methods
  118. //
  119. bool Is_Performance_Sampling_On (void) const { return m_bPerformanceSampling; }
  120. void Performance_Sampling_On (bool sampling_on) { m_bPerformanceSampling = sampling_on; }
  121. //
  122. // Snap points methods
  123. //
  124. bool Are_Snap_Points_Active (void) const { return m_bSnapPointsActive; }
  125. void Activate_Snap_Points (bool bactive) { m_bSnapPointsActive = bactive; }
  126. //
  127. // 'Dirty' methods
  128. //
  129. void Need_RePartition (void) { m_bNeedRepartition = true; }
  130. void Repartition_If_Necessary (void);
  131. //
  132. // File methods
  133. //
  134. class FileMgrClass * Get_File_Mgr (void) { return m_pFileMgr; }
  135. bool Change_Base_Path (void);
  136. void Update_Core_Files (void);
  137. void Update_Asset_Tree (void);
  138. void Update_Assets_For_Mod_Tree (void);
  139. //
  140. // Light methods
  141. //
  142. bool Are_Lights_On (void) const { return m_bLightsOn; }
  143. void Turn_Lights_On (bool onoff);
  144. //
  145. // Pathfind Debug methods
  146. //
  147. bool Is_Path_Web_Displayed (void) const { return m_DisplayPathWeb; }
  148. void Display_Path_Web (bool onoff) { m_DisplayPathWeb = onoff; }
  149. bool Are_Full_Paths_Displayed (void) const { return m_DisplayFullPaths; }
  150. void Display_Full_Paths (bool onoff) { m_DisplayFullPaths = onoff; }
  151. //
  152. // Debug methods
  153. //
  154. void Set_Debug_Script_Mode (bool onoff);
  155. bool Get_Debug_Script_Mode (void) const { return m_DebugScriptsMode; }
  156. //
  157. // Preload methods
  158. //
  159. void Preload_Assets (void);
  160. void Preload_Human_Data (void);
  161. void Preload_Tool_Assets (void);
  162. //
  163. // Batch export information
  164. //
  165. static bool Is_Batch_Export_Mode (void) { return IsBatchExportMode; }
  166. static void Set_Is_Batch_Export_Mode (bool onoff) { IsBatchExportMode = onoff; }
  167. protected:
  168. //
  169. // VSS methods
  170. //
  171. bool Initialize_VSS (void);
  172. bool Do_Version_Check (void);
  173. //
  174. // Export methods
  175. //
  176. void Save_Level_File (const char *full_path);
  177. bool Pick_Save_Path (CString &save_path);
  178. private:
  179. /////////////////////////////////////////////////////////////////
  180. // Private member data
  181. /////////////////////////////////////////////////////////////////
  182. class SceneEditorClass * m_pScene;
  183. class FileMgrClass * m_pFileMgr;
  184. COORD_SYSTEM m_CoordSystem;
  185. AXIS_RESTRICTION m_AxisRestriction;
  186. int m_ModeModifiers;
  187. bool m_bPerformanceSampling;
  188. bool m_bSnapPointsActive;
  189. bool m_bNeedRepartition;
  190. bool m_bLightsOn;
  191. bool m_DisplayPathWeb;
  192. bool m_DisplayFullPaths;
  193. bool m_DebugScriptsMode;
  194. static bool IsBatchExportMode;
  195. };
  196. /////////////////////////////////////////////////////////////////////////////
  197. //{{AFX_INSERT_LOCATION}}
  198. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  199. #endif // !defined(AFX_LEVELEDITDOC_H__6D711A29_651E_11D2_9FC8_00104B791122__INCLUDED_)