mirror of https://github.com/axmolengine/axmol.git
RenderState can be part of Material and Technique
This commit is contained in:
parent
7bf550f38b
commit
aeea7ade14
|
@ -133,9 +133,14 @@ bool Material::parseProperties(Properties* materialProperties)
|
|||
while (space)
|
||||
{
|
||||
const char* name = space->getNamespace();
|
||||
if (strcmp(name, "technique") == 0) {
|
||||
if (strcmp(name, "technique") == 0)
|
||||
{
|
||||
parseTechnique(space);
|
||||
}
|
||||
else if (strcmp(name, "renderState") == 0)
|
||||
{
|
||||
parseRenderState(this, space);
|
||||
}
|
||||
|
||||
space = materialProperties->getNextNamespace();
|
||||
|
||||
|
@ -161,9 +166,14 @@ bool Material::parseTechnique(Properties* techniqueProperties)
|
|||
while (space)
|
||||
{
|
||||
const char* name = space->getNamespace();
|
||||
if (strcmp(name, "pass") == 0) {
|
||||
if (strcmp(name, "pass") == 0)
|
||||
{
|
||||
parsePass(technique, space);
|
||||
}
|
||||
else if (strcmp(name, "renderState") == 0)
|
||||
{
|
||||
parseRenderState(this, space);
|
||||
}
|
||||
|
||||
space = techniqueProperties->getNextNamespace();
|
||||
}
|
||||
|
@ -371,9 +381,9 @@ bool Material::parseUniform(GLProgramState* programState, Properties* properties
|
|||
}
|
||||
|
||||
|
||||
bool Material::parseRenderState(Pass* pass, Properties* properties)
|
||||
bool Material::parseRenderState(RenderState* renderState, Properties* properties)
|
||||
{
|
||||
auto state = pass->getStateBlock();
|
||||
auto state = renderState->getStateBlock();
|
||||
|
||||
auto property = properties->getNextProperty();
|
||||
while (property)
|
||||
|
|
|
@ -134,7 +134,7 @@ protected:
|
|||
bool parseSampler(Pass* pass, Properties* properties);
|
||||
bool parseShader(Pass* pass, Properties* properties);
|
||||
bool parseUniform(GLProgramState* programState, Properties* properties, const char* uniformName);
|
||||
bool parseRenderState(Pass* pass, Properties* properties);
|
||||
bool parseRenderState(RenderState* renderState, Properties* properties);
|
||||
|
||||
|
||||
// material name
|
||||
|
|
Loading…
Reference in New Issue