Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-01-11 10:38:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-01-11 10:38:16 +0300
commitfded5e5ce5451a10055f615a0d4c83d902aac107 (patch)
tree00f84ec2022de9ee7c4dfb860e082f2d449383d3 /source
parent37420b2cf20b49599904c9ed9f68ff2eea3dd664 (diff)
comment/remove unused vars from particle and multires code.
also remove calls to dm->getFaceDataArray() within a loop for particle grid distribution, instead call this once at the start and reuse the result.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/multires.c10
-rw-r--r--source/blender/blenkernel/intern/particle.c7
-rw-r--r--source/blender/blenkernel/intern/particle_system.c34
3 files changed, 22 insertions, 29 deletions
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index 6c1b8fb6047..ed0b1bfceca 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -1299,7 +1299,6 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
unsigned int i, j, totvert;
src = 0;
- dst = 0;
vsrc = mr->verts;
vdst = dm->getVertArray(dm);
totvert = (unsigned int)dm->getNumVerts(dm);
@@ -1428,7 +1427,7 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
dst = ldst;
}
- lvl = lvl->next;
+ /*lvl = lvl->next;*/ /*UNUSED*/
for(i = 0; i < (unsigned int)(mr->level_count - 1); ++i) {
MEM_freeN(fmap[i]);
@@ -1596,10 +1595,9 @@ void multires_apply_smat(Scene *scene, Object *ob, float smat[3][3])
DMGridData **gridData, **subGridData;
Mesh *me= (Mesh*)ob->data;
MFace *mface= me->mface;
- MVert *mvert= NULL;
MDisps *mdisps;
int *gridOffset;
- int i, numGrids, gridSize, dGridSize, dSkip, totvert;
+ int i, /*numGrids,*/ gridSize, dGridSize, dSkip, totvert;
float (*vertCos)[3] = NULL;
MultiresModifierData *mmd= get_multires_modifier(scene, ob);
MultiresModifierData high_mmd;
@@ -1627,13 +1625,11 @@ void multires_apply_smat(Scene *scene, Object *ob, float smat[3][3])
CDDM_apply_vert_coords(cddm, vertCos);
MEM_freeN(vertCos);
- mvert= cddm->getVertArray(cddm);
-
/* scaled ccgDM for tangent space of object with applied scale */
dm= subsurf_dm_create_local(ob, cddm, high_mmd.totlvl, high_mmd.simple, 0);
cddm->release(cddm);
- numGrids= dm->getNumGrids(dm);
+ /*numGrids= dm->getNumGrids(dm);*/ /*UNUSED*/
gridSize= dm->getGridSize(dm);
gridData= dm->getGridData(dm);
gridOffset= dm->getGridOffset(dm);
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 279190b9f9c..db826b83864 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -197,7 +197,7 @@ void psys_set_current_num(Object *ob, int index)
}
Object *psys_find_object(Scene *scene, ParticleSystem *psys)
{
- Base *base = scene->base.first;
+ Base *base;
ParticleSystem *tpsys;
for(base = scene->base.first; base; base = base->next) {
@@ -3953,7 +3953,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
float t, frs_sec = sim->scene->r.frs_sec;
float co[3], orco[3];
float hairmat[4][4];
- int totparent = 0;
+ /*int totparent = 0;*/ /*UNUSED*/
int totpart = psys->totpart;
int totchild = psys->totchild;
short between = 0, edit = 0;
@@ -4009,11 +4009,12 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
t = psys_get_child_time(psys, cpa, -state->time, NULL, NULL);
if(totchild && part->from!=PART_FROM_PARTICLE && part->childtype==PART_CHILD_FACES){
+#if 0 /* totparent is UNUSED */
totparent=(int)(totchild*part->parents*0.3);
if(G.rendering && part->child_nbr && part->ren_child_nbr)
totparent*=(float)part->child_nbr/(float)part->ren_child_nbr;
-
+#endif
/* part->parents could still be 0 so we can't test with totparent */
between=1;
}
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 4cfcad4dbb6..27adeaa2430 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -467,13 +467,13 @@ static void distribute_particles_in_grid(DerivedMesh *dm, ParticleSystem *psys)
else if(ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)){
float co1[3], co2[3];
- MFace *mface=0;
+ MFace *mface= NULL, *mface_array;
float v1[3], v2[3], v3[3], v4[4], lambda;
int a, a1, a2, a0mul, a1mul, a2mul, totface;
int amax= from==PART_FROM_FACE ? 3 : 1;
totface=dm->getNumFaces(dm);
- mface=dm->getFaceDataArray(dm,CD_MFACE);
+ mface_array= dm->getFaceDataArray(dm,CD_MFACE);
for(a=0; a<amax; a++){
if(a==0){ a0mul=res*res; a1mul=res; a2mul=1; }
@@ -482,7 +482,7 @@ static void distribute_particles_in_grid(DerivedMesh *dm, ParticleSystem *psys)
for(a1=0; a1<size[(a+1)%3]; a1++){
for(a2=0; a2<size[(a+2)%3]; a2++){
- mface=dm->getFaceDataArray(dm,CD_MFACE);
+ mface= mface_array;
pa=psys->particles + a1*a1mul + a2*a2mul;
VECCOPY(co1,pa->fuv);
@@ -533,7 +533,7 @@ static void distribute_particles_in_grid(DerivedMesh *dm, ParticleSystem *psys)
}
if(psys->part->flag & PART_GRID_INVERT){
- for(i=0,pa=psys->particles; i<size[0]; i++){
+ for(i=0; i<size[0]; i++){
for(j=0; j<size[1]; j++){
pa=psys->particles + res*(i*res + j);
for(k=0; k<size[2]; k++, pa++){
@@ -810,7 +810,7 @@ static void psys_thread_distribute_particle(ParticleThread *thread, ParticleData
if(ctx->tree){
KDTreeNearest ptn[10];
int w,maxw;//, do_seams;
- float maxd,mind,dd,totw=0.0;
+ float maxd,mind,/*dd,*/totw=0.0;
int parent[10];
float pweight[10];
@@ -820,7 +820,7 @@ static void psys_thread_distribute_particle(ParticleThread *thread, ParticleData
maxd=ptn[maxw-1].dist;
mind=ptn[0].dist;
- dd=maxd-mind;
+ /*dd=maxd-mind;*/ /*UNUSED*/
/* the weights here could be done better */
for(w=0; w<maxw; w++){
@@ -941,7 +941,7 @@ static int psys_threads_init_distribution(ParticleThread *threads, Scene *scene,
DerivedMesh *dm= NULL;
float *jit= NULL;
int i, seed, p=0, totthread= threads[0].tot;
- int no_distr=0, cfrom=0;
+ int /*no_distr=0,*/ cfrom=0;
int tot=0, totpart, *index=0, children=0, totseam=0;
//int *vertpart=0;
int jitlevel= 1, distr;
@@ -1028,7 +1028,7 @@ static int psys_threads_init_distribution(ParticleThread *threads, Scene *scene,
DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, get_mesh_orco_verts(ob));
distr=part->distr;
- pa=psys->particles;
+
if(from==PART_FROM_VERT){
MVert *mv= dm->getVertDataArray(dm, CD_MVERT);
float (*orcodata)[3]= dm->getVertDataArray(dm, CD_ORCO);
@@ -1073,7 +1073,7 @@ static int psys_threads_init_distribution(ParticleThread *threads, Scene *scene,
}
if(tot==0){
- no_distr=1;
+ /*no_distr=1;*/ /*UNUSED*/
if(children){
if(G.f & G_DEBUG)
fprintf(stderr,"Particle child distribution error: Nothing to emit from!\n");
@@ -2272,7 +2272,7 @@ void delete_fluid_spring(ParticleSystem *psys, int j)
EdgeHash *build_fluid_springhash(ParticleSystem *psys)
{
EdgeHash *springhash = NULL;
- ParticleSpring *spring = psys->fluid_springs;
+ ParticleSpring *spring;
int i = 0;
springhash = BLI_edgehash_new();
@@ -2469,7 +2469,7 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
ParticleKey states[5], tkey;
float timestep = psys_get_timestep(sim);
float force[3],impulse[3],dx[4][3],dv[4][3],oldpos[3];
- float dtime=dfra*timestep, time, pa_mass=part->mass, fac, fra=sim->psys->cfra;
+ float dtime=dfra*timestep, time, pa_mass=part->mass, fac /*, fra=sim->psys->cfra*/;
int i, steps=1;
/* maintain angular velocity */
@@ -2542,7 +2542,7 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
if(i==0){
VECADDFAC(states[1].co,states->co,states->vel,dtime*0.5f);
VECADDFAC(states[1].vel,states->vel,force,dtime*0.5f);
- fra=sim->psys->cfra+0.5f*dfra;
+ /*fra=sim->psys->cfra+0.5f*dfra;*/
}
else{
VECADDFAC(pa->state.co,states->co,states[1].vel,dtime);
@@ -2559,7 +2559,7 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
VECADDFAC(states[1].co,states->co,dx[0],0.5f);
VECADDFAC(states[1].vel,states->vel,dv[0],0.5f);
- fra=sim->psys->cfra+0.5f*dfra;
+ /*fra=sim->psys->cfra+0.5f*dfra;*/
break;
case 1:
VECADDFAC(dx[1],states->vel,dv[0],0.5f);
@@ -2578,7 +2578,7 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
VECADD(states[3].co,states->co,dx[2]);
VECADD(states[3].vel,states->vel,dv[2]);
- fra=cfra;
+ /*fra=cfra;*/
break;
case 3:
VECADD(dx[3],states->vel,dv[2]);
@@ -3353,15 +3353,12 @@ static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra)){
ParticleSystem *psys = sim->psys;
HairKey *key, *root;
PARTICLE_P;
- int totpart;
invert_m4_m4(ob->imat, ob->obmat);
psys->lattice= psys_get_lattice(sim);
if(psys->totpart==0) return;
-
- totpart=psys->totpart;
/* save new keys for elements if needed */
LOOP_PARTICLES {
@@ -3684,7 +3681,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
char filename[256];
char debugStrBuffer[256];
int curFrame = sim->scene->r.cfra -1; // warning - sync with derived mesh fsmesh loading
- int p, j, numFileParts, totpart;
+ int p, j, totpart;
int readMask, activeParts = 0, fileParts = 0;
gzFile gzf;
@@ -3706,7 +3703,6 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
}
gzread(gzf, &totpart, sizeof(totpart));
- numFileParts = totpart;
totpart = (G.rendering)?totpart:(part->disp*totpart)/100;
part->totpart= totpart;