EmitterColorPropPage.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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_EMITTERCOLORPROPPAGE_H__83A8B83F_BA3B_11D2_9FFA_00104B791122__INCLUDED_)
  19. #define AFX_EMITTERCOLORPROPPAGE_H__83A8B83F_BA3B_11D2_9FFA_00104B791122__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // EmitterColorPropPage.h : header file
  24. //
  25. #include "Resource.H"
  26. #include "Vector3.H"
  27. #include "ColorBar.H"
  28. #include "Part_Emt.H"
  29. // Forward declarations
  30. class EmitterInstanceListClass;
  31. /////////////////////////////////////////////////////////////////////////////
  32. // EmitterColorPropPageClass dialog
  33. class EmitterColorPropPageClass : public CPropertyPage
  34. {
  35. DECLARE_DYNCREATE(EmitterColorPropPageClass)
  36. // Construction
  37. public:
  38. EmitterColorPropPageClass (EmitterInstanceListClass *pemitter_list = NULL);
  39. ~EmitterColorPropPageClass ();
  40. // Dialog Data
  41. //{{AFX_DATA(EmitterColorPropPageClass)
  42. enum { IDD = IDD_PROP_PAGE_EMITTER_COLOR };
  43. CSpinButtonCtrl m_OpacityRandomSpin;
  44. CSpinButtonCtrl m_RedRandomSpin;
  45. CSpinButtonCtrl m_GreenRandomSpin;
  46. CSpinButtonCtrl m_BlueRandomSpin;
  47. //}}AFX_DATA
  48. // Overrides
  49. // ClassWizard generate virtual function overrides
  50. //{{AFX_VIRTUAL(EmitterColorPropPageClass)
  51. public:
  52. virtual BOOL OnApply();
  53. virtual void OnCancel();
  54. protected:
  55. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  56. virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
  57. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  58. //}}AFX_VIRTUAL
  59. // Implementation
  60. protected:
  61. // Generated message map functions
  62. //{{AFX_MSG(EmitterColorPropPageClass)
  63. virtual BOOL OnInitDialog();
  64. afx_msg void OnDestroy();
  65. afx_msg void OnDeltaposRedRandomSpin(NMHDR* pNMHDR, LRESULT* pResult);
  66. //}}AFX_MSG
  67. DECLARE_MESSAGE_MAP()
  68. public:
  69. /////////////////////////////////////////////////////////
  70. //
  71. // Public methods
  72. //
  73. //
  74. // Inline accessors
  75. //
  76. EmitterInstanceListClass * Get_Emitter (void) const { return m_pEmitterList; }
  77. void Set_Emitter (EmitterInstanceListClass *pemitter_list) { m_pEmitterList = pemitter_list; Initialize (); }
  78. bool Is_Data_Valid (void) const { return m_bValid; }
  79. void Get_Color_Keyframes (ParticlePropertyStruct<Vector3> &colors) { colors = m_CurrentColors; }
  80. void Get_Opacity_Keyframes (ParticlePropertyStruct<float> &opacity) { opacity = m_CurrentOpacities; }
  81. /*const Vector3 & Get_Start_Color (void) const { return m_StartColor; }
  82. const Vector3 & Get_End_Color (void) const { return m_EndColor; }
  83. float Get_Start_Opacity (void) const { return m_StartOpacity; }
  84. float Get_End_Opacity (void) const { return m_EndOpacity; }
  85. float Get_Fade_Time (void) const { return m_FadeTime; }*/
  86. void On_Lifetime_Changed (float lifetime);
  87. protected:
  88. /////////////////////////////////////////////////////////
  89. //
  90. // Protected methods
  91. //
  92. void Initialize (void);
  93. void Update_Colors (void);
  94. void Update_Opacities (void);
  95. private:
  96. /////////////////////////////////////////////////////////
  97. //
  98. // Private member data
  99. //
  100. EmitterInstanceListClass * m_pEmitterList;
  101. bool m_bValid;
  102. ColorBarClass * m_ColorBar;
  103. ColorBarClass * m_OpacityBar;
  104. ParticlePropertyStruct<Vector3> m_OrigColors;
  105. ParticlePropertyStruct<float> m_OrigOpacities;
  106. ParticlePropertyStruct<Vector3> m_CurrentColors;
  107. ParticlePropertyStruct<float> m_CurrentOpacities;
  108. float m_Lifetime;
  109. };
  110. //{{AFX_INSERT_LOCATION}}
  111. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  112. #endif // !defined(AFX_EMITTERCOLORPROPPAGE_H__83A8B83F_BA3B_11D2_9FFA_00104B791122__INCLUDED_)