Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
matpass.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/matpass.h $*
26 * *
27 * Original Author:: Greg Hjelstrom *
28 * *
29 * Author : Kenny Mitchell *
30 * *
31 * $Modtime:: 06/27/02 1:27p $*
32 * *
33 * $Revision:: 6 $*
34 * *
35 * 06/27/02 KM Texture class abstraction *
36 *---------------------------------------------------------------------------------------------*
37 * Functions: *
38 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
39
40#if defined(_MSC_VER)
41#pragma once
42#endif
43
44#ifndef MATPASS_H
45#define MATPASS_H
46
47#ifndef REFCOUNT_H
48#include "refcount.h"
49#endif
50
51#ifndef SHADER_H
52#include "shader.h"
53#endif
54
55#ifndef WWDEBUG_H
56#include "wwdebug.h"
57#endif
58
59
60class TextureClass;
62class MeshModelClass;
63class OBBoxClass;
64
79{
80public:
81
84
86 virtual void Install_Materials(void) const;
87 virtual void UnInstall_Materials(void) const { };
88
89 void Set_Texture(TextureClass * Texture,int stage = 0);
90 void Set_Shader(ShaderClass shader);
92
93 TextureClass * Get_Texture(int stage = 0) const;
95
96 TextureClass * Peek_Texture(int stage = 0) const;
97 ShaderClass Peek_Shader(void) const { return Shader; }
98 VertexMaterialClass * Peek_Material(void) const { return Material; }
99
100 void Set_Cull_Volume(OBBoxClass * volume) { CullVolume = volume; }
101 OBBoxClass * Get_Cull_Volume(void) const { return CullVolume; }
102
105
106 static void Enable_Per_Polygon_Culling(bool onoff) { EnablePerPolygonCulling = onoff; }
108
109protected:
110
111 enum { MAX_TEX_STAGES = 8 };
112
117
120
121};
122
123
125{
126 WWASSERT(stage >= 0);
127 WWASSERT(stage < MAX_TEX_STAGES);
128 return Texture[stage];
129}
130
131
132#endif // MATPASS_H
#define WWASSERT
void Set_Texture(TextureClass *Texture, int stage=0)
reset/cleanup D3D states
Definition matpass.cpp:142
void Set_Shader(ShaderClass shader)
Definition matpass.cpp:164
VertexMaterialClass * Peek_Material(void) const
Definition matpass.h:98
OBBoxClass * CullVolume
Definition matpass.h:118
static void Enable_Per_Polygon_Culling(bool onoff)
Definition matpass.h:106
ShaderClass Peek_Shader(void) const
Definition matpass.h:97
virtual void Install_Materials(void) const
MW: Had to make this virtual so app can perform direct/custom D3D setup.
Definition matpass.cpp:118
static bool EnablePerPolygonCulling
Definition matpass.h:119
TextureClass * Texture[MAX_TEX_STAGES]
Definition matpass.h:113
bool EnableOnTranslucentMeshes
Definition matpass.h:116
OBBoxClass * Get_Cull_Volume(void) const
Definition matpass.h:101
TextureClass * Peek_Texture(int stage=0) const
Definition matpass.h:124
VertexMaterialClass * Get_Material(void) const
Definition matpass.cpp:228
void Set_Material(VertexMaterialClass *mat)
Definition matpass.cpp:184
bool Is_Enabled_On_Translucent_Meshes(void)
Definition matpass.h:104
virtual void UnInstall_Materials(void) const
Definition matpass.h:87
MaterialPassClass(void)
Definition matpass.cpp:72
void Set_Cull_Volume(OBBoxClass *volume)
Definition matpass.h:100
void Enable_On_Translucent_Meshes(bool onoff)
Definition matpass.h:103
VertexMaterialClass * Material
Definition matpass.h:115
~MaterialPassClass(void)
Definition matpass.cpp:96
static bool Is_Per_Polygon_Culling_Enabled(void)
Definition matpass.h:107
TextureClass * Get_Texture(int stage=0) const
Definition matpass.cpp:203
ShaderClass Shader
Definition matpass.h:114
RefCountClass(void)
Definition refcount.h:108