diff --git a/app/node/value.h b/app/node/value.h index 6c8534a2a..345b7ed4d 100644 --- a/app/node/value.h +++ b/app/node/value.h @@ -195,13 +195,14 @@ public: { } - NodeValue(Type type, const QVariant& data, const Node* from = nullptr, bool array = false, const QString& tag = QString()) : + template + NodeValue(Type type, const T& data, const Node* from = nullptr, bool array = false, const QString& tag = QString()) : type_(type), - data_(data), from_(from), tag_(tag), array_(array) { + set_value(data); } Type type() const @@ -362,7 +363,8 @@ public: values_.append(value.values_); } - void Push(NodeValue::Type type, const QVariant& data, const Node *from, bool array = false, const QString& tag = QString()) + template + void Push(NodeValue::Type type, const T& data, const Node *from, bool array = false, const QString& tag = QString()) { Push(NodeValue(type, data, from, array, tag)); } @@ -372,7 +374,8 @@ public: values_.prepend(value); } - void Prepend(NodeValue::Type type, const QVariant& data, const Node *from, bool array = false, const QString& tag = QString()) + template + void Prepend(NodeValue::Type type, const T& data, const Node *from, bool array = false, const QString& tag = QString()) { Prepend(NodeValue(type, data, from, array, tag)); } diff --git a/app/render/renderer.cpp b/app/render/renderer.cpp index 2d75ae47f..bd18c725f 100644 --- a/app/render/renderer.cpp +++ b/app/render/renderer.cpp @@ -216,7 +216,7 @@ void Renderer::BlitColorManaged(const ColorTransformJob &color_job, Texture *des job.InsertValue(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(color_job.GetInputTexture()))); job.InsertValue(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, color_job.GetTransformMatrix())); job.InsertValue(QStringLiteral("ove_cropmatrix"), NodeValue(NodeValue::kMatrix, color_job.GetCropMatrix().inverted())); - job.InsertValue(QStringLiteral("ove_maintex_alpha"), NodeValue(NodeValue::kInt, color_job.GetInputAlphaAssociation())); + job.InsertValue(QStringLiteral("ove_maintex_alpha"), NodeValue(NodeValue::kInt, int(color_job.GetInputAlphaAssociation()))); job.InsertValue(color_job.GetValues()); job.SetAlphaChannelRequired(color_job.GetAlphaChannelRequired());