Made new Defocus node compile happily in MSVC
authorTon Roosendaal <ton@blender.org>
Thu, 21 Dec 2006 18:23:30 +0000 (18:23 +0000)
committerTon Roosendaal <ton@blender.org>
Thu, 21 Dec 2006 18:23:30 +0000 (18:23 +0000)
source/blender/blenkernel/intern/node_composite.c

index c21c2633698eb71248dad3e2dc087007eb6971d6..97f000a0272d6f85986116134679e79ba5f9a1c8 100644 (file)
@@ -3759,6 +3759,8 @@ static void defocus_blur(CompBuf* new, CompBuf* img, CompBuf* zbuf, float inpval
                                // sampled, simple rejection sampling here, good enough
                                unsigned int maxsam, s, ui = BLI_rand()*BLI_rand();
                                float cpr = BLI_frand();
                                // sampled, simple rejection sampling here, good enough
                                unsigned int maxsam, s, ui = BLI_rand()*BLI_rand();
                                float cpr = BLI_frand();
+                               float wcor;
+                               
                                if (nqd->no_zbuf)
                                        maxsam = nqd->samples;  // no zbuffer input, use sample value directly
                                else {
                                if (nqd->no_zbuf)
                                        maxsam = nqd->samples;  // no zbuffer input, use sample value directly
                                else {
@@ -3766,7 +3768,9 @@ static void defocus_blur(CompBuf* new, CompBuf* img, CompBuf* zbuf, float inpval
                                        maxsam = (int)(0.5f + nqd->samples*(1.f-(float)exp(-fabs(zbuf->rect[cp] - cam_fdist))));
                                        if (maxsam < 16) maxsam = 16;
                                }
                                        maxsam = (int)(0.5f + nqd->samples*(1.f-(float)exp(-fabs(zbuf->rect[cp] - cam_fdist))));
                                        if (maxsam < 16) maxsam = 16;
                                }
-                               float wcor = 1.f/(float)maxsam;
+                               
+                               wcor = 1.f/(float)maxsam;
+                               
                                for (s=0; s<maxsam; ++s) {
                                        u = ct_crad*(2.f*RI_vdC(s, ui) - 1.f);
                                        v = ct_crad*(2.f*(s + cpr)/(float)maxsam - 1.f);
                                for (s=0; s<maxsam; ++s) {
                                        u = ct_crad*(2.f*RI_vdC(s, ui) - 1.f);
                                        v = ct_crad*(2.f*(s + cpr)/(float)maxsam - 1.f);