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 {0}
 
StdCopyStrBuf Name
 
bool ReceiveShadows {true}
 
std::vector
< StdMeshMaterialTechnique
Techniques
 
int BestTechniqueIndex {-1}
 

Detailed Description

Definition at line 491 of file StdMeshMaterial.h.

Constructor & Destructor Documentation

StdMeshMaterial::StdMeshMaterial ( )
default

Member Function Documentation

bool StdMeshMaterial::IsOpaque ( ) const
inline

Definition at line 497 of file StdMeshMaterial.h.

References BestTechniqueIndex, and Techniques.

Referenced by StdSubMeshInstance::SetFaceOrderingForClrModulation().

497 { 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 1459 of file StdMeshMaterial.cpp.

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

Referenced by StdMeshMatManager::Parse().

1460 {
1461  Token token;
1462  StdCopyStrBuf token_name;
1463  StdMeshMaterialSubLoader technique_loader;
1464  while ((token = ctx.AdvanceNonEOF(token_name)) == TOKEN_IDTF)
1465  {
1466  if (token_name == "technique")
1467  {
1468  technique_loader.Load(ctx, Techniques);
1469  }
1470  else if (token_name == "receive_shadows")
1471  {
1473  }
1474  else
1475  ctx.ErrorUnexpectedIdentifier(token_name);
1476  }
1477 
1478  if (token != TOKEN_BRACE_CLOSE)
1479  ctx.Error(StdCopyStrBuf("'") + token_name.getData() + "' unexpected");
1480 }
const char * getData() const
Definition: StdBuf.h:442
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

int StdMeshMaterial::BestTechniqueIndex {-1}
StdCopyStrBuf StdMeshMaterial::FileName

Definition at line 500 of file StdMeshMaterial.h.

Referenced by StdMeshMatManager::Parse().

unsigned int StdMeshMaterial::Line {0}

Definition at line 501 of file StdMeshMaterial.h.

Referenced by StdMeshMatManager::Parse().

StdCopyStrBuf StdMeshMaterial::Name
bool StdMeshMaterial::ReceiveShadows {true}

Definition at line 508 of file StdMeshMaterial.h.

std::vector<StdMeshMaterialTechnique> StdMeshMaterial::Techniques

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