[Bf-blender-cvs] [73d2d75eeda] blender2.8: Cleanup: rename 'ct' to 'len' for editors

Campbell Barton noreply at git.blender.org
Sun Jul 8 13:20:58 CEST 2018


Commit: 73d2d75eeda3b15e1ca1a3136ad9818cd230dbbc
Author: Campbell Barton
Date:   Sun Jul 8 13:19:10 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB73d2d75eeda3b15e1ca1a3136ad9818cd230dbbc

Cleanup: rename 'ct' to 'len' for editors

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

M	source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl
M	source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl
M	source/blender/editors/animation/keyframes_draw.c
M	source/blender/editors/interface/interface_draw.c
M	source/blender/editors/interface/interface_panel.c
M	source/blender/editors/space_clip/clip_dopesheet_draw.c
M	source/blender/editors/space_nla/nla_draw.c
M	source/blender/editors/space_node/node_draw.c
M	source/blender/editors/space_sequencer/sequencer_draw.c

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

diff --git a/source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl b/source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl
index 948392bd8ee..d8c8f22ed1c 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl
@@ -6,24 +6,24 @@
 
 #ifdef DOUBLE_MANIFOLD
 #  ifdef USE_INVOC_EXT
-#    define invoc_ct 2
+#    define invoc_len 2
 #  else
-#    define vert_ct 6
+#    define vert_len 6
 #  endif
 #else
 #  ifdef USE_INVOC_EXT
-#    define invoc_ct 2
+#    define invoc_len 2
 #  else
-#    define vert_ct 6
+#    define vert_len 6
 #  endif
 #endif
 
 #ifdef USE_INVOC_EXT
-layout(triangles, invocations = invoc_ct) in;
+layout(triangles, invocations = invoc_len) in;
 layout(triangle_strip, max_vertices = 3) out;
 #else
 layout(triangles) in;
-layout(triangle_strip, max_vertices = vert_ct) out;
+layout(triangle_strip, max_vertices = vert_len) out;
 #endif
 
 uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57);
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl b/source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl
index 5a31aa34932..7418f86a58e 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl
@@ -6,24 +6,24 @@
 
 #ifdef DOUBLE_MANIFOLD
 #  ifdef USE_INVOC_EXT
-#    define invoc_ct 2
+#    define invoc_len 2
 #  else
-#    define vert_ct 8
+#    define vert_len 8
 #  endif
 #else
 #  ifdef USE_INVOC_EXT
-#    define invoc_ct 1
+#    define invoc_len 1
 #  else
-#    define vert_ct 4
+#    define vert_len 4
 #  endif
 #endif
 
 #ifdef USE_INVOC_EXT
-layout(lines_adjacency, invocations = invoc_ct) in;
+layout(lines_adjacency, invocations = invoc_len) in;
 layout(triangle_strip, max_vertices = 4) out;
 #else
 layout(lines_adjacency) in;
-layout(triangle_strip, max_vertices = vert_ct) out;
+layout(triangle_strip, max_vertices = vert_len) out;
 #endif
 
 uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57);
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index e06c443e8f0..78ce24db503 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -585,20 +585,20 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa
 		copy_v4_v4(unsel_mhcol, unsel_color);
 		unsel_mhcol[3] *= 0.8f;
 
-		unsigned int block_ct = 0;
+		uint block_len = 0;
 		for (ActKeyBlock *ab = blocks->first; ab; ab = ab->next) {
 			if (actkeyblock_is_valid(ab, keys)) {
-				block_ct++;
+				block_len++;
 			}
 		}
 
