TerrainMaterial.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. ** Command & Conquer Generals(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_TERRAINMATERIAL_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)
  19. #define AFX_TERRAINMATERIAL_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // terrainmaterial.h : header file
  24. //
  25. #include "WBPopupSlider.h"
  26. #include "TerrainSwatches.h"
  27. #include "OptionsPanel.h"
  28. class WorldHeightMapEdit;
  29. /////////////////////////////////////////////////////////////////////////////
  30. // TerrainMaterial dialog
  31. class TerrainMaterial : public COptionsPanel, public PopupSliderOwner
  32. {
  33. // Construction
  34. public:
  35. TerrainMaterial(CWnd* pParent = NULL); // standard constructor
  36. // Dialog Data
  37. //{{AFX_DATA(TerrainMaterial)
  38. enum { IDD = IDD_TERRAIN_MATERIAL };
  39. // NOTE: the ClassWizard will add data members here
  40. //}}AFX_DATA
  41. // Overrides
  42. // ClassWizard generated virtual function overrides
  43. //{{AFX_VIRTUAL(TerrainMaterial)
  44. protected:
  45. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  46. virtual void OnOK(){return;}; ///< Modeless dialogs don't OK, so eat this for modeless.
  47. virtual void OnCancel(){return;}; ///< Modeless dialogs don't close on ESC, so eat this for modeless.
  48. virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
  49. //}}AFX_VIRTUAL
  50. // Implementation
  51. protected:
  52. enum {MIN_TILE_SIZE=2, MAX_TILE_SIZE = 100};
  53. // Generated message map functions
  54. //{{AFX_MSG(TerrainMaterial)
  55. virtual BOOL OnInitDialog();
  56. afx_msg void OnSwapTextures();
  57. afx_msg void OnChangeSizeEdit();
  58. afx_msg void OnImpassable();
  59. afx_msg void OnPassableCheck();
  60. afx_msg void OnPassable();
  61. //}}AFX_MSG
  62. DECLARE_MESSAGE_MAP()
  63. protected:
  64. static TerrainMaterial *m_staticThis;
  65. Bool m_updating;
  66. static Int m_currentFgTexture;
  67. static Int m_currentBgTexture;
  68. CTreeCtrl m_terrainTreeView;
  69. TerrainSwatches m_terrainSwatches;
  70. WBPopupSliderButton m_widthPopup;
  71. Int m_currentWidth;
  72. static Bool m_paintingPathingInfo; // If true, we are painting passable/impassable. If false, normal texture painting.
  73. static Bool m_paintingPassable;
  74. protected:
  75. void addTerrain(char *pPath, Int terrainNdx, HTREEITEM parent);
  76. HTREEITEM findOrAdd(HTREEITEM parent, char *pLabel);
  77. void updateLabel(void);
  78. public:
  79. static Int getFgTexClass(void) {return m_currentFgTexture;}
  80. static Int getBgTexClass(void) {return m_currentBgTexture;}
  81. static void setFgTexClass(Int texClass);
  82. static void setBgTexClass(Int texClass);
  83. static void updateTextures(WorldHeightMapEdit *pMap);
  84. static void updateTextureSelection(void);
  85. static void setToolOptions(Bool singleCell);
  86. static void setWidth(Int width);
  87. static Bool isPaintingPathingInfo(void) {return m_paintingPathingInfo;}
  88. static Bool isPaintingPassable(void) {return m_paintingPassable;}
  89. public:
  90. Bool setTerrainTreeViewSelection(HTREEITEM parent, Int selection);
  91. // Popup slider interface.
  92. virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
  93. virtual void PopSliderChanged(const long sliderID, long theVal);
  94. virtual void PopSliderFinished(const long sliderID, long theVal);
  95. };
  96. //{{AFX_INSERT_LOCATION}}
  97. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  98. #endif // !defined(AFX_TERRAINMATERIAL_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)