remove / comment unused code, patch by nico_ga on IRC with some edits.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 22 May 2011 16:29:51 +0000 (16:29 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 22 May 2011 16:29:51 +0000 (16:29 +0000)
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/softbody.c

index e12ec559f4b323c360a67a3b8cb95fa507e9ce47..1763866c00032a72a0c1c32a019a071eb8d04352 100644 (file)
@@ -1206,7 +1206,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
        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 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
                                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 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
                                /* 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);
                        }
index 6813d5d18a61c3df57973104cc39fe1c58cc5b62..472d7d77b80fd654bf882e56387822d3d643d135 100644 (file)
@@ -1189,7 +1189,7 @@ DagNodeQueue * graph_dfs(void)
        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 @@ DagNodeQueue * graph_dfs(void)
                                } 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.
index 54e4bf08ee763da09681d3001d104292e8234a9b..9aa794aa97e19571b44fab96c4ac92e4e22038e0 100644 (file)
@@ -332,19 +332,12 @@ void fastshade_free_render(void)
        }
 }
 
-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 @@ static void fastshade_customdata(CustomData *fdata, int a, int j, Material *ma)
                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 @@ static void fastshade_customdata(CustomData *fdata, int a, int j, Material *ma)
                        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;
index bad6c6248a106eaad6bde3bfebcd23a824bc0e01..3523d1812a04ca357cf022074803e519dc316e41 100644 (file)
@@ -1648,12 +1648,6 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
 
 /* 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 */
index 5ec4c36177f644d7dc5d79c6fb0d523e90bee789..d0fee1d5bd592b6f1d2e342a62eec5d5225948f8 100644 (file)
@@ -3057,7 +3057,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
        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 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
                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... */
index 6b1540d7d53c35fb5a34126c1c71793c8fc2e985..fca8d470dc17a62d788038ba9ae45481988a8cef 100644 (file)
@@ -890,7 +890,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
                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 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
                        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++){
index 30d2816769c9a250db755bccb7477fab29dd3883..ff238678eeb9891c3cb880903e0e77d768e77e35 100644 (file)
@@ -640,7 +640,7 @@ static void add_mesh_quad_diag_springs(Object *ob)
 {
        Mesh *me= ob->data;
        MFace *mface= me->mface;
-       BodyPoint *bp;
+       /*BodyPoint *bp;*/ /*UNUSED*/
        BodySpring *bs, *bs_new;
        int a ;
 
@@ -661,7 +661,7 @@ static void add_mesh_quad_diag_springs(Object *ob)
                        /* 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 @@ static int sb_detect_aabb_collisionCached(       float UNUSED(force[3]), unsigned int
        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 @@ static int sb_detect_aabb_collisionCached(      float UNUSED(force[3]), unsigned int
                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 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UN
 
        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 @@ static void softbody_calc_forcesEx(Scene *scene, Object *ob, float forcetime, fl
  * 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 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
                */
                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 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
                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 */