[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51266] trunk/blender/source/blender: quiet compiler warnings from recent merge.

Campbell Barton ideasman42 at gmail.com
Wed Oct 10 16:28:47 CEST 2012


Revision: 51266
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51266
Author:   campbellbarton
Date:     2012-10-10 14:28:47 +0000 (Wed, 10 Oct 2012)
Log Message:
-----------
quiet compiler warnings from recent merge.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/smoke.c
    trunk/blender/source/blender/editors/space_view3d/drawobject.c
    trunk/blender/source/blender/editors/space_view3d/drawvolume.c
    trunk/blender/source/blender/editors/space_view3d/view3d_intern.h

Modified: trunk/blender/source/blender/blenkernel/intern/smoke.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/smoke.c	2012-10-10 14:21:58 UTC (rev 51265)
+++ trunk/blender/source/blender/blenkernel/intern/smoke.c	2012-10-10 14:28:47 UTC (rev 51266)
@@ -684,7 +684,6 @@
 		MFace *mface = NULL;
 		BVHTreeFromMesh treeData = {0};
 		int numverts, i, z;
-		int *res = sds->res;
 
 		float surface_distance = 0.6;
 
@@ -799,7 +798,8 @@
 }
 
 /* Animated obstacles: dx_step = ((x_new - x_old) / totalsteps) * substep */
-static void update_obstacles(Scene *scene, Object *ob, SmokeDomainSettings *sds, float dt, int substep, int totalsteps)
+static void update_obstacles(Scene *scene, Object *ob, SmokeDomainSettings *sds, float dt,
+                             int UNUSED(substep), int UNUSED(totalsteps))
 {
 	Object **collobjs = NULL;
 	unsigned int numcollobj = 0;
@@ -1540,7 +1540,7 @@
 {
 	int absolute_flow = (sfs->flags & MOD_SMOKE_FLOW_ABSOLUTE);
 	float dens_old = density[index];
-	float fuel_old = (fuel) ? fuel[index] : 0.0f;
+	// float fuel_old = (fuel) ? fuel[index] : 0.0f;  /* UNUSED */
 	float dens_flow = (sfs->type == MOD_SMOKE_FLOW_TYPE_FIRE) ? 0.0f : emission_value * sfs->density;
 	float fuel_flow = emission_value * sfs->fuel_amount;
 	/* add heat */
@@ -1972,12 +1972,14 @@
 	float gravity[3] = {0.0f, 0.0f, -1.0f};
 	float gravity_mag;
 
+#if 0  /* UNUSED */
 	/* get max velocity and lower the dt value if it is too high */
 	size_t size = sds->res[0] * sds->res[1] * sds->res[2];
 	float *velX = smoke_get_velocity_x(sds->fluid);
 	float *velY = smoke_get_velocity_y(sds->fluid);
 	float *velZ = smoke_get_velocity_z(sds->fluid);
 	size_t i;
+#endif
 
 	/* update object state */
 	invert_m4_m4(sds->imat, ob->obmat);
@@ -2001,12 +2003,13 @@
 	// maximum timestep/"CFL" constraint: dt < 5.0 *dx / maxVel
 	maxVel = (sds->dx * 5.0);
 
-	/*for(i = 0; i < size; i++)
-	{
+#if 0
+	for (i = 0; i < size; i++) {
 		float vtemp = (velX[i]*velX[i]+velY[i]*velY[i]+velZ[i]*velZ[i]);
 		if(vtemp > maxVelMag)
 			maxVelMag = vtemp;
-	}*/
+	}
+#endif
 
 	maxVelMag = sqrt(maxVelMag) * dt * sds->time_scale;
 	totalSubsteps = (int)((maxVelMag / maxVel) + 1.0f); /* always round up */
@@ -2119,7 +2122,7 @@
 	return result;
 }
 
