diff options
Diffstat (limited to 'source/blender')
16 files changed, 53 insertions, 51 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 69168c4dd3d..2f392271157 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -88,9 +88,7 @@ static SceneCollection *collection_add(ID *owner_id, SceneCollection *sc_parent, else { const int number = BLI_listbase_count(&sc_parent->scene_collections) + 1; const int digits = integer_digits_i(number); - const int max_len = sizeof(sc_parent->name) - - 1 /* NULL terminator */ - - (1 + digits) /* " %d" */; + const int max_len = sizeof(sc_parent->name) - 1 /* NULL terminator */ - (1 + digits) /* " %d" */; name = BLI_sprintfN("%.*s %d", max_len, sc_parent->name, number); } } diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index cb7b72bdabd..8e7b7f5456b 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -569,9 +569,9 @@ struct LayerCollection *BKE_layer_collection_duplicate(struct ID *owner_id, stru layer_collection); if (layer_collections_parent != NULL) { layer_collection_new = BLI_findptr( - layer_collections_parent, - scene_collection_new, - offsetof(LayerCollection, scene_collection)); + layer_collections_parent, + scene_collection_new, + offsetof(LayerCollection, scene_collection)); break; } } diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 9d911ffdf27..93c6a9cccba 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -611,7 +611,7 @@ void do_versions_after_linking_280(Main *main) #endif if (object->particlesystem.first) { object->duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT; - for (ParticleSystem *psys = object->particlesystem.first; psys; psys=psys->next) { + for (ParticleSystem *psys = object->particlesystem.first; psys; psys = psys->next) { if (psys->part->draw & PART_DRAW_EMITTER) { object->duplicator_visibility_flag |= OB_DUPLI_FLAG_RENDER; #ifndef VERSION_280_SUBVERSION_4 @@ -902,11 +902,11 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main) SpaceOops *so = (SpaceOops *)sl; if (!ELEM(so->outlinevis, - SO_SCENES, - SO_GROUPS, - SO_LIBRARIES, - SO_SEQUENCE, - SO_DATABLOCKS, + SO_SCENES, + SO_GROUPS, + SO_LIBRARIES, + SO_SEQUENCE, + SO_DATABLOCKS, SO_ID_ORPHANS, SO_VIEW_LAYER, SO_COLLECTIONS)) diff --git a/source/blender/draw/engines/eevee/eevee_effects.c b/source/blender/draw/engines/eevee/eevee_effects.c index 9afe54d08fc..751b9a0f7d6 100644 --- a/source/blender/draw/engines/eevee/eevee_effects.c +++ b/source/blender/draw/engines/eevee/eevee_effects.c @@ -132,7 +132,7 @@ void EEVEE_effects_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, Object /* Force normal buffer creation. */ if (DRW_state_is_image_render() && - (view_layer->passflag & SCE_PASS_NORMAL) != 0) + (view_layer->passflag & SCE_PASS_NORMAL) != 0) { effects->enabled_effects |= EFFECT_NORMAL_BUFFER; } diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index 1967762a36d..3224088716b 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -190,7 +190,7 @@ static void eevee_draw_background(void *vedata) double r[3]; if (DRW_state_is_image_render() || - ((stl->effects->enabled_effects & EFFECT_TAA) != 0)) + ((stl->effects->enabled_effects & EFFECT_TAA) != 0)) { BLI_halton_3D(primes, offset, stl->effects->taa_current_sample, r); EEVEE_update_noise(psl, fbl, r); @@ -226,8 +226,8 @@ static void eevee_draw_background(void *vedata) } if (((stl->effects->enabled_effects & EFFECT_TAA) != 0) && - (stl->effects->taa_current_sample > 1) && - !DRW_state_is_image_render()) + (stl->effects->taa_current_sample > 1) && + !DRW_state_is_image_render()) { DRW_viewport_matrix_override_set(stl->effects->overide_persmat, DRW_MAT_PERS); DRW_viewport_matrix_override_set(stl->effects->overide_persinv, DRW_MAT_PERSINV); diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index beed1416715..a6bedafc16c 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -507,28 +507,30 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat psl->probe_display = DRW_pass_create("LightProbe Display", state); DRW_shgroup_instance_format(e_data.format_probe_display_cube, { - {"probe_id" , DRW_ATTRIB_INT, 1}, + {"probe_id", DRW_ATTRIB_INT, 1}, {"probe_location", DRW_ATTRIB_FLOAT, 3}, - {"sphere_size" , DRW_ATTRIB_FLOAT, 1}, + {"sphere_size", DRW_ATTRIB_FLOAT, 1}, }); - DRWShadingGroup *grp = DRW_shgroup_instance_create(e_data.probe_cube_display_sh, - psl->probe_display, - DRW_cache_sphere_get(), - e_data.format_probe_display_cube); + DRWShadingGroup *grp = DRW_shgroup_instance_create( + e_data.probe_cube_display_sh, + psl->probe_display, + DRW_cache_sphere_get(), + e_data.format_probe_display_cube); stl->g_data->cube_display_shgrp = grp; DRW_shgroup_uniform_buffer(grp, "probeCubes", &sldata->probe_pool); DRW_shgroup_uniform_block(grp, "common_block", sldata->common_ubo); DRW_shgroup_instance_format(e_data.format_probe_display_planar, { - {"probe_id" , DRW_ATTRIB_INT, 1}, + {"probe_id", DRW_ATTRIB_INT, 1}, {"probe_mat", DRW_ATTRIB_FLOAT, 16}, }); - grp = DRW_shgroup_instance_create(e_data.probe_planar_display_sh, - psl->probe_display, - DRW_cache_quad_get(), - e_data.format_probe_display_planar); + grp = DRW_shgroup_instance_create( + e_data.probe_planar_display_sh, + psl->probe_display, + DRW_cache_quad_get(), + e_data.format_probe_display_planar); stl->g_data->planar_display_shgrp = grp; DRW_shgroup_uniform_buffer(grp, "probePlanars", &txl->planar_pool); } @@ -537,9 +539,10 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat psl->probe_planar_downsample_ps = DRW_pass_create("LightProbe Planar Downsample", DRW_STATE_WRITE_COLOR); struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get(); - DRWShadingGroup *grp = DRW_shgroup_instance_create(e_data.probe_planar_downsample_sh, - psl->probe_planar_downsample_ps, - geom, NULL); + DRWShadingGroup *grp = DRW_shgroup_instance_create( + e_data.probe_planar_downsample_sh, + psl->probe_planar_downsample_ps, + geom, NULL); stl->g_data->planar_downsample = grp; DRW_shgroup_uniform_buffer(grp, "source", &txl->planar_pool); DRW_shgroup_uniform_float(grp, "fireflyFactor", &sldata->common_data.ssr_firefly_fac, 1); @@ -564,7 +567,7 @@ void EEVEE_lightprobes_cache_add(EEVEE_ViewLayerData *sldata, Object *ob) ped->num_cell = probe->grid_resolution_x * probe->grid_resolution_y * probe->grid_resolution_z; if ((probe->type == LIGHTPROBE_TYPE_GRID) && - ((pinfo->total_irradiance_samples + ped->num_cell) >= MAX_IRRADIANCE_SAMPLES)) + ((pinfo->total_irradiance_samples + ped->num_cell) >= MAX_IRRADIANCE_SAMPLES)) { printf("Too much grid samples !!!\n"); return; @@ -843,9 +846,10 @@ static void EEVEE_lightprobes_updates(EEVEE_ViewLayerData *sldata, EEVEE_PassLis (probe->flag & LIGHTPROBE_FLAG_SHOW_DATA)) { struct Gwn_Batch *geom = DRW_cache_sphere_get(); - DRWShadingGroup *grp = DRW_shgroup_instance_create(e_data.probe_grid_display_sh, - psl->probe_display, - geom, NULL); + DRWShadingGroup *grp = DRW_shgroup_instance_create( + e_data.probe_grid_display_sh, + psl->probe_display, + geom, NULL); DRW_shgroup_set_instance_count(grp, ped->num_cell); DRW_shgroup_uniform_int(grp, "offset", &egrid->offset, 1); DRW_shgroup_uniform_ivec3(grp, "grid_resolution", egrid->resolution, 1); diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index 6f96d1af3ed..582f7ea747a 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -343,7 +343,7 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob) /* For light update tracking. */ if ((prev_cube_sh_id >= 0) && - (prev_cube_sh_id < linfo->shcaster_backbuffer->count)) + (prev_cube_sh_id < linfo->shcaster_backbuffer->count)) { linfo->new_shadow_id[prev_cube_sh_id] = linfo->cpu_cube_ct; } diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 71564be496a..0e444039573 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -594,7 +594,7 @@ void EEVEE_materials_init(EEVEE_ViewLayerData *sldata, EEVEE_StorageList *stl, E } if (!DRW_state_is_image_render() && - ((stl->effects->enabled_effects & EFFECT_TAA) == 0)) + ((stl->effects->enabled_effects & EFFECT_TAA) == 0)) { e_data.alpha_hash_offset = 0.0f; } diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c index 4524ac397e7..eb7f722f3a8 100644 --- a/source/blender/draw/engines/eevee/eevee_render.c +++ b/source/blender/draw/engines/eevee/eevee_render.c @@ -233,7 +233,7 @@ static void eevee_render_result_normal( /* Convert Eevee encoded normals to Blender normals. */ for (int i = 0; i < rr->rectx * rr->recty * 3; i += 3) { - if (rp->rect[i] == 0.0f && rp->rect[i+1] == 0.0f) { + if (rp->rect[i] == 0.0f && rp->rect[i + 1] == 0.0f) { /* If normal is not correct then do not produce NANs. */ continue; } @@ -245,9 +245,9 @@ static void eevee_render_result_normal( float f = dot_v2v2(fenc, fenc); float g = sqrtf(1.0f - f / 4.0f); - rp->rect[i+0] = fenc[0] * g; - rp->rect[i+1] = fenc[1] * g; - rp->rect[i+2] = 1.0f - f / 2.0f; + rp->rect[i + 0] = fenc[0] * g; + rp->rect[i + 1] = fenc[1] * g; + rp->rect[i + 2] = 1.0f - f / 2.0f; mul_mat3_m4_v3(g_data->viewinv, &rp->rect[i]); } @@ -342,7 +342,7 @@ static void eevee_render_result_occlusion( /* This is the accumulated color. Divide by the number of samples. */ for (int i = 0; i < rr->rectx * rr->recty * 3; i += 3) { - rp->rect[i] = rp->rect[i+1] = rp->rect[i+2] = min_ff(1.0f, rp->rect[i] / render_samples); + rp->rect[i] = rp->rect[i + 1] = rp->rect[i+2] = min_ff(1.0f, rp->rect[i] / render_samples); } } } @@ -525,4 +525,4 @@ void EEVEE_render_update_passes(RenderEngine *engine, Scene *scene, ViewLayer *v CHECK_PASS(SUBSURFACE_DIRECT, 3, "RGB"); #undef CHECK_PASS -}
\ No newline at end of file +} diff --git a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c index 09f40254f1b..a417a9bdf56 100644 --- a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c +++ b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c @@ -67,12 +67,12 @@ static void compute_cdf(float (*func)(float x), float cdf[FILTER_CDF_TABLE_SIZE] { cdf[0] = 0.0f; /* Actual CDF evaluation. */ - for(int u = 0; u < FILTER_CDF_TABLE_SIZE - 1; ++u) { + for (int u = 0; u < FILTER_CDF_TABLE_SIZE - 1; ++u) { float x = (float)(u + 1) / (float)(FILTER_CDF_TABLE_SIZE - 1); cdf[u + 1] = cdf[u] + func(x - 0.5f); /* [-0.5..0.5]. We resize later. */ } /* Normalize the CDF. */ - for(int u = 0; u < FILTER_CDF_TABLE_SIZE - 1; u++) { + for (int u = 0; u < FILTER_CDF_TABLE_SIZE - 1; u++) { cdf[u] /= cdf[FILTER_CDF_TABLE_SIZE - 1]; } /* Just to make sure. */ @@ -89,7 +89,7 @@ static void invert_cdf(const float cdf[FILTER_CDF_TABLE_SIZE], float invert_cdf[ invert_cdf[u] = 1.0f; } else { - float t = (x - cdf[i])/(cdf[i+1] - cdf[i]); + float t = (x - cdf[i]) / (cdf[i + 1] - cdf[i]); invert_cdf[u] = ((float)i + t) / (float)(FILTER_CDF_TABLE_SIZE - 1); } break; diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index 3b2c74e8032..0bf7c24193c 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -174,7 +174,7 @@ static struct { void DRW_globals_free(void) { struct Gwn_VertFormat **format = &g_formats.instance_screenspace; - for (int i = 0; i < sizeof(g_formats) / sizeof(void*); ++i, ++format) { + for (int i = 0; i < sizeof(g_formats) / sizeof(void *); ++i, ++format) { MEM_SAFE_FREE(*format); } } diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 2f52212cb22..84a0337277b 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -2097,7 +2097,7 @@ int GPU_scene_object_lights(ViewLayer *view_layer, float viewmat[4][4], int orth return count; } -static void gpu_disable_multisample() +static void gpu_disable_multisample(void) { #ifdef __linux__ /* changing multisample from the default (enabled) causes problems on some diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 32edabe37d9..8fc6b2b1a58 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -711,7 +711,7 @@ static void rna_CollisionSettings_dependency_update(Main *bmain, Scene *scene, P /* add/remove modifier as needed */ if (ob->pd->deflect && !md) - ED_object_modifier_add(NULL, bmain, scene, ob, bmain->eval_ctx->object_mode , NULL, eModifierType_Collision); + ED_object_modifier_add(NULL, bmain, scene, ob, bmain->eval_ctx->object_mode, NULL, eModifierType_Collision); else if (!ob->pd->deflect && md) ED_object_modifier_remove(NULL, bmain, ob, md); diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c index 03fbe234a20..bc84d0b6748 100644 --- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c +++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c @@ -608,7 +608,7 @@ wmManipulator *wm_manipulatormap_highlight_find( if (do_step[step]) { if ((mmap->update_flag[step] & MANIPULATORMAP_IS_REFRESH_CALLBACK) && - (mgroup->type->refresh != NULL)) + (mgroup->type->refresh != NULL)) { mgroup->type->refresh(C, mgroup); /* cleared below */ diff --git a/source/blender/windowmanager/message_bus/intern/wm_message_bus_static.c b/source/blender/windowmanager/message_bus/intern/wm_message_bus_static.c index 59bebad7f7b..d768e77c8fe 100644 --- a/source/blender/windowmanager/message_bus/intern/wm_message_bus_static.c +++ b/source/blender/windowmanager/message_bus/intern/wm_message_bus_static.c @@ -18,7 +18,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/windowmanager/intern/wm_message_bus_static.c +/** \file blender/windowmanager/intern/message_bus/wm_message_bus_static.c * \ingroup wm */ diff --git a/source/blender/windowmanager/message_bus/wm_message_bus.h b/source/blender/windowmanager/message_bus/wm_message_bus.h index 53f283cacd2..8a800d18101 100644 --- a/source/blender/windowmanager/message_bus/wm_message_bus.h +++ b/source/blender/windowmanager/message_bus/wm_message_bus.h @@ -18,7 +18,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/windowmanager/wm_message_bus.h +/** \file blender/windowmanager/message_bus/wm_message_bus.h * \ingroup wm */ |