[Bf-blender-cvs] [9536f920e37] blender2.8: Cleanup: style
Campbell Barton
noreply at git.blender.org
Tue Jul 10 09:29:50 CEST 2018
Commit: 9536f920e375cddbb83e55c53e50a3b8cab54ce6
Author: Campbell Barton
Date: Tue Jul 10 09:29:30 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9536f920e375cddbb83e55c53e50a3b8cab54ce6
Cleanup: style
===================================================================
M source/blender/blenkernel/intern/studiolight.c
M source/blender/depsgraph/intern/builder/deg_builder.cc
M source/blender/draw/engines/workbench/workbench_effect_aa.c
M source/blender/draw/engines/workbench/workbench_effect_taa.c
M source/blender/draw/engines/workbench/workbench_forward.c
M source/blender/draw/engines/workbench/workbench_materials.c
M source/blender/editors/interface/interface_icons.c
M source/blender/editors/sculpt_paint/sculpt.c
M source/blender/makesrna/intern/rna_lamp.c
M source/blender/nodes/shader/node_shader_tree.c
===================================================================
diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c
index 468a961627e..dbe5228b6ea 100644
--- a/source/blender/blenkernel/intern/studiolight.c
+++ b/source/blender/blenkernel/intern/studiolight.c
@@ -120,7 +120,7 @@ static void studiolight_free(struct StudioLight *sl)
STUDIOLIGHT_DELETE_ICON(sl->icon_id_matcap_flipped);
#undef STUDIOLIGHT_DELETE_ICON
- for (int index = 0 ; index < 6 ; index ++) {
+ for (int index = 0; index < 6; index++) {
IMB_SAFE_FREE(sl->radiance_cubemap_buffers[index]);
}
GPU_TEXTURE_SAFE_FREE(sl->equirectangular_radiance_gputexture);
@@ -152,7 +152,7 @@ static struct StudioLight *studiolight_create(int flag)
sl->icon_id_irradiance = BKE_icon_ensure_studio_light(sl, STUDIOLIGHT_ICON_ID_TYPE_IRRADIANCE);
}
- for (int index = 0 ; index < 6 ; index ++) {
+ for (int index = 0; index < 6; index++) {
sl->radiance_cubemap_buffers[index] = NULL;
}
@@ -193,9 +193,9 @@ static void studiolight_calculate_radiance_buffer(
float xf;
float *color = colbuf;
- for (int y = 0; y < STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE; y ++, yf += add_y) {
+ for (int y = 0; y < STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE; y++, yf += add_y) {
xf = start_x;
- for (int x = 0; x < STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE; x ++, xf += add_x) {
+ for (int x = 0; x < STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE; x++, xf += add_x) {
direction[index_x] = xf;
direction[index_y] = yf;
direction[index_z] = z;
@@ -234,7 +234,7 @@ static void studiolight_create_equirectangular_radiance_gputexture(StudioLight *
float *offset4 = ibuf->rect_float;
float *offset3 = sl->gpu_matcap_3components;
- for (int i = 0 ; i < ibuf->x * ibuf->y; i++) {
+ for (int i = 0; i < ibuf->x * ibuf->y; i++) {
copy_v3_v3(offset3, offset4);
offset3 += 3;
offset4 += 4;
@@ -336,8 +336,8 @@ BLI_INLINE void studiolight_evaluate_radiance_buffer(
float angle;
float *radiance_color = radiance_buffer->rect_float;
float direction[3];
- for (int y = 0; y < STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE; y ++) {
- for (int x = 0; x < STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE; x ++) {
+ for (int y = 0; y < STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE; y++) {
+ for (int x = 0; x < STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE; x++) {
// calculate light direction;
direction[zoffset] = zvalue;
direction[xoffset] = (x / (float)STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) - 0.5f;
@@ -345,7 +345,7 @@ BLI_INLINE void studiolight_evaluate_radiance_buffer(
normalize_v3(direction);
angle = fmax(0.0f, dot_v3v3(direction, normal));
madd_v3_v3fl(color, radiance_color, angle);
- (*hits) ++;
+ (*hits)++;
radiance_color += 4;
}
}
@@ -504,7 +504,7 @@ static void studiolight_calculate_spherical_harmonics_coefficient(StudioLight *s
}
case 11:
{
- coef = (0.9461746957575601f * nz * nx * (-1.0f +7.0f*ny2)) / -24.0f;
+ coef = (0.9461746957575601f * nz * nx * (-1.0f + 7.0f * ny2)) / -24.0f;
break;
}
case 12:
@@ -514,7 +514,7 @@ static void studiolight_calculate_spherical_harmonics_coefficient(StudioLight *s
}
case 13:
{
- coef = ((105.0f*ny4-90.0f*ny2+9.0f)/28.359261614f) / -24.0f;
+ coef = ((105.0f * ny4 - 90.0f * ny2 + 9.0f) / 28.359261614f) / -24.0f;
break;
}
case 14:
@@ -621,7 +621,7 @@ static void studiolight_apply_spherical_harmonics_windowing(StudioLight *sl, flo
/* Apply windowing lambda */
index = 0;
- for (int level = 0; level <= STUDIOLIGHT_SPHERICAL_HARMONICS_LEVEL; level ++) {
+ for (int level = 0; level <= STUDIOLIGHT_SPHERICAL_HARMONICS_LEVEL; level++) {
float s = 1.0f / (1.0f + lambda * SQUARE(level) * SQUARE(level + 1.0f));
for (int m = -1; m <= level; m++) {
@@ -666,9 +666,9 @@ BLI_INLINE void studiolight_sample_spherical_harmonics(StudioLight *sl, float co
const float nz4 = SQUARE(nz2);
madd_v3_v3fl(color, sl->spherical_harmonics_coefs[9], 2.5033429417967046f * nx * nz * (nx2 - nz2));
madd_v3_v3fl(color, sl->spherical_harmonics_coefs[10], -1.7701307697799304f * nz * ny * (3.0f * nx2 - nz2));
- madd_v3_v3fl(color, sl->spherical_harmonics_coefs[11], 0.9461746957575601f * nz * nx * (-1.0f + 7.0f*ny2));
+ madd_v3_v3fl(color, sl->spherical_harmonics_coefs[11], 0.9461746957575601f * nz * nx * (-1.0f + 7.0f * ny2));
madd_v3_v3fl(color, sl->spherical_harmonics_coefs[12], -0.6690465435572892f * nz * ny * (-3.0f + 7.0f * ny2));
- madd_v3_v3fl(color, sl->spherical_harmonics_coefs[13], (105.0f*ny4-90.0f*ny2+9.0f)/28.359261614f);
+ madd_v3_v3fl(color, sl->spherical_harmonics_coefs[13], (105.0f * ny4 - 90.0f * ny2 + 9.0f) / 28.359261614f);
madd_v3_v3fl(color, sl->spherical_harmonics_coefs[14], -0.6690465435572892f * nx * ny * (-3.0f + 7.0f * ny2));
madd_v3_v3fl(color, sl->spherical_harmonics_coefs[15], 0.9461746957575601f * (nx2 - nz2) * (-1.0f + 7.0f * ny2));
madd_v3_v3fl(color, sl->spherical_harmonics_coefs[16], -1.7701307697799304f * nx * ny * (nx2 - 3.0f * nz2));
@@ -683,7 +683,7 @@ static void studiolight_calculate_diffuse_light(StudioLight *sl)
if (sl->flag & STUDIOLIGHT_EXTERNAL_FILE) {
BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_RADIANCE_BUFFERS_CALCULATED);
- for (int comp = 0; comp < STUDIOLIGHT_SPHERICAL_HARMONICS_COMPONENTS; comp ++) {
+ for (int comp = 0; comp < STUDIOLIGHT_SPHERICAL_HARMONICS_COMPONENTS; comp++) {
studiolight_calculate_spherical_harmonics_coefficient(sl, comp);
}
@@ -705,8 +705,8 @@ static void studiolight_calculate_diffuse_light(StudioLight *sl)
static float texel_coord_solid_angle(float a_U, float a_V, int a_Size)
{
//scale up to [-1, 1] range (inclusive), offset by 0.5 to point to texel center.
- float u = (2.0f * ((float)a_U + 0.5f) / (float)a_Size ) - 1.0f;
- float v = (2.0f * ((float)a_V + 0.5f) / (float)a_Size ) - 1.0f;
+ float u = (2.0f * ((float)a_U + 0.5f) / (float)a_Size) - 1.0f;
+ float v = (2.0f * ((float)a_V + 0.5f) / (float)a_Size) - 1.0f;
float resolution_inv = 1.0f / a_Size;
@@ -729,8 +729,8 @@ BLI_INLINE void studiolight_evaluate_specular_radiance_buffer(
float angle;
float *radiance_color = radiance_buffer->rect_float;
float direction[3];
- for (int y = 0; y < STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE; y ++) {
- for (int x = 0; x < STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE; x ++) {
+ for (int y = 0; y < STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE; y++) {
+ for (int x = 0; x < STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE; x++) {
// calculate light direction;
float u = (x / (float)STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) - 0.5f;
float v = (y / (float)STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) - 0.5f;
@@ -823,10 +823,10 @@ static void studiolight_calculate_irradiance_equirectangular_image(StudioLight *
float *colbuf = MEM_mallocN(STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_WIDTH * STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_HEIGHT * sizeof(float[4]), __func__);
float *color = colbuf;
- for (int y = 0; y < STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_HEIGHT ; y ++) {
+ for (int y = 0; y < STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_HEIGHT; y++) {
float yf = y / (float)STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_HEIGHT;
- for (int x = 0; x < STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_WIDTH ; x ++) {
+ for (int x = 0; x < STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_WIDTH; x++) {
float xf = x / (float)STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_WIDTH;
float dir[3];
equirectangular_to_direction(dir, xf, yf);
@@ -875,8 +875,8 @@ static void studiolight_calculate_light_direction(StudioLight *sl)
/* go over every pixel, determine light, if higher calc direction off the light */
float new_light;
float *color = ibuf->rect_float;
- for (int y = 0; y < STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_HEIGHT; y ++) {
- for (int x = 0; x < STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_WIDTH; x ++) {
+ for (int y = 0; y < STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_HEIGHT; y++) {
+ for (int x = 0; x < STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_WIDTH; x++) {
new_light = color[0] + color[1] + color[2];
if (new_light > best_light) {
float u = x / (float)STUDIOLIGHT_IRRADIANCE_EQUIRECTANGULAR_WIDTH;
diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc
index 34da29652a4..4cbc7700947 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder.cc
@@ -70,7 +70,7 @@ void deg_graph_build_finalize(Main *bmain, Depsgraph *graph)
}
if (flag != 0) {
DEG_graph_id_tag_update(bmain,
- (::Depsgraph*)graph,
+ (::Depsgraph *)graph,
id_node->id_orig,
flag);
}
diff --git a/source/blender/draw/engines/workbench/workbench_effect_aa.c b/source/blender/draw/engines/workbench/workbench_effect_aa.c
index 95a81649522..f1d5d5d6078 100644
--- a/source/blender/draw/engines/workbench/workbench_effect_aa.c
+++ b/source/blender/draw/engines/workbench/workbench_effect_aa.c
@@ -67,8 +67,7 @@ void workbench_aa_draw_pass(WORKBENCH_Data *vedata, GPUTexture *tx)
* the workbench_taa_draw_screen_end will fill the history buffer
* for the other iterations.
*/
- if (effect_info->jitter_index == 1)
- {
+ if (effect_info->jitter_index == 1) {
GPU_framebuffer_bind(dfbl->color_only_fb);
DRW_transform_to_display(tx);
}
diff --git a/source/blender/draw/engines/workbench/workbench_effect_taa.c b/source/blender/draw/engines/workbench/workbench_effect_taa.c
index 302cb27cbb9..fbeccc19660 100644
--- a/source/blender/draw/engines/workbench/workbench_effect_taa.c
+++ b/source/blender/draw/engines/workbench/workbench_effect_taa.c
@@ -105,8 +105,7 @@ int workbench_taa_calculate_num_iterations(WORKBENCH_Data *vedata)
{
result = 16;
}
- else
- {
+ else {
result = 32;
}
}
@@ -288,11 +287,9 @@ void workbench_taa_draw_scene_end(WORKBENCH_Data *vedata)
void workbench_taa_view_updated(WORKBENCH_Data *vedata)
{
WORKBENCH_StorageList *stl = vedata->stl;
- if (stl)
- {
+ if (stl) {
WORKBENCH_EffectInfo *effect_info = stl->effects;
- if (effect_info)
- {
+ if (effect_info) {
effect_info->view_updated = true;
}
}
diff --g
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list