]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/output.cpp
Properly resolve arithmetic assignment operators
[libs/gl.git] / source / glsl / output.cpp
index 72af837958e77a712196b97cc9279258e8c08555..d44dbff99de3f1c0e6b59f244169ff18072f61d9 100644 (file)
@@ -243,7 +243,10 @@ void Formatter::visit(VariableDeclaration &var)
        }
        if(!var.precision.empty())
                append(format("%s ", var.precision));
-       append(format("%s %s", var.type, var.name));
+       string type_name = var.type_declaration->name;
+       if(var.array)
+               type_name = type_name.substr(0, type_name.find('['));
+       append(format("%s %s", type_name, var.name));
        if(var.array)
        {
                append('[');
@@ -277,7 +280,7 @@ void Formatter::visit(InterfaceBlock &iface)
 
 void Formatter::visit(FunctionDeclaration &func)
 {
-       append(format("%s %s(", func.return_type, func.name));
+       append(format("%s %s(", func.return_type_declaration->name, func.name));
        for(NodeArray<VariableDeclaration>::iterator i=func.parameters.begin(); i!=func.parameters.end(); ++i)
        {
                if(i!=func.parameters.begin())