[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22070] branches/blender2.5/blender: Smoke : fixing some compile warning reported by Ton and one compile erro for gcc 4 .4.1 reported by mrunion
Daniel Genrich
daniel.genrich at gmx.net
Thu Jul 30 22:12:40 CEST 2009
Revision: 22070
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22070
Author: genscher
Date: 2009-07-30 22:12:40 +0200 (Thu, 30 Jul 2009)
Log Message:
-----------
Smoke: fixing some compile warning reported by Ton and one compile erro for gcc 4.4.1 reported by mrunion
Modified Paths:
--------------
branches/blender2.5/blender/intern/elbeem/intern/solver_init.cpp
branches/blender2.5/blender/intern/smoke/extern/smoke_API.h
branches/blender2.5/blender/intern/smoke/intern/FLUID_3D.cpp
branches/blender2.5/blender/intern/smoke/intern/FLUID_3D.h
branches/blender2.5/blender/intern/smoke/intern/FLUID_3D_SOLVERS.cpp
branches/blender2.5/blender/intern/smoke/intern/FLUID_3D_STATIC.cpp
branches/blender2.5/blender/intern/smoke/intern/IMAGE.h
branches/blender2.5/blender/intern/smoke/intern/WAVELET_NOISE.h
branches/blender2.5/blender/intern/smoke/intern/WTURBULENCE.cpp
branches/blender2.5/blender/intern/smoke/intern/smoke_API.cpp
branches/blender2.5/blender/source/blender/blenkernel/intern/smoke.c
branches/blender2.5/blender/source/blender/editors/space_view3d/drawobject.c
Modified: branches/blender2.5/blender/intern/elbeem/intern/solver_init.cpp
===================================================================
--- branches/blender2.5/blender/intern/elbeem/intern/solver_init.cpp 2009-07-30 20:11:59 UTC (rev 22069)
+++ branches/blender2.5/blender/intern/elbeem/intern/solver_init.cpp 2009-07-30 20:12:40 UTC (rev 22070)
@@ -1464,7 +1464,7 @@
obj->applyTransformation(targetTime, &mMOIVertices,NULL /* no old normals needed */, 0, mMOIVertices.size(), false );
} else {
// only do transform update
- obj->getMovingPoints(mMOIVertices,pNormals);
+ obj->getMovingPoints(mMOIVertices,pNormals); // mMOIVertices = mCachedMovPoints
mMOIVerticesOld = mMOIVertices;
// WARNING - assumes mSimulationTime is global!?
obj->applyTransformation(targetTime, &mMOIVertices,pNormals, 0, mMOIVertices.size(), false );
Modified: branches/blender2.5/blender/intern/smoke/extern/smoke_API.h
===================================================================
--- branches/blender2.5/blender/intern/smoke/extern/smoke_API.h 2009-07-30 20:11:59 UTC (rev 22069)
+++ branches/blender2.5/blender/intern/smoke/extern/smoke_API.h 2009-07-30 20:12:40 UTC (rev 22070)
@@ -32,7 +32,7 @@
extern "C" {
#endif
-struct FLUID_3D *smoke_init(int *res, int amplify, float *p0, float *p1, float dt);
+struct FLUID_3D *smoke_init(int *res, int amplify, float *p0, float dt);
void smoke_free(struct FLUID_3D *fluid);
void smoke_initBlenderRNA(struct FLUID_3D *fluid, float *alpha, float *beta);
@@ -48,8 +48,8 @@
unsigned char *smoke_get_obstacle(struct FLUID_3D *fluid);
-size_t smoke_get_index(int x, int max_x, int y, int max_y, int z, int max_z);
-size_t smoke_get_index2d(int x, int max_x, int y, int max_y, int z, int max_z);
+size_t smoke_get_index(int x, int max_x, int y, int max_y, int z);
+size_t smoke_get_index2d(int x, int max_x, int y);
void smoke_set_noise(struct FLUID_3D *fluid, int type);
@@ -59,4 +59,4 @@
}
#endif
-#endif /* SMOKE_API_H_ */
+#endif /* SMOKE_API_H_ */
\ No newline at end of file
Modified: branches/blender2.5/blender/intern/smoke/intern/FLUID_3D.cpp
===================================================================
--- branches/blender2.5/blender/intern/smoke/intern/FLUID_3D.cpp 2009-07-30 20:11:59 UTC (rev 22069)
+++ branches/blender2.5/blender/intern/smoke/intern/FLUID_3D.cpp 2009-07-30 20:12:40 UTC (rev 22070)
@@ -38,8 +38,8 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
-FLUID_3D::FLUID_3D(int *res, int amplify, float *p0, float *p1, float dt) :
- _xRes(res[0]), _yRes(res[1]), _zRes(res[2]), _res(0.), _dt(dt)
+FLUID_3D::FLUID_3D(int *res, int amplify, float *p0, float dt) :
+ _xRes(res[0]), _yRes(res[1]), _zRes(res[2]), _res(0.0f), _dt(dt)
{
// set simulation consts
// _dt = dt; // 0.10
@@ -486,10 +486,12 @@
const int down = _obstacles[index - _xRes];
const int left = _obstacles[index - 1];
const int right = _obstacles[index + 1];
- const bool fullz = (top && bottom);
- const bool fully = (up && down);
- const bool fullx = (left && right);
+ // unused
+ // const bool fullz = (top && bottom);
+ // const bool fully = (up && down);
+ //const bool fullx = (left && right);
+
_xVelocity[index] =
_yVelocity[index] =
_zVelocity[index] = 0.0f;
Modified: branches/blender2.5/blender/intern/smoke/intern/FLUID_3D.h
===================================================================
--- branches/blender2.5/blender/intern/smoke/intern/FLUID_3D.h 2009-07-30 20:11:59 UTC (rev 22069)
+++ branches/blender2.5/blender/intern/smoke/intern/FLUID_3D.h 2009-07-30 20:12:40 UTC (rev 22070)
@@ -37,7 +37,7 @@
class FLUID_3D
{
public:
- FLUID_3D(int *res, int amplify, float *p0, float *p1, float dt);
+ FLUID_3D(int *res, int amplify, float *p0, float dt);
FLUID_3D() {};
virtual ~FLUID_3D();
@@ -166,11 +166,10 @@
float* oldField, float* newField, Vec3Int res, const float* obstacles, const float *oldAdvection);
// output helper functions
- static void writeImageSliceXY(const float *field, Vec3Int res, int slice, string prefix, int picCnt, float scale=1.);
- static void writeImageSliceYZ(const float *field, Vec3Int res, int slice, string prefix, int picCnt, float scale=1.);
- static void writeImageSliceXZ(const float *field, Vec3Int res, int slice, string prefix, int picCnt, float scale=1.);
- static void writeProjectedIntern(const float *field, Vec3Int res, int dir1, int dir2, string prefix, int picCnt, float scale=1.);
+ // static void writeImageSliceXY(const float *field, Vec3Int res, int slice, string prefix, int picCnt, float scale=1.);
+ // static void writeImageSliceYZ(const float *field, Vec3Int res, int slice, string prefix, int picCnt, float scale=1.);
+ // static void writeImageSliceXZ(const float *field, Vec3Int res, int slice, string prefix, int picCnt, float scale=1.);
+ // static void writeProjectedIntern(const float *field, Vec3Int res, int dir1, int dir2, string prefix, int picCnt, float scale=1.);
};
#endif
-
Modified: branches/blender2.5/blender/intern/smoke/intern/FLUID_3D_SOLVERS.cpp
===================================================================
--- branches/blender2.5/blender/intern/smoke/intern/FLUID_3D_SOLVERS.cpp 2009-07-30 20:11:59 UTC (rev 22069)
+++ branches/blender2.5/blender/intern/smoke/intern/FLUID_3D_SOLVERS.cpp 2009-07-30 20:12:40 UTC (rev 22070)
@@ -78,7 +78,7 @@
deltaNew += _residual[index] * _residual[index];
// delta0 = deltaNew
- float delta0 = deltaNew;
+ // float delta0 = deltaNew;
// While deltaNew > (eps^2) * delta0
const float eps = SOLVER_ACCURACY;
@@ -225,7 +225,7 @@
deltaNew += _residual[index] * _residual[index];
// delta0 = deltaNew
- float delta0 = deltaNew;
+ // float delta0 = deltaNew;
// While deltaNew > (eps^2) * delta0
const float eps = SOLVER_ACCURACY;
@@ -316,3 +316,4 @@
}
cout << i << " iterations converged to " << maxR << endl;
}
+
Modified: branches/blender2.5/blender/intern/smoke/intern/FLUID_3D_STATIC.cpp
===================================================================
--- branches/blender2.5/blender/intern/smoke/intern/FLUID_3D_STATIC.cpp 2009-07-30 20:11:59 UTC (rev 22069)
+++ branches/blender2.5/blender/intern/smoke/intern/FLUID_3D_STATIC.cpp 2009-07-30 20:12:40 UTC (rev 22070)
@@ -29,6 +29,7 @@
//////////////////////////////////////////////////////////////////////
// add a test cube of density to the center
//////////////////////////////////////////////////////////////////////
+/*
void FLUID_3D::addSmokeColumn() {
addSmokeTestCase(_density, _res, 1.0);
// addSmokeTestCase(_zVelocity, _res, 1.0);
@@ -37,11 +38,13 @@
addSmokeTestCase(_wTurbulence->getDensityBig(), _wTurbulence->getResBig(), 1.0);
}
}
+*/
//////////////////////////////////////////////////////////////////////
// generic static version, so that it can be applied to the
// WTURBULENCE grid as well
//////////////////////////////////////////////////////////////////////
+/*
void FLUID_3D::addSmokeTestCase(float* field, Vec3Int res, float value)
{
const int slabSize = res[0]*res[1]; int maxRes = (int)MAX3V(res);
@@ -69,6 +72,7 @@
}
}
}
+*/
//////////////////////////////////////////////////////////////////////
// set x direction to Neumann boundary conditions
@@ -114,7 +118,7 @@
for (int x = 0; x < res[0]; x++)
{
// top slab
- int index = x + z * slabSize;
+ index = x + z * slabSize;
index += slabSize - res[0];
if(field[index]<0.) field[index] = 0.;
index -= res[0];
@@ -226,7 +230,6 @@
void FLUID_3D::copyBorderY(float* field, Vec3Int res)
{
const int slabSize = res[0] * res[1];
- const int totalCells = res[0] * res[1] * res[2];
int index;
for (int z = 0; z < res[2]; z++)
for (int x = 0; x < res[0]; x++)
@@ -265,8 +268,6 @@
const int xres = res[0];
const int yres = res[1];
const int zres = res[2];
- static int hits = 0;
- static int total = 0;
const int slabSize = res[0] * res[1];
// scale dt up to grid resolution
@@ -615,12 +616,16 @@
case 0: return 1;
case 1: return 0; }
break;
+ default:
+ return 0;
}
+ return 0;
}
//////////////////////////////////////////////////////////////////////
// average densities along third spatial direction
//////////////////////////////////////////////////////////////////////
+/*
void FLUID_3D::writeProjectedIntern(const float *field, Vec3Int res,
int dir1, int dir2, string prefix, int picCnt, float scale) {
const int nitems = res[dir1]*res[dir2];
@@ -645,6 +650,8 @@
buf[bufindex] += field[index] * scale *div;
}
}
- IMAGE::dumpNumberedPNG(picCnt, prefix, buf, res[dir1], res[dir2]);
+ // IMAGE::dumpNumberedPNG(picCnt, prefix, buf, res[dir1], res[dir2]);
delete[] buf;
}
+*/
+
Modified: branches/blender2.5/blender/intern/smoke/intern/IMAGE.h
===================================================================
--- branches/blender2.5/blender/intern/smoke/intern/IMAGE.h 2009-07-30 20:11:59 UTC (rev 22069)
+++ branches/blender2.5/blender/intern/smoke/intern/IMAGE.h 2009-07-30 20:12:40 UTC (rev 22070)
@@ -77,7 +77,8 @@
#include <png.h>
namespace IMAGE {
- static int writePng(const char *fileName, unsigned char **rowsp, int w, int h, bool normalize)
+ /*
+ static int writePng(const char *fileName, unsigned char **rowsp, int w, int h)
{
// defaults
const int colortype = PNG_COLOR_TYPE_RGBA;
@@ -123,13 +124,14 @@
if(png_ptr || info_ptr) png_destroy_write_struct(&png_ptr, &info_ptr);
return -1;
}
+ */
/////////////////////////////////////////////////////////////////////////////////
// write a numbered PNG file out, padded with zeros up to three zeros
/////////////////////////////////////////////////////////////////////////////////
+ /*
static void dumpNumberedPNG(int counter, std::string prefix, float* field, int xRes, int yRes)
{
- /*
char buffer[256];
sprintf(buffer,"%04i", counter);
std::string number = std::string(buffer);
@@ -153,12 +155,13 @@
std::string filenamePNG = prefix + number + std::string(".png");
writePng(filenamePNG.c_str(), rows, xRes, yRes, false);
printf("Writing %s\n", filenamePNG.c_str());
- */
+
}
-
+*/
/////////////////////////////////////////////////////////////////////////////////
// export pbrt volumegrid geometry object
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list