[Bf-blender-cvs] [fb262f942e4] blender2.8: Cleanup: style, includes

Campbell Barton noreply at git.blender.org
Mon Nov 26 22:02:21 CET 2018


Commit: fb262f942e44f86931f3519383da9ad350733afb
Author: Campbell Barton
Date:   Tue Nov 27 08:00:49 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBfb262f942e44f86931f3519383da9ad350733afb

Cleanup: style, includes

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

M	source/blender/blenlib/BLI_timer.h
M	source/blender/blenlib/intern/BLI_timer.c
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M	source/blender/draw/engines/gpencil/gpencil_engine.c
M	source/blender/draw/engines/workbench/workbench_data.c
M	source/blender/draw/engines/workbench/workbench_forward.c
M	source/blender/draw/intern/draw_cache_impl_particles.c
M	source/blender/draw/intern/draw_hair.c
M	source/blender/editors/io/io_collada.c

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

diff --git a/source/blender/blenlib/BLI_timer.h b/source/blender/blenlib/BLI_timer.h
index 6dfb13fd738..8f18d4fb3f4 100644
--- a/source/blender/blenlib/BLI_timer.h
+++ b/source/blender/blenlib/BLI_timer.h
@@ -15,7 +15,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * The Original Code is Copyright (C) 2018 Blender Foundation.
  * All rights reserved.
  *
  * ***** END GPL LICENSE BLOCK *****
@@ -24,7 +24,7 @@
 #ifndef __BLI_TIMER_H__
 #define __BLI_TIMER_H__
 
