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
 

Detailed Description

Definition at line 477 of file StdMeshMaterial.h.

Constructor & Destructor Documentation

StdMeshMaterialTechnique::StdMeshMaterialTechnique ( )

Definition at line 1445 of file StdMeshMaterial.cpp.

1445  :
1446  Available(false)
1447 {
1448 }

Member Function Documentation

bool StdMeshMaterialTechnique::IsOpaque ( ) const

Definition at line 1469 of file StdMeshMaterial.cpp.

References Passes.

1470 {
1471  // Technique is opaque if one of the passes is opaque (subsequent
1472  // non-opaque passes will just depend on the opaque value drawn in
1473  // the previous pass; total result will not depend on original
1474  // frame buffer value).
1475  for(unsigned int i = 0; i < Passes.size(); ++i)
1476  if(Passes[i].IsOpaque())
1477  return true;
1478  return false;
1479 }
std::vector< StdMeshMaterialPass > Passes
void StdMeshMaterialTechnique::Load ( StdMeshMaterialParserCtx ctx)

Definition at line 1450 of file StdMeshMaterial.cpp.

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

1451 {
1452  Token token;
1453  StdCopyStrBuf token_name;
1454  StdMeshMaterialSubLoader pass_loader;
1455  while ((token = ctx.AdvanceNonEOF(token_name)) == TOKEN_IDTF)
1456  {
1457  if (token_name == "pass")
1458  {
1459  pass_loader.Load(ctx, Passes);
1460  }
1461  else
1462  ctx.ErrorUnexpectedIdentifier(token_name);
1463  }
1464 
1465  if (token != TOKEN_BRACE_CLOSE)
1466  ctx.Error(StdCopyStrBuf("'") + token_name.getData() + "' unexpected");
1467 }
const char * getData() const
Definition: StdBuf.h:450
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

Definition at line 491 of file StdMeshMaterial.h.

Referenced by CStdGL::PrepareMaterial().

StdCopyStrBuf StdMeshMaterialTechnique::Name

Definition at line 486 of file StdMeshMaterial.h.

Referenced by CStdGL::PrepareMaterial().

std::vector<StdMeshMaterialPass> StdMeshMaterialTechnique::Passes

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