removed all dependence on NodeOutputs
If Nodes only have the one output, we don't need to do so much differentiation between them. Previous iteration used outputs as like a distinct function within a Node (e.g. length output would return one result, buffer output would produce a different result - each run different code to produce their results). Now in this iteration, it's more accurate to say a Node is just one function (which seems more appropriate for a node system anyway).
This commit is contained in:
@@ -26,9 +26,6 @@ SolidGenerator::SolidGenerator() :
|
||||
color_input_ = new NodeInput("color_in");
|
||||
color_input_->set_data_type(NodeParam::kColor);
|
||||
AddParameter(color_input_);
|
||||
|
||||
texture_output_ = new NodeOutput("tex_out");
|
||||
AddParameter(texture_output_);
|
||||
}
|
||||
|
||||
Node *SolidGenerator::copy() const
|
||||
@@ -56,23 +53,14 @@ QString SolidGenerator::Description() const
|
||||
return tr("Generate a solid color.");
|
||||
}
|
||||
|
||||
NodeOutput *SolidGenerator::texture_output() const
|
||||
QString SolidGenerator::Code() const
|
||||
{
|
||||
return texture_output_;
|
||||
}
|
||||
|
||||
QString SolidGenerator::Code(NodeOutput *output) const
|
||||
{
|
||||
if (output == texture_output()) {
|
||||
// FIXME: Not color managed
|
||||
return "#version 110\n"
|
||||
"\n"
|
||||
"uniform vec4 color_in;\n"
|
||||
"\n"
|
||||
"void main(void) {\n"
|
||||
" gl_FragColor = color_in;\n"
|
||||
"}\n";
|
||||
}
|
||||
|
||||
return Node::Code(output);
|
||||
// FIXME: Not color managed
|
||||
return "#version 110\n"
|
||||
"\n"
|
||||
"uniform vec4 color_in;\n"
|
||||
"\n"
|
||||
"void main(void) {\n"
|
||||
" gl_FragColor = color_in;\n"
|
||||
"}\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user