From be23539a9469e24caf65b192779cedac9ad2cd6c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 25 Jul 2012 22:37:52 +0000 Subject: code cleanup: use BKE_pain_ prefix for paint funcs. also minor style edits --- source/blender/blenkernel/BKE_paint.h | 5 +++-- source/blender/blenkernel/intern/object.c | 18 +++++++++++++++--- source/blender/blenkernel/intern/paint.c | 4 ++-- source/blender/blenkernel/intern/scene.c | 18 +++++++++--------- 4 files changed, 29 insertions(+), 16 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index e517d950d05..a93e542fe15 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -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); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index fa394d4a951..baf216b95e9 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -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; diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 56db84ab0d5..3267253e744 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -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); diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 185bee86f69..edc82b56d23 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -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; -- cgit v1.2.3