OpenClonk
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< StdMeshMaterialTechniqueTechniques
 
int BestTechniqueIndex {-1}
 

Detailed Description

Definition at line 491 of file StdMeshMaterial.h.

Constructor & Destructor Documentation

◆ StdMeshMaterial()

StdMeshMaterial::StdMeshMaterial ( )
default

Member Function Documentation

◆ IsOpaque()

bool StdMeshMaterial::IsOpaque ( ) const
inline

Definition at line 497 of file StdMeshMaterial.h.

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

References BestTechniqueIndex, and Techniques.

Referenced by StdSubMeshInstance::SetFaceOrderingForClrModulation().

Here is the caller graph for this function:

◆ Load()

void StdMeshMaterial::Load ( StdMeshMaterialParserCtx ctx)

Definition at line 1460 of file StdMeshMaterial.cpp.

1461 {
1462  Token token;
1463  StdCopyStrBuf token_name;
1464  StdMeshMaterialSubLoader technique_loader;
1465  while ((token = ctx.AdvanceNonEOF(token_name)) == TOKEN_IDTF)
1466  {
1467  if (token_name == "technique")
1468  {
1469  technique_loader.Load(ctx, Techniques);
1470  }
1471  else if (token_name == "receive_shadows")
1472  {
1474  }
1475  else
1476  ctx.ErrorUnexpectedIdentifier(token_name);
1477  }
1478 
1479  if (token != TOKEN_BRACE_CLOSE)
1480  ctx.Error(StdCopyStrBuf("'") + token_name.getData() + "' unexpected");
1481 }
@ TOKEN_IDTF
@ TOKEN_BRACE_CLOSE
void Error(const StdStrBuf &message)
void ErrorUnexpectedIdentifier(const StdStrBuf &identifier)
Token AdvanceNonEOF(StdStrBuf &name)
void Load(StdMeshMaterialParserCtx &ctx, std::vector< SubT > &vec)
const char * getData() const
Definition: StdBuf.h:442

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

Referenced by StdMeshMatManager::Parse().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ BestTechniqueIndex

int StdMeshMaterial::BestTechniqueIndex {-1}

◆ FileName

StdCopyStrBuf StdMeshMaterial::FileName

Definition at line 500 of file StdMeshMaterial.h.

Referenced by StdMeshMatManager::Parse().

◆ Line

unsigned int StdMeshMaterial::Line {0}

Definition at line 501 of file StdMeshMaterial.h.

Referenced by StdMeshMatManager::Parse().

◆ Name

StdCopyStrBuf StdMeshMaterial::Name

◆ ReceiveShadows

bool StdMeshMaterial::ReceiveShadows {true}

Definition at line 508 of file StdMeshMaterial.h.

◆ Techniques

std::vector<StdMeshMaterialTechnique> StdMeshMaterial::Techniques

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