OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
StdMeshMaterial Class Reference

#include <StdMeshMaterial.h>

Collaboration diagram for StdMeshMaterial:
[legend]

Public Member Functions

 StdMeshMaterial ()
 
void Load (StdMeshMaterialParserCtx &ctx)
 
bool IsOpaque () const
 

Public Attributes

StdCopyStrBuf FileName
 
unsigned int Line
 
StdCopyStrBuf Name
 
bool ReceiveShadows
 
std::vector
< StdMeshMaterialTechnique
Techniques
 
int BestTechniqueIndex
 

Detailed Description

Definition at line 494 of file StdMeshMaterial.h.

Constructor & Destructor Documentation

StdMeshMaterial::StdMeshMaterial ( )

Definition at line 1481 of file StdMeshMaterial.cpp.

1481  :
1482  Line(0), ReceiveShadows(true), BestTechniqueIndex(-1)
1483 {
1484 }
unsigned int Line

Member Function Documentation

bool StdMeshMaterial::IsOpaque ( ) const
inline

Definition at line 500 of file StdMeshMaterial.h.

References BestTechniqueIndex, and Techniques.

Referenced by StdSubMeshInstance::SetFaceOrderingForClrModulation().

500 { assert(BestTechniqueIndex >= 0); return Techniques[BestTechniqueIndex].IsOpaque(); }
std::vector< StdMeshMaterialTechnique > Techniques

Here is the caller graph for this function:

void StdMeshMaterial::Load ( StdMeshMaterialParserCtx ctx)

Definition at line 1486 of file StdMeshMaterial.cpp.

References StdMeshMaterialParserCtx::AdvanceBoolean(), StdMeshMaterialParserCtx::AdvanceNonEOF(), StdMeshMaterialParserCtx::Error(), StdMeshMaterialParserCtx::ErrorUnexpectedIdentifier(), StdStrBuf::getData(), StdMeshMaterialSubLoader::Load(), ReceiveShadows, Techniques, TOKEN_BRACE_CLOSE, and TOKEN_IDTF.

Referenced by StdMeshMatManager::Parse().

1487 {
1488  Token token;
1489  StdCopyStrBuf token_name;
1490  StdMeshMaterialSubLoader technique_loader;
1491  while ((token = ctx.AdvanceNonEOF(token_name)) == TOKEN_IDTF)
1492  {
1493  if (token_name == "technique")
1494  {
1495  technique_loader.Load(ctx, Techniques);
1496  }
1497  else if (token_name == "receive_shadows")
1498  {
1500  }
1501  else
1502  ctx.ErrorUnexpectedIdentifier(token_name);
1503  }
1504 
1505  if (token != TOKEN_BRACE_CLOSE)
1506  ctx.Error(StdCopyStrBuf("'") + token_name.getData() + "' unexpected");
1507 }
const char * getData() const
Definition: StdBuf.h:450
void ErrorUnexpectedIdentifier(const StdStrBuf &identifier)
void Error(const StdStrBuf &message)
Token AdvanceNonEOF(StdStrBuf &name)
void Load(StdMeshMaterialParserCtx &ctx, std::vector< SubT > &vec)
std::vector< StdMeshMaterialTechnique > Techniques

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

StdCopyStrBuf StdMeshMaterial::FileName

Definition at line 503 of file StdMeshMaterial.h.

Referenced by StdMeshMatManager::Parse().

unsigned int StdMeshMaterial::Line

Definition at line 504 of file StdMeshMaterial.h.

Referenced by StdMeshMatManager::Parse().

StdCopyStrBuf StdMeshMaterial::Name
bool StdMeshMaterial::ReceiveShadows

Definition at line 511 of file StdMeshMaterial.h.

Referenced by Load().


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