]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/resolve.cpp
Leave no-op constructors as they are
[libs/gl.git] / source / glsl / resolve.cpp
index bf32326f249defc16224efb11b10ed3a5a6c7244..2b18c84b653bbbc1195f30a69c362137ec5754db 100644 (file)
@@ -293,6 +293,7 @@ void VariableResolver::visit(MemberAccess &memacc)
                if(i!=strct->members.variables.end())
                {
                        declaration = i->second;
+                       index = 0;
                        for(NodeList<Statement>::const_iterator j=strct->members.body.begin(); (j!=strct->members.body.end() && j->get()!=i->second); ++j)
                                ++index;
 
@@ -882,6 +883,8 @@ void ExpressionResolver::visit_constructor(FunctionCall &call)
        map<string, TypeDeclaration *>::const_iterator i = stage->types.find(call.name);
        if(i==stage->types.end())
                return;
+       else if(call.arguments.size()==1 && i->second==call.arguments[0]->type)
+               ;
        else if(BasicTypeDeclaration *basic = dynamic_cast<BasicTypeDeclaration *>(i->second))
        {
                BasicTypeDeclaration *elem = get_element_type(*basic);