Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
shdbumpdiff.h
Go to the documentation of this file.
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 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 ***
21 ***********************************************************************************************
22 * *
23 * Project Name : WW3D *
24 * *
25 * $Archive:: /Commando/Code/ww3d2/shdbumpdiff.h $*
26 * *
27 * $Author:: Kenny_m
28 *
29 * $Modtime:: 6/03/02 8:12a $*
30 * *
31 * $Revision:: 1 $*
32 * *
33 *---------------------------------------------------------------------------------------------*
34 * Functions: *
35 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
36
37#ifndef SHDBUMPDIFF_H
38#define SHDBUMPDIFF_H
39
40#include "shddef.h"
41#include "saveload.h"
42#include "shader.h"
43
45{
46public:
47
49 // Editable interface requirements
52
55 virtual ~ShdBumpDiffDefClass();
56
57 virtual ShdDefClass* Clone() const { return new ShdBumpDiffDefClass(*this); }
58
59 // Shader Creation (should create a shader compatible with the current hardware/API)
60 virtual void Init();
61 virtual void Shutdown();
62 virtual ShdInterfaceClass* Create() const;
63
64 // Validation methods
65 virtual bool Is_Valid_Config(StringClass &message);
66
67 // Requirements
68 virtual bool Requires_Normals() const { return true; }
69 virtual bool Requires_Tangent_Space_Vectors() const { return true; }
70 virtual bool Requires_Sorting() const { return false; }
71 virtual int Static_Sort_Index() const { return 0; }
72
73 // From PersistClass
74 virtual bool Save(ChunkSaveClass &csave);
75 virtual bool Load(ChunkLoadClass &cload);
76
77 void Set_Texture_Name(const StringClass& name) { TextureName=name; }
78 const StringClass& Get_Texture_Name() const { return TextureName; }
79
80 void Set_Bump_Map_Name(const StringClass& name) { BumpMapName=name; }
81 const StringClass& Get_Bump_Map_Name() const { return BumpMapName; }
82
83 void Set_Ambient(const Vector3& ambient) { Ambient=ambient; }
84 const Vector3& Get_Ambient() const { return Ambient; }
85
86 void Set_Diffuse(const Vector3& diffuse) { Diffuse=diffuse; }
87 const Vector3& Get_Diffuse() const { return Diffuse; }
88
89 void Set_Diffuse_Bumpiness(const Vector2& diffuse_bumpiness) { Diffuse_Bumpiness=diffuse_bumpiness; }
90 const Vector2& Get_Diffuse_Bumpiness() const { return Diffuse_Bumpiness; }
91
92private:
93
94 static ShdVersion Version;
95
96 bool Save_Variables(ChunkSaveClass &csave);
97 bool Load_Variables(ChunkLoadClass &cload);
98
99 StringClass TextureName;
100 StringClass BumpMapName;
101
102 Vector3 Ambient;
103 Vector3 Diffuse;
104
105 Vector2 Diffuse_Bumpiness;
106};
107
108
109#endif //SHDBUMPDIFF_H
void Set_Diffuse(const Vector3 &diffuse)
Definition shdbumpdiff.h:86
virtual bool Requires_Sorting() const
Definition shdbumpdiff.h:70
virtual bool Save(ChunkSaveClass &csave)
Serialize this ShdDef into a chunk saver.
void Set_Texture_Name(const StringClass &name)
Definition shdbumpdiff.h:77
DECLARE_EDITABLE(ShdBumpDiffDefClass, ShdDefClass)
const StringClass & Get_Bump_Map_Name() const
Definition shdbumpdiff.h:81
virtual ~ShdBumpDiffDefClass()
virtual void Init()
const Vector3 & Get_Ambient() const
Definition shdbumpdiff.h:84
void Set_Ambient(const Vector3 &ambient)
Definition shdbumpdiff.h:83
virtual int Static_Sort_Index() const
Definition shdbumpdiff.h:71
virtual ShdDefClass * Clone() const
Definition shdbumpdiff.h:57
virtual void Shutdown()
const StringClass & Get_Texture_Name() const
Definition shdbumpdiff.h:78
void Set_Bump_Map_Name(const StringClass &name)
Definition shdbumpdiff.h:80
virtual bool Requires_Normals() const
Definition shdbumpdiff.h:68
void Set_Diffuse_Bumpiness(const Vector2 &diffuse_bumpiness)
Definition shdbumpdiff.h:89
const Vector3 & Get_Diffuse() const
Definition shdbumpdiff.h:87
virtual bool Is_Valid_Config(StringClass &message)
virtual bool Requires_Tangent_Space_Vectors() const
Definition shdbumpdiff.h:69
virtual bool Load(ChunkLoadClass &cload)
Load this ShdDef from a chunk loader.
virtual ShdInterfaceClass * Create() const
const Vector2 & Get_Diffuse_Bumpiness() const
Definition shdbumpdiff.h:90
ShdDefClass(uint32 class_id)
Definition shddef.cpp:45