[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36821] trunk/blender/source/blender/ blenkernel/intern: remove / comment unused code, patch by nico_ga on IRC with some edits.
Campbell Barton
ideasman42 at gmail.com
Sun May 22 18:29:52 CEST 2011
Revision: 36821
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36821
Author: campbellbarton
Date: 2011-05-22 16:29:51 +0000 (Sun, 22 May 2011)
Log Message:
-----------
remove / comment unused code, patch by nico_ga on IRC with some edits.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/anim.c
trunk/blender/source/blender/blenkernel/intern/depsgraph.c
trunk/blender/source/blender/blenkernel/intern/displist.c
trunk/blender/source/blender/blenkernel/intern/object.c
trunk/blender/source/blender/blenkernel/intern/particle.c
trunk/blender/source/blender/blenkernel/intern/particle_system.c
trunk/blender/source/blender/blenkernel/intern/softbody.c
Modified: trunk/blender/source/blender/blenkernel/intern/anim.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/anim.c 2011-05-22 12:28:23 UTC (rev 36820)
+++ trunk/blender/source/blender/blenkernel/intern/anim.c 2011-05-22 16:29:51 UTC (rev 36821)
@@ -1206,7 +1206,7 @@
float tmat[4][4], mat[4][4], pamat[4][4], vec[3], size=0.0;
float (*obmat)[4], (*oldobmat)[4];
int a, b, counter, hair = 0;
- int totpart, totchild, totgroup=0, pa_num;
+ int totpart, totchild, totgroup=0 /*, pa_num */;
int no_draw_flag = PARS_UNEXIST;
@@ -1323,7 +1323,7 @@
if(pa->flag & no_draw_flag)
continue;
- pa_num = pa->num;
+ /* pa_num = pa->num; */ /* UNUSED */
pa_time = pa->time;
size = pa->size;
}
@@ -1331,7 +1331,7 @@
/* handle child particle */
cpa = &psys->child[a - totpart];
- pa_num = a;
+ /* pa_num = a; */ /* UNUSED */
pa_time = psys->particles[cpa->parent].time;
size = psys_get_child_size(psys, cpa, ctime, NULL);
}
Modified: trunk/blender/source/blender/blenkernel/intern/depsgraph.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/depsgraph.c 2011-05-22 12:28:23 UTC (rev 36820)
+++ trunk/blender/source/blender/blenkernel/intern/depsgraph.c 2011-05-22 16:29:51 UTC (rev 36821)
@@ -1189,7 +1189,7 @@
int skip = 0;
int minheight;
int maxpos=0;
- int is_cycle = 0;
+ /* int is_cycle = 0; */ /* UNUSED */
/*
*fprintf(stderr,"starting DFS \n ------------\n");
*/
@@ -1245,7 +1245,7 @@
} else {
if (itA->node->color == DAG_GRAY) { // back edge
fprintf(stderr,"dfs back edge :%15s %15s \n",((ID *) node->ob)->name, ((ID *) itA->node->ob)->name);
- is_cycle = 1;
+ /* is_cycle = 1; */ /* UNUSED */
} else if (itA->node->color == DAG_BLACK) {
;
/* already processed node but we may want later to change distance either to shorter to longer.
Modified: trunk/blender/source/blender/blenkernel/intern/displist.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/displist.c 2011-05-22 12:28:23 UTC (rev 36820)
+++ trunk/blender/source/blender/blenkernel/intern/displist.c 2011-05-22 16:29:51 UTC (rev 36821)
@@ -332,19 +332,12 @@
}
}
-static int fastshade_customdata_layer_num(int n, int active)
-{
- /* make the active layer the first */
- if (n == active) return 0;
- else if (n < active) return n+1;
- else return n;
-}
static void fastshade_customdata(CustomData *fdata, int a, int j, Material *ma)
{
CustomDataLayer *layer;
MTFace *mtface;
- int index, n, needuv= ma->texco & TEXCO_UV;
+ int index, needuv= ma->texco & TEXCO_UV;
char *vertcol;
shi.totuv= 0;
@@ -354,7 +347,6 @@
layer= &fdata->layers[index];
if(needuv && layer->type == CD_MTFACE && shi.totuv < MAX_MTFACE) {
- n= fastshade_customdata_layer_num(shi.totuv, layer->active_rnd);
mtface= &((MTFace*)layer->data)[a];
shi.uv[shi.totuv].uv[0]= 2.0f*mtface->uv[j][0]-1.0f;
@@ -365,7 +357,6 @@
shi.totuv++;
}
else if(layer->type == CD_MCOL && shi.totcol < MAX_MCOL) {
- n= fastshade_customdata_layer_num(shi.totcol, layer->active_rnd);
vertcol= (char*)&((MCol*)layer->data)[a*4 + j];
shi.col[shi.totcol].col[0]= ((float)vertcol[3])/255.0f;
Modified: trunk/blender/source/blender/blenkernel/intern/object.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/object.c 2011-05-22 12:28:23 UTC (rev 36820)
+++ trunk/blender/source/blender/blenkernel/intern/object.c 2011-05-22 16:29:51 UTC (rev 36821)
@@ -1648,13 +1648,7 @@
/* there is also a timing calculation in drawobject() */
-static int no_speed_curve= 0;
-void disable_speed_curve(int val)
-{
- no_speed_curve= val;
-}
-
// XXX THIS CRUFT NEEDS SERIOUS RECODING ASAP!
/* ob can be NULL */
float bsystem_time(struct Scene *scene, Object *UNUSED(ob), float cfra, float ofs)
Modified: trunk/blender/source/blender/blenkernel/intern/particle.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle.c 2011-05-22 12:28:23 UTC (rev 36820)
+++ trunk/blender/source/blender/blenkernel/intern/particle.c 2011-05-22 16:29:51 UTC (rev 36821)
@@ -3057,7 +3057,7 @@
ParticleKey result;
float birthtime = 0.0f, dietime = 0.0f;
- float t, time = 0.0f, keytime = 0.0f, frs_sec;
+ float t, time = 0.0f, keytime = 0.0f /*, frs_sec */;
float hairmat[4][4], rotmat[3][3], prev_tangent[3] = {0.0f, 0.0f, 0.0f};
int k, i;
int steps = (int)pow(2.0, (double)pset->draw_step);
@@ -3078,7 +3078,7 @@
recalc_set = 1;
}
- frs_sec = (psys || edit->pid.flag & PTCACHE_VEL_PER_SEC) ? 25.0f : 1.0f;
+ /* frs_sec = (psys || edit->pid.flag & PTCACHE_VEL_PER_SEC) ? 25.0f : 1.0f; */ /* UNUSED */
if(pset->brushtype == PE_BRUSH_WEIGHT) {
;/* use weight painting colors now... */
Modified: trunk/blender/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle_system.c 2011-05-22 12:28:23 UTC (rev 36820)
+++ trunk/blender/source/blender/blenkernel/intern/particle_system.c 2011-05-22 16:29:51 UTC (rev 36821)
@@ -890,7 +890,7 @@
if(ctx->tree){
KDTreeNearest ptn[10];
int w,maxw;//, do_seams;
- float maxd,mind,/*dd,*/totw= 0.0f;
+ float maxd /*, mind,dd */, totw= 0.0f;
int parent[10];
float pweight[10];
@@ -899,7 +899,7 @@
maxw = BLI_kdtree_find_n_nearest(ctx->tree,4,orco1,NULL,ptn);
maxd=ptn[maxw-1].dist;
- mind=ptn[0].dist;
+ /* mind=ptn[0].dist; */ /* UNUSED */
/* the weights here could be done better */
for(w=0; w<maxw; w++){
Modified: trunk/blender/source/blender/blenkernel/intern/softbody.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/softbody.c 2011-05-22 12:28:23 UTC (rev 36820)
+++ trunk/blender/source/blender/blenkernel/intern/softbody.c 2011-05-22 16:29:51 UTC (rev 36821)
@@ -640,7 +640,7 @@
{
Mesh *me= ob->data;
MFace *mface= me->mface;
- BodyPoint *bp;
+ /*BodyPoint *bp;*/ /*UNUSED*/
BodySpring *bs, *bs_new;
int a ;
@@ -661,7 +661,7 @@
/* fill the tail */
a = 0;
bs = bs_new+ob->soft->totspring;
- bp= ob->soft->bpoint;
+ /*bp= ob->soft->bpoint; */ /*UNUSED*/
if(mface ) {
for(a=me->totface; a>0; a--, mface++) {
if(mface->v4) {
@@ -1042,7 +1042,10 @@
GHash *hash;
GHashIterator *ihash;
float aabbmin[3],aabbmax[3];
- int a, deflected=0;
+ int deflected=0;
+#if 0
+ int a;
+#endif
if ((sb == NULL) || (sb->scratch ==NULL)) return 0;
VECCOPY(aabbmin,sb->scratch->aabbmin);
@@ -1056,17 +1059,20 @@
ob = BLI_ghashIterator_getKey (ihash);
/* only with deflecting set */
if(ob->pd && ob->pd->deflect) {
+#if 0 /* UNUSED */
MFace *mface= NULL;
MVert *mvert= NULL;
MVert *mprevvert= NULL;
ccdf_minmax *mima= NULL;
+#endif
if(ccdm){
+#if 0 /* UNUSED */
mface= ccdm->mface;
mvert= ccdm->mvert;
mprevvert= ccdm->mprevvert;
mima= ccdm->mima;
a = ccdm->totface;
-
+#endif
if ((aabbmax[0] < ccdm->bbmin[0]) ||
(aabbmax[1] < ccdm->bbmin[1]) ||
(aabbmax[2] < ccdm->bbmin[2]) ||
@@ -2095,19 +2101,25 @@
float dir[3],dvel[3];
float distance,forcefactor,kd,absvel,projvel,kw;
+#if 0 /* UNUSED */
int ia,ic;
+#endif
/* prepare depending on which side of the spring we are on */
if (bpi == bs->v1){
bp1 = &sb->bpoint[bs->v1];
bp2 = &sb->bpoint[bs->v2];
+#if 0 /* UNUSED */
ia =3*bs->v1;
ic =3*bs->v2;
+#endif
}
else if (bpi == bs->v2){
bp1 = &sb->bpoint[bs->v2];
bp2 = &sb->bpoint[bs->v1];
+#if 0 /* UNUSED */
ia =3*bs->v2;
ic =3*bs->v1;
+#endif
}
else{
/* TODO make this debug option */
@@ -2454,23 +2466,23 @@
* this will ruin adaptive stepsize AKA heun! (BM)
*/
SoftBody *sb= ob->soft; /* is supposed to be there */
- BodyPoint *bproot;
+ /*BodyPoint *bproot;*/ /* UNUSED */
ListBase *do_effector = NULL;
- float gravity;
+ /* float gravity; */ /* UNUSED */
/* float iks; */
float fieldfactor = -1.0f, windfactor = 0.25;
- int do_deflector,do_selfcollision,do_springcollision,do_aero;
+ int do_deflector /*,do_selfcollision*/ ,do_springcollision,do_aero;
- gravity = sb->grav * sb_grav_force_scale(ob);
+ /* gravity = sb->grav * sb_grav_force_scale(ob); */ /* UNUSED */
/* check conditions for various options */
do_deflector= query_external_colliders(scene, ob);
- do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF));
+ /* do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF)); */ /* UNUSED */
do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL);
do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES));
/* iks = 1.0f/(1.0f-sb->inspring)-1.0f; */ /* inner spring constants function */ /* UNUSED */
- bproot= sb->bpoint; /* need this for proper spring addressing */
+ /* bproot= sb->bpoint; */ /* need this for proper spring addressing */ /* UNUSED */
if (do_springcollision || do_aero)
sb_sfesf_threads_run(scene, ob, timenow,sb->totspring,NULL);
@@ -2516,7 +2528,7 @@
*/
SoftBody *sb= ob->soft; /* is supposed to be there */
BodyPoint *bp;
- BodyPoint *bproot;
+ /* BodyPoint *bproot; */ /* UNUSED */
BodySpring *bs;
ListBase *do_effector = NULL;
float iks, ks, kd, gravity[3] = {0.0f,0.0f,0.0f};
@@ -2547,7 +2559,7 @@
do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES));
iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */
- bproot= sb->bpoint; /* need this for proper spring addressing */
+ /* bproot= sb->bpoint; */ /* need this for proper spring addressing */ /* UNUSED */
if (do_springcollision || do_aero) scan_for_ext_spring_forces(scene, ob, timenow);
/* after spring scan because it uses Effoctors too */
More information about the Bf-blender-cvs
mailing list