Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
MeshMatDescClass Class Reference

#include <meshmatdesc.h>

Inherits W3DMPO.

Public Types

enum  { MAX_PASSES = 4 , MAX_TEX_STAGES = 2 , MAX_COLOR_ARRAYS = 2 , MAX_UV_ARRAYS = MAX_PASSES * MAX_TEX_STAGES }
 

Public Member Functions

 MeshMatDescClass (void)
 
 MeshMatDescClass (const MeshMatDescClass &that)
 
 ~MeshMatDescClass (void)
 
void Reset (int polycount, int vertcount, int passcount)
 
MeshMatDescClassoperator= (const MeshMatDescClass &that)
 
void Init_Alternate (MeshMatDescClass &def_mat_desc, MeshMatDescClass &alternate_desc)
 
bool Is_Empty (void)
 
void Set_Pass_Count (int passes)
 
int Get_Pass_Count (void) const
 
void Set_Vertex_Count (int vertcount)
 
int Get_Vertex_Count (void) const
 
void Set_Polygon_Count (int polycount)
 
int Get_Polygon_Count (void) const
 
Vector2Get_UV_Array (int pass, int stage)
 
void Install_UV_Array (int pass, int stage, Vector2 *uvs, int count)
 
void Set_UV_Source (int pass, int stage, int sourceindex)
 
int Get_UV_Source (int pass, int stage)
 
int Get_UV_Array_Count (void)
 
Vector2Get_UV_Array_By_Index (int index, bool create=true)
 
unsigned * Get_DCG_Array (int pass)
 
unsigned * Get_DIG_Array (int pass)
 
void Set_DCG_Source (int pass, VertexMaterialClass::ColorSourceType source)
 
void Set_DIG_Source (int pass, VertexMaterialClass::ColorSourceType source)
 
VertexMaterialClass::ColorSourceType Get_DCG_Source (int pass)
 
VertexMaterialClass::ColorSourceType Get_DIG_Source (int pass)
 
unsigned * Get_Color_Array (int array, bool create=true)
 
void Set_Single_Material (VertexMaterialClass *vmat, int pass=0)
 
void Set_Single_Texture (TextureClass *tex, int pass=0, int stage=0)
 
void Set_Single_Shader (ShaderClass shader, int pass=0)
 
VertexMaterialClassGet_Single_Material (int pass=0) const
 
TextureClassGet_Single_Texture (int pass=0, int stage=0) const
 
ShaderClass Get_Single_Shader (int pass=0) const
 
VertexMaterialClassPeek_Single_Material (int pass=0) const
 
TextureClassPeek_Single_Texture (int pass=0, int stage=0) const
 
void Set_Material (int vidx, VertexMaterialClass *vmat, int pass=0)
 
void Set_Shader (int pidx, ShaderClass shader, int pass=0)
 
void Set_Texture (int pidx, TextureClass *tex, int pass=0, int stage=0)
 
bool Has_Material_Array (int pass) const
 
bool Has_Shader_Array (int pass) const
 
bool Has_Texture_Array (int pass, int stage) const
 
bool Has_UV (int pass, int stage)
 
bool Has_Color_Array (int array)
 
bool Has_Texture_Data (int pass, int stage)
 
bool Has_Shader_Data (int pass)
 
bool Has_Material_Data (int pass)
 
VertexMaterialClassGet_Material (int vidx, int pass=0) const
 
TextureClassGet_Texture (int pidx, int pass=0, int stage=0) const
 
ShaderClass Get_Shader (int pidx, int pass=0) const
 
VertexMaterialClassPeek_Material (int vidx, int pass=0) const
 
TextureClassPeek_Texture (int pidx, int pass=0, int stage=0) const
 
TexBufferClassGet_Texture_Array (int pass, int stage, bool create=true)
 
MatBufferClassGet_Material_Array (int pass, bool create=true)
 
ShaderClassGet_Shader_Array (int pass, bool create=true)
 
void Make_UV_Array_Unique (int pass, int stage)
 
void Make_Color_Array_Unique (int index)
 
