Water.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. ** Command & Conquer Generals Zero Hour(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. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: Water.h //////////////////////////////////////////////////////////////////////////////////
  24. // Author: Colin Day, December 2001
  25. // Desc: Water settings
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. #pragma once
  28. #ifndef __WATER_H_
  29. #define __WATER_H_
  30. // INLCLUDES //////////////////////////////////////////////////////////////////////////////////////
  31. #include "Common/GameType.h"
  32. #include "Common/Overridable.h"
  33. #include "Common/Override.h"
  34. //-------------------------------------------------------------------------------------------------
  35. struct FieldParse;
  36. //-------------------------------------------------------------------------------------------------
  37. /** This structures keeps the settings for how our water will look */
  38. //-------------------------------------------------------------------------------------------------
  39. class WaterSetting
  40. {
  41. public:
  42. WaterSetting( void );
  43. virtual ~WaterSetting( void );
  44. /// Get the INI parsing table for loading
  45. const FieldParse *getFieldParse( void ) { return m_waterSettingFieldParseTable; }
  46. static const FieldParse m_waterSettingFieldParseTable[]; ///< the parse table for INI definition
  47. AsciiString m_skyTextureFile;
  48. AsciiString m_waterTextureFile;
  49. Int m_waterRepeatCount;
  50. Real m_skyTexelsPerUnit; //texel density of sky plane (higher value repeats texture more).
  51. RGBAColorInt m_vertex00Diffuse;
  52. RGBAColorInt m_vertex10Diffuse;
  53. RGBAColorInt m_vertex11Diffuse;
  54. RGBAColorInt m_vertex01Diffuse;
  55. RGBAColorInt m_waterDiffuseColor;
  56. RGBAColorInt m_transparentWaterDiffuse;
  57. Real m_uScrollPerMs;
  58. Real m_vScrollPerMs;
  59. };
  60. //-------------------------------------------------------------------------------------------------
  61. /** This structure keeps the transparency and vertex settings, which are the same regardless of the
  62. time of day. They can be overridden on a per-map basis. */
  63. //-------------------------------------------------------------------------------------------------
  64. class WaterTransparencySetting : public Overridable
  65. {
  66. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( WaterTransparencySetting, "WaterTransparencySetting" )
  67. public:
  68. Real m_transparentWaterDepth;
  69. Real m_minWaterOpacity;
  70. RGBColor m_standingWaterColor;
  71. RGBColor m_radarColor;
  72. Bool m_additiveBlend;
  73. AsciiString m_standingWaterTexture;
  74. AsciiString m_skyboxTextureN;
  75. AsciiString m_skyboxTextureE;
  76. AsciiString m_skyboxTextureS;
  77. AsciiString m_skyboxTextureW;
  78. AsciiString m_skyboxTextureT;
  79. public:
  80. WaterTransparencySetting()
  81. {
  82. m_transparentWaterDepth = 3.0f;
  83. m_minWaterOpacity = 1.0f;
  84. m_standingWaterColor.red = 1.0f;
  85. m_standingWaterColor.green = 1.0f;
  86. m_standingWaterColor.blue = 1.0f;
  87. m_radarColor.red = 140;
  88. m_radarColor.green = 140;
  89. m_radarColor.blue = 255;
  90. m_standingWaterTexture = "TWWater01.tga";
  91. m_additiveBlend = FALSE;
  92. m_skyboxTextureN = "TSMorningN.tga";
  93. m_skyboxTextureE = "TSMorningE.tga";
  94. m_skyboxTextureS = "TSMorningS.tga";
  95. m_skyboxTextureW = "TSMorningW.tga";
  96. m_skyboxTextureT = "TSMorningT.tga";
  97. }
  98. static const FieldParse m_waterTransparencySettingFieldParseTable[]; ///< the parse table for INI definition
  99. /// Get the INI parsing table for loading
  100. const FieldParse *getFieldParse( void ) const { return m_waterTransparencySettingFieldParseTable; }
  101. };
  102. EMPTY_DTOR(WaterTransparencySetting)
  103. // EXTERNAL ///////////////////////////////////////////////////////////////////////////////////////
  104. extern WaterSetting WaterSettings[ TIME_OF_DAY_COUNT ];
  105. extern OVERRIDE<WaterTransparencySetting> TheWaterTransparency;
  106. #endif // __WATER_H_