]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/compatibility.cpp
Rename members of visitors to indicate which are "return values"
[libs/gl.git] / source / glsl / compatibility.cpp
index a65f6de72fe1a3ddfe29be27edd8d563c9dde55a..9ed0d20c82c8b2a0ecc109c9db4adb55fff5040b 100644 (file)
@@ -17,7 +17,7 @@ DefaultPrecisionGenerator::DefaultPrecisionGenerator():
 void DefaultPrecisionGenerator::apply(Stage &s)
 {
        stage = &s;
-       visit(s.content);
+       s.content.visit(*this);
 }
 
 void DefaultPrecisionGenerator::visit(Block &block)
@@ -65,7 +65,7 @@ void DefaultPrecisionGenerator::visit(VariableDeclaration &var)
 
 void PrecisionRemover::apply(Stage &stage)
 {
-       visit(stage.content);
+       stage.content.visit(*this);
        NodeRemover().apply(stage, nodes_to_remove);
 }
 
@@ -90,7 +90,7 @@ void LegacyConverter::apply(Stage &s, const Features &feat)
        features = feat;
        if(!supports_stage(s.type))
                throw unsupported_shader(format("Stage %s is not supported", Stage::get_stage_name(s.type)));
-       visit(s.content);
+       s.content.visit(*this);
 }
 
 void LegacyConverter::visit(Block &block)
@@ -150,12 +150,12 @@ void LegacyConverter::visit(VariableReference &var)
        {
                var.name = "gl_FragColor";
                var.declaration = 0;
-               type = "vec4";
+               r_type = "vec4";
        }
        else if(var.declaration)
-               type = var.declaration->type;
+               r_type = var.declaration->type;
        else
-               type = string();
+               r_type.clear();
 }
 
 void LegacyConverter::visit(Assignment &assign)
@@ -178,12 +178,12 @@ void LegacyConverter::visit(FunctionCall &call)
        if(call.name=="texture")
        {
                string sampler_type;
-               type = string();
+               r_type.clear();
                NodeArray<Expression>::iterator i = call.arguments.begin();
                if(i!=call.arguments.end())
                {
                        (*i)->visit(*this);
-                       sampler_type = type;
+                       sampler_type = r_type;
 
                        for(; i!=call.arguments.end(); ++i)
                                (*i)->visit(*this);