void Post_Load_Process (bool enable_lighting=true, MeshModelClass *parent=NULL)
 
void Disable_Lighting (void)
 
bool Do_Mappers_Need_Normals (void)
 
- Public Member Functions inherited from W3DMPO
virtual ~W3DMPO ()
 

Static Public Attributes

static ShaderClass NullShader
 

Protected Member Functions

void Configure_Material (VertexMaterialClass *mtl, int pass, bool lighting_enabled)
 
void Disable_Backface_Culling (void)
 
void Delete_Pass (int pass)
 
- Protected Member Functions inherited from W3DMPO
virtual int glueEnforcer () const =0
 

Protected Attributes

int PassCount
 
int VertexCount
 
int PolyCount
 
UVBufferClassUV [MAX_UV_ARRAYS]
 
int UVSource [MAX_PASSES][MAX_TEX_STAGES]
 
ShareBufferClass< unsigned > * ColorArray [2]
 
VertexMaterialClass::ColorSourceType DCGSource [MAX_PASSES]
 
VertexMaterialClass::ColorSourceType DIGSource [MAX_PASSES]
 
TextureClassTexture [MAX_PASSES][MAX_TEX_STAGES]
 
ShaderClass Shader [MAX_PASSES]
 
VertexMaterialClassMaterial [MAX_PASSES]
 
TexBufferClassTextureArray [MAX_PASSES][MAX_TEX_STAGES]
 
MatBufferClassMaterialArray [MAX_PASSES]
 
ShareBufferClass< ShaderClass > * ShaderArray [MAX_PASSES]
 

Friends

class MeshModelClass
 

Detailed Description

MeshMatDescClass - This class encapsulates all of the material description data for a mesh. WARNING: The vertex count and polygon count MUST be kept in sync with the mesh

Definition at line 61 of file meshmatdesc.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_PASSES 
MAX_TEX_STAGES 
MAX_COLOR_ARRAYS 
MAX_UV_ARRAYS 

Definition at line 66 of file meshmatdesc.h.

Constructor & Destructor Documentation

◆ MeshMatDescClass() [1/2]

MeshMatDescClass::MeshMatDescClass ( void )

Definition at line 178 of file meshmatdesc.cpp.

◆ MeshMatDescClass() [2/2]

MeshMatDescClass::MeshMatDescClass ( const MeshMatDescClass & that)

Definition at line 207 of file meshmatdesc.cpp.

◆ ~MeshMatDescClass()

MeshMatDescClass::~MeshMatDescClass ( void )

Definition at line 295 of file meshmatdesc.cpp.

Member Function Documentation

◆ Configure_Material()

void MeshMatDescClass::Configure_Material ( VertexMaterialClass * mtl,
int pass,
bool lighting_enabled )
protected

Definition at line 941 of file meshmatdesc.cpp.

◆ Delete_Pass()

void MeshMatDescClass::Delete_Pass ( int pass)
protected

◆ Disable_Backface_Culling()

void MeshMatDescClass::Disable_Backface_Culling ( void )
inlineprotected

Definition at line 482 of file meshmatdesc.h.

◆ Disable_Lighting()

void MeshMatDescClass::Disable_Lighting ( void )

◆ Do_Mappers_Need_Normals()

bool MeshMatDescClass::Do_Mappers_Need_Normals ( void )

Definition at line 957 of file meshmatdesc.cpp.

◆ Get_Color_Array()

unsigned * MeshMatDescClass::Get_Color_Array ( int array,
bool create = true )
inline

Definition at line 433 of file meshmatdesc.h.

◆ Get_DCG_Array()

unsigned * MeshMatDescClass::Get_DCG_Array ( int pass)
inline

Definition at line 355 of file meshmatdesc.h.

◆ Get_DCG_Source()

VertexMaterialClass::ColorSourceType MeshMatDescClass::Get_DCG_Source ( int pass)
inline

Definition at line 423 of file meshmatdesc.h.

◆ Get_DIG_Array()

