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