Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Emara <mail@OmarEmara.dev>2022-09-02 19:12:31 +0300
committerOmar Emara <mail@OmarEmara.dev>2022-09-02 19:12:31 +0300
commit719a0378ae83727c0d48975eb42224db66e03182 (patch)
tree9ed7a84f4b9bca0e7bb0fb7d032da2fe00619004 /source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc
parent49ca810bf302fdf48e37527d1f8d160fcbd958d2 (diff)
Cleanup: Use NODE_STORAGE_FUNCS for compositor nodes
This patches replaces the custom node storage acessor functions from the viewport compositor code and replaces it with NODE_STORAGE_FUNCS.
Diffstat (limited to 'source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc')
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc b/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc
index 2ea83340c2b..e5ce87169d4 100644
--- a/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc
+++ b/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc
@@ -22,6 +22,8 @@
namespace blender::nodes::node_composite_chroma_matte_cc {
+NODE_STORAGE_FUNCS(NodeChroma)
+
static void cmp_node_chroma_matte_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>(N_("Image"))
@@ -86,24 +88,19 @@ class ChromaMatteShaderNode : public ShaderNode {
GPU_uniform(&falloff));
}
- const NodeChroma *get_node_chroma()
- {
- return static_cast<const NodeChroma *>(bnode().storage);
- }
-
float get_acceptance()
{
- return std::tan(get_node_chroma()->t1) / 2.0f;
+ return std::tan(node_storage(bnode()).t1) / 2.0f;
}
float get_cutoff()
{
- return get_node_chroma()->t2;
+ return node_storage(bnode()).t2;
}
float get_falloff()
{
- return get_node_chroma()->fstrength;
+ return node_storage(bnode()).fstrength;
}
};