shdbumpdiff.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : WW3D *
  23. * *
  24. * $Archive:: /Commando/Code/ww3d2/shdbumpdiff.h $*
  25. * *
  26. * $Author:: Kenny_m
  27. *
  28. * $Modtime:: 6/03/02 8:12a $*
  29. * *
  30. * $Revision:: 1 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef SHDBUMPDIFF_H
  36. #define SHDBUMPDIFF_H
  37. #include "shddef.h"
  38. #include "saveload.h"
  39. #include "shader.h"
  40. class ShdBumpDiffDefClass : public ShdDefClass
  41. {
  42. public:
  43. /////////////////////////////////////////////////////////////////////
  44. // Editable interface requirements
  45. /////////////////////////////////////////////////////////////////////
  46. DECLARE_EDITABLE(ShdBumpDiffDefClass, ShdDefClass);
  47. ShdBumpDiffDefClass();
  48. ShdBumpDiffDefClass(const ShdBumpDiffDefClass& that);
  49. virtual ~ShdBumpDiffDefClass();
  50. virtual ShdDefClass* Clone() const { return new ShdBumpDiffDefClass(*this); }
  51. // Shader Creation (should create a shader compatible with the current hardware/API)
  52. virtual void Init();
  53. virtual void Shutdown();
  54. virtual ShdInterfaceClass* Create() const;
  55. // Validation methods
  56. virtual bool Is_Valid_Config(StringClass &message);
  57. // Requirements
  58. virtual bool Requires_Normals() const { return true; }
  59. virtual bool Requires_Tangent_Space_Vectors() const { return true; }
  60. virtual bool Requires_Sorting() const { return false; }
  61. virtual int Static_Sort_Index() const { return 0; }
  62. // From PersistClass
  63. virtual bool Save(ChunkSaveClass &csave);
  64. virtual bool Load(ChunkLoadClass &cload);
  65. void Set_Texture_Name(const StringClass& name) { TextureName=name; }
  66. const StringClass& Get_Texture_Name() const { return TextureName; }
  67. void Set_Bump_Map_Name(const StringClass& name) { BumpMapName=name; }
  68. const StringClass& Get_Bump_Map_Name() const { return BumpMapName; }
  69. void Set_Ambient(const Vector3& ambient) { Ambient=ambient; }
  70. const Vector3& Get_Ambient() const { return Ambient; }
  71. void Set_Diffuse(const Vector3& diffuse) { Diffuse=diffuse; }
  72. const Vector3& Get_Diffuse() const { return Diffuse; }
  73. void Set_Diffuse_Bumpiness(const Vector2& diffuse_bumpiness) { Diffuse_Bumpiness=diffuse_bumpiness; }
  74. const Vector2& Get_Diffuse_Bumpiness() const { return Diffuse_Bumpiness; }
  75. private:
  76. static ShdVersion Version;
  77. bool Save_Variables(ChunkSaveClass &csave);
  78. bool Load_Variables(ChunkLoadClass &cload);
  79. StringClass TextureName;
  80. StringClass BumpMapName;
  81. Vector3 Ambient;
  82. Vector3 Diffuse;
  83. Vector2 Diffuse_Bumpiness;
  84. };
  85. #endif //SHDBUMPDIFF_H