-#include "BLI_utildefines.h"
+#include "BLI_sys_types.h"
 
 /** \file BLI_timer.h
  *  \ingroup BLI
diff --git a/source/blender/blenlib/intern/BLI_timer.c b/source/blender/blenlib/intern/BLI_timer.c
index 875b667de46..7bb919d47e0 100644
--- a/source/blender/blenlib/intern/BLI_timer.c
+++ b/source/blender/blenlib/intern/BLI_timer.c
@@ -15,11 +15,9 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2018 Blender Foundation.
  * All rights reserved.
  *
- * The Original Code is: all of this file, with exception of below:
- *
  * ***** END GPL LICENSE BLOCK *****
  */
 
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 5e1ebee337c..b5a221a2215 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1034,7 +1034,8 @@ void DepsgraphRelationBuilder::build_constraints(ID *id,
 					}
 					/* if needs bbone shape, reference the segment computation */
 					if (BKE_constraint_target_uses_bbone(con, ct) &&
-					    bone_has_segments(ct->tar, ct->subtarget)) {
+					    bone_has_segments(ct->tar, ct->subtarget))
+					{
 						opcode = DEG_OPCODE_BONE_SEGMENTS;
 					}
 					OperationKey target_key(&ct->tar->id,
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index e4d6fa582b8..932a6cc3df0 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -252,7 +252,7 @@ static void DRW_gpencil_recalc_geometry_caches(
 		if ((gps->tot_triangles == 0) || (gps->triangles == NULL)) {
 			if ((gps->totpoints > 2) &&
 			    ((gp_style->fill_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) ||
-				(gp_style->fill_style > 0) || (gpl->blend_mode != eGplBlendMode_Normal)))
+			     (gp_style->fill_style > 0) || (gpl->blend_mode != eGplBlendMode_Normal)))
 			{
 				DRW_gpencil_triangulate_stroke_fill(ob, gps);
 			}
@@ -562,8 +562,9 @@ static void gpencil_add_fill_vertexdata(
 		interp_v3_v3v3(tfill, gps->runtime.tmp_fill_rgba, tintcolor, tintcolor[3]);
 		tfill[3] = gps->runtime.tmp_fill_rgba[3] * opacity;
 		if ((tfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) ||
-			(gp_style->fill_style > 0) ||
-			(gpl->blend_mode != eGplBlendMode_Normal)) {
+		    (gp_style->fill_style > 0) ||
+		    (gpl->blend_mode != eGplBlendMode_Normal))
+		{
 			if (cache->is_dirty) {
 				const float *color;
 				if (!onion) {
@@ -586,7 +587,7 @@ static void gpencil_add_fill_vertexdata(
 				if (old_len < cache->b_fill.vbo_len) {
 					cache->grp_cache = gpencil_group_cache_add(
 					        cache->grp_cache, gpl, gpf, gps,
-							eGpencilBatchGroupType_Fill, onion,
+					        eGpencilBatchGroupType_Fill, onion,
 					        cache->b_fill.vbo_len,
 					        &cache->grp_size, &cache->grp_used);
 				}
@@ -643,7 +644,7 @@ static void gpencil_add_stroke_vertexdata(
 			if (old_len < cache->b_stroke.vbo_len) {
 				cache->grp_cache = gpencil_group_cache_add(
 				        cache->grp_cache, gpl, gpf, gps,
-						eGpencilBatchGroupType_Stroke, onion,
+				        eGpencilBatchGroupType_Stroke, onion,
 				        cache->b_stroke.vbo_len,
 				        &cache->grp_size, &cache->grp_used);
 			}
@@ -694,7 +695,7 @@ static void gpencil_add_editpoints_vertexdata(
 				/* add to list of groups */
 				cache->grp_cache = gpencil_group_cache_add(
 				        cache->grp_cache, gpl, gpf, gps,
-						eGpencilBatchGroupType_Edlin, false,
+				        eGpencilBatchGroupType_Edlin, false,
 				        cache->b_edlin.vbo_len,
 				        &cache->grp_size, &cache->grp_used);
 			}
@@ -707,7 +708,7 @@ static void gpencil_add_editpoints_vertexdata(
 						/* add to list of groups */
 						cache->grp_cache = gpencil_group_cache_add(
 						        cache->grp_cache, gpl, gpf, gps,
-								eGpencilBatchGroupType_Edit, false,
+						        eGpencilBatchGroupType_Edit, false,
 						        cache->b_edit.vbo_len,
 						        &cache->grp_size, &cache->grp_used);
 					}
@@ -786,7 +787,7 @@ static void gpencil_draw_strokes(
 		if ((stl->storage->simplify_fill) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_REMOVE_FILL_LINE)) {
 			if ((gp_style->fill_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) ||
 			    (gp_style->fill_style > GP_STYLE_FILL_STYLE_SOLID) ||
-				(gpl->blend_mode != eGplBlendMode_Normal))
+			    (gpl->blend_mode != eGplBlendMode_Normal))
 			{
 				GP_SET_SRC_GPS(src_gps);
 				continue;
@@ -809,12 +810,12 @@ static void gpencil_draw_strokes(
 
 			/* hide any blend layer */
 			if ((!stl->storage->simplify_blend) ||
-				(gpl->blend_mode == eGplBlendMode_Normal))
+			    (gpl->blend_mode == eGplBlendMode_Normal))
 			{
 				/* fill */
 				if ((gp_style->flag & GP_STYLE_FILL_SHOW) &&
-					(!stl->storage->simplify_fill) &&
-					((gps->flag & GP_STROKE_NOFILL) == 0))
+				    (!stl->storage->simplify_fill) &&
+				    ((gps->flag & GP_STROKE_NOFILL) == 0))
 				{
 					gpencil_add_fill_vertexdata(
 						cache, ob, gpl, derived_gpf, gps,
@@ -822,8 +823,8 @@ static void gpencil_draw_strokes(
 				}
 				/* stroke */
 				if ((gp_style->flag & GP_STYLE_STROKE_SHOW) &&
-					((gp_style->stroke_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) ||
-					(gpl->blend_mode == eGplBlendMode_Normal)))
+				    ((gp_style->stroke_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) ||
+				     (gpl->blend_mode == eGplBlendMode_Normal)))
 				{
 					gpencil_add_stroke_vertexdata(
 						cache, ob, gpl, derived_gpf, gps,
@@ -1301,8 +1302,7 @@ static void DRW_gpencil_shgroups_create(
 			tag_first = true;
 		}
 		else {
-			if (elm->gpl != gpl_prev)
-			{
+			if (elm->gpl != gpl_prev) {
 				/* first layer is always blend Normal */
 				array_elm->mode = idx == 0 ? eGplBlendMode_Normal: gpl->blend_mode;
 				array_elm->end_shgrp = shgrp;
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index a80ad133d09..a7141ff93bb 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -781,8 +781,8 @@ void GPENCIL_draw_scene(void *ved)
 						array_elm = &cache_ob->shgrp_array[e];
 
 						if (((array_elm->mode == eGplBlendMode_Normal) &&
-							(!use_blend) && (!array_elm->clamp_layer)) ||
-							( e == 0))
+						     (!use_blend) && (!array_elm->clamp_layer)) ||
+						    (e == 0))
 						{
 							if (init_shgrp == NULL) {
 								init_shgrp = array_elm->init_shgrp;
diff --git a/source/blender/draw/engines/workbench/workbench_data.c b/source/blender/draw/engines/workbench/workbench_data.c
index e92cb704216..18f4ced6074 100644
--- a/source/blender/draw/engines/workbench/workbench_data.c
+++ b/source/blender/draw/engines/workbench/workbench_data.c
@@ -84,8 +84,8 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd)
 	copy_v3_v3(wd->object_outline_color, wpd->shading.object_outline_color);
 	wd->object_outline_color[3] = 1.0f;
 
-	wd->curvature_ridge = 0.5f / max_ff(wpd->shading.curvature_ridge_factor*wpd->shading.curvature_ridge_factor, 1e-4f);
-	wd->curvature_valley = 0.7f / max_ff(wpd->shading.curvature_valley_factor*wpd->shading.curvature_valley_factor, 1e-4f);
+	wd->curvature_ridge = 0.5f / max_ff(SQUARE(wpd->shading.curvature_ridge_factor), 1e-4f);
+	wd->curvature_valley = 0.7f / max_ff(SQUARE(wpd->shading.curvature_valley_factor), 1e-4f);
 
 	wpd->world_ubo = DRW_uniformbuffer_create(sizeof(WORKBENCH_UBO_World), &wpd->world_data);
 
@@ -111,7 +111,12 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd)
 		wpd->ssao_params[3] = 0;
 
 		/* distance, factor, factor, attenuation */
-		copy_v4_fl4(wpd->ssao_settings, scene->display.matcap_ssao_distance, wpd->shading.cavity_valley_factor, wpd->shading.cavity_ridge_factor, scene->display.matcap_ssao_attenuation);
+		copy_v4_fl4(
+		        wpd->ssao_settings,
+		        scene->display.matcap_ssao_distance,
+		        wpd->shading.cavity_valley_factor,
+		        wpd->shading.cavity_ridge_factor,
+		        scene->display.matcap_ssao_attenuation);
 
 		/* invert the view matrix */
 		DRW_viewport_matrix_get(wpd->winmat, DRW_MAT_WIN);
diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c
index 2da40a51e60..22b2a4020af 100644
--- a/source/blender/draw/engines/workbench/workbench_forward.c
+++ b/source/blender/draw/engines/workbench/workbench_forward.c
@@ -416,7 +416,6 @@ static void workbench_forward_cache_populate_particles(WORKBENCH_Data *vedata, O
 	WORKBENCH_StorageList *stl = vedata->stl;
 	WORKBENCH_PassList *psl = vedata->psl;
 	WORKBENCH_PrivateData *wpd = stl->g_data;
-	const DRWContextState *draw_ctx = DRW_context_state_get();
 
 	for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
 		if (md->type != eModifierType_ParticleSystem) {
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c
index 46ce115c382..c8185c2db60 100644
--- a/source/blender/draw/intern/draw_cache_impl_particles.c
+++ b/source/blender/draw/intern/draw_cache_impl_particles.c
@@ -687,7 +687,7 @@ static float particle_key_select_ratio(const PTCacheEdit *edit, int strand, floa
 		int index = (int)interp;
 		interp -= floorf

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list