Making Blender compile for C90 standard, var declared after code :)
authorTon Roosendaal <ton@blender.org>
Wed, 6 Jul 2011 11:44:27 +0000 (11:44 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 6 Jul 2011 11:44:27 +0000 (11:44 +0000)
Also cleaned a line of code that was horribly spread over 4 lines.

source/blender/nodes/intern/TEX_nodes/TEX_texture.c

index 51c7c0ed341109ef25e8ae3bd794320a688a58bc..f0bc2bd4a7c67edc3fdbb210fb0792e0623e97ef 100644 (file)
@@ -49,6 +49,7 @@ static bNodeSocketType outputs[]= {
 
 static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
 {
+       Tex *nodetex = (Tex *)node->id;
        static float red[] = {1,0,0,1};
        static float white[] = {1,1,1,1};
        float co[3], dxt[3], dyt[3];
@@ -57,14 +58,9 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
        copy_v3_v3(dxt, p->dxt);
        copy_v3_v3(dyt, p->dyt);
        
-       Tex *nodetex = (Tex *)node->id;
-       
        if(node->custom2 || node->need_exec==0) {
                /* this node refers to its own texture tree! */
-               QUATCOPY(
-                       out,
-                       (fabs(co[0] - co[1]) < .01) ? white : red 
-               );
+               QUATCOPY(out, (fabs(co[0] - co[1]) < .01) ? white : red ;
        }
        else if(nodetex) {
                TexResult texres;