-void smokeModifier_process(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm)
+static void smokeModifier_process(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm)
 {	
 	if((smd->type & MOD_SMOKE_TYPE_FLOW))
 	{

Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c	2012-10-10 14:21:58 UTC (rev 51265)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c	2012-10-10 14:28:47 UTC (rev 51266)
@@ -6670,19 +6670,19 @@
 				if (!sds->wt || !(sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {
 					smd->domain->tex = NULL;
 					GPU_create_smoke(smd, 0);
-					draw_smoke_volume(sds, ob, ar, sds->tex,
-								p0, p1,
-								sds->res, sds->dx, sds->scale*sds->maxres,
-								viewnormal, sds->tex_shadow, sds->tex_flame);
+					draw_smoke_volume(sds, ob, sds->tex,
+					                  p0, p1,
+					                  sds->res, sds->dx, sds->scale * sds->maxres,
+					                  viewnormal, sds->tex_shadow, sds->tex_flame);
 					GPU_free_smoke(smd);
 				}
 				else if (sds->wt && (sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {
 					sds->tex = NULL;
 					GPU_create_smoke(smd, 1);
-					draw_smoke_volume(sds, ob, ar, sds->tex,
-								p0, p1,
-								sds->res_wt, sds->dx, sds->scale*sds->maxres,
-								viewnormal, sds->tex_shadow, sds->tex_flame);
+					draw_smoke_volume(sds, ob, sds->tex,
+					                  p0, p1,
+					                  sds->res_wt, sds->dx, sds->scale * sds->maxres,
+					                  viewnormal, sds->tex_shadow, sds->tex_flame);
 					GPU_free_smoke(smd);
 				}
 

Modified: trunk/blender/source/blender/editors/space_view3d/drawvolume.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawvolume.c	2012-10-10 14:21:58 UTC (rev 51265)
+++ trunk/blender/source/blender/editors/space_view3d/drawvolume.c	2012-10-10 14:28:47 UTC (rev 51266)
@@ -157,7 +157,10 @@
 	return dot_v3v3(up, tmp) >= 0;
 }
 
-void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob, ARegion *ar, GPUTexture *tex, float min[3], float max[3], int res[3], float dx, float base_scale, float viewnormal[3], GPUTexture *tex_shadow, GPUTexture *tex_flame)
+void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
+                       GPUTexture *tex, float min[3], float max[3],
+                       int res[3], float dx, float UNUSED(base_scale), float viewnormal[3],
+                       GPUTexture *tex_shadow, GPUTexture *tex_flame)
 {
 	int i, j, k, n, good_index;
 	float d /*, d0 */ /* UNUSED */, dd, ds;
@@ -197,67 +200,70 @@
 
 	/* Fragment program to calculate the view3d of smoke */
 	/* using 4 textures, density, shadow, flame and flame spectrum */
-	const char *shader_basic = "!!ARBfp1.0\n"
-	                   "PARAM dx = program.local[0];\n"
-	                   "PARAM darkness = program.local[1];\n"
-					   "PARAM render = program.local[2];\n"
-	                   "PARAM f = {1.442695041, 1.442695041, 1.442695041, 0.01};\n"
-	                   "TEMP temp, shadow, flame, spec, value;\n"
-	                   "TEX temp, fragment.texcoord[0], texture[0], 3D;\n"
-	                   "TEX shadow, fragment.texcoord[0], texture[1], 3D;\n"
-					   "TEX flame, fragment.texcoord[0], texture[2], 3D;\n"
-					   "TEX spec, flame.r, texture[3], 1D;\n"
-					   /* calculate shading factor from density */
-	                   "MUL value.r, temp.a, darkness.a;\n"
-	                   "MUL value.r, value.r, dx.r;\n"
-	                   "MUL value.r, value.r, f.r;\n"
-	                   "EX2 temp, -value.r;\n"
-					   /* alpha */
-					   "SUB temp.a, 1.0, temp.r;\n"
-					   /* shade colors */
-	                   "MUL temp.r, temp.r, shadow.r;\n"
-	                   "MUL temp.g, temp.g, shadow.r;\n"
-	                   "MUL temp.b, temp.b, shadow.r;\n"
-					   "MUL temp.r, temp.r, darkness.r;\n"
-	                   "MUL temp.g, temp.g, darkness.g;\n"
-	                   "MUL temp.b, temp.b, darkness.b;\n"
-					   /* for now this just replace smoke shading if rendering fire */
-					   "CMP result.color, render.r, temp, spec;\n"
-	                   "END\n";
+	const char *shader_basic =
+	        "!!ARBfp1.0\n"
+	        "PARAM dx = program.local[0];\n"
+	        "PARAM darkness = program.local[1];\n"
+	        "PARAM render = program.local[2];\n"
+	        "PARAM f = {1.442695041, 1.442695041, 1.442695041, 0.01};\n"
+	        "TEMP temp, shadow, flame, spec, value;\n"
+	        "TEX temp, fragment.texcoord[0], texture[0], 3D;\n"
+	        "TEX shadow, fragment.texcoord[0], texture[1], 3D;\n"
+	        "TEX flame, fragment.texcoord[0], texture[2], 3D;\n"
+	        "TEX spec, flame.r, texture[3], 1D;\n"
+	        /* calculate shading factor from density */
+	        "MUL value.r, temp.a, darkness.a;\n"
+	        "MUL value.r, value.r, dx.r;\n"
+	        "MUL value.r, value.r, f.r;\n"
+	        "EX2 temp, -value.r;\n"
+	        /* alpha */
+	        "SUB temp.a, 1.0, temp.r;\n"
+	        /* shade colors */
+	        "MUL temp.r, temp.r, shadow.r;\n"
+	        "MUL temp.g, temp.g, shadow.r;\n"
+	        "MUL temp.b, temp.b, shadow.r;\n"
+	        "MUL temp.r, temp.r, darkness.r;\n"
+	        "MUL temp.g, temp.g, darkness.g;\n"
+	        "MUL temp.b, temp.b, darkness.b;\n"
+	        /* for now this just replace smoke shading if rendering fire */
+	        "CMP result.color, render.r, temp, spec;\n"
+	        "END\n";
 
 	/* color shader */
-	const char *shader_color = "!!ARBfp1.0\n"
-	                   "PARAM dx = program.local[0];\n"
-	                   "PARAM darkness = program.local[1];\n"
-					   "PARAM render = program.local[2];\n"
-	                   "PARAM f = {1.442695041, 1.442695041, 1.442695041, 1.442695041};\n"
-	                   "TEMP temp, shadow, flame, spec, value;\n"
-	                   "TEX temp, fragment.texcoord[0], texture[0], 3D;\n"
-	                   "TEX shadow, fragment.texcoord[0], texture[1], 3D;\n"
-					   "TEX flame, fragment.texcoord[0], texture[2], 3D;\n"
-					   "TEX spec, flame.r, texture[3], 1D;\n"
-					   /* unpremultiply volume texture */
-					   "RCP value.r, temp.a;\n"
-					   "MUL temp.r, temp.r, value.r;\n"
-					   "MUL temp.g, temp.g, value.r;\n"
-					   "MUL temp.b, temp.b, value.r;\n"
-						/* calculate shading factor from density */
-	                   "MUL value.r, temp.a, darkness.a;\n"
-	                   "MUL value.r, value.r, dx.r;\n"
-	                   "MUL value.r, value.r, f.r;\n"
-	                   "EX2 value.r, -value.r;\n"
-						/* alpha */
-	                   "SUB temp.a, 1.0, value.r;\n"
-					   /* shade colors */
-	                   "MUL temp.r, temp.r, shadow.r;\n"
-	                   "MUL temp.g, temp.g, shadow.r;\n"
-	                   "MUL temp.b, temp.b, shadow.r;\n"
-					   "MUL temp.r, temp.r, value.r;\n"
-	                   "MUL temp.g, temp.g, value.r;\n"
-	                   "MUL temp.b, temp.b, value.r;\n"
-					   /* for now this just replace smoke shading if rendering fire */
-					   "CMP result.color, render.r, temp, spec;\n"
-	                   "END\n";
+	const char *shader_color =
+	        "!!ARBfp1.0\n"
+	        "PARAM dx = program.local[0];\n"
+	        "PARAM darkness = program.local[1];\n"
+	        "PARAM render = program.local[2];\n"
+	        "PARAM f = {1.442695041, 1.442695041, 1.442695041, 1.442695041};\n"
+	        "TEMP temp, shadow, flame, spec, value;\n"
+	        "TEX temp, fragment.texcoord[0], texture[0], 3D;\n"
+	        "TEX shadow, fragment.texcoord[0], texture[1], 3D;\n"
+	        "TEX flame, fragment.texcoord[0], texture[2], 3D;\n"
+	        "TEX spec, flame.r, texture[3], 1D;\n"
+	        /* unpremultiply volume texture */
+	        "RCP value.r, temp.a;\n"
+	        "MUL temp.r, temp.r, value.r;\n"
+	        "MUL temp.g, temp.g, value.r;\n"
+	        "MUL temp.b, temp.b, value.r;\n"
+	        /* calculate shading factor from density */
+	        "MUL value.r, temp.a, darkness.a;\n"

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list