2
0

GraphicView.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. // GraphicView.h : interface of the CGraphicView class
  19. //
  20. /////////////////////////////////////////////////////////////////////////////
  21. #if !defined(AFX_PHYSTESTVIEW_H__616293EC_E4F0_11D2_802E_0040056350C8__INCLUDED_)
  22. #define AFX_PHYSTESTVIEW_H__616293EC_E4F0_11D2_802E_0040056350C8__INCLUDED_
  23. #if _MSC_VER > 1000
  24. #pragma once
  25. #endif // _MSC_VER > 1000
  26. class CPhysTestDoc;
  27. class RenderObjClass;
  28. class CameraClass;
  29. class SceneClass;
  30. class ChunkSaveClass;
  31. class ChunkLoadClass;
  32. class CGraphicView : public CView
  33. {
  34. protected: // create from serialization only
  35. CGraphicView();
  36. DECLARE_DYNCREATE(CGraphicView)
  37. // Attributes
  38. public:
  39. CPhysTestDoc* GetDocument();
  40. void Save(ChunkSaveClass & csave);
  41. void Load(ChunkLoadClass & cload);
  42. // Operations
  43. public:
  44. // Overrides
  45. // ClassWizard generated virtual function overrides
  46. //{{AFX_VIRTUAL(CGraphicView)
  47. public:
  48. virtual void OnDraw(CDC* pDC); // overridden to draw this view
  49. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  50. virtual void OnInitialUpdate();
  51. protected:
  52. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  53. //}}AFX_VIRTUAL
  54. // Implementation
  55. public:
  56. enum {
  57. CAMERA_FLY = 0,
  58. CAMERA_FOLLOW,
  59. CAMERA_TETHER,
  60. CAMERA_RIGID_TETHER,
  61. };
  62. virtual ~CGraphicView();
  63. BOOL Initialize_WW3D(int device,int bits);
  64. bool Is_WW3D_Initialized(void) { return Initialized; }
  65. void Repaint_View(void);
  66. void Set_Active(bool onoff);
  67. bool Is_Simulation_Enabled(void) { return RunSimulation; }
  68. void Enable_Simulation(bool onoff) { RunSimulation = onoff; }
  69. bool Is_Collision_Box_Display_Enabled(void);
  70. void Enable_Collision_Box_Display(bool onoff);
  71. void Set_Camera_Mode(int mode) { CameraMode = mode; }
  72. int Get_Camera_Mode(void) { return CameraMode; }
  73. #ifdef _DEBUG
  74. virtual void AssertValid() const;
  75. virtual void Dump(CDumpContext& dc) const;
  76. #endif
  77. protected:
  78. bool Initialized;
  79. bool Active;
  80. bool RunSimulation;
  81. bool DisplayBoxes;
  82. int CameraMode;
  83. CameraClass * Camera;
  84. int TimerID;
  85. bool LMouseDown;
  86. bool RMouseDown;
  87. CPoint LastPoint;
  88. CameraClass * PipCamera;
  89. SceneClass * PipScene;
  90. RenderObjClass * Axes;
  91. void Timestep(void);
  92. void Update_Pip_Camera(void);
  93. // Generated message map functions
  94. protected:
  95. //{{AFX_MSG(CGraphicView)
  96. afx_msg void OnSize(UINT nType, int cx, int cy);
  97. afx_msg void OnDestroy();
  98. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  99. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  100. afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  101. afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
  102. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  103. //}}AFX_MSG
  104. DECLARE_MESSAGE_MAP()
  105. };
  106. #ifndef _DEBUG // debug version in PhysTestView.cpp
  107. inline CPhysTestDoc* CGraphicView::GetDocument()
  108. { return (CPhysTestDoc*)m_pDocument; }
  109. #endif
  110. /////////////////////////////////////////////////////////////////////////////
  111. //{{AFX_INSERT_LOCATION}}
  112. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  113. #endif // !defined(AFX_PHYSTESTVIEW_H__616293EC_E4F0_11D2_802E_0040056350C8__INCLUDED_)