unsigned * MeshMatDescClass::Get_DIG_Array ( int pass)
inline

Definition at line 384 of file meshmatdesc.h.

◆ Get_DIG_Source()

VertexMaterialClass::ColorSourceType MeshMatDescClass::Get_DIG_Source ( int pass)
inline

Definition at line 428 of file meshmatdesc.h.

◆ Get_Material()

VertexMaterialClass * MeshMatDescClass::Get_Material ( int vidx,
int pass = 0 ) const

Definition at line 497 of file meshmatdesc.cpp.

◆ Get_Material_Array()

MatBufferClass * MeshMatDescClass::Get_Material_Array ( int pass,
bool create = true )

Definition at line 559 of file meshmatdesc.cpp.

◆ Get_Pass_Count()

int MeshMatDescClass::Get_Pass_Count ( void ) const
inline

Definition at line 91 of file meshmatdesc.h.

◆ Get_Polygon_Count()

int MeshMatDescClass::Get_Polygon_Count ( void ) const
inline

Definition at line 95 of file meshmatdesc.h.

◆ Get_Shader()

ShaderClass MeshMatDescClass::Get_Shader ( int pidx,
int pass = 0 ) const

Definition at line 512 of file meshmatdesc.cpp.

◆ Get_Shader_Array()

ShaderClass * MeshMatDescClass::Get_Shader_Array ( int pass,
bool create = true )

Definition at line 567 of file meshmatdesc.cpp.

◆ Get_Single_Material()

VertexMaterialClass * MeshMatDescClass::Get_Single_Material ( int pass = 0) const
inline

Definition at line 444 of file meshmatdesc.h.

◆ Get_Single_Shader()

ShaderClass MeshMatDescClass::Get_Single_Shader ( int pass = 0) const
inline

Definition at line 462 of file meshmatdesc.h.

◆ Get_Single_Texture()

TextureClass * MeshMatDescClass::Get_Single_Texture ( int pass = 0,
int stage = 0 ) const

Definition at line 300 of file meshmatdesc.cpp.

◆ Get_Texture()

TextureClass * MeshMatDescClass::Get_Texture ( int pidx,
int pass = 0,
int stage = 0 ) const

Definition at line 520 of file meshmatdesc.cpp.

◆ Get_Texture_Array()

TexBufferClass * MeshMatDescClass::Get_Texture_Array ( int pass,
int stage,
bool create = true )

Definition at line 551 of file meshmatdesc.cpp.

◆ Get_UV_Array()

Vector2 * MeshMatDescClass::Get_UV_Array ( int pass,
int stage )
inline

Definition at line 304 of file meshmatdesc.h.

◆ Get_UV_Array_By_Index()

Vector2 * MeshMatDescClass::Get_UV_Array_By_Index ( int index,
bool create = true )
inline

Definition at line 342 of file meshmatdesc.h.

◆ Get_UV_Array_Count()

int MeshMatDescClass::Get_UV_Array_Count ( void )
inline

Definition at line 333 of file meshmatdesc.h.

◆ Get_UV_Source()

int MeshMatDescClass::Get_UV_Source ( int pass,
int stage )
inline

Definition at line 324 of file meshmatdesc.h.

◆ Get_Vertex_Count()

int MeshMatDescClass::Get_Vertex_Count ( void ) const
inline

Definition at line 93 of file meshmatdesc.h.

◆ Has_Color_Array()

bool MeshMatDescClass::Has_Color_Array ( int array)
inline

Definition at line 149 of file meshmatdesc.h.

◆ Has_Material_Array()

bool MeshMatDescClass::Has_Material_Array ( int pass) const
inline

Definition at line 467 of file meshmatdesc.h.

◆ Has_Material_Data()

bool MeshMatDescClass::Has_Material_Data ( int pass)
inline

Definition at line 153 of file meshmatdesc.h.

◆ Has_Shader_Array()

bool MeshMatDescClass::Has_Shader_Array ( int pass) const
inline

Definition at line 472 of file meshmatdesc.h.

◆ Has_Shader_Data()

