style cleanup: follow style guide for formatting of if/for/while loops, and else...
[blender.git] / source / blender / nodes / composite / nodes / node_composite_mapValue.c
index 6930fbf0664b67c4220d7417b013ceb8cd2f6173..2fd115261f8ddf473adbb8107b228d0f44f98abd 100644 (file)
@@ -47,11 +47,11 @@ static void do_map_value(bNode *node, float *out, float *src)
        TexMapping *texmap= node->storage;
        
        out[0]= (src[0] + texmap->loc[0])*texmap->size[0];
-       if(texmap->flag & TEXMAP_CLIP_MIN)
-               if(out[0]<texmap->min[0])
+       if (texmap->flag & TEXMAP_CLIP_MIN)
+               if (out[0]<texmap->min[0])
                        out[0]= texmap->min[0];
-       if(texmap->flag & TEXMAP_CLIP_MAX)
-               if(out[0]>texmap->max[0])
+       if (texmap->flag & TEXMAP_CLIP_MAX)
+               if (out[0]>texmap->max[0])
                        out[0]= texmap->max[0];
 }
 
@@ -59,10 +59,10 @@ static void node_composit_exec_map_value(void *UNUSED(data), bNode *node, bNodeS
 {
        /* stack order in: valbuf */
        /* stack order out: valbuf */
-       if(out[0]->hasoutput==0) return;
+       if (out[0]->hasoutput==0) return;
        
        /* input no image? then only value operation */
-       if(in[0]->data==NULL) {
+       if (in[0]->data==NULL) {
                do_map_value(node, out[0]->vec, in[0]->vec);
        }
        else {
@@ -82,20 +82,16 @@ static void node_composit_init_map_value(bNodeTree *UNUSED(ntree), bNode* node,
        node->storage= add_tex_mapping();
 }
 
-void register_node_type_cmp_map_value(ListBase *lb)
+void register_node_type_cmp_map_value(bNodeTreeType *ttype)
 {
        static bNodeType ntype;
 
-       node_type_base(&ntype, CMP_NODE_MAP_VALUE, "Map Value", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
+       node_type_base(ttype, &ntype, CMP_NODE_MAP_VALUE, "Map Value", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
        node_type_socket_templates(&ntype, cmp_node_map_value_in, cmp_node_map_value_out);
        node_type_size(&ntype, 100, 60, 150);
        node_type_init(&ntype, node_composit_init_map_value);
        node_type_storage(&ntype, "TexMapping", node_free_standard_storage, node_copy_standard_storage);
        node_type_exec(&ntype, node_composit_exec_map_value);
 
-       nodeRegisterType(lb, &ntype);
+       nodeRegisterType(ttype, &ntype);
 }
-
-
-
-