Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-11-29 07:19:29 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-29 07:19:29 +0300
commita740cc53ea1061fde58ca0a36986fc04bfe1dad7 (patch)
treedf136bbcf1a4c7dbb2970363df4938386c8721b8 /source/blender/blenkernel/intern/paint.c
parent6e24dd9a1e34cf07b369d43bd701b261a37e0798 (diff)
Fix paint initialization, incorrect pointer checks
Diffstat (limited to 'source/blender/blenkernel/intern/paint.c')
-rw-r--r--source/blender/blenkernel/intern/paint.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 9445981538e..8b44bbfa15f 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -664,11 +664,13 @@ bool BKE_paint_ensure(const ToolSettings *ts, struct Paint **r_paint)
return true;
}
- if (ELEM(*r_paint, &ts->vpaint->paint, &ts->wpaint->paint)) {
+ if (((VPaint **)r_paint == &ts->vpaint) ||
+ ((VPaint **)r_paint == &ts->wpaint))
+ {
VPaint *data = MEM_callocN(sizeof(*data), __func__);
paint = &data->paint;
}
- else if (*r_paint == &ts->sculpt->paint) {
+ else if ((Sculpt **)r_paint == &ts->sculpt) {
Sculpt *data = MEM_callocN(sizeof(*data), __func__);
paint = &data->paint;
@@ -678,11 +680,11 @@ bool BKE_paint_ensure(const ToolSettings *ts, struct Paint **r_paint)
/* Make sure at least dyntopo subdivision is enabled */
data->flags |= SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE;
}
- else if (*r_paint == &ts->gp_paint->paint) {
+ else if ((GpPaint **)r_paint == &ts->gp_paint) {
GpPaint *data = MEM_callocN(sizeof(*data), __func__);
paint = &data->paint;
}
- else if (*r_paint == &ts->uvsculpt->paint) {
+ else if ((UvSculpt **)r_paint == &ts->uvsculpt) {
UvSculpt *data = MEM_callocN(sizeof(*data), __func__);
paint = &data->paint;
}