style cleanup: follow style guide for formatting of if/for/while loops, and else...
[blender.git] / source / blender / nodes / composite / nodes / node_composite_texture.c
index 24d7b30f11d1efb3c4a726fa950ae46d696d5de5..562e2b2737e79476b1287903c15e66f385329c17 100644 (file)
@@ -60,19 +60,19 @@ static void texture_procedural(CompBuf *cbuf, float *out, float xco, float yco)
        
        retval= multitex_ext((Tex *)node->id, vec, NULL, NULL, 0, &texres);
        
-       if(type==CB_VAL) {
-               if(texres.talpha)
+       if (type==CB_VAL) {
+               if (texres.talpha)
                        col[0]= texres.ta;
                else
                        col[0]= texres.tin;
        }
-       else if(type==CB_RGBA) {
-               if(texres.talpha)
+       else if (type==CB_RGBA) {
+               if (texres.talpha)
                        col[3]= texres.ta;
                else
                        col[3]= texres.tin;
                
-               if((retval & TEX_RGB)) {
+               if ((retval & TEX_RGB)) {
                        col[0]= texres.tr;
                        col[1]= texres.tg;
                        col[2]= texres.tb;
@@ -80,7 +80,7 @@ static void texture_procedural(CompBuf *cbuf, float *out, float xco, float yco)
                else col[0]= col[1]= col[2]= col[3];
        }
        else { 
-               VECCOPY(col, nor);
+               copy_v3_v3(col, nor);
        }
        
        typecheck_compbuf_color(out, col, cbuf->type, cbuf->procedural_type);
@@ -92,7 +92,7 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
 {
        /* outputs: value, color, normal */
        
-       if(node->id) {
+       if (node->id) {
                RenderData *rd= data;
                short sizex, sizey;
                
@@ -101,8 +101,8 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
 
                prevbuf->rect_procedural= texture_procedural;
                prevbuf->node= node;
-               VECCOPY(prevbuf->procedural_offset, in[0]->vec);
-               VECCOPY(prevbuf->procedural_size, in[1]->vec);
+               copy_v3_v3(prevbuf->procedural_offset, in[0]->vec);
+               copy_v3_v3(prevbuf->procedural_size, in[1]->vec);
                prevbuf->procedural_type= CB_RGBA;
                composit1_pixel_processor(node, prevbuf, prevbuf, out[0]->vec, do_copy_rgba, CB_RGBA);
                
@@ -113,26 +113,26 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
                sizex = (rd->size*rd->xsch)/100;
                sizey = (rd->size*rd->ysch)/100;
                
-               if(out[0]->hasoutput) {
+               if (out[0]->hasoutput) {
                        CompBuf *stackbuf= alloc_compbuf(sizex, sizey, CB_VAL, 1); /* alloc */
                        
                        stackbuf->rect_procedural= texture_procedural;
                        stackbuf->node= node;
-                       VECCOPY(stackbuf->procedural_offset, in[0]->vec);
-                       VECCOPY(stackbuf->procedural_size, in[1]->vec);
+                       copy_v3_v3(stackbuf->procedural_offset, in[0]->vec);
+                       copy_v3_v3(stackbuf->procedural_size, in[1]->vec);
                        stackbuf->procedural_type= CB_VAL;
                        composit1_pixel_processor(node, stackbuf, stackbuf, out[0]->vec, do_copy_value, CB_VAL);
                        stackbuf->rect_procedural= NULL;
                        
                        out[0]->data= stackbuf; 
                }
-               if(out[1]->hasoutput) {
+               if (out[1]->hasoutput) {
                        CompBuf *stackbuf= alloc_compbuf(sizex, sizey, CB_RGBA, 1); /* alloc */
                        
                        stackbuf->rect_procedural= texture_procedural;
                        stackbuf->node= node;
-                       VECCOPY(stackbuf->procedural_offset, in[0]->vec);
-                       VECCOPY(stackbuf->procedural_size, in[1]->vec);
+                       copy_v3_v3(stackbuf->procedural_offset, in[0]->vec);
+                       copy_v3_v3(stackbuf->procedural_size, in[1]->vec);
                        stackbuf->procedural_type= CB_RGBA;
                        composit1_pixel_processor(node, stackbuf, stackbuf, out[0]->vec, do_copy_rgba, CB_RGBA);
                        stackbuf->rect_procedural= NULL;
@@ -142,17 +142,14 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
        }
 }
 
-void register_node_type_cmp_texture(ListBase *lb)
+void register_node_type_cmp_texture(bNodeTreeType *ttype)
 {
        static bNodeType ntype;
 
-       node_type_base(&ntype, CMP_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
+       node_type_base(ttype, &ntype, CMP_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
        node_type_socket_templates(&ntype, cmp_node_texture_in, cmp_node_texture_out);
        node_type_size(&ntype, 120, 80, 240);
        node_type_exec(&ntype, node_composit_exec_texture);
 
-       nodeRegisterType(lb, &ntype);
+       nodeRegisterType(ttype, &ntype);
 }
-
-
-