diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-31 12:30:24 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-31 12:48:03 +0300 |
commit | d273f3ff7125ce5fe6366b7b55461951f7ce57e7 (patch) | |
tree | 13b239bb410b4595b43042e8a11904f9bf235d35 /source/blender/editors/gpencil/gpencil_edit.c | |
parent | 1fd27c2332a2d74d16cc8f339dd68fe1d06874a7 (diff) |
Cleanup: fix compiler warnings.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_edit.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 4a603e97615..93cf2f18233 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -2454,7 +2454,6 @@ static void gpencil_stroke_copy_point(bGPDstroke *gps, bGPDspoint *point, int id float pressure, float strength, float deltatime) { bGPDspoint *newpoint; - MDeformVert *dvert, *newdvert; gps->points = MEM_reallocN(gps->points, sizeof(bGPDspoint) * (gps->totpoints + 1)); if (gps->dvert != NULL) { @@ -2463,11 +2462,6 @@ static void gpencil_stroke_copy_point(bGPDstroke *gps, bGPDspoint *point, int id gps->totpoints++; newpoint = &gps->points[gps->totpoints - 1]; - if (gps->dvert != NULL) { - dvert = &gps->dvert[idx]; - newdvert = &gps->dvert[gps->totpoints - 1]; - } - newpoint->x = point->x * delta[0]; newpoint->y = point->y * delta[1]; newpoint->z = point->z * delta[2]; @@ -2476,8 +2470,13 @@ static void gpencil_stroke_copy_point(bGPDstroke *gps, bGPDspoint *point, int id newpoint->strength = strength; newpoint->time = point->time + deltatime; - newdvert->totweight = dvert->totweight; - newdvert->dw = MEM_dupallocN(dvert->dw); + if (gps->dvert != NULL) { + MDeformVert *dvert = &gps->dvert[idx]; + MDeformVert *newdvert = &gps->dvert[gps->totpoints - 1]; + + newdvert->totweight = dvert->totweight; + newdvert->dw = MEM_dupallocN(dvert->dw); + } } /* Helper: join two strokes using the shortest distance (reorder stroke if necessary ) */ |