bool MeshMatDescClass::Has_Shader_Data ( int pass)
inline

Definition at line 152 of file meshmatdesc.h.

◆ Has_Texture_Array()

bool MeshMatDescClass::Has_Texture_Array ( int pass,
int stage ) const
inline

Definition at line 477 of file meshmatdesc.h.

◆ Has_Texture_Data()

bool MeshMatDescClass::Has_Texture_Data ( int pass,
int stage )
inline

Definition at line 151 of file meshmatdesc.h.

◆ Has_UV()

bool MeshMatDescClass::Has_UV ( int pass,
int stage )
inline

Definition at line 148 of file meshmatdesc.h.

◆ Init_Alternate()

void MeshMatDescClass::Init_Alternate ( MeshMatDescClass & def_mat_desc,
MeshMatDescClass & alternate_desc )

Definition at line 340 of file meshmatdesc.cpp.

◆ Install_UV_Array()

void MeshMatDescClass::Install_UV_Array ( int pass,
int stage,
Vector2 * uvs,
int count )

Definition at line 598 of file meshmatdesc.cpp.

◆ Is_Empty()

bool MeshMatDescClass::Is_Empty ( void )

Definition at line 439 of file meshmatdesc.cpp.

◆ Make_Color_Array_Unique()

void MeshMatDescClass::Make_Color_Array_Unique ( int index)

Definition at line 589 of file meshmatdesc.cpp.

◆ Make_UV_Array_Unique()

void MeshMatDescClass::Make_UV_Array_Unique ( int pass,
int stage )

Definition at line 579 of file meshmatdesc.cpp.

◆ operator=()

MeshMatDescClass & MeshMatDescClass::operator= ( const MeshMatDescClass & that)

Definition at line 243 of file meshmatdesc.cpp.

◆ Peek_Material()

VertexMaterialClass * MeshMatDescClass::Peek_Material ( int vidx,
int pass = 0 ) const

Definition at line 535 of file meshmatdesc.cpp.

◆ Peek_Single_Material()

VertexMaterialClass * MeshMatDescClass::Peek_Single_Material ( int pass = 0) const
inline

Definition at line 452 of file meshmatdesc.h.

◆ Peek_Single_Texture()

TextureClass * MeshMatDescClass::Peek_Single_Texture ( int pass = 0,
int stage = 0 ) const
inline

Definition at line 457 of file meshmatdesc.h.

◆ Peek_Texture()

TextureClass * MeshMatDescClass::Peek_Texture ( int pidx,
int pass = 0,
int stage = 0 ) const

Definition at line 543 of file meshmatdesc.cpp.

◆ Post_Load_Process()

void MeshMatDescClass::Post_Load_Process ( bool enable_lighting = true,
MeshModelClass * parent = NULL )

Definition at line 643 of file meshmatdesc.cpp.

◆ Reset()

void MeshMatDescClass::Reset ( int polycount,
int vertcount,
int passcount )

Definition at line 308 of file meshmatdesc.cpp.

◆ Set_DCG_Source()

void MeshMatDescClass::Set_DCG_Source ( int pass,
VertexMaterialClass::ColorSourceType source )
inline

Definition at line 413 of file meshmatdesc.h.

◆ Set_DIG_Source()

void MeshMatDescClass::Set_DIG_Source ( int pass,
VertexMaterialClass::ColorSourceType source )
inline

Definition at line 418 of file meshmatdesc.h.

◆ Set_Material()

void MeshMatDescClass::Set_Material ( int vidx,
VertexMaterialClass * vmat,
int pass = 0 )

Definition at line 479 of file meshmatdesc.cpp.

◆ Set_Pass_Count()

void MeshMatDescClass::Set_Pass_Count ( int passes)
inline

Definition at line 90 of file meshmatdesc.h.

◆ Set_Polygon_Count()

void MeshMatDescClass::Set_Polygon_Count ( int polycount)
inline

Definition at line 94 of file meshmatdesc.h.

◆ Set_Shader()

