[Bf-blender-cvs] [475d536f72] master: Fix minor glitches in GP code.

Bastien Montagne noreply at git.blender.org
Fri Jan 20 18:53:07 CET 2017


Commit: 475d536f720df3ed9bed783e6d108fa1341fe541
Author: Bastien Montagne
Date:   Fri Jan 20 18:46:06 2017 +0100
Branches: master
https://developer.blender.org/rB475d536f720df3ed9bed783e6d108fa1341fe541

Fix minor glitches in GP code.

Reported by coverity scan.

===================================================================

M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/editors/gpencil/gpencil_interpolate.c

===================================================================

diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 2fd574d652..a542bf8fa1 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -1563,7 +1563,7 @@ static void gp_draw_data_all(Scene *scene, bGPdata *gpd, int offsx, int offsy, i
 {
 	bGPdata *gpd_source = NULL;
 	ToolSettings *ts;
-	bGPDbrush *brush;
+	bGPDbrush *brush = NULL;
 	if (scene) {
 		ts = scene->toolsettings;
 		brush = BKE_gpencil_brush_getactive(ts);
@@ -1572,8 +1572,7 @@ static void gp_draw_data_all(Scene *scene, bGPdata *gpd, int offsx, int offsy, i
 			BKE_gpencil_brush_init_presets(ts);
 			brush = BKE_gpencil_brush_getactive(ts);
 		}
-	}
-	if (scene) {
+
 		if (spacetype == SPACE_VIEW3D) {
 			gpd_source = (scene->gpd ? scene->gpd : NULL);
 		}
@@ -1581,13 +1580,12 @@ static void gp_draw_data_all(Scene *scene, bGPdata *gpd, int offsx, int offsy, i
 			/* currently drawing only gpencil data from either clip or track, but not both - XXX fix logic behind */
 			gpd_source = (scene->clip->gpd ? scene->clip->gpd : NULL);
 		}
-		
+
 		if (gpd_source) {
 			if (brush != NULL) {
 				gp_draw_data(brush, ts->gp_sculpt.alpha, gpd_source,
 				             offsx, offsy, winx, winy, cfra, dflag);
 			}
-			
 		}
 	}
 	
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index 0d3fa1fc90..297058168a 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -735,7 +735,7 @@ static float gp_interpolate_seq_easing_calc(GP_Interpolate_Settings *ipo_setting
 			}
 			break;
 			
-		case BEZT_IPO_CIRC:
+		case GP_IPO_CIRC:
 			switch (easing) {
 				case BEZT_IPO_EASE_IN:
 					result = BLI_easing_circ_ease_in(time, begin, change, duration);
@@ -753,7 +753,7 @@ static float gp_interpolate_seq_easing_calc(GP_Interpolate_Settings *ipo_setting
 			}
 			break;
 
-		case BEZT_IPO_CUBIC:
+		case GP_IPO_CUBIC:
 			switch (easing) {
 				case BEZT_IPO_EASE_IN:
 					result = BLI_easing_cubic_ease_in(time, begin, change, duration);




More information about the Bf-blender-cvs mailing list