style cleanup: follow style guide for formatting of if/for/while loops, and else...
[blender.git] / source / blender / nodes / texture / nodes / node_texture_image.c
index 0acfe62ed82131d9d692e89f71d2013aff71db36..d0bc30089e2d2cb9cd3c93e10d1d2414be859da1 100644 (file)
@@ -45,9 +45,9 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(i
        Image *ima= (Image *)node->id;
        ImageUser *iuser= (ImageUser *)node->storage;
        
-       if( ima ) {
+       if ( ima ) {
                ImBuf *ibuf = BKE_image_get_ibuf(ima, iuser);
-               if( ibuf ) {
+               if ( ibuf ) {
                        float xsize, ysize;
                        float xoff, yoff;
                        int px, py;
@@ -61,19 +61,19 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(i
                        px = (int)( (x-xoff) * xsize );
                        py = (int)( (y-yoff) * ysize );
                
-                       if( (!xsize) || (!ysize) ) return;
+                       if ( (!xsize) || (!ysize) ) return;
                        
-                       if( !ibuf->rect_float ) {
+                       if ( !ibuf->rect_float ) {
                                BLI_lock_thread(LOCK_IMAGE);
-                               if( !ibuf->rect_float )
+                               if ( !ibuf->rect_float )
                                        IMB_float_from_rect(ibuf);
                                BLI_unlock_thread(LOCK_IMAGE);
                        }
                        
-                       while( px < 0 ) px += ibuf->x;
-                       while( py < 0 ) py += ibuf->y;
-                       while( px >= ibuf->x ) px -= ibuf->x;
-                       while( py >= ibuf->y ) py -= ibuf->y;
+                       while ( px < 0 ) px += ibuf->x;
+                       while ( py < 0 ) py += ibuf->y;
+                       while ( px >= ibuf->x ) px -= ibuf->x;
+                       while ( py >= ibuf->y ) py -= ibuf->y;
                        
                        result = ibuf->rect_float + py*ibuf->x*4 + px*4;
                        copy_v4_v4( out, result );