Cleanup: whitespace

This commit is contained in:
Campbell Barton 2017-12-04 17:19:34 +11:00
parent 1b2f8b2754
commit 9dfbd98339
27 changed files with 61 additions and 55 deletions

View File

@ -76,9 +76,10 @@ struct Base *BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Objec
void BKE_view_layer_base_deselect_all(struct ViewLayer *view_layer);
void BKE_view_layer_base_select(struct ViewLayer *view_layer, struct Base *selbase);
void BKE_view_layer_copy_data(struct ViewLayer *view_layer_dst, struct ViewLayer *view_layer_src,
struct SceneCollection* mc_dst, struct SceneCollection* mc_src,
const int flag);
void BKE_view_layer_copy_data(
struct ViewLayer *view_layer_dst, struct ViewLayer *view_layer_src,
struct SceneCollection *mc_dst, struct SceneCollection *mc_src,
const int flag);
void BKE_layer_collection_free(struct ViewLayer *view_layer, struct LayerCollection *lc);

View File

@ -142,7 +142,9 @@ ViewLayer *BKE_view_layer_add(Scene *scene, const char *name)
BLI_addtail(&scene->view_layers, view_layer);
/* unique name */
BLI_uniquename(&scene->view_layers, view_layer, DATA_("ViewLayer"), '.', offsetof(ViewLayer, name), sizeof(view_layer->name));
BLI_uniquename(
&scene->view_layers, view_layer, DATA_("ViewLayer"), '.',
offsetof(ViewLayer, name), sizeof(view_layer->name));
return view_layer;
}
@ -325,7 +327,8 @@ void BKE_view_layer_base_select(struct ViewLayer *view_layer, Base *selbase)
/* Copying functions for datablocks that use ViewLayer/SceneCollection */
/* Find the equivalent SceneCollection in the new tree */
static SceneCollection *scene_collection_from_new_tree(SceneCollection *sc_reference, SceneCollection *sc_dst, SceneCollection *sc_src)
static SceneCollection *scene_collection_from_new_tree(
SceneCollection *sc_reference, SceneCollection *sc_dst, SceneCollection *sc_src)
{
if (sc_src == sc_reference) {
return sc_dst;
@ -387,8 +390,9 @@ static void layer_collections_recreate(
* \param mc_dst Master Collection the destination ViewLayer links in.
* \param flag Copying options (see BKE_library.h's LIB_ID_COPY_... flags for more).
*/
void BKE_view_layer_copy_data(ViewLayer *view_layer_dst, ViewLayer *view_layer_src, SceneCollection* mc_dst, SceneCollection* mc_src,
const int flag)
void BKE_view_layer_copy_data(
ViewLayer *view_layer_dst, ViewLayer *view_layer_src, SceneCollection *mc_dst, SceneCollection *mc_src,
const int flag)
{
IDPropertyTemplate val = {0};
@ -761,7 +765,8 @@ bool BKE_layer_collection_move_into(const ID *owner_id, LayerCollection *lc_dst,
}
}
LayerCollection *lc_new = BLI_findptr(&lc_dst->layer_collections, lc_src->scene_collection, offsetof(LayerCollection, scene_collection));
LayerCollection *lc_new = BLI_findptr(
&lc_dst->layer_collections, lc_src->scene_collection, offsetof(LayerCollection, scene_collection));
BLI_assert(lc_new);
layer_collection_swap(view_layer, &lc_dst->layer_collections, NULL, lc_new, lc_src);

View File

@ -2212,8 +2212,8 @@ Depsgraph *BKE_scene_get_depsgraph(Scene *scene,
Depsgraph **depsgraph_ptr;
if (!BLI_ghash_ensure_p_ex(scene->depsgraph_hash,
&key,
(void***)&key_ptr,
(void***)&depsgraph_ptr))
(void ***)&key_ptr,
(void ***)&depsgraph_ptr))
{
*key_ptr = MEM_mallocN(sizeof(DepsgraphKey), __func__);
**key_ptr = key;

View File

@ -219,7 +219,7 @@ void do_versions_after_linking_280(Main *main)
if (base->lay & (1 << layer)) {
int collection_index = -1;
if ((base->object->restrictflag & OB_RESTRICT_VIEW) &&
(base->object->restrictflag & OB_RESTRICT_RENDER))
(base->object->restrictflag & OB_RESTRICT_RENDER))
{
collection_index = DO_VERSION_COLLECTION_HIDE_ALL;
}
@ -360,7 +360,7 @@ void do_versions_after_linking_280(Main *main)
/* Add new collection bases. */
for (int layer = 0; layer < 20; layer++) {
if ((scene->lay & srl->lay & ~(srl->lay_exclude) & (1 << layer)) ||
(srl->lay_zmask & (scene->lay | srl->lay_exclude) & (1 << layer)))
(srl->lay_zmask & (scene->lay | srl->lay_exclude) & (1 << layer)))
{
if (collections[DO_VERSION_COLLECTION_VISIBLE].created & (1 << layer)) {
@ -580,14 +580,14 @@ void do_versions_after_linking_280(Main *main)
SceneCollection *sc_hidden = NULL;
for (GroupObject *go = group->gobject.first; go; go = go->next) {
if (go->ob->lay & group->layer){
if (go->ob->lay & group->layer) {
BKE_collection_object_add(&group->id, sc, go->ob);
}
else {
if (sc_hidden == NULL) {
sc_hidden = BKE_collection_add(&group->id, sc, COLLECTION_TYPE_GROUP_INTERNAL, "Hidden");
}
BKE_collection_object_add(&group->id, sc_hidden, go->ob);
BKE_collection_object_add(&group->id, sc_hidden, go->ob);
}
}

View File

@ -4000,7 +4000,7 @@ static bool write_file_handle(
write_scene(wd, (Scene *)id);
break;
case ID_CU:
write_curve(wd,(Curve *)id);
write_curve(wd, (Curve *)id);
break;
case ID_MB:
write_mball(wd, (MetaBall *)id);

View File

@ -24,7 +24,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/depsgraph/intern/builder/deg_builder_nodes_layer.cc
/** \file blender/depsgraph/intern/builder/deg_builder_nodes_layer_collection.cc
* \ingroup depsgraph
*
* Methods for constructing depsgraph's nodes

View File

@ -24,7 +24,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc
/** \file blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
* \ingroup depsgraph
*
* Methods for constructing depsgraph's nodes

View File

@ -24,7 +24,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/depsgraph/intern/builder/deg_builder_relations_layer.cc
/** \file blender/depsgraph/intern/builder/deg_builder_relations_layer_collection.cc
* \ingroup depsgraph
*
* Methods for constructing depsgraph

View File

@ -24,7 +24,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
/** \file blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc
* \ingroup depsgraph
*
* Methods for constructing depsgraph

View File

@ -653,7 +653,7 @@ ID *deg_expand_copy_on_write_datablock(const Depsgraph *depsgraph,
switch (id_type) {
case ID_SCE:
{
done = scene_copy_inplace_no_main((Scene *)id_orig, (Scene*)id_cow);
done = scene_copy_inplace_no_main((Scene *)id_orig, (Scene *)id_cow);
break;
}
case ID_ME:

View File

@ -1295,7 +1295,7 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sld
/* Do not render surface if we are rendering a volume object
* and do not have a surface closure. */
if (use_volume_material &&
(gpumat_array[i] && !GPU_material_use_domain_surface(gpumat_array[i])))
(gpumat_array[i] && !GPU_material_use_domain_surface(gpumat_array[i])))
{
continue;
}

View File

@ -19,7 +19,7 @@
*
*/
/** \file eevee_effects.c
/** \file eevee_motion_blur.c
* \ingroup draw_engine
*
* Gather all screen space effects technique such as Bloom, Motion Blur, DoF, SSAO, SSR, ...

View File

@ -56,9 +56,9 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data
IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, COLLECTION_MODE_NONE, RE_engine_id_BLENDER_EEVEE);
if (BKE_collection_engine_property_value_get_int(props, "taa_samples") != 1 &&
/* FIXME the motion blur camera evaluation is tagging view_updated
* thus making the TAA always reset and never stopping rendering. */
(effects->enabled_effects & EFFECT_MOTION_BLUR) == 0)
/* FIXME the motion blur camera evaluation is tagging view_updated
* thus making the TAA always reset and never stopping rendering. */
(effects->enabled_effects & EFFECT_MOTION_BLUR) == 0)
{
const float *viewport_size = DRW_viewport_size_get();
float persmat[4][4], viewmat[4][4];

View File

@ -19,7 +19,7 @@
*
*/
/** \file eevee_volume.c
/** \file eevee_volumes.c
* \ingroup draw_engine
*
* Volumetric effects rendering using frostbite approach.

View File

@ -1449,7 +1449,7 @@ void DRW_pass_sort_shgroup_z(DRWPass *pass)
DRWShadingGroup *last = pass->shgroups;
while ((last = last->next)) {
/* Do nothing */
};
}
pass->shgroups_last = last;
}
}
@ -2044,8 +2044,7 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state)
}
}
else {
for (DRWCall *call = shgroup->calls_first; call; call = call->head.prev)
{
for (DRWCall *call = shgroup->calls_first; call; call = call->head.prev) {
bool neg_scale = is_negative_m4(call->obmat);
/* Negative scale objects */

View File

@ -82,7 +82,7 @@ typedef enum eParentType {
PAR_VERTEX_TRI,
} eParentType;
typedef enum eObjectSelect_Mode{
typedef enum eObjectSelect_Mode {
BA_DESELECT = 0,
BA_SELECT = 1,
BA_INVERT = 2,

View File

@ -502,7 +502,7 @@ static int override_type_set_button_exec(bContext *C, wmOperator *op)
short operation;
switch(op_type) {
switch (op_type) {
case UIOverride_Type_NOOP:
operation = IDOVERRIDESTATIC_OP_NOOP;
break;

View File

@ -132,7 +132,7 @@ static int edbm_polybuild_face_at_cursor_invoke(
BMEdge *e_iter = v_act->e;
do {
if ((BM_elem_flag_test(e_iter, BM_ELEM_HIDDEN) == false) &&
(allow_wire ? BM_edge_is_wire(e_iter) : BM_edge_is_boundary(e_iter)))
(allow_wire ? BM_edge_is_wire(e_iter) : BM_edge_is_boundary(e_iter)))
{
if (i == 2) {
e_pair[0] = e_pair[1] = NULL;
@ -489,9 +489,9 @@ static int edbm_polybuild_hover_invoke(
/* pass */
}
else if (vc.win->tweak ||
(vc.win->eventstate->check_click &&
vc.win->eventstate->prevval == KM_PRESS &&
ISMOUSE(vc.win->eventstate->prevtype)))
(vc.win->eventstate->check_click &&
vc.win->eventstate->prevval == KM_PRESS &&
ISMOUSE(vc.win->eventstate->prevtype)))
{
return OPERATOR_PASS_THROUGH;
}

View File

@ -832,7 +832,7 @@ static void clean_viewport_memory(Main *bmain, Scene *scene)
}
}
for (SETLOOPER_SET_ONLY(scene, sce_iter, base)) {
for (SETLOOPER_SET_ONLY(scene, sce_iter, base)) {
clean_viewport_memory_base(base);
}
}

View File

@ -619,9 +619,9 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
if (collection->scene_collection->type == COLLECTION_TYPE_NONE) {
bt = uiDefIconButBitS(block, UI_BTYPE_ICON_TOGGLE_N, COLLECTION_SELECTABLE, 0, ICON_RESTRICT_SELECT_OFF,
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), te->ys, UI_UNIT_X,
UI_UNIT_Y, &collection->flag, 0, 0, 0, 0,
TIP_("Restrict/Allow 3D View selection of objects in the collection"));
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), te->ys, UI_UNIT_X,
UI_UNIT_Y, &collection->flag, 0, 0, 0, 0,
TIP_("Restrict/Allow 3D View selection of objects in the collection"));
UI_but_func_set(bt, restrictbutton_collection_flag_cb, scene, collection);
UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
}

View File

@ -125,7 +125,8 @@ static int outliner_parent_drop_poll(bContext *C, wmDrag *drag, const wmEvent *e
*/
if (!scene) {
return 1;
} else {
}
else {
for (ViewLayer *view_layer = scene->view_layers.first;
view_layer;
view_layer = view_layer->next)

View File

@ -1500,7 +1500,7 @@ static void WIDGETGROUP_xform_cage_setup(const bContext *UNUSED(C), wmManipulato
ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE);
mpr->color[0] = 1;
mpr->color_hi[0]=1;
mpr->color_hi[0] =1;
mgroup->customdata = xmgroup;

View File

@ -181,7 +181,8 @@ void gpu_extensions_init(void)
/* XXX : TODO : Remove this once this sampling mipmap problem is gone.
* https://github.com/dfelinto/opengl-sandbox/blob/downsample/README.md */
else if (strstr(renderer, "AMD VEGA") &&
strstr(vendor, "X.Org")) {
strstr(vendor, "X.Org"))
{
GG.device = GPU_DEVICE_AMD_VEGA;
GG.driver = GPU_DRIVER_OPENSOURCE;
}

View File

@ -516,9 +516,9 @@ static float gaussian_profile(float r, float radius)
const float v = radius * radius * (0.25f * 0.25f);
const float Rm = sqrtf(v * GAUSS_TRUNCATE);
if(r >= Rm)
if (r >= Rm) {
return 0.0f;
}
return expf(-r * r / (2.0f * v)) / (2.0f * M_PI * v);
}
@ -535,20 +535,20 @@ static float cubic_profile(float r, float radius, float sharpness)
{
float Rm = radius * (1.0f + sharpness);
if(r >= Rm)
if (r >= Rm) {
return 0.0f;
}
/* custom variation with extra sharpness, to match the previous code */
const float y = 1.0f/(1.0f + sharpness);
const float y = 1.0f / (1.0f + sharpness);
float Rmy, ry, ryinv;
Rmy = powf(Rm, y);
ry = powf(r, y);
ryinv = (r > 0.0f)? powf(r, y - 1.0f): 0.0f;
ryinv = (r > 0.0f) ? powf(r, y - 1.0f) : 0.0f;
const float Rmy5 = (Rmy*Rmy) * (Rmy*Rmy) * Rmy;
const float Rmy5 = (Rmy * Rmy) * (Rmy * Rmy) * Rmy;
const float f = Rmy - ry;
const float num = f*(f*f)*(y*ryinv);
const float num = f * (f * f) * (y * ryinv);
return (10.0f * num) / (Rmy5 * M_PI);
}
@ -576,7 +576,7 @@ static float eval_integral(float x0, float x1, short falloff_type, float sharpne
const float step = range / INTEGRAL_RESOLUTION;
float integral = 0.0f;
for(int i = 0; i < INTEGRAL_RESOLUTION; ++i) {
for (int i = 0; i < INTEGRAL_RESOLUTION; ++i) {
float x = x0 + range * ((float)i + 0.5f) / (float)INTEGRAL_RESOLUTION;
float y = eval_profile(x, falloff_type, sharpness, param);
integral += y * step;

View File

@ -7319,8 +7319,7 @@ void RNA_property_override_apply(
PointerRNA *dst, PointerRNA *src, PointerRNA *storage, PropertyRNA *prop, IDOverrideStaticProperty *op)
{
for (IDOverrideStaticPropertyOperation *opop = op->operations.first; opop; opop = opop->next) {
if (!rna_property_override_operation_apply(dst, src, storage, prop, opop))
{
if (!rna_property_override_operation_apply(dst, src, storage, prop, opop)) {
BLI_assert(0);
}
}

View File

@ -57,7 +57,6 @@
#include "BLI_sys_types.h" /* needed for intptr_t used in ED_mesh.h */
#include "ED_mesh.h"
#include "ED_object.h"
#include "WM_api.h"
#include "WM_types.h"

View File

@ -231,7 +231,8 @@ int main(
/* --- end declarations --- */
/* ensure we free data on early-exit */ struct CreatorAtExitData app_init_data = {NULL};
/* ensure we free data on early-exit */
struct CreatorAtExitData app_init_data = {NULL};
BKE_blender_atexit_register(callback_main_atexit, &app_init_data);
#ifdef WIN32