Cleanup: style

This commit is contained in:
Campbell Barton 2018-04-21 20:42:27 +02:00
parent 112540da62
commit 122d0d1504
23 changed files with 51 additions and 51 deletions

View File

@ -35,7 +35,7 @@
#define BLF_BATCH_DRAW_LEN_MAX 2048 /* in glyph */
typedef struct BatchBLF{
typedef struct BatchBLF {
struct FontBLF *font; /* can only batch glyph from the same font */
struct Gwn_Batch *batch;
struct Gwn_VertBuf *verts;

View File

@ -5967,12 +5967,12 @@ static int dynamicPaint_doStep(struct Depsgraph *depsgraph, Scene *scene, Object
/* Apply brush on the surface depending on it's collision type */
if (brush->psys && brush->psys->part &&
ELEM(brush->psys->part->type, PART_EMITTER, PART_FLUID) &&
psys_check_enabled(brushObj, brush->psys, G.is_rendering))
ELEM(brush->psys->part->type, PART_EMITTER, PART_FLUID) &&
psys_check_enabled(brushObj, brush->psys, G.is_rendering))
{
/* Paint a particle system */
BKE_animsys_evaluate_animdata(scene, &brush->psys->part->id, brush->psys->part->adt,
BKE_scene_frame_get(scene), ADT_RECALC_ANIM);
BKE_scene_frame_get(scene), ADT_RECALC_ANIM);
dynamicPaint_paintParticles(surface, brush->psys, brush, timescale);
}
/* Object center distance: */

View File

@ -693,22 +693,22 @@ static const float blackbody_table_b[6][4] = {
static void blackbody_temperature_to_rgb(float rgb[3], float t)
{
if(t >= 12000.0f) {
if (t >= 12000.0f) {
rgb[0] = 0.826270103f;
rgb[1] = 0.994478524f;
rgb[2] = 1.56626022f;
}
else if(t < 965.0f) {
else if (t < 965.0f) {
rgb[0] = 4.70366907f;
rgb[1] = 0.0f;
rgb[2] = 0.0f;
}
else {
int i = (t >= 6365.0f)? 5:
(t >= 3315.0f)? 4:
(t >= 1902.0f)? 3:
(t >= 1449.0f)? 2:
(t >= 1167.0f)? 1: 0;
int i = (t >= 6365.0f) ? 5 :
(t >= 3315.0f) ? 4 :
(t >= 1902.0f) ? 3 :
(t >= 1449.0f) ? 2 :
(t >= 1167.0f) ? 1 : 0;
const float *r = blackbody_table_r[i];
const float *g = blackbody_table_g[i];

View File

@ -533,8 +533,8 @@ void do_versions_after_linking_280(Main *main)
/* Due to several changes to particle RNA and draw code particles from older files may no longer
* be visible. Here we correct this by setting a default draw size for those files. */
for (Object *object = main->object.first; object; object = object->id.next) {
for (ParticleSystem *psys = object->particlesystem.first; psys; psys=psys->next) {
if(psys->part->draw_size == 0.0f) {
for (ParticleSystem *psys = object->particlesystem.first; psys; psys = psys->next) {
if (psys->part->draw_size == 0.0f) {
psys->part->draw_size = 0.1f;
}
}
@ -617,7 +617,7 @@ void do_versions_after_linking_280(Main *main)
}
}
}
else if (object->transflag & OB_DUPLI){
else if (object->transflag & OB_DUPLI) {
object->duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT;
}
else {
@ -837,7 +837,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
}
for (Group *group = main->group.first; group; group = group->id.next) {
if (group->view_layer != NULL){
if (group->view_layer != NULL) {
do_version_view_layer_visibility(group->view_layer);
}
}
@ -933,7 +933,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
/* Blender Internal removal */
for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
if (STREQ(scene->r.engine, "BLENDER_RENDER") ||
STREQ(scene->r.engine, "BLENDER_GAME")) {
STREQ(scene->r.engine, "BLENDER_GAME"))
{
BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine));
}

View File

@ -207,7 +207,7 @@ static void eevee_draw_background(void *vedata)
bool taa_use_reprojection = (stl->effects->enabled_effects & EFFECT_TAA_REPROJECT) != 0;
if (DRW_state_is_image_render() ||
taa_use_reprojection ||
taa_use_reprojection ||
((stl->effects->enabled_effects & EFFECT_TAA) != 0))
{
int samp = taa_use_reprojection

View File

@ -196,7 +196,7 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data
int repro_flag = 0;
if (!DRW_state_is_image_render() &&
BKE_collection_engine_property_value_get_bool(props, "taa_reprojection"))
BKE_collection_engine_property_value_get_bool(props, "taa_reprojection"))
{
repro_flag = EFFECT_TAA_REPROJECT | EFFECT_VELOCITY_BUFFER | EFFECT_DEPTH_DOUBLE_BUFFER | EFFECT_DOUBLE_BUFFER | EFFECT_POST_BUFFER;
effects->taa_reproject_sample = ((effects->taa_reproject_sample + 1) % 16);

View File

@ -61,7 +61,8 @@ static void get_material_solid_color(WORKBENCH_PrivateData *wpd, Object *ob, flo
unsigned int obhash = BLI_ghashutil_strhash(ob->id.name);
cpack_to_rgb(obhash, &color[0], &color[1], &color[2]);
} else {
}
else {
copy_v3_v3(color, ob->col);
}
}
@ -142,7 +143,7 @@ void workbench_materials_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob
DRW_shgroup_call_add(stl->g_data->depth_shgrp, geom, ob->obmat);
/* Solid */
GPUShader *shader = wpd->drawtype_lighting == V3D_LIGHTING_FLAT?e_data.solid_flat_sh:e_data.solid_studio_sh;
GPUShader *shader = wpd->drawtype_lighting == V3D_LIGHTING_FLAT ? e_data.solid_flat_sh : e_data.solid_studio_sh;
float color[3];
get_material_solid_color(wpd, ob, color);

View File

@ -984,7 +984,8 @@ static void drw_engines_enable_from_mode(int mode)
}
}
static void drw_engines_enable_from_overlays(int draw_overlays) {
static void drw_engines_enable_from_overlays(int draw_overlays)
{
if (draw_overlays) {
use_drw_engine(&draw_engine_overlay_type);
}

View File

@ -565,13 +565,13 @@ static void draw_clipping_setup_from_view(void)
/* distance to view Z axis */
f = len_v2(farpoint);
/* get corresponding point on the near plane */
mul_v2_v2fl(farxy, farpoint, s/e);
mul_v2_v2fl(farxy, farpoint, s / e);
/* this formula preserve the sign of n */
sub_v2_v2(nearpoint, farxy);
n = f * s / e - len_v2(nearpoint);
c = len_v2(farcenter) / e;
/* the big formula, it simplifies to (F-N)/(2(e-s)) for the symmetric case */
z = (F-N) / (2.0f * (e-s + c*(f-n)));
z = (F - N) / (2.0f * (e - s + c * (f - n)));
bsphere->center[0] = farcenter[0] * z / e;
bsphere->center[1] = farcenter[1] * z / e;

View File

@ -110,8 +110,7 @@ static void overlay_cache_init(void *vedata)
}
/* Face Orientation Pass */
if (stl->g_data->overlays & V3D_OVERLAY_FACE_ORIENTATION)
{
if (stl->g_data->overlays & V3D_OVERLAY_FACE_ORIENTATION) {
int state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | bm_face_orientation;
psl->face_orientation_pass = DRW_pass_create("Face Orientation", state);
stl->g_data->face_orientation_shgrp = DRW_shgroup_create(e_data.face_orientation_sh, psl->face_orientation_pass);

View File

@ -1482,8 +1482,7 @@ static int edbm_face_make_planar_exec(bContext *C, wmOperator *op)
const int repeat = RNA_int_get(op->ptr, "repeat");
const float fac = RNA_float_get(op->ptr, "factor");
for (uint ob_index = 0; ob_index < objects_len; ob_index++)
{
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
BMEditMesh *em = BKE_editmesh_from_object(obedit);
if (em->bm->totfacesel == 0) {
@ -1491,8 +1490,8 @@ static int edbm_face_make_planar_exec(bContext *C, wmOperator *op)
}
if (!EDBM_op_callf(
em, op, "planar_faces faces=%hf iterations=%i factor=%f",
BM_ELEM_SELECT, repeat, fac))
em, op, "planar_faces faces=%hf iterations=%i factor=%f",
BM_ELEM_SELECT, repeat, fac))
{
continue;
}
@ -4488,8 +4487,8 @@ static int edbm_decimate_exec(bContext *C, wmOperator *op)
}
BM_mesh_decimate_collapse(
em->bm, ratio_adjust, vweights, vertex_group_factor, false,
symmetry_axis, symmetry_eps);
em->bm, ratio_adjust, vweights, vertex_group_factor, false,
symmetry_axis, symmetry_eps);
MEM_freeN(vweights);
@ -6093,9 +6092,9 @@ static int mesh_symmetrize_exec(bContext *C, wmOperator *op)
const float thresh = RNA_float_get(op->ptr, "threshold");
EDBM_op_init(
em, &bmop, op,
"symmetrize input=%hvef direction=%i dist=%f",
BM_ELEM_SELECT, RNA_enum_get(op->ptr, "direction"), thresh);
em, &bmop, op,
"symmetrize input=%hvef direction=%i dist=%f",
BM_ELEM_SELECT, RNA_enum_get(op->ptr, "direction"), thresh);
BMO_op_exec(em->bm, &bmop);
EDBM_flag_disable_all(em, BM_ELEM_SELECT);

View File

@ -2221,7 +2221,7 @@ void ED_region_header(const bContext *C, ARegion *ar)
UI_view2d_view_ortho(&ar->v2d);
xco = maxco = start_ofs;
yco = headery + (ar->winy - headery)/2 - floor(0.2f * UI_UNIT_Y);
yco = headery + (ar->winy - headery) / 2 - floor(0.2f * UI_UNIT_Y);
/* XXX workaround for 1 px alignment issue. Not sure what causes it... Would prefer a proper fix - Julian */
if (CTX_wm_area(C)->spacetype == SPACE_TOPBAR) {

View File

@ -1527,7 +1527,7 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s
for (ar = newa->regionbase.first; ar; ar = ar->next) {
ar->flagfullscreen = ar->flag;
if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_HEADER, RGN_TYPE_TOOLS)){
if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_HEADER, RGN_TYPE_TOOLS)) {
ar->flag |= RGN_FLAG_HIDDEN;
}
}

View File

@ -1592,7 +1592,7 @@ void postTrans(bContext *C, TransInfo *t)
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
/* free data malloced per trans-data */
if (ELEM(t->obedit_type, OB_CURVE, OB_SURF) ||
(t->spacetype == SPACE_IPO))
(t->spacetype == SPACE_IPO))
{
TransData *td = tc->data;
for (int a = 0; a < tc->data_len; a++, td++) {

View File

@ -1597,7 +1597,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

@ -753,7 +753,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje
/* For more efficiency first transfer the entire buffer to vram. */
Gwn_Batch *loop_batch = immBeginBatchAtMost(GWN_PRIM_LINE_LOOP, bm->totloop);
Gwn_VertBuf* loop_vbo = loop_batch->verts[0];
Gwn_VertBuf *loop_vbo = loop_batch->verts[0];
BM_ITER_MESH(efa, &iter, bm, BM_FACES_OF_MESH) {
if (!BM_elem_flag_test(efa, BM_ELEM_TAG))
continue;

View File

@ -43,7 +43,7 @@ typedef struct GPUAttachment {
int mip, layer;
} GPUAttachment;
typedef enum GPUFrameBufferBits{
typedef enum GPUFrameBufferBits {
GPU_COLOR_BIT = (1 << 0),
GPU_DEPTH_BIT = (1 << 1),
GPU_STENCIL_BIT = (1 << 2),

View File

@ -248,7 +248,7 @@ GPUMaterial *GPU_material_from_nodetree_find(
GPUMaterial *GPU_material_from_nodetree(
struct Scene *scene, struct bNodeTree *ntree, struct ListBase *gpumaterials, const void *engine_type, int options);
void GPU_material_generate_pass(
GPUMaterial *mat, const char *vert_code, const char *geom_code, const char *frag_lib, const char *defines);
GPUMaterial *mat, const char *vert_code, const char *geom_code, const char *frag_lib, const char *defines);
void GPU_material_free(struct ListBase *gpumaterial);
void GPU_materials_free(void);

View File

@ -51,7 +51,7 @@ static struct GPUTextureGlobal {
/* Maximum number of FBOs a texture can be attached to. */
#define GPU_TEX_MAX_FBO_ATTACHED 8
typedef enum GPUTextureFormatFlag{
typedef enum GPUTextureFormatFlag {
GPU_FORMAT_DEPTH = (1 << 0),
GPU_FORMAT_STENCIL = (1 << 1),
GPU_FORMAT_INTEGER = (1 << 2),

View File

@ -296,11 +296,11 @@ typedef enum eSpaceOutliner_Filter {
SO_FILTER_NO_OB_CAMERA = (1 << 10),
SO_FILTER_NO_OB_OTHERS = (1 << 11),
SO_FILTER_OB_STATE = (1 << 12),
SO_FILTER_OB_STATE_VISIBLE = (1 << 13), /* Not set via DNA. */
SO_FILTER_OB_STATE_SELECTED= (1 << 14), /* Not set via DNA. */
SO_FILTER_OB_STATE_ACTIVE = (1 << 15), /* Not set via DNA. */
SO_FILTER_NO_COLLECTION = (1 << 16),
SO_FILTER_OB_STATE = (1 << 12),
SO_FILTER_OB_STATE_VISIBLE = (1 << 13), /* Not set via DNA. */
SO_FILTER_OB_STATE_SELECTED = (1 << 14), /* Not set via DNA. */
SO_FILTER_OB_STATE_ACTIVE = (1 << 15), /* Not set via DNA. */
SO_FILTER_NO_COLLECTION = (1 << 16),
} eSpaceOutliner_Filter;
#define SO_FILTER_NO_OB_ALL (SO_FILTER_NO_OB_MESH | \

View File

@ -81,7 +81,7 @@ enum {
};
enum {
V3D_DRAWOPTION_RANDOMIZE = (1<<0),
V3D_DRAWOPTION_RANDOMIZE = (1 << 0),
};
enum {

View File

@ -273,8 +273,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
best_projector = &projectors[0];
for (j = 1; j < num_projectors; ++j) {
float tmp_dot = dot_v3v3(projectors[j].normal,
face_no);
float tmp_dot = dot_v3v3(projectors[j].normal, face_no);
if (tmp_dot > best_dot) {
best_dot = tmp_dot;
best_projector = &projectors[j];

View File

@ -18,7 +18,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/windowmanager/intern/message_bus/wm_message_bus_static.c
/** \file blender/windowmanager/message_bus/intern/wm_message_bus_static.c
* \ingroup wm
*/