diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-22 05:08:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-22 05:08:42 +0400 |
commit | 2a5cabb039faf8a4f39a5dbe0edc0497a4f72b63 (patch) | |
tree | 27f63aa843429457bfacc67ac7698f11674538f0 /source/blender/editors/sculpt_paint | |
parent | 78e688b71ced5ea4f34cfc4b3d913cfebaedd461 (diff) |
code cleanup and minor changes
- use DummyRNA_NULL_items to replace empty enums.
- replace calloc with malloc in copy_dverts since its copied over after.
- add wmGesture->userdata, so operators that use gestures have somewhere to store their own data (not used yet).
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 9bbf99ff3cf..7134f1c2367 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -402,12 +402,28 @@ static int wpaint_mirror_vgroup_ensure(Object *ob, const int vgroup_active) return -1; } -static void copy_vpaint_prev(VPaint *vp, unsigned int *lcol, int tot) +static void free_vpaint_prev(VPaint *vp) { if (vp->vpaint_prev) { MEM_freeN(vp->vpaint_prev); vp->vpaint_prev = NULL; + vp->tot = 0; + } +} + +static void free_wpaint_prev(VPaint *vp) +{ + if (vp->wpaint_prev) { + MEM_freeN(vp->wpaint_prev); + vp->wpaint_prev = NULL; + vp->tot = 0; } +} + +static void copy_vpaint_prev(VPaint *vp, unsigned int *lcol, int tot) +{ + free_vpaint_prev(vp); + vp->tot = tot; if (lcol == NULL || tot == 0) return; @@ -419,10 +435,7 @@ static void copy_vpaint_prev(VPaint *vp, unsigned int *lcol, int tot) static void copy_wpaint_prev(VPaint *wp, MDeformVert *dverts, int dcount) { - if (wp->wpaint_prev) { - free_dverts(wp->wpaint_prev, wp->tot); - wp->wpaint_prev = NULL; - } + free_wpaint_prev(wp); if (dverts && dcount) { @@ -432,7 +445,6 @@ static void copy_wpaint_prev(VPaint *wp, MDeformVert *dverts, int dcount) } } - void vpaint_fill(Object *ob, unsigned int paintcol) { Mesh *me; |