LevelEditView.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. // LevelEditView.h : interface of the CLevelEditView class
  19. //
  20. /////////////////////////////////////////////////////////////////////////////
  21. #if !defined(AFX_LEVELEDITVIEW_H__6D711A2B_651E_11D2_9FC8_00104B791122__INCLUDED_)
  22. #define AFX_LEVELEDITVIEW_H__6D711A2B_651E_11D2_9FC8_00104B791122__INCLUDED_
  23. #if _MSC_VER >= 1000
  24. #pragma once
  25. #endif // _MSC_VER >= 1000
  26. #include "LevelEditDoc.H"
  27. class CLevelEditView : public CView
  28. {
  29. protected: // create from serialization only
  30. CLevelEditView();
  31. DECLARE_DYNCREATE(CLevelEditView)
  32. // Attributes
  33. public:
  34. CLevelEditDoc* GetDocument();
  35. // Operations
  36. public:
  37. // Overrides
  38. // ClassWizard generated virtual function overrides
  39. //{{AFX_VIRTUAL(CLevelEditView)
  40. public:
  41. virtual void OnDraw(CDC* pDC); // overridden to draw this view
  42. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  43. virtual void OnFinalRelease();
  44. virtual void OnInitialUpdate();
  45. protected:
  46. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  47. //}}AFX_VIRTUAL
  48. // Implementation
  49. public:
  50. virtual ~CLevelEditView();
  51. #ifdef _DEBUG
  52. virtual void AssertValid() const;
  53. virtual void Dump(CDumpContext& dc) const;
  54. #endif
  55. protected:
  56. // Generated message map functions
  57. protected:
  58. //{{AFX_MSG(CLevelEditView)
  59. afx_msg void OnSize(UINT nType, int cx, int cy);
  60. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  61. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  62. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  63. afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  64. afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
  65. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  66. afx_msg void OnDestroy();
  67. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  68. //}}AFX_MSG
  69. DECLARE_MESSAGE_MAP()
  70. public:
  71. ////////////////////////////////////////////////////
  72. //
  73. // Public methods
  74. //
  75. //
  76. // Render device methods
  77. //
  78. void Set_Render_Device_Info (int device_index, int bits_per_pixel) { m_iDeviceIndex = device_index; m_iBitsPerPixel = bits_per_pixel; }
  79. bool Initialize_Render_Device (void);
  80. bool Is_Windowed (void) { return bool(m_iWindowed == 1); }
  81. void Set_Windowed (bool windowed) { m_iWindowed = (int)windowed; Initialize_Render_Device (); }
  82. //
  83. // Painting methods
  84. //
  85. void Repaint_View (void);
  86. void Start_Update (bool bstart = true);
  87. bool Is_Updating (void) { return (m_TimerID != 0); }
  88. HHOOK Get_Hook (void) { return m_hMouseHook; }
  89. //
  90. // Misc accessors
  91. //
  92. class CameraMgr * Get_Camera_Mgr (void) const { return m_pCameraMgr; }
  93. class MouseMgrClass * Get_Mouse_Mgr (void) const { return m_pMouseMgr; }
  94. class SceneClass * Get_2D_Scene (void) const { return m_p2DScene; }
  95. //
  96. // 'New' level methods
  97. //
  98. void Reset_View (void);
  99. //
  100. // Cursor aspect ratio
  101. //
  102. float Get_Cursor_Aspect_RatioX (void) const { return m_CursorXRatio; }
  103. float Get_Cursor_Aspect_RatioY (void) const { return m_CursorYRatio; }
  104. //
  105. // Static methods
  106. //
  107. static int _iPaintingLock;
  108. static bool _bNeedsRepaint;
  109. static void Allow_Repaint (bool active);
  110. private:
  111. ////////////////////////////////////////////////////
  112. // Private member data
  113. ////////////////////////////////////////////////////
  114. bool m_bActive;
  115. int m_iDeviceIndex;
  116. int m_iBitsPerPixel;
  117. bool m_bRenderDeviceInitialized;
  118. class CameraMgr * m_pCameraMgr;
  119. class MouseMgrClass * m_pMouseMgr;
  120. CPoint m_LastMousePoint;
  121. UINT m_TimerID;
  122. int m_iWindowed;
  123. double m_HorzFOV;
  124. double m_VertFOV;
  125. float m_CursorXRatio;
  126. float m_CursorYRatio;
  127. HHOOK m_hMouseHook;
  128. class SceneClass * m_p2DScene;
  129. class CameraClass * m_p2DCamera;
  130. class DynamicScreenMeshClass * m_pCursorMesh;
  131. };
  132. #ifndef _DEBUG // debug version in LevelEditView.cpp
  133. inline CLevelEditDoc* CLevelEditView::GetDocument()
  134. { return (CLevelEditDoc*)m_pDocument; }
  135. #endif
  136. /////////////////////////////////////////////////////////////////////////////
  137. //{{AFX_INSERT_LOCATION}}
  138. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  139. #endif // !defined(AFX_LEVELEDITVIEW_H__6D711A2B_651E_11D2_9FC8_00104B791122__INCLUDED_)