void MeshMatDescClass::Set_Shader ( int pidx,
ShaderClass shader,
int pass = 0 )

Definition at line 485 of file meshmatdesc.cpp.

◆ Set_Single_Material()

void MeshMatDescClass::Set_Single_Material ( VertexMaterialClass * vmat,
int pass = 0 )

Definition at line 464 of file meshmatdesc.cpp.

◆ Set_Single_Shader()

void MeshMatDescClass::Set_Single_Shader ( ShaderClass shader,
int pass = 0 )

Definition at line 474 of file meshmatdesc.cpp.

◆ Set_Single_Texture()

void MeshMatDescClass::Set_Single_Texture ( TextureClass * tex,
int pass = 0,
int stage = 0 )

Definition at line 469 of file meshmatdesc.cpp.

◆ Set_Texture()

void MeshMatDescClass::Set_Texture ( int pidx,
TextureClass * tex,
int pass = 0,
int stage = 0 )

Definition at line 491 of file meshmatdesc.cpp.

◆ Set_UV_Source()

void MeshMatDescClass::Set_UV_Source ( int pass,
int stage,
int sourceindex )
inline

Definition at line 315 of file meshmatdesc.h.

◆ Set_Vertex_Count()

void MeshMatDescClass::Set_Vertex_Count ( int vertcount)
inline

Definition at line 92 of file meshmatdesc.h.

Friends And Related Symbol Documentation

◆ MeshModelClass

friend class MeshModelClass
friend

Definition at line 222 of file meshmatdesc.h.

Member Data Documentation

◆ ColorArray

ShareBufferClass<unsigned>* MeshMatDescClass::ColorArray[2]
protected

Definition at line 208 of file meshmatdesc.h.

◆ DCGSource

VertexMaterialClass::ColorSourceType MeshMatDescClass::DCGSource[MAX_PASSES]
protected

Definition at line 209 of file meshmatdesc.h.

◆ DIGSource

VertexMaterialClass::ColorSourceType MeshMatDescClass::DIGSource[MAX_PASSES]
protected

Definition at line 210 of file meshmatdesc.h.

◆ Material

VertexMaterialClass* MeshMatDescClass::Material[MAX_PASSES]
protected

Definition at line 215 of file meshmatdesc.h.

◆ MaterialArray

MatBufferClass* MeshMatDescClass::MaterialArray[MAX_PASSES]
protected

Definition at line 219 of file meshmatdesc.h.

◆ NullShader

ShaderClass MeshMatDescClass::NullShader
static

Definition at line 190 of file meshmatdesc.h.

◆ PassCount

int MeshMatDescClass::PassCount
protected

Definition at line 198 of file meshmatdesc.h.

◆ PolyCount

int MeshMatDescClass::PolyCount
protected

Definition at line 200 of file meshmatdesc.h.

◆ Shader

ShaderClass MeshMatDescClass::Shader[MAX_PASSES]
protected

Definition at line 214 of file meshmatdesc.h.

◆ ShaderArray

ShareBufferClass<ShaderClass>* MeshMatDescClass::ShaderArray[MAX_PASSES]
protected

Definition at line 220 of file meshmatdesc.h.

◆ Texture

TextureClass* MeshMatDescClass::Texture[MAX_PASSES][MAX_TEX_STAGES]
protected

Definition at line 213 of file meshmatdesc.h.

◆ TextureArray

TexBufferClass* MeshMatDescClass::TextureArray[MAX_PASSES][MAX_TEX_STAGES]
protected

Definition at line 218 of file meshmatdesc.h.

◆ UV

UVBufferClass* MeshMatDescClass::UV[MAX_UV_ARRAYS]
protected

Definition at line 203 of file meshmatdesc.h.

◆ UVSource

int MeshMatDescClass::UVSource[MAX_PASSES][MAX_TEX_STAGES]
protected

Definition at line 204 of file meshmatdesc.h.

◆ VertexCount

int MeshMatDescClass::VertexCount
protected

Definition at line 199 of file meshmatdesc.h.


The documentation for this class was generated from the following files: