ZoneEditDialog.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. #if !defined(AFX_ZONEEDITDIALOG_H__68FE6085_8F85_11D3_8DE2_00104B6FD9E3__INCLUDED_)
  19. #define AFX_ZONEEDITDIALOG_H__68FE6085_8F85_11D3_8DE2_00104B6FD9E3__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. #include "resource.h"
  24. #include "dialogtoolbar.h"
  25. #include "obbox.h"
  26. #include "dx8wrapper.h"
  27. /////////////////////////////////////////////////////////////////////////////
  28. // Forward declarations
  29. /////////////////////////////////////////////////////////////////////////////
  30. class SimpleSceneClass;
  31. class CameraClass;
  32. class RenderObjClass;
  33. class PhysClass;
  34. class Box3DClass;
  35. /////////////////////////////////////////////////////////////////////////////
  36. //
  37. // ZoneEditDialogClass
  38. //
  39. /////////////////////////////////////////////////////////////////////////////
  40. class ZoneEditDialogClass : public CDialog
  41. {
  42. // Construction
  43. public:
  44. ZoneEditDialogClass(CWnd* pParent = NULL); // standard constructor
  45. // Dialog Data
  46. //{{AFX_DATA(ZoneEditDialogClass)
  47. enum { IDD = IDD_ZONE_EDIT };
  48. CButton m_MoveZoneCheck;
  49. CButton m_SizeZoneCheck;
  50. //}}AFX_DATA
  51. // Overrides
  52. // ClassWizard generated virtual function overrides
  53. //{{AFX_VIRTUAL(ZoneEditDialogClass)
  54. public:
  55. virtual BOOL PreTranslateMessage(MSG* pMsg);
  56. protected:
  57. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  58. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  59. //}}AFX_VIRTUAL
  60. // Implementation
  61. protected:
  62. // Generated message map functions
  63. //{{AFX_MSG(ZoneEditDialogClass)
  64. virtual BOOL OnInitDialog();
  65. virtual void OnOK();
  66. afx_msg void OnDestroy();
  67. afx_msg void OnTop();
  68. afx_msg void OnFront();
  69. afx_msg void OnLeft();
  70. afx_msg void OnRight();
  71. afx_msg void OnEditZone();
  72. afx_msg void OnSizeZone();
  73. afx_msg void OnLastFrame();
  74. afx_msg void OnFirstFrame();
  75. //}}AFX_MSG
  76. DECLARE_MESSAGE_MAP()
  77. public:
  78. /////////////////////////////////////////////////////////////////////////
  79. // Public methods
  80. /////////////////////////////////////////////////////////////////////////
  81. void Set_Phys_Obj (PhysClass *phys_obj);
  82. void Set_Zone (const OBBoxClass &zone) { m_ZoneBox = zone; }
  83. const OBBoxClass & Get_Zone (void) const { return m_ZoneBox; }
  84. protected:
  85. /////////////////////////////////////////////////////////////////////////
  86. // Protected methods
  87. /////////////////////////////////////////////////////////////////////////
  88. void Handle_Keypress (void);
  89. void Load_Object (void);
  90. void Render_View (void);
  91. void Insert_Zone (void);
  92. static void CALLBACK fnUpdateTimer (UINT, UINT, DWORD, DWORD, DWORD);
  93. void Update_Status (void);
  94. static LRESULT CALLBACK fn3DWindow (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
  95. void Handle_LBUTTON_DOWN (WPARAM wparam, LPARAM lparam);
  96. void Handle_LBUTTON_UP (WPARAM wparam, LPARAM lparam);
  97. void Handle_MOUSEMOVE (WPARAM wparam, LPARAM lparam);
  98. private:
  99. /////////////////////////////////////////////////////////////////////////
  100. // Private member data
  101. /////////////////////////////////////////////////////////////////////////
  102. UINT m_TimerID;
  103. SimpleSceneClass * m_Scene;
  104. CameraClass * m_Camera;
  105. IDirect3DSwapChain8 *m_SwapChain;
  106. RenderObjClass * m_RenderObj;
  107. PhysClass * m_PhysObj;
  108. Box3DClass * m_Zone;
  109. OBBoxClass m_ZoneBox;
  110. float m_LookAtDist;
  111. bool m_IsEditingZone;
  112. bool m_IsSizingZone;
  113. bool m_Initialized;
  114. CPoint m_LastPoint;
  115. DialogToolbarClass m_Toolbar;
  116. };
  117. //{{AFX_INSERT_LOCATION}}
  118. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  119. #endif // !defined(AFX_ZONEEDITDIALOG_H__68FE6085_8F85_11D3_8DE2_00104B6FD9E3__INCLUDED_)