code cleanup: use BKE_pain_ prefix for paint funcs. also minor style edits
authorCampbell Barton <ideasman42@gmail.com>
Wed, 25 Jul 2012 22:37:52 +0000 (22:37 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 25 Jul 2012 22:37:52 +0000 (22:37 +0000)
source/blender/blenkernel/BKE_paint.h
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/scene.c

index e517d950d05f456649da29271de8cff0bdb73369..a93e542fe15f9513801227184a64b2b9167dda07 100644 (file)
@@ -52,9 +52,10 @@ extern const char PAINT_CURSOR_WEIGHT_PAINT[3];
 extern const char PAINT_CURSOR_TEXTURE_PAINT[3];
 
 void BKE_paint_init(struct Paint *p, const char col[3]);
-void free_paint(struct Paint *p);
-void copy_paint(struct Paint *src, struct Paint *tar);
+void BKE_paint_free(struct Paint *p);
+void BKE_paint_copy(struct Paint *src, struct Paint *tar);
 
+/* TODO, give these BKE_ prefix too */
 struct Paint *paint_get_active(struct Scene *sce);
 struct Paint *paint_get_active_from_context(const struct bContext *C);
 struct Brush *paint_brush(struct Paint *paint);
index fa394d4a95119895aa32c3e11caf19b17d84ac8c..baf216b95e9726d376ee3618f3589096baff8e50 100644 (file)
@@ -210,7 +210,14 @@ void BKE_object_link_modifiers(struct Object *ob, struct Object *from)
        for (md = from->modifiers.first; md; md = md->next) {
                ModifierData *nmd = NULL;
 
-               if (ELEM4(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_ParticleInstance, eModifierType_Collision)) continue;
+               if (ELEM4(md->type,
+                         eModifierType_Hook,
+                         eModifierType_Softbody,
+                         eModifierType_ParticleInstance,
+                         eModifierType_Collision))
+               {
+                       continue;
+               }
 
                if (!BKE_object_support_modifier_type_check(ob, md->type))
                        continue;
@@ -1318,7 +1325,8 @@ void BKE_object_copy_proxy_drivers(Object *ob, Object *target)
                                                if ((Object *)dtar->id == target)
                                                        dtar->id = (ID *)ob;
                                                else {
-                                                       /* only on local objects because this causes indirect links a -> b -> c, blend to point directly to a.blend
+                                                       /* only on local objects because this causes indirect links
+                                                        * 'a -> b -> c', blend to point directly to a.blend
                                                         * when a.blend has a proxy thats linked into c.blend  */
                                                        if (ob->id.lib == NULL)
                                                                id_lib_extern((ID *)dtar->id);
@@ -1803,7 +1811,11 @@ static void give_parvert(Object *par, int nr, float vec[3])
                                dm->getVertCo(dm, 0, vec);
                        }
                }
-               else fprintf(stderr, "%s: DerivedMesh is needed to solve parenting, object position can be wrong now\n", __func__);
+               else {
+                       fprintf(stderr,
+                               "%s: DerivedMesh is needed to solve parenting, "
+                               "object position can be wrong now\n", __func__);
+               }
        }
        else if (ELEM(par->type, OB_CURVE, OB_SURF)) {
                Nurb *nu;
index 56db84ab0d5d54e1b9299a39d5ecb6a3c9eb8821..3267253e744c69cf789bb203bd765ef31828a250 100644 (file)
@@ -184,7 +184,7 @@ void BKE_paint_init(Paint *p, const char col[3])
        p->flags |= PAINT_SHOW_BRUSH;
 }
 
-void free_paint(Paint *paint)
+void BKE_paint_free(Paint *paint)
 {
        id_us_min((ID *)paint->brush);
 }
@@ -193,7 +193,7 @@ void free_paint(Paint *paint)
  * still do a id_us_plus(), rather then if we were copying betweem 2 existing
  * scenes where a matching value should decrease the existing user count as
  * with paint_brush_set() */
-void copy_paint(Paint *src, Paint *tar)
+void BKE_paint_copy(Paint *src, Paint *tar)
 {
        tar->brush = src->brush;
        id_us_plus((ID *)tar->brush);
index 185bee86f694a868cd7b671f6b798aef8ed0435f..edc82b56d23f182ba3e1f8d2dc01c3352095e310 100644 (file)
@@ -178,21 +178,21 @@ Scene *BKE_scene_copy(Scene *sce, int type)
                        ts->vpaint->paintcursor = NULL;
                        ts->vpaint->vpaint_prev = NULL;
                        ts->vpaint->wpaint_prev = NULL;
-                       copy_paint(&ts->vpaint->paint, &ts->vpaint->paint);
+                       BKE_paint_copy(&ts->vpaint->paint, &ts->vpaint->paint);
                }
                if (ts->wpaint) {
                        ts->wpaint = MEM_dupallocN(ts->wpaint);
                        ts->wpaint->paintcursor = NULL;
                        ts->wpaint->vpaint_prev = NULL;
                        ts->wpaint->wpaint_prev = NULL;
-                       copy_paint(&ts->wpaint->paint, &ts->wpaint->paint);
+                       BKE_paint_copy(&ts->wpaint->paint, &ts->wpaint->paint);
                }
                if (ts->sculpt) {
                        ts->sculpt = MEM_dupallocN(ts->sculpt);
-                       copy_paint(&ts->sculpt->paint, &ts->sculpt->paint);
+                       BKE_paint_copy(&ts->sculpt->paint, &ts->sculpt->paint);
                }
 
-               copy_paint(&ts->imapaint.paint, &ts->imapaint.paint);
+               BKE_paint_copy(&ts->imapaint.paint, &ts->imapaint.paint);
                ts->imapaint.paintcursor = NULL;
                ts->particle.paintcursor = NULL;
        }
@@ -294,22 +294,22 @@ void BKE_scene_free(Scene *sce)
        
        if (sce->toolsettings) {
                if (sce->toolsettings->vpaint) {
-                       free_paint(&sce->toolsettings->vpaint->paint);
+                       BKE_paint_free(&sce->toolsettings->vpaint->paint);
                        MEM_freeN(sce->toolsettings->vpaint);
                }
                if (sce->toolsettings->wpaint) {
-                       free_paint(&sce->toolsettings->wpaint->paint);
+                       BKE_paint_free(&sce->toolsettings->wpaint->paint);
                        MEM_freeN(sce->toolsettings->wpaint);
                }
                if (sce->toolsettings->sculpt) {
-                       free_paint(&sce->toolsettings->sculpt->paint);
+                       BKE_paint_free(&sce->toolsettings->sculpt->paint);
                        MEM_freeN(sce->toolsettings->sculpt);
                }
                if (sce->toolsettings->uvsculpt) {
-                       free_paint(&sce->toolsettings->uvsculpt->paint);
+                       BKE_paint_free(&sce->toolsettings->uvsculpt->paint);
                        MEM_freeN(sce->toolsettings->uvsculpt);
                }
-               free_paint(&sce->toolsettings->imapaint.paint);
+               BKE_paint_free(&sce->toolsettings->imapaint.paint);
 
                MEM_freeN(sce->toolsettings);
                sce->toolsettings = NULL;