nodevalue: further qvariant abstraction

This commit is contained in:
itsmattkc
2022-05-09 14:56:32 -07:00
parent bb0fedabba
commit 7af12bda95
2 changed files with 8 additions and 5 deletions
+7 -4
View File
@@ -195,13 +195,14 @@ public:
{
}
NodeValue(Type type, const QVariant& data, const Node* from = nullptr, bool array = false, const QString& tag = QString()) :
template <typename T>
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 <typename T>
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 <typename T>
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));
}
+1 -1
View File
@@ -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());