quiet double-promotion warnings, change octree.cpp to use a float (vector accumulated...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 6 Aug 2013 06:38:52 +0000 (06:38 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 6 Aug 2013 06:38:52 +0000 (06:38 +0000)
intern/dualcon/intern/octree.cpp
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/drawvolume.c

index 3ba396b940d19e32304ffd81ebaf32831e9ce989..bd7194cf3fd0603fa837a97437d5e3d64bbb462a 100644 (file)
@@ -2182,7 +2182,7 @@ static void minimize(float rvalue[3], float mp[3], const float pts[12][3],
                        ata[4] += (float)(norm[1] * norm[2]);
                        ata[5] += (float)(norm[2] * norm[2]);
 
-                       double pn = p[0] * norm[0] + p[1] * norm[1] + p[2] * norm[2];
+                       const float pn = p[0] * norm[0] + p[1] * norm[1] + p[2] * norm[2];
 
                        atb[0] += (float)(norm[0] * pn);
                        atb[1] += (float)(norm[1] * pn);
index f3105284a39e94bb01e2319b645c58f478d1ba9d..d5d5c48fb466c9b99c27583916f1ab546da3b968 100644 (file)
@@ -7056,12 +7056,12 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
                                /* set dynamic boundaries to draw the volume
                                 * also scale cube to global space to equalize volume slicing on all axises
                                 *  (its scaled back before drawing) */
-                               p0[0] = (sds->p0[0] + sds->cell_size[0] * sds->res_min[0] + sds->obj_shift_f[0]) * fabs(ob->size[0]);
-                               p0[1] = (sds->p0[1] + sds->cell_size[1] * sds->res_min[1] + sds->obj_shift_f[1]) * fabs(ob->size[1]);
-                               p0[2] = (sds->p0[2] + sds->cell_size[2] * sds->res_min[2] + sds->obj_shift_f[2]) * fabs(ob->size[2]);
-                               p1[0] = (sds->p0[0] + sds->cell_size[0] * sds->res_max[0] + sds->obj_shift_f[0]) * fabs(ob->size[0]);
-                               p1[1] = (sds->p0[1] + sds->cell_size[1] * sds->res_max[1] + sds->obj_shift_f[1]) * fabs(ob->size[1]);
-                               p1[2] = (sds->p0[2] + sds->cell_size[2] * sds->res_max[2] + sds->obj_shift_f[2]) * fabs(ob->size[2]);
+                               p0[0] = (sds->p0[0] + sds->cell_size[0] * sds->res_min[0] + sds->obj_shift_f[0]) * fabsf(ob->size[0]);
+                               p0[1] = (sds->p0[1] + sds->cell_size[1] * sds->res_min[1] + sds->obj_shift_f[1]) * fabsf(ob->size[1]);
+                               p0[2] = (sds->p0[2] + sds->cell_size[2] * sds->res_min[2] + sds->obj_shift_f[2]) * fabsf(ob->size[2]);
+                               p1[0] = (sds->p0[0] + sds->cell_size[0] * sds->res_max[0] + sds->obj_shift_f[0]) * fabsf(ob->size[0]);
+                               p1[1] = (sds->p0[1] + sds->cell_size[1] * sds->res_max[1] + sds->obj_shift_f[1]) * fabsf(ob->size[1]);
+                               p1[2] = (sds->p0[2] + sds->cell_size[2] * sds->res_max[2] + sds->obj_shift_f[2]) * fabsf(ob->size[2]);
 
                                if (!sds->wt || !(sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {
                                        smd->domain->tex = NULL;
index 5ac6382bdbecb30bd41a7ee7c160e0df1df7065b..542ed7af0e605fec8e9ccfce4362aa8b88167266 100644 (file)
@@ -461,7 +461,9 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
                                glTexCoord3d((points[i * 3 + 0] - min[0]) * cor[0] / size[0],
                                             (points[i * 3 + 1] - min[1]) * cor[1] / size[1],
                                             (points[i * 3 + 2] - min[2]) * cor[2] / size[2]);
-                               glVertex3f(points[i * 3 + 0] / fabs(ob->size[0]), points[i * 3 + 1] / fabs(ob->size[1]), points[i * 3 + 2] / fabs(ob->size[2]));
+                               glVertex3f(points[i * 3 + 0] / fabsf(ob->size[0]),
+                                          points[i * 3 + 1] / fabsf(ob->size[1]),
+                                          points[i * 3 + 2] / fabsf(ob->size[2]));
                        }
                        glEnd();
 
@@ -474,7 +476,9 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
                                glTexCoord3d((points[i * 3 + 0] - min[0]) * cor[0] / size[0],
                                             (points[i * 3 + 1] - min[1]) * cor[1] / size[1],
                                             (points[i * 3 + 2] - min[2]) * cor[2] / size[2]);
-                               glVertex3f(points[i * 3 + 0] / fabs(ob->size[0]), points[i * 3 + 1] / fabs(ob->size[1]), points[i * 3 + 2] / fabs(ob->size[2]));
+                               glVertex3f(points[i * 3 + 0] / fabsf(ob->size[0]),
+                                          points[i * 3 + 1] / fabsf(ob->size[1]),
+                                          points[i * 3 + 2] / fabsf(ob->size[2]));
                        }
                        glEnd();
                }