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_normal.c')
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_normal.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_normal.c b/source/blender/nodes/intern/SHD_nodes/SHD_normal.c
index eb3786286ae..ccbf80edeb7 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_normal.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_normal.c
@@ -42,7 +42,7 @@ static bNodeSocketType sh_node_normal_out[]= {
};
/* generates normal, does dot product */
-static void node_shader_exec_normal(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
+static void node_shader_exec_normal(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
bNodeSocket *sock= node->outputs.first;
float vec[3];
@@ -65,21 +65,14 @@ static int gpu_shader_normal(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GP
return GPU_stack_link(mat, "normal", in, out, vec);
}
-bNodeType sh_node_normal= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ SH_NODE_NORMAL,
- /* name */ "Normal",
- /* width+range */ 100, 60, 200,
- /* class+opts */ NODE_CLASS_OP_VECTOR, NODE_OPTIONS,
- /* input sock */ sh_node_normal_in,
- /* output sock */ sh_node_normal_out,
- /* storage */ "",
- /* execfunc */ node_shader_exec_normal,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL, NULL, NULL,
- /* gpufunc */ gpu_shader_normal
-};
-
+void register_node_type_sh_normal(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, SH_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, NODE_OPTIONS,
+ sh_node_normal_in, sh_node_normal_out);
+ node_type_exec(&ntype, node_shader_exec_normal);
+ node_type_gpu(&ntype, gpu_shader_normal);
+
+ nodeRegisterType(lb, &ntype);
+}