Cleanup: whitespace, duplicate includes

This commit is contained in:
2018-05-08 16:57:07 +02:00
parent 5b3559576d
commit fa69ce9e3a
26 changed files with 115 additions and 111 deletions

View File

@@ -176,55 +176,64 @@ struct bPose;
struct bSplineIKConstraint;
struct bPoseChannel *BKE_armature_ik_solver_find_root(
struct bPoseChannel *pchan,
struct bKinematicConstraint *data);
struct bPoseChannel *pchan,
struct bKinematicConstraint *data);
struct bPoseChannel *BKE_armature_splineik_solver_find_root(
struct bPoseChannel *pchan,
struct bSplineIKConstraint *data);
struct bPoseChannel *pchan,
struct bSplineIKConstraint *data);
void BKE_pose_splineik_init_tree(struct Scene *scene, struct Object *ob, float ctime);
void BKE_splineik_execute_tree(
struct Depsgraph *depsgraph, struct Scene *scene,
struct Object *ob, struct bPoseChannel *pchan_root, float ctime);
struct Depsgraph *depsgraph, struct Scene *scene,
struct Object *ob, struct bPoseChannel *pchan_root, float ctime);
void BKE_pose_eval_init(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
void BKE_pose_eval_init(
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
void BKE_pose_eval_init_ik(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
void BKE_pose_eval_init_ik(
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
void BKE_pose_eval_bone(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
int pchan_index);
void BKE_pose_eval_bone(
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
int pchan_index);
void BKE_pose_constraints_evaluate(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
int pchan_index);
void BKE_pose_constraints_evaluate(
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
int pchan_index);
void BKE_pose_bone_done(struct Depsgraph *depsgraph,
struct Object *ob,
int pchan_index);
void BKE_pose_bone_done(
struct Depsgraph *depsgraph,
struct Object *ob,
int pchan_index);
void BKE_pose_iktree_evaluate(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
int rootchan_index);
void BKE_pose_iktree_evaluate(
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
int rootchan_index);
void BKE_pose_splineik_evaluate(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
int rootchan_index);
void BKE_pose_splineik_evaluate(
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
int rootchan_index);
void BKE_pose_eval_flush(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
void BKE_pose_eval_flush(
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
void BKE_pose_eval_proxy_copy(struct Depsgraph *depsgraph,
struct Object *ob);
void BKE_pose_eval_proxy_copy(
struct Depsgraph *depsgraph,
struct Object *ob);
#ifdef __cplusplus
}

View File

@@ -101,7 +101,7 @@ struct Mesh *BKE_mesh_copy(struct Main *bmain, const struct Mesh *me);
void BKE_mesh_update_customdata_pointers(struct Mesh *me, const bool do_ensure_tess_cd);
void BKE_mesh_ensure_skin_customdata(struct Mesh *me);
struct Mesh *BKE_mesh_new_nomain(int numVerts, int numEdges, int numTessFaces,int numLoops, int numPolys);
struct Mesh *BKE_mesh_new_nomain(int numVerts, int numEdges, int numTessFaces, int numLoops, int numPolys);
struct Mesh *BKE_mesh_from_template(
const struct Mesh *me_src,
int numVerts, int numEdges, int numTessFaces,

View File

@@ -51,7 +51,6 @@
#include "BKE_main.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
#include "BKE_idcode.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_displist.h"
@@ -615,13 +614,14 @@ void BKE_mesh_copy_data(Main *bmain, Mesh *me_dst, const Mesh *me_src, const int
}
}
Mesh *BKE_mesh_new_nomain(int numVerts, int numEdges, int numTessFaces,int numLoops, int numPolys)
Mesh *BKE_mesh_new_nomain(int numVerts, int numEdges, int numTessFaces, int numLoops, int numPolys)
{
Mesh *mesh = BKE_libblock_alloc(NULL, ID_ME,
BKE_idcode_to_name(ID_ME),
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG);
Mesh *mesh = BKE_libblock_alloc(
NULL, ID_ME,
BKE_idcode_to_name(ID_ME),
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG);
BKE_libblock_init_empty(&mesh->id);
/* don't use CustomData_reset(...); because we dont want to touch customdata */

View File

@@ -962,7 +962,7 @@ struct Mesh *modifier_applyModifier(struct ModifierData *md, const ModifierEvalC
DerivedMesh *ndm = mti->applyModifier_DM(md, ctx, dm);
if(ndm != dm) {
if (ndm != dm) {
dm->release(dm);
}
@@ -986,7 +986,7 @@ struct Mesh *modifier_applyModifierEM(struct ModifierData *md, const ModifierEva
DerivedMesh *ndm = mti->applyModifierEM_DM(md, ctx, editData, dm);
if(ndm != dm) {
if (ndm != dm) {
dm->release(dm);
}
@@ -1120,7 +1120,7 @@ struct DerivedMesh *modifier_applyModifier_DM_deprecated(struct ModifierData *md
/* Make a DM that doesn't reference new_mesh so we can free the latter. */
DerivedMesh *ndm = CDDM_from_mesh_ex(new_mesh, CD_DUPLICATE);
if(new_mesh != mesh) {
if (new_mesh != mesh) {
BKE_id_free(NULL, new_mesh);
}
if (mesh != NULL) {
@@ -1153,7 +1153,7 @@ struct DerivedMesh *modifier_applyModifierEM_DM_deprecated(struct ModifierData *
/* Make a DM that doesn't reference new_mesh so we can free the latter. */
DerivedMesh *ndm = CDDM_from_mesh_ex(new_mesh, CD_DUPLICATE);
if(new_mesh != mesh) {
if (new_mesh != mesh) {
BKE_id_free(NULL, new_mesh);
}
if (mesh != NULL) {

View File

@@ -96,7 +96,7 @@ static char *workbench_build_defines(WORKBENCH_PrivateData *wpd, int drawtype)
if (wpd->shading.light & V3D_LIGHTING_STUDIO) {
BLI_dynstr_appendf(ds, "#define V3D_LIGHTING_STUDIO\n");
}
switch(drawtype) {
switch (drawtype) {
case OB_SOLID:
BLI_dynstr_appendf(ds, "#define OB_SOLID\n");
break;
@@ -165,7 +165,8 @@ static int get_shader_index(WORKBENCH_PrivateData *wpd, int drawtype)
return index;
}
static void ensure_deferred_shaders(WORKBENCH_PrivateData *wpd, int index, int drawtype) {
static void ensure_deferred_shaders(WORKBENCH_PrivateData *wpd, int index, int drawtype)
{
if (e_data.prepass_sh_cache[index] == NULL) {
char *defines = workbench_build_defines(wpd, drawtype);
char *composite_frag = workbench_build_composite_frag(wpd);
@@ -434,7 +435,7 @@ static WORKBENCH_MaterialData *get_or_create_material_data(WORKBENCH_Data *vedat
DRW_shgroup_stencil_mask(material->shgrp, 0xFF);
material->object_id = engine_object_data->object_id;
copy_v3_v3(material->color, material_template.color);
switch(drawtype) {
switch (drawtype) {
case OB_SOLID:
DRW_shgroup_uniform_vec3(material->shgrp, "object_color", material->color, 1);
break;
@@ -503,8 +504,7 @@ void workbench_materials_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob
const bool is_sculpt_mode = is_active && (draw_ctx->object_mode & OB_MODE_SCULPT) != 0;
const bool is_edit_mode = is_active && (draw_ctx->object_mode & OB_MODE_EDIT) != 0;
bool is_drawn = false;
if (!is_edit_mode && !is_sculpt_mode && wpd->drawtype == OB_TEXTURE && ob->type == OB_MESH)
{
if (!is_edit_mode && !is_sculpt_mode && wpd->drawtype == OB_TEXTURE && ob->type == OB_MESH) {
const Mesh *me = ob->data;
if (me->mloopuv) {
const int materials_len = MAX2(1, (is_sculpt_mode ? 1 : ob->totcol));

View File

@@ -19,10 +19,10 @@
*
*/
/** \file workbench_studiolight.h
/** \file workbench_studiolight.c
* \ingroup draw_engine
*/
#include "DRW_engine.h"
#include "DRW_engine.h"
#include "workbench_private.h"
#include "BLI_math.h"
@@ -78,7 +78,8 @@ const float studiolights[][6][3] = {
},
};
void studiolight_update_world(int studio_light, WORKBENCH_UBO_World* wd) {
void studiolight_update_world(int studio_light, WORKBENCH_UBO_World *wd)
{
copy_v3_v3(wd->diffuse_light_x_pos, studiolights[studio_light][STUDIOLIGHT_X_POS]);
copy_v3_v3(wd->diffuse_light_x_neg, studiolights[studio_light][STUDIOLIGHT_X_NEG]);
copy_v3_v3(wd->diffuse_light_y_pos, studiolights[studio_light][STUDIOLIGHT_Y_POS]);
@@ -87,7 +88,8 @@ void studiolight_update_world(int studio_light, WORKBENCH_UBO_World* wd) {
copy_v3_v3(wd->diffuse_light_z_neg, studiolights[studio_light][STUDIOLIGHT_Z_NEG]);
}
unsigned int *WORKBENCH_generate_studiolight_preview(int studiolight_id, int icon_size) {
uint *WORKBENCH_generate_studiolight_preview(int studiolight_id, int icon_size)
{
unsigned int* rect = MEM_mallocN(icon_size * icon_size * sizeof(unsigned int), __func__);
int icon_center = icon_size / 2;
float sphere_radius = icon_center * 0.9;

View File

@@ -131,7 +131,7 @@ int DRW_object_wire_theme_get(
float *DRW_color_background_blend_get(int theme_id);
/* draw_armature.c */
typedef struct DRWArmaturePasses{
typedef struct DRWArmaturePasses {
struct DRWPass *bone_solid;
struct DRWPass *bone_outline;
struct DRWPass *bone_wire;

View File

@@ -206,7 +206,7 @@ static void arrow_draw_intern(ArrowManipulator3D *arrow, const bool select, cons
glEnable(GL_BLEND);
arrow_draw_geom(arrow, select, (const float [4]){0.5f, 0.5f, 0.5f, 0.5f});
arrow_draw_geom(arrow, select, (const float[4]){0.5f, 0.5f, 0.5f, 0.5f});
glDisable(GL_BLEND);
gpuPopMatrix();

View File

@@ -193,7 +193,7 @@ static int manipulator_button2d_test_select(
}
}
else {
copy_v2_v2(point_local, (float [2]){UNPACK2(event->mval)});
copy_v2_v2(point_local, (float[2]){UNPACK2(event->mval)});
sub_v2_v2(point_local, mpr->matrix_basis[3]);
mul_v2_fl(point_local, 1.0f / (mpr->scale_basis * UI_DPI_FAC));
}

View File

@@ -999,7 +999,7 @@ static int manipulator_cage2d_modal(
mul_v3_fl(matrix_scale[0], scale[0]);
mul_v3_fl(matrix_scale[1], scale[1]);
transform_pivot_set_m4(matrix_scale, (const float [3]){pivot[0] * dims[0], pivot[1] * dims[1], 0.0f});
transform_pivot_set_m4(matrix_scale, (const float[3]){pivot[0] * dims[0], pivot[1] * dims[1], 0.0f});
mul_m4_m4m4(mpr->matrix_offset, data->orig_matrix_offset, matrix_scale);
}

View File

@@ -627,7 +627,7 @@ static int manipulator_cage3d_modal(
transform_pivot_set_m4(
matrix_scale,
(const float [3]){pivot[0] * dims[0], pivot[1] * dims[1], pivot[2] * dims[2]});
(const float[3]){pivot[0] * dims[0], pivot[1] * dims[1], pivot[2] * dims[2]});
mul_m4_m4m4(mpr->matrix_offset, data->orig_matrix_offset, matrix_scale);
}

View File

@@ -311,7 +311,7 @@ static void dial_draw_intern(
/* draw! */
for (int i = 0; i < 2; i++) {
glDisable(GL_POLYGON_SMOOTH);
dial_ghostarc_draw(mpr, angle_ofs, angle_delta, (const float [4]){0.8f, 0.8f, 0.8f, 0.4f});
dial_ghostarc_draw(mpr, angle_ofs, angle_delta, (const float[4]){0.8f, 0.8f, 0.8f, 0.4f});
glEnable(GL_POLYGON_SMOOTH);
dial_ghostarc_draw_helpline(angle_ofs, co_outer, color); /* starting position */

View File

@@ -202,7 +202,7 @@ static void grab3d_draw_intern(
}
glEnable(GL_BLEND);
grab_geom_draw(mpr, (const float [4]){0.5f, 0.5f, 0.5f, 0.5f}, select, draw_options);
grab_geom_draw(mpr, (const float[4]){0.5f, 0.5f, 0.5f, 0.5f}, select, draw_options);
glDisable(GL_BLEND);
gpuPopMatrix();
}

View File

@@ -25,7 +25,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/editors/mesh/editmesh_extrude_spin.c
/** \file blender/editors/mesh/editmesh_extrude_screw.c
* \ingroup edmesh
*/

View File

@@ -40,7 +40,6 @@
#include "DNA_scene_types.h"
#include "DNA_group_types.h"
#include "DNA_lattice_types.h"
#include "DNA_lamp_types.h"
#include "BLI_math.h"
#include "BLI_listbase.h"

View File

@@ -998,7 +998,7 @@ static bool region_is_overlap(ScrArea *sa, ARegion *ar)
if (ar->regiontype == RGN_TYPE_HEADER)
return 1;
}
else if(sa->spacetype == SPACE_SEQ) {
else if (sa->spacetype == SPACE_SEQ) {
if (ar->regiontype == RGN_TYPE_PREVIEW)
return 1;
}
@@ -1898,8 +1898,8 @@ void ED_region_panels(const bContext *C, ARegion *ar, const char *context, int c
if (pt->draw_header && !(pt->flag & PNL_NO_HEADER) && (open || vertical)) {
/* for enabled buttons */
panel->layout = UI_block_layout(
block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER,
triangle, (UI_UNIT_Y * 1.1f) + style->panelspace, UI_UNIT_Y, 1, 0, style);
block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER,
triangle, (UI_UNIT_Y * 1.1f) + style->panelspace, UI_UNIT_Y, 1, 0, style);
pt->draw_header(C, panel);
@@ -1921,8 +1921,8 @@ void ED_region_panels(const bContext *C, ARegion *ar, const char *context, int c
panelContext = UI_LAYOUT_PANEL;
panel->layout = UI_block_layout(
block, UI_LAYOUT_VERTICAL, panelContext,
style->panelspace, 0, w - 2 * style->panelspace, em, 0, style);
block, UI_LAYOUT_VERTICAL, panelContext,
style->panelspace, 0, w - 2 * style->panelspace, em, 0, style);
pt->draw(C, panel);

View File

@@ -143,7 +143,7 @@ static void axis_geom_draw(
immUniformColor4fv(axis_black);
madd_v3_v3fl(
center,
(float [3]){
(float[3]){
mpr->matrix_offset[0][2],
mpr->matrix_offset[1][2],
mpr->matrix_offset[2][2],

View File

@@ -18,7 +18,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/editors/transform/transform_manipulator_2d.c
/** \file blender/editors/transform/transform_manipulator_3d.c
* \ingroup edtransform
*
* \name 3D Transform Manipulator

View File

@@ -52,12 +52,6 @@
#include "BKE_particle.h"
#include "BKE_scene.h"
#ifdef _OPENMP
# include "BKE_mesh.h" /* BKE_MESH_OMP_LIMIT */
#endif
static void initData(ModifierData *md)
{
BuildModifierData *bmd = (BuildModifierData *) md;

View File

@@ -406,12 +406,12 @@ static Mesh *normalEditModifier_do(NormalEditModifierData *enmd, Object *ob, Mes
Mesh *result;
BKE_id_copy_ex(
NULL, &mesh->id, (ID **)&result,
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG|
LIB_ID_COPY_NO_PREVIEW,
false);
NULL, &mesh->id, (ID **)&result,
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG |
LIB_ID_COPY_NO_PREVIEW,
false);
const int num_verts = result->totvert;
const int num_edges = result->totedge;

View File

@@ -205,7 +205,7 @@ static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *c
MPoly *mpoly, *orig_mpoly;
MLoop *mloop, *orig_mloop;
MVert *mvert, *orig_mvert;
int totvert, totpoly, totloop , totedge;
int totvert, totpoly, totloop, totedge;
int maxvert, maxpoly, maxloop, maxedge, part_end = 0, part_start;
int k, p, p_skip;
short track = ctx->object->trackflag % 3, trackneg, axis = pimd->axis;

View File

@@ -38,7 +38,6 @@
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_scene_types.h"
#include "BLI_utildefines.h"
#include "BLI_math_vector.h"
@@ -301,11 +300,12 @@ Mesh *get_mesh(Object *ob, struct BMEditMesh *em, Mesh *mesh,
struct BMeshToMeshParams bmtmp = {0};
if (em) mesh = BKE_bmesh_to_mesh_nomain(em->bm, &bmtmp);
else {
BKE_id_copy_ex(NULL, ob->data, (ID **)&mesh,
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG,
false);
BKE_id_copy_ex(
NULL, ob->data, (ID **)&mesh,
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG,
false);
}
if (vertexCos) {

View File

@@ -203,12 +203,12 @@ static Mesh *applyModifier(ModifierData *md,
Mesh *result;
BKE_id_copy_ex(
NULL, &mesh->id, (ID **)&result,
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG|
LIB_ID_COPY_NO_PREVIEW,
false);
NULL, &mesh->id, (ID **)&result,
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG |
LIB_ID_COPY_NO_PREVIEW,
false);
if (has_mdef) {
dvert = CustomData_get_layer(&result->vdata, CD_MDEFORMVERT);

View File

@@ -245,12 +245,12 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
Mesh *result;
BKE_id_copy_ex(
NULL, &mesh->id, (ID **)&result,
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG|
LIB_ID_COPY_NO_PREVIEW,
false);
NULL, &mesh->id, (ID **)&result,
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG |
LIB_ID_COPY_NO_PREVIEW,
false);
if (has_mdef) {
dvert = CustomData_get_layer(&result->vdata, CD_MDEFORMVERT);

View File

@@ -426,12 +426,12 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
Mesh *result;
BKE_id_copy_ex(
NULL, &mesh->id, (ID **)&result,
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG|
LIB_ID_COPY_NO_PREVIEW,
false);
NULL, &mesh->id, (ID **)&result,
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG |
LIB_ID_COPY_NO_PREVIEW,
false);
if (has_mdef) {
dvert = CustomData_get_layer(&result->vdata, CD_MDEFORMVERT);

View File

@@ -304,7 +304,7 @@ static void wm_draw_region_buffer_create(ARegion *ar, bool stereo, bool use_view
/* Free offscreen buffer on size changes. Viewport auto resizes. */
GPUOffScreen *offscreen = ar->draw_buffer->offscreen[0];
if (offscreen && (GPU_offscreen_width(offscreen) != ar->winx ||
GPU_offscreen_height(offscreen) != ar->winy))
GPU_offscreen_height(offscreen) != ar->winy))
{
wm_draw_region_buffer_free(ar);
}