quiet compiler warnings from recent merge.

This commit is contained in:
Campbell Barton 2012-10-10 14:28:47 +00:00
parent 56f798db8c
commit e9a61cd29d
4 changed files with 90 additions and 76 deletions

@ -684,7 +684,6 @@ static void obstacles_from_derivedmesh(Object *coll_ob, SmokeDomainSettings *sds
MFace *mface = NULL; MFace *mface = NULL;
BVHTreeFromMesh treeData = {0}; BVHTreeFromMesh treeData = {0};
int numverts, i, z; int numverts, i, z;
int *res = sds->res;
float surface_distance = 0.6; float surface_distance = 0.6;
@ -799,7 +798,8 @@ static void obstacles_from_derivedmesh(Object *coll_ob, SmokeDomainSettings *sds
} }
/* Animated obstacles: dx_step = ((x_new - x_old) / totalsteps) * substep */ /* 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; Object **collobjs = NULL;
unsigned int numcollobj = 0; unsigned int numcollobj = 0;
@ -1540,7 +1540,7 @@ BLI_INLINE void apply_inflow_fields(SmokeFlowSettings *sfs, float emission_value
{ {
int absolute_flow = (sfs->flags & MOD_SMOKE_FLOW_ABSOLUTE); int absolute_flow = (sfs->flags & MOD_SMOKE_FLOW_ABSOLUTE);
float dens_old = density[index]; 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 dens_flow = (sfs->type == MOD_SMOKE_FLOW_TYPE_FIRE) ? 0.0f : emission_value * sfs->density;
float fuel_flow = emission_value * sfs->fuel_amount; float fuel_flow = emission_value * sfs->fuel_amount;
/* add heat */ /* add heat */
@ -1972,12 +1972,14 @@ static void step(Scene *scene, Object *ob, SmokeModifierData *smd, DerivedMesh *
float gravity[3] = {0.0f, 0.0f, -1.0f}; float gravity[3] = {0.0f, 0.0f, -1.0f};
float gravity_mag; float gravity_mag;
#if 0 /* UNUSED */
/* get max velocity and lower the dt value if it is too high */ /* 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]; size_t size = sds->res[0] * sds->res[1] * sds->res[2];
float *velX = smoke_get_velocity_x(sds->fluid); float *velX = smoke_get_velocity_x(sds->fluid);
float *velY = smoke_get_velocity_y(sds->fluid); float *velY = smoke_get_velocity_y(sds->fluid);
float *velZ = smoke_get_velocity_z(sds->fluid); float *velZ = smoke_get_velocity_z(sds->fluid);
size_t i; size_t i;
#endif
/* update object state */ /* update object state */
invert_m4_m4(sds->imat, ob->obmat); invert_m4_m4(sds->imat, ob->obmat);
@ -2001,12 +2003,13 @@ static void step(Scene *scene, Object *ob, SmokeModifierData *smd, DerivedMesh *
// maximum timestep/"CFL" constraint: dt < 5.0 *dx / maxVel // maximum timestep/"CFL" constraint: dt < 5.0 *dx / maxVel
maxVel = (sds->dx * 5.0); 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]); float vtemp = (velX[i]*velX[i]+velY[i]*velY[i]+velZ[i]*velZ[i]);
if(vtemp > maxVelMag) if(vtemp > maxVelMag)
maxVelMag = vtemp; maxVelMag = vtemp;
}*/ }
#endif
maxVelMag = sqrt(maxVelMag) * dt * sds->time_scale; maxVelMag = sqrt(maxVelMag) * dt * sds->time_scale;
totalSubsteps = (int)((maxVelMag / maxVel) + 1.0f); /* always round up */ totalSubsteps = (int)((maxVelMag / maxVel) + 1.0f); /* always round up */
@ -2119,7 +2122,7 @@ static DerivedMesh *createDomainGeometry(SmokeDomainSettings *sds, Object *ob)
return result; 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)) if((smd->type & MOD_SMOKE_TYPE_FLOW))
{ {

@ -6670,18 +6670,18 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
if (!sds->wt || !(sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) { if (!sds->wt || !(sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {
smd->domain->tex = NULL; smd->domain->tex = NULL;
GPU_create_smoke(smd, 0); GPU_create_smoke(smd, 0);
draw_smoke_volume(sds, ob, ar, sds->tex, draw_smoke_volume(sds, ob, sds->tex,
p0, p1, p0, p1,
sds->res, sds->dx, sds->scale*sds->maxres, sds->res, sds->dx, sds->scale * sds->maxres,
viewnormal, sds->tex_shadow, sds->tex_flame); viewnormal, sds->tex_shadow, sds->tex_flame);
GPU_free_smoke(smd); GPU_free_smoke(smd);
} }
else if (sds->wt && (sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) { else if (sds->wt && (sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {
sds->tex = NULL; sds->tex = NULL;
GPU_create_smoke(smd, 1); GPU_create_smoke(smd, 1);
draw_smoke_volume(sds, ob, ar, sds->tex, draw_smoke_volume(sds, ob, sds->tex,
p0, p1, p0, p1,
sds->res_wt, sds->dx, sds->scale*sds->maxres, sds->res_wt, sds->dx, sds->scale * sds->maxres,
viewnormal, sds->tex_shadow, sds->tex_flame); viewnormal, sds->tex_shadow, sds->tex_flame);
GPU_free_smoke(smd); GPU_free_smoke(smd);
} }

@ -157,7 +157,10 @@ static int convex(const float p0[3], const float up[3], const float a[3], const
return dot_v3v3(up, tmp) >= 0; 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; int i, j, k, n, good_index;
float d /*, d0 */ /* UNUSED */, dd, ds; float d /*, d0 */ /* UNUSED */, dd, ds;
@ -197,7 +200,8 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob, ARegion *ar, GPUTex
/* Fragment program to calculate the view3d of smoke */ /* Fragment program to calculate the view3d of smoke */
/* using 4 textures, density, shadow, flame and flame spectrum */ /* using 4 textures, density, shadow, flame and flame spectrum */
const char *shader_basic = "!!ARBfp1.0\n" const char *shader_basic =
"!!ARBfp1.0\n"
"PARAM dx = program.local[0];\n" "PARAM dx = program.local[0];\n"
"PARAM darkness = program.local[1];\n" "PARAM darkness = program.local[1];\n"
"PARAM render = program.local[2];\n" "PARAM render = program.local[2];\n"
@ -226,7 +230,8 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob, ARegion *ar, GPUTex
"END\n"; "END\n";
/* color shader */ /* color shader */
const char *shader_color = "!!ARBfp1.0\n" const char *shader_color =
"!!ARBfp1.0\n"
"PARAM dx = program.local[0];\n" "PARAM dx = program.local[0];\n"
"PARAM darkness = program.local[1];\n" "PARAM darkness = program.local[1];\n"
"PARAM render = program.local[2];\n" "PARAM render = program.local[2];\n"
@ -258,6 +263,7 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob, ARegion *ar, GPUTex
/* for now this just replace smoke shading if rendering fire */ /* for now this just replace smoke shading if rendering fire */
"CMP result.color, render.r, temp, spec;\n" "CMP result.color, render.r, temp, spec;\n"
"END\n"; "END\n";
GLuint prog; GLuint prog;

@ -40,6 +40,7 @@ struct ARegionType;
struct BoundBox; struct BoundBox;
struct DerivedMesh; struct DerivedMesh;
struct Object; struct Object;
struct SmokeDomainSettings;
struct ViewContext; struct ViewContext;
struct bAnimVizSettings; struct bAnimVizSettings;
struct bContext; struct bContext;
@ -212,7 +213,11 @@ ARegion *view3d_has_tools_region(ScrArea *sa);
extern const char *view3d_context_dir[]; /* doc access */ extern const char *view3d_context_dir[]; /* doc access */
/* draw_volume.c */ /* draw_volume.c */
void draw_smoke_volume(struct SmokeDomainSettings *sds, struct Object *ob, struct ARegion *ar, struct GPUTexture *tex, float min[3], float max[3], int res[3], float dx, float base_scale, float viewnormal[3], struct GPUTexture *tex_shadow, struct GPUTexture *tex_flame); void draw_smoke_volume(struct SmokeDomainSettings *sds, struct Object *ob,
struct GPUTexture *tex, float min[3], float max[3],
int res[3], float dx, float base_scale, float viewnormal[3],
struct GPUTexture *tex_shadow, struct GPUTexture *tex_flame);
//#define SMOKE_DEBUG_VELOCITY //#define SMOKE_DEBUG_VELOCITY
//#define SMOKE_DEBUG_HEAT //#define SMOKE_DEBUG_HEAT