[Bf-blender-cvs] [dc4242a] temp-openvdb: Reduce scope of bounding box vars (closer how it was in master)

Campbell Barton noreply at git.blender.org
Sat Jan 23 07:28:37 CET 2016


Commit: dc4242a17c2e410b4f203c09bde5c0855b775dc6
Author: Campbell Barton
Date:   Sat Jan 23 17:15:21 2016 +1100
Branches: temp-openvdb
https://developer.blender.org/rBdc4242a17c2e410b4f203c09bde5c0855b775dc6

Reduce scope of bounding box vars (closer how it was in master)

===================================================================

M	source/blender/editors/space_view3d/drawobject.c

===================================================================

diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index cb0ea39..8231b26 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -7843,8 +7843,6 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 		/* only draw domains */
 		if (smd->domain) {
 			SmokeDomainSettings *sds = smd->domain;
-			BoundBox bb;
-			float p0[3], p1[3];
 			float viewnormal[3];
 
 			glLoadMatrixf(rv3d->viewmat);
@@ -7853,6 +7851,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 			/* draw adaptive domain bounds */
 			if ((sds->flags & MOD_SMOKE_ADAPTIVE_DOMAIN) && !render_override) {
 				/* draw domain max bounds */
+				BoundBox bb;
+				float p0[3], p1[3];
 				VECSUBFAC(p0, sds->p0, sds->cell_size, sds->adapt_res);
 				VECADDFAC(p1, sds->p1, sds->cell_size, sds->adapt_res);
 				BKE_boundbox_init_from_minmax(&bb, p0, p1);
@@ -7863,10 +7863,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 				BKE_boundbox_init_from_minmax(&bb, sds->p0, sds->p1);
 				draw_box(bb.vec);
 #endif
-			}
 
-			/* draw a single voxel to hint the user about the resolution of the fluid */
-			{
+
+				/* draw a single voxel to hint the user about the resolution of the fluid */
 				copy_v3_v3(p0, sds->p0);
 
 				if (sds->flags & MOD_SMOKE_HIGHRES) {
@@ -7882,6 +7881,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 
 			/* don't show smoke before simulation starts, this could be made an option in the future */
 			if (sds->fluid && CFRA >= sds->point_cache[0]->startframe) {
+				float p0[3], p1[3];
+
 				/* get view vector */
 				invert_m4_m4(ob->imat, ob->obmat);
 				mul_v3_mat3_m4v3(viewnormal, ob->imat, rv3d->viewinv[2]);




More information about the Bf-blender-cvs mailing list