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:
Diffstat (limited to 'source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c')
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c b/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
index 062c6402fb6..a85022cffab 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
@@ -44,7 +44,7 @@ static bNodeSocketType sh_node_vect_math_out[]= {
{ -1, 0, "" }
};
-static void node_shader_exec_vect_math(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
+static void node_shader_exec_vect_math(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
float vec1[3], vec2[3];
@@ -101,7 +101,7 @@ static void node_shader_exec_vect_math(void *data, bNode *node, bNodeStack **in,
static int gpu_shader_vect_math(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
{
- static char *names[] = {"vec_math_add", "vec_math_sub",
+ static const char *names[] = {"vec_math_add", "vec_math_sub",
"vec_math_average", "vec_math_dot", "vec_math_cross",
"vec_math_normalize"};
@@ -127,21 +127,19 @@ static int gpu_shader_vect_math(GPUMaterial *mat, bNode *node, GPUNodeStack *in,
return 1;
}
-bNodeType sh_node_vect_math= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ SH_NODE_VECT_MATH,
- /* name */ "Vector Math",
- /* width+range */ 80, 75, 140,
- /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS,
- /* input sock */ sh_node_vect_math_in,
- /* output sock */ sh_node_vect_math_out,
- /* storage */ "node_vect_math",
- /* execfunc */ node_shader_exec_vect_math,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL, NULL, NULL,
- /* gpufunc */ gpu_shader_vect_math
-};
+void register_node_type_sh_vect_math(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, SH_NODE_VECT_MATH, "Vector Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS,
+ sh_node_vect_math_in, sh_node_vect_math_out);
+ node_type_size(&ntype, 80, 75, 140);
+ node_type_label(&ntype, node_vect_math_label);
+ node_type_storage(&ntype, "node_vect_math", NULL, NULL);
+ node_type_exec(&ntype, node_shader_exec_vect_math);
+ node_type_gpu(&ntype, gpu_shader_vect_math);
+
+ nodeRegisterType(lb, &ntype);
+}
+