-		if (block_ct > 0) {
+		if (block_len > 0) {
 			Gwn_VertFormat *format = immVertexFormat();
 			uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
 			uint color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT);
 			immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
 
-			immBegin(GWN_PRIM_TRIS, 6 * block_ct);
+			immBegin(GWN_PRIM_TRIS, 6 * block_len);
 			for (ActKeyBlock *ab = blocks->first; ab; ab = ab->next) {
 				if (actkeyblock_is_valid(ab, keys)) {
 					if (ab->flag & ACTKEYBLOCK_FLAG_MOVING_HOLD) {
@@ -622,16 +622,16 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa
 
 	if (keys) {
 		/* count keys */
-		unsigned int key_ct = 0;
+		uint key_len = 0;
 		for (ActKeyColumn *ak = keys->first; ak; ak = ak->next) {
 			/* optimization: if keyframe doesn't appear within 5 units (screenspace) in visible area, don't draw
 			 *	- this might give some improvements, since we current have to flip between view/region matrices
 			 */
 			if (IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax))
-				key_ct++;
+				key_len++;
 		}
 
-		if (key_ct > 0) {
+		if (key_len > 0) {
 			/* draw keys */
 			Gwn_VertFormat *format = immVertexFormat();
 			uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
@@ -640,7 +640,7 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa
 			uint outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT);
 			immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND);
 			GPU_enable_program_point_size();
-			immBegin(GWN_PRIM_POINTS, key_ct);
+			immBegin(GWN_PRIM_POINTS, key_len);
 
 			for (ActKeyColumn *ak = keys->first; ak; ak = ak->next) {
 				if (IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax)) {
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 336b996f169..0a8a6d1f832 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -166,16 +166,16 @@ void UI_draw_roundbox_4fv(bool filled, float minx, float miny, float maxx, float
 		mul_v2_fl(vec[a], rad);
 	}
 
-	unsigned int vert_ct = 0;
-	vert_ct += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 9 : 1;
-	vert_ct += (roundboxtype & UI_CNR_TOP_RIGHT) ? 9 : 1;
-	vert_ct += (roundboxtype & UI_CNR_TOP_LEFT) ? 9 : 1;
-	vert_ct += (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 9 : 1;
+	uint vert_len = 0;
+	vert_len += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 9 : 1;
+	vert_len += (roundboxtype & UI_CNR_TOP_RIGHT) ? 9 : 1;
+	vert_len += (roundboxtype & UI_CNR_TOP_LEFT) ? 9 : 1;
+	vert_len += (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 9 : 1;
 
 	immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 	immUniformColor4fv(col);
 
-	immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_LOOP, vert_ct);
+	immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_LOOP, vert_len);
 	/* start with corner right-bottom */
 	if (roundboxtype & UI_CNR_BOTTOM_RIGHT) {
 		immVertex2f(pos, maxx - rad, miny);
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index ccb025d534f..538f188c436 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1738,22 +1738,22 @@ static void ui_panel_category_draw_tab(
 		mul_v2_fl(vec[a], rad);
 	}
 
-	unsigned int vert_ct = 0;
+	uint vert_len = 0;
 	if (use_highlight) {
-		vert_ct += (roundboxtype & UI_CNR_TOP_RIGHT) ? 6 : 1;
-		vert_ct += (roundboxtype & UI_CNR_TOP_LEFT) ? 6 : 1;
+		vert_len += (roundboxtype & UI_CNR_TOP_RIGHT) ? 6 : 1;
+		vert_len += (roundboxtype & UI_CNR_TOP_LEFT) ? 6 : 1;
 	}
 	if (use_highlight && !use_shadow) {
-		vert_ct++;
+		vert_len++;
 	}
 	else {
-		vert_ct += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 6 : 1;
-		vert_ct += (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 6 : 1;
+		vert_len += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 6 : 1;
+		vert_len += (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 6 : 1;
 	}
 
 	immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR);
 
-	immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_STRIP, vert_ct);
+	immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_STRIP, vert_len);
 
 	/* start with corner right-top */
 	if (use_highlight) {
diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c
index 60a8c77bcc4..76450cba3cb 100644
--- a/source/blender/editors/space_clip/clip_dopesheet_draw.c
+++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c
@@ -128,7 +128,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
 		float strip[4], selected_strip[4];
 		float height = (dopesheet->tot_channel * CHANNEL_STEP) + (CHANNEL_HEIGHT);
 
-		unsigned int keyframe_ct = 0;
+		uint keyframe_len = 0;
 
 		Gwn_VertFormat *format = immVertexFormat();
 		uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
@@ -186,10 +186,10 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
 					if (start_frame != end_frame) {
 						immRectf(pos_id, start_frame, (float) y - STRIP_HEIGHT_HALF,
 						         end_frame, (float) y + STRIP_HEIGHT_HALF);
-						keyframe_ct += 2;
+						keyframe_len += 2;
 					}
 					else {
-						keyframe_ct++;
+						keyframe_len++;
 					}
 				}
 
@@ -199,7 +199,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
 					MovieTrackingMarker *marker = &track->markers[i];
 
 					if ((marker->flag & (MARKER_DISABLED | MARKER_TRACKED)) == 0) {
-						keyframe_ct++;
+						keyframe_len++;
 					}
 
 					i++;
@@ -212,7 +212,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
 
 		immUnbindProgram();
 
-		if (keyframe_ct > 0) {
+		if (keyframe_len > 0) {
 			/* draw keyframe markers */
 			format = immVertexFormat();
 			pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
@@ -222,7 +222,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
 
 			immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND);
 			GPU_enable_program_point_size();
-			immBegin(GWN_PRIM_POINTS, keyframe_ct);
+			immBegin(GWN_PRIM_POINTS, keyframe_len);
 
 			/* all same size with black outline */
 			immAttrib1f(size_id, 2.0f * STRIP_HEIGHT_HALF);
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index b9f92f383c4..3f1bd0db74c 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -138,9 +138,9 @@ static void nla_action_draw_keyframes(AnimData *adt, bAction *act, float y, floa
 
 	/* count keys before drawing */
 	/* Note: It's safe to cast DLRBT_Tree, as it's designed to degrade down to a ListBase */
-	unsigned int key_ct = BLI_listbase_count((ListBase *)&keys);
+	uint key_len = BLI_listbase_count((ListBase *)&keys);
 
-	if (key_ct > 0) {
+	if (key_len > 0) {
 		format = immVertexFormat();
 		pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
 		uint size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT);
@@ -148,7 +148,7 @@ static void nla_action_draw_keyframes(AnimData *adt, bAction *act, float y, floa
 		uint outline_color_id = GWN_

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list