diff options
Diffstat (limited to 'source/blender')
10 files changed, 41 insertions, 45 deletions
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 --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c index 76172443c2d..24ba3aa8981 100644 --- a/source/blender/draw/engines/workbench/workbench_forward.c +++ b/source/blender/draw/engines/workbench/workbench_forward.c @@ -176,14 +176,15 @@ static WORKBENCH_MaterialData *get_or_create_material_data( material->shgrp = grp; /* Depth */ - if (workbench_material_determine_color_type(wpd, material->ima) == V3D_SHADING_TEXTURE_COLOR) - { - material->shgrp_object_outline = DRW_shgroup_create(e_data.object_outline_texture_sh, psl->object_outline_pass); + if (workbench_material_determine_color_type(wpd, material->ima) == V3D_SHADING_TEXTURE_COLOR) { + material->shgrp_object_outline = DRW_shgroup_create( + e_data.object_outline_texture_sh, psl->object_outline_pass); GPUTexture *tex = GPU_texture_from_blender(material->ima, NULL, GL_TEXTURE_2D, false, 0.0f); DRW_shgroup_uniform_texture(material->shgrp_object_outline, "image", tex); } else { - material->shgrp_object_outline = DRW_shgroup_create(e_data.object_outline_sh, psl->object_outline_pass); + material->shgrp_object_outline = DRW_shgroup_create( + e_data.object_outline_sh, psl->object_outline_pass); } material->object_id = engine_object_data->object_id; DRW_shgroup_uniform_int(material->shgrp_object_outline, "object_id", &material->object_id, 1); diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c index 6755bf82ecd..54e8aa1c3b3 100644 --- a/source/blender/draw/engines/workbench/workbench_materials.c +++ b/source/blender/draw/engines/workbench/workbench_materials.c @@ -129,8 +129,7 @@ uint workbench_material_get_hash(WORKBENCH_MaterialData *material_template) result += BLI_ghashutil_uinthash_v4_murmur(input); /* add texture reference */ - if (material_template->ima) - { + if (material_template->ima) { result += BLI_ghashutil_inthash_p_murmur(material_template->ima); } @@ -182,10 +181,10 @@ int workbench_material_determine_color_type(WORKBENCH_PrivateData *wpd, Image *i return color_type; } -void workbench_material_shgroup_uniform(WORKBENCH_PrivateData *wpd, DRWShadingGroup *grp, WORKBENCH_MaterialData *material) +void workbench_material_shgroup_uniform( + WORKBENCH_PrivateData *wpd, DRWShadingGroup *grp, WORKBENCH_MaterialData *material) { - if (workbench_material_determine_color_type(wpd, material->ima) == V3D_SHADING_TEXTURE_COLOR) - { + if (workbench_material_determine_color_type(wpd, material->ima) == V3D_SHADING_TEXTURE_COLOR) { GPUTexture *tex = GPU_texture_from_blender(material->ima, NULL, GL_TEXTURE_2D, false, 0.0f); DRW_shgroup_uniform_texture(grp, "image", tex); } diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 9c5a4392f78..62413e2434c 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1444,7 +1444,7 @@ static void icon_draw_size( di->data.texture.w, di->data.texture.h, alpha, rgb); GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); } - else if (di->type== ICON_TYPE_MONO_TEXTURE) { + else if (di->type == ICON_TYPE_MONO_TEXTURE) { /* icon that matches text color, assumed to be white */ float text_color[4]; UI_GetThemeColor4fv(TH_TEXT, text_color); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index baaa2d638a3..77f4da2d16b 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3528,7 +3528,7 @@ static void sculpt_topology_update(Sculpt *sd, Object *ob, Brush *brush, Unified } if ((sd->flags & SCULPT_DYNTOPO_COLLAPSE) || - (brush->sculpt_tool == SCULPT_TOOL_SIMPLIFY)) + (brush->sculpt_tool == SCULPT_TOOL_SIMPLIFY)) { mode |= PBVH_Collapse; } diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 1fb76a93e27..573540ee641 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -20,7 +20,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/makesrna/intern/rna_light.c +/** \file blender/makesrna/intern/rna_lamp.c * \ingroup RNA */ diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c index 32c9244735d..919af171756 100644 --- a/source/blender/nodes/shader/node_shader_tree.c +++ b/source/blender/nodes/shader/node_shader_tree.c @@ -243,11 +243,11 @@ bNode *ntreeShaderOutputNode(bNodeTree *ntree, int target) if (output_node == NULL) { output_node = node; } - else if(output_node->custom1 == SHD_OUTPUT_ALL) { + else if (output_node->custom1 == SHD_OUTPUT_ALL) { output_node = node; } else if ((node->flag & NODE_DO_OUTPUT) && - !(output_node->flag & NODE_DO_OUTPUT)) + !(output_node->flag & NODE_DO_OUTPUT)) { output_node = node; } |