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

#include <StdMeshMaterial.h>

Public Member Functions

 StdMeshMaterialShaderParameters ()
 
void Load (StdMeshMaterialParserCtx &ctx)
 
StdMeshMaterialShaderParameterAddParameter (const char *name, StdMeshMaterialShaderParameter::Type type)
 

Public Attributes

std::vector< std::pair
< StdCopyStrBuf,
StdMeshMaterialShaderParameter > > 
NamedParameters
 

Detailed Description

Definition at line 104 of file StdMeshMaterial.h.

Constructor & Destructor Documentation

StdMeshMaterialShaderParameters::StdMeshMaterialShaderParameters ( )

Definition at line 737 of file StdMeshMaterial.cpp.

738 {
739 }

Member Function Documentation

StdMeshMaterialShaderParameter & StdMeshMaterialShaderParameters::AddParameter ( const char *  name,
StdMeshMaterialShaderParameter::Type  type 
)

Definition at line 825 of file StdMeshMaterial.cpp.

References NamedParameters.

826 {
827  NamedParameters.push_back(std::make_pair(StdCopyStrBuf(name), StdMeshMaterialShaderParameter(type)));
828  return NamedParameters.back().second;
829 }
std::vector< std::pair< StdCopyStrBuf, StdMeshMaterialShaderParameter > > NamedParameters
void StdMeshMaterialShaderParameters::Load ( StdMeshMaterialParserCtx ctx)

Definition at line 795 of file StdMeshMaterial.cpp.

References StdMeshMaterialParserCtx::AdvanceNonEOF(), StdMeshMaterialParserCtx::AdvanceRequired(), StdMeshMaterialParserCtx::Error(), StdMeshMaterialParserCtx::ErrorUnexpectedIdentifier(), StdStrBuf::getData(), NamedParameters, TOKEN_BRACE_CLOSE, TOKEN_BRACE_OPEN, and TOKEN_IDTF.

796 {
797  StdStrBuf token_name;
798  ctx.AdvanceRequired(token_name, TOKEN_BRACE_OPEN);
799 
800  Token token;
801  while ((token = ctx.AdvanceNonEOF(token_name)) == TOKEN_IDTF)
802  {
803  if(token_name == "param_named")
804  {
805  StdStrBuf param_name;
806  ctx.AdvanceRequired(param_name, TOKEN_IDTF);
807  NamedParameters.push_back(std::make_pair(StdCopyStrBuf(param_name), LoadConstParameter(ctx)));
808  }
809  else if(token_name == "param_named_auto")
810  {
811  StdStrBuf param_name;
812  ctx.AdvanceRequired(param_name, TOKEN_IDTF);
813  NamedParameters.push_back(std::make_pair(StdCopyStrBuf(param_name), LoadAutoParameter(ctx)));
814  }
815  else
816  {
817  ctx.ErrorUnexpectedIdentifier(token_name);
818  }
819  }
820 
821  if (token != TOKEN_BRACE_CLOSE)
822  ctx.Error(StdCopyStrBuf("'") + token_name.getData() + "' unexpected");
823 }
const char * getData() const
Definition: StdBuf.h:450
Token AdvanceRequired(StdStrBuf &name, Token expect)
void ErrorUnexpectedIdentifier(const StdStrBuf &identifier)
void Error(const StdStrBuf &message)
Token AdvanceNonEOF(StdStrBuf &name)
std::vector< std::pair< StdCopyStrBuf, StdMeshMaterialShaderParameter > > NamedParameters

Here is the call graph for this function:

Member Data Documentation

std::vector<std::pair<StdCopyStrBuf, StdMeshMaterialShaderParameter> > StdMeshMaterialShaderParameters::NamedParameters

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