[Bf-blender-cvs] [bf390d57481] greasepencil-object: Code Cleanup - Style, indentation

Joshua Leung noreply at git.blender.org
Tue Oct 24 13:27:33 CEST 2017


Commit: bf390d57481f07df5bbb9f20f9b229cba1d70746
Author: Joshua Leung
Date:   Tue Oct 24 21:25:00 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rBbf390d57481f07df5bbb9f20f9b229cba1d70746

Code Cleanup - Style, indentation

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

M	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index b7e6458a5fe..75a255f341e 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -207,10 +207,10 @@ static void gpencil_batch_cache_clear(GpencilBatchCache *cache, bGPdata *gpd)
 
 	if (cache->cache_size > 0) {
 		for (int i = 0; i < cache->cache_size; i++) {
-		GWN_BATCH_DISCARD_SAFE(cache->batch_stroke[i]);
-		GWN_BATCH_DISCARD_SAFE(cache->batch_fill[i]);
-		GWN_BATCH_DISCARD_SAFE(cache->batch_edit[i]);
-		GWN_BATCH_DISCARD_SAFE(cache->batch_edlin[i]);
+			GWN_BATCH_DISCARD_SAFE(cache->batch_stroke[i]);
+			GWN_BATCH_DISCARD_SAFE(cache->batch_fill[i]);
+			GWN_BATCH_DISCARD_SAFE(cache->batch_edit[i]);
+			GWN_BATCH_DISCARD_SAFE(cache->batch_edlin[i]);
 		}
 		MEM_SAFE_FREE(cache->batch_stroke);
 		MEM_SAFE_FREE(cache->batch_fill);
@@ -250,8 +250,8 @@ static DRWShadingGroup *DRW_gpencil_shgroup_fill_create(GPENCIL_e_data *e_data,
 
 	/* e_data.gpencil_fill_sh */
 	DRWShadingGroup *grp = DRW_shgroup_create(shader, pass);
-	++stl->g_data->tot_sh;
-	++stl->g_data->tot_sh_fill;
+	stl->g_data->tot_sh++;
+	stl->g_data->tot_sh_fill++;
 
 	DRW_shgroup_uniform_vec4(grp, "color2", palcolor->scolor, 1);
 	stl->shgroups[id].fill_style = palcolor->fill_style;
@@ -319,9 +319,9 @@ DRWShadingGroup *DRW_gpencil_shgroup_stroke_create(GPENCIL_e_data *e_data, GPENC
 
 	/* e_data.gpencil_stroke_sh */
 	DRWShadingGroup *grp = DRW_shgroup_create(shader, pass);
-	++stl->g_data->tot_sh;
+	stl->g_data->tot_sh++;
 	if (id != -1) {
-		++stl->g_data->tot_sh_stroke;
+		stl->g_data->tot_sh_stroke++;
 	}
 
 	DRW_shgroup_uniform_vec2(grp, "Viewport", viewport_size, 1);
@@ -414,8 +414,8 @@ DRWShadingGroup *DRW_gpencil_shgroup_point_create(GPENCIL_e_data *e_data, GPENCI
 
 	/* e_data.gpencil_stroke_sh */
 	DRWShadingGroup *grp = DRW_shgroup_create(shader, pass);
-	++stl->g_data->tot_sh;
-	++stl->g_data->tot_sh_point;
+	stl->g_data->tot_sh++;
+	stl->g_data->tot_sh_point++;
 
 	DRW_shgroup_uniform_vec2(grp, "Viewport", viewport_size, 1);
 	DRW_shgroup_uniform_float(grp, "pixsize", DRW_viewport_pixelsize_get(), 1);
@@ -643,8 +643,8 @@ static void gpencil_draw_onion_strokes(GpencilBatchCache *cache, GPENCIL_e_data
 		/* stroke */
 		gpencil_add_stroke_shgroup(cache, stl->shgroups[id].shgrps_stroke, ob, gpd, gpl, gpf, gps, opacity, tintcolor, true, custonion);
 
-		++stl->storage->shgroup_id;
-		++cache->cache_idx;
+		stl->storage->shgroup_id++;
+		cache->cache_idx++;
 	}
 }
 
@@ -738,7 +738,7 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, GPENCIL_e_data *e_dat
 					stl->shgroups[id].shgrps_stroke = NULL;
 				}
 			}
-			++stl->storage->shgroup_id;
+			stl->storage->shgroup_id++;
 
 			fillgrp = stl->shgroups[id].shgrps_fill;
 			strokegrp = stl->shgroups[id].shgrps_stroke;
@@ -763,11 +763,11 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, GPENCIL_e_data *e_dat
 		if (src_gps) {
 			if (!stl->g_data->shgrps_edit_line) {
 				stl->g_data->shgrps_edit_line = DRW_shgroup_create(e_data->gpencil_line_sh, psl->edit_pass);
-				++stl->g_data->tot_sh;
+				stl->g_data->tot_sh++;
 			}
 			if (!stl->g_data->shgrps_edit_volumetric) {
 				stl->g_data->shgrps_edit_volumetric = DRW_shgroup_create(e_data->gpencil_volumetric_sh, psl->edit_pass);
-				++stl->g_data->tot_sh;
+				stl->g_data->tot_sh++;
 			}
 
 			gpencil_add_editpoints_shgroup(stl, cache, ts, ob, gpd, gpl, derived_gpf, src_gps);
@@ -777,7 +777,7 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, GPENCIL_e_data *e_dat
 			src_gps = src_gps->next;
 		}
 
-		++cache->cache_idx;
+		cache->cache_idx++;
 	}
 }
 
@@ -792,10 +792,11 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T
 
 	bGPDpaletteref *palslot = BKE_gpencil_paletteslot_get_active(gpd);
 	PaletteColor *palcolor = BKE_palette_color_get_active((palslot) ? palslot->palette : NULL);
+	
 	/* drawing strokes */
 	/* Check if may need to draw the active stroke cache, only if this layer is the active layer
-	* that is being edited. (Stroke buffer is currently stored in gp-data)
-	*/
+	 * that is being edited. (Stroke buffer is currently stored in gp-data)
+	 */
 	if (ED_gpencil_session_active() && (gpd->sbuffer_size > 0)) {
 		if ((gpd->sbuffer_sflag & GP_STROKE_ERASER) == 0) {
 			/* It should also be noted that sbuffer contains temporary point types
@@ -827,7 +828,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T
 						gpd->sfill[3] = 0.5f;
 					}
 					stl->g_data->shgrps_drawing_fill = DRW_shgroup_create(e_data->gpencil_drawing_fill_sh, psl->drawing_pass);
-					++stl->g_data->tot_sh;
+					stl->g_data->tot_sh++;
 					stl->g_data->batch_buffer_fill = DRW_gpencil_get_buffer_fill_geom(gpd->sbuffer, gpd->sbuffer_size, gpd->sfill);
 					DRW_shgroup_call_add(stl->g_data->shgrps_drawing_fill, stl->g_data->batch_buffer_fill, stl->storage->unit_matrix);
 				}
@@ -899,7 +900,7 @@ static void gpencil_draw_onionskins(
 		}
 		/* relative range */
 		if (mode == GP_ONION_MODE_RELATIVE) {
-			++idx;
+			idx++;
 			if (idx > step) {
 				break;
 			}
@@ -916,7 +917,7 @@ static void gpencil_draw_onionskins(
 			color[3] = alpha * fac * 0.66f;
 		}
 		else {
-			++idx;
+			idx++;
 			fac = alpha - ((1.1f - (1.0f / (float)idx)) * 0.66f);
 			color[3] = fac;
 		}
@@ -979,7 +980,7 @@ static void gpencil_draw_onionskins(
 		}
 		/* relative range */
 		if (mode == GP_ONION_MODE_RELATIVE) {
-			++idx;
+			idx++;
 			if (idx > step) {
 				break;
 			}
@@ -996,7 +997,7 @@ static void gpencil_draw_onionskins(
 			color[3] = alpha * fac * 0.66f;
 		}
 		else {
-			++idx;
+			idx++;
 			fac = alpha - ((1.1f - (1.0f / (float)idx)) * 0.66f);
 			color[3] = fac;
 		}



More information about the Bf-blender-cvs mailing list