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

#include <StdMeshMaterial.h>

Collaboration diagram for StdMeshMaterialTechnique:
[legend]

Public Member Functions

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

Public Attributes

StdCopyStrBuf Name
 
std::vector< StdMeshMaterialPassPasses
 
bool Available {false}
 

Detailed Description

Definition at line 474 of file StdMeshMaterial.h.

Constructor & Destructor Documentation

StdMeshMaterialTechnique::StdMeshMaterialTechnique ( )
default

Member Function Documentation

bool StdMeshMaterialTechnique::IsOpaque ( ) const

Definition at line 1445 of file StdMeshMaterial.cpp.

1446 {
1447  // Technique is opaque if one of the passes is opaque (subsequent
1448  // non-opaque passes will just depend on the opaque value drawn in
1449  // the previous pass; total result will not depend on original
1450  // frame buffer value).
1451  for(const auto & Pass : Passes)
1452  if(Pass.IsOpaque())
1453  return true;
1454  return false;
1455 }
std::vector< StdMeshMaterialPass > Passes
void StdMeshMaterialTechnique::Load ( StdMeshMaterialParserCtx ctx)

Definition at line 1426 of file StdMeshMaterial.cpp.

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

1427 {
1428  Token token;
1429  StdCopyStrBuf token_name;
1430  StdMeshMaterialSubLoader pass_loader;
1431  while ((token = ctx.AdvanceNonEOF(token_name)) == TOKEN_IDTF)
1432  {
1433  if (token_name == "pass")
1434  {
1435  pass_loader.Load(ctx, Passes);
1436  }
1437  else
1438  ctx.ErrorUnexpectedIdentifier(token_name);
1439  }
1440 
1441  if (token != TOKEN_BRACE_CLOSE)
1442  ctx.Error(StdCopyStrBuf("'") + token_name.getData() + "' unexpected");
1443 }
const char * getData() const
Definition: StdBuf.h:442
void ErrorUnexpectedIdentifier(const StdStrBuf &identifier)
void Error(const StdStrBuf &message)
Token AdvanceNonEOF(StdStrBuf &name)
std::vector< StdMeshMaterialPass > Passes
void Load(StdMeshMaterialParserCtx &ctx, std::vector< SubT > &vec)

Here is the call graph for this function:

Member Data Documentation

bool StdMeshMaterialTechnique::Available {false}

Definition at line 488 of file StdMeshMaterial.h.

Referenced by CStdGL::PrepareMaterial().

StdCopyStrBuf StdMeshMaterialTechnique::Name

Definition at line 483 of file StdMeshMaterial.h.

Referenced by CStdGL::PrepareMaterial().

std::vector<StdMeshMaterialPass> StdMeshMaterialTechnique::Passes

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