Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-06 22:40:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-06 22:40:15 +0400
commit31d2ee9bf77bb991ea4779c47379b2cee84b27ed (patch)
treefd6f021356fc78d6dfeff9f18f601ce645dd7ffe /source/blender/blenkernel
parent7b7214c72233f72268f72d31fd8626a0f94e557e (diff)
style cleanup, brackets in else/if, some indentation.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c54
-rw-r--r--source/blender/blenkernel/intern/boids.c3
-rw-r--r--source/blender/blenkernel/intern/cloth.c9
-rw-r--r--source/blender/blenkernel/intern/collision.c3
-rw-r--r--source/blender/blenkernel/intern/effect.c3
-rw-r--r--source/blender/blenkernel/intern/fcurve.c17
-rw-r--r--source/blender/blenkernel/intern/font.c14
-rw-r--r--source/blender/blenkernel/intern/icons.c9
-rw-r--r--source/blender/blenkernel/intern/image_gen.c18
-rw-r--r--source/blender/blenkernel/intern/navmesh_conversion.c3
-rw-r--r--source/blender/blenkernel/intern/nla.c9
-rw-r--r--source/blender/blenkernel/intern/ocean.c6
-rw-r--r--source/blender/blenkernel/intern/particle.c14
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c18
-rw-r--r--source/blender/blenkernel/intern/smoke.c30
-rw-r--r--source/blender/blenkernel/intern/sound.c15
-rw-r--r--source/blender/blenkernel/intern/unit.c3
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c6
18 files changed, 86 insertions, 148 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 0d12785872c..bc9794db698 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -2460,14 +2460,12 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
MFace * mface = dm->getTessFaceArray(dm);
MTFace * mtface = dm->getTessFaceDataArray(dm, CD_MTFACE);
- if(mtface)
- {
+ if(mtface) {
double dsum = 0.0;
int nr_accumulated = 0;
int f;
- for ( f=0; f<totface; f++ )
- {
+ for ( f=0; f < totface; f++ ) {
{
float * verts[4], * tex_coords[4];
const int nr_verts = mface[f].v4!=0 ? 4 : 3;
@@ -2490,32 +2488,33 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
}
// verify last vertex as well if this is a quad
- if ( is_degenerate==0 && nr_verts==4 )
- {
- if( equals_v3v3(verts[3], verts[0]) || equals_v3v3(verts[3], verts[1]) || equals_v3v3(verts[3], verts[2]) ||
- equals_v2v2(tex_coords[3], tex_coords[0]) || equals_v2v2(tex_coords[3], tex_coords[1]) || equals_v2v2(tex_coords[3], tex_coords[2]) )
+ if (is_degenerate == 0 && nr_verts == 4) {
+ if (equals_v3v3(verts[3], verts[0]) || equals_v3v3(verts[3], verts[1]) || equals_v3v3(verts[3], verts[2]) ||
+ equals_v2v2(tex_coords[3], tex_coords[0]) || equals_v2v2(tex_coords[3], tex_coords[1]) || equals_v2v2(tex_coords[3], tex_coords[2]) )
{
is_degenerate = 1;
}
// verify the winding is consistent
- if ( is_degenerate==0 )
- {
+ if (is_degenerate == 0) {
float prev_edge[2];
int is_signed = 0;
sub_v2_v2v2(prev_edge, tex_coords[0], tex_coords[3]);
i = 0;
- while ( is_degenerate==0 && i<4 )
- {
+ while (is_degenerate == 0 && i < 4) {
float cur_edge[2], signed_area;
sub_v2_v2v2(cur_edge, tex_coords[(i+1)&0x3], tex_coords[i]);
signed_area = prev_edge[0]*cur_edge[1] - prev_edge[1]*cur_edge[0];
- if ( i==0 ) is_signed = signed_area<0.0f ? 1 : 0;
- else if((is_signed!=0)!=(signed_area<0.0f)) is_degenerate=1;
- if ( is_degenerate==0 )
- {
+ if (i == 0 ) {
+ is_signed = (signed_area < 0.0f) ? 1 : 0;
+ }
+ else if((is_signed != 0) != (signed_area < 0.0f)) {
+ is_degenerate = 1;
+ }
+
+ if (is_degenerate == 0) {
copy_v2_v2(prev_edge, cur_edge);
++i;
}
@@ -2524,13 +2523,11 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
}
// proceed if not a degenerate face
- if ( is_degenerate==0 )
- {
+ if (is_degenerate == 0) {
int nr_tris_to_pile=0;
// quads split at shortest diagonal
int offs = 0; // initial triangulation is 0,1,2 and 0, 2, 3
- if ( nr_verts==4 )
- {
+ if (nr_verts == 4) {
float pos_len_diag0, pos_len_diag1;
float vtmp[3];
sub_v3_v3v3(vtmp, verts[2], verts[0]);
@@ -2538,10 +2535,10 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
sub_v3_v3v3(vtmp, verts[3], verts[1]);
pos_len_diag1 = dot_v3v3(vtmp, vtmp);
- if(pos_len_diag1<pos_len_diag0)
+ if(pos_len_diag1<pos_len_diag0) {
offs=1; // alter split
- else if(pos_len_diag0==pos_len_diag1) // do UV check instead
- {
+ }
+ else if(pos_len_diag0==pos_len_diag1) { /* do UV check instead */
float tex_len_diag0, tex_len_diag1;
sub_v2_v2v2(vtmp, tex_coords[2], tex_coords[0]);
@@ -2549,15 +2546,13 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
sub_v2_v2v2(vtmp, tex_coords[3], tex_coords[1]);
tex_len_diag1 = dot_v2v2(vtmp, vtmp);
- if(tex_len_diag1<tex_len_diag0)
- {
- offs=1; // alter split
+ if (tex_len_diag1<tex_len_diag0) {
+ offs=1; /* alter split */
}
}
}
nr_tris_to_pile = nr_verts - 2;
- if ( nr_tris_to_pile==1 || nr_tris_to_pile==2 )
- {
+ if (nr_tris_to_pile==1 || nr_tris_to_pile==2) {
const int indices[] = {offs+0, offs+1, offs+2, offs+0, offs+2, (offs+3)&0x3 };
int t;
for ( t=0; t<nr_tris_to_pile; t++ )
@@ -2598,8 +2593,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
dm->auto_bump_scale = use_as_render_bump_scale;
}
}
- else
- {
+ else {
dm->auto_bump_scale = 1.0f;
}
}
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index f3f4d7c9598..8fa0a46f6da 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -250,8 +250,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
}
//check boids in own system
- if(acbr->options & BRULE_ACOLL_WITH_BOIDS)
- {
+ if (acbr->options & BRULE_ACOLL_WITH_BOIDS) {
neighbors = BLI_kdtree_range_search(bbd->sim->psys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
if(neighbors > 1) for(n=1; n<neighbors; n++) {
copy_v3_v3(co1, pa->prev_state.co);
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index e2d12c04bf2..e5276d1bbd4 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -288,8 +288,7 @@ void bvhtree_update_from_cloth(ClothModifierData *clmd, int moving)
ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, (mfaces->v4 ? 4 : 3));
}
- else
- {
+ else {
ret = BLI_bvhtree_update_node(bvhtree, i, co, NULL, (mfaces->v4 ? 4 : 3));
}
@@ -332,8 +331,7 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving)
ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, 1);
}
- else
- {
+ else {
ret = BLI_bvhtree_update_node(bvhtree, i, co, NULL, 1);
}
@@ -1096,8 +1094,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
BLI_linklist_prepend ( &cloth->springs, spring );
}
- else
- {
+ else {
cloth_free_errorsprings(cloth, edgehash, edgelist);
return 0;
}
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index 5e65d104a03..ce0de3216d3 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -2543,8 +2543,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
ret = 1;
ret2 += ret;
}
- else
- {
+ else {
// check for approximated time collisions
}
}
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 21c798c3cae..1124922efaa 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -426,8 +426,7 @@ static float eff_calc_visibility(ListBase *colliders, EffectorCache *eff, Effect
if(col->ob == eff->ob)
continue;
- if(collmd->bvhtree)
- {
+ if (collmd->bvhtree) {
BVHTreeRayHit hit;
hit.index = -1;
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 3efcd3d8dcf..50e3c2c63eb 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -1873,15 +1873,13 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
lastbezt= prevbezt + a;
/* evaluation time at or past endpoints? */
- if (prevbezt->vec[1][0] >= evaltime)
- {
+ if (prevbezt->vec[1][0] >= evaltime) {
/* before or on first keyframe */
if ( (fcu->extend == FCURVE_EXTRAPOLATE_LINEAR) && (prevbezt->ipo != BEZT_IPO_CONST) &&
- !(fcu->flag & FCURVE_DISCRETE_VALUES) )
+ !(fcu->flag & FCURVE_DISCRETE_VALUES) )
{
/* linear or bezier interpolation */
- if (prevbezt->ipo==BEZT_IPO_LIN)
- {
+ if (prevbezt->ipo==BEZT_IPO_LIN) {
/* Use the next center point instead of our own handle for
* linear interpolated extrapolate
*/
@@ -1981,8 +1979,7 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
cvalue= lastbezt->vec[1][1];
}
}
- else
- {
+ else {
/* evaltime occurs somewhere in the middle of the curve */
for (a=0; prevbezt && bezt && (a < fcu->totvert-1); a++, prevbezt=bezt, bezt++)
{
@@ -1991,8 +1988,7 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
cvalue= bezt->vec[1][1];
}
/* evaltime occurs within the interval defined by these two keyframes */
- else if ((prevbezt->vec[1][0] <= evaltime) && (bezt->vec[1][0] >= evaltime))
- {
+ else if ((prevbezt->vec[1][0] <= evaltime) && (bezt->vec[1][0] >= evaltime)) {
/* value depends on interpolation mode */
if ((prevbezt->ipo == BEZT_IPO_CONST) || (fcu->flag & FCURVE_DISCRETE_VALUES))
{
@@ -2012,8 +2008,7 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
else
cvalue= prevbezt->vec[1][1];
}
- else
- {
+ else {
/* bezier interpolation */
/* v1,v2 are the first keyframe and its 2nd handle */
v1[0]= prevbezt->vec[1][0];
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index ba23b2123d6..4cf47906b64 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -165,8 +165,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
pf= vfont->packedfile;
// We need to copy a tmp font to memory unless it is already there
- if(!tmpfnt)
- {
+ if(!tmpfnt) {
tpf= MEM_callocN(sizeof(*tpf), "PackedFile");
tpf->data= MEM_mallocN(pf->size, "packFile");
tpf->size= pf->size;
@@ -178,11 +177,11 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
tmpfnt->vfont= vfont;
BLI_addtail(&ttfdata, tmpfnt);
}
- } else {
+ }
+ else {
pf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id));
-
- if(!tmpfnt)
- {
+
+ if (!tmpfnt) {
tpf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id));
// Add temporary packed file to globals
@@ -257,8 +256,7 @@ VFont *load_vfont(Main *bmain, const char *name)
}
// Do not add FO_BUILTIN_NAME to temporary listbase
- if(strcmp(filename, FO_BUILTIN_NAME))
- {
+ if (strcmp(filename, FO_BUILTIN_NAME)) {
tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font");
tmpfnt->pf= tpf;
tmpfnt->vfont= vfont;
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index 533dd783422..72038955c55 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -66,8 +66,7 @@ static void icon_free(void *val)
{
Icon* icon = val;
- if (icon)
- {
+ if (icon) {
if (icon->drawinfo_free) {
icon->drawinfo_free(icon->drawinfo);
}
@@ -236,8 +235,7 @@ void BKE_icon_changed(int id)
icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(id));
- if (icon)
- {
+ if (icon) {
PreviewImage *prv = BKE_previewimg_get((ID*)icon->obj);
/* all previews changed */
@@ -302,8 +300,7 @@ void BKE_icon_set(int icon_id, struct Icon* icon)
old_icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id));
- if (old_icon)
- {
+ if (old_icon) {
printf("BKE_icon_set: Internal error, icon already set: %d\n", icon_id);
return;
}
diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c
index 111350bb1bb..d4185af2f98 100644
--- a/source/blender/blenkernel/intern/image_gen.c
+++ b/source/blender/blenkernel/intern/image_gen.c
@@ -202,12 +202,9 @@ static void checker_board_color_tint(unsigned char *rect, float *rect_float, int
int x, y;
float blend_half= blend * 0.5f;
- for(y= 0; y < height; y++)
- {
- for(x= 0; x < width; x++)
- {
- if( ( (y/size)%2 == 1 && (x/size)%2 == 1 ) || ( (y/size)%2 == 0 && (x/size)%2 == 0 ) )
- {
+ for (y= 0; y < height; y++) {
+ for (x= 0; x < width; x++) {
+ if (((y / size) % 2 == 1 && (x / size) % 2 == 1 ) || ( (y / size) % 2 == 0 && (x / size) % 2 == 0 )) {
if (rect) {
rect[0]= (char)BLEND_CHAR(rect[0], blend);
rect[1]= (char)BLEND_CHAR(rect[1], blend);
@@ -251,12 +248,9 @@ static void checker_board_color_tint(unsigned char *rect, float *rect_float, int
static void checker_board_grid_fill(unsigned char *rect, float *rect_float, int width, int height, float blend)
{
int x, y;
- for(y= 0; y < height; y++)
- {
- for(x= 0; x < width; x++)
- {
- if( ((y % 32) == 0) || ((x % 32) == 0) || x == 0 )
- {
+ for(y= 0; y < height; y++) {
+ for(x= 0; x < width; x++) {
+ if (((y % 32) == 0) || ((x % 32) == 0) || x == 0) {
if (rect) {
rect[0]= BLEND_CHAR(rect[0], blend);
rect[1]= BLEND_CHAR(rect[1], blend);
diff --git a/source/blender/blenkernel/intern/navmesh_conversion.c b/source/blender/blenkernel/intern/navmesh_conversion.c
index 4c9c0a3a1fc..cdba036a6ae 100644
--- a/source/blender/blenkernel/intern/navmesh_conversion.c
+++ b/source/blender/blenkernel/intern/navmesh_conversion.c
@@ -248,8 +248,7 @@ int buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
//move to next edge
edge = (edge+1)%3;
}
- else
- {
+ else {
//move to next tri
int twinedge = -1;
for (k=0; k<3; k++)
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 814f0715d11..f67d3274b34 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -352,8 +352,7 @@ NlaStrip *add_nla_soundstrip (Scene *scene, Speaker *speaker)
* otherwise default to length of 10 frames
*/
#ifdef WITH_AUDASPACE
- if (speaker->sound)
- {
+ if (speaker->sound) {
AUD_SoundInfo info = AUD_getInfo(speaker->sound->playback_handle);
strip->end = (float)ceil((double)info.length * FPS);
@@ -1395,8 +1394,7 @@ static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls)
* is directly followed/preceeded by another strip, forming an
* 'island' of continuous strips
*/
- if ( (ps || ns) && ((nls->prev == NULL) || IS_EQF(nls->prev->end, nls->start)==0) )
- {
+ if ((ps || ns) && ((nls->prev == NULL) || IS_EQF(nls->prev->end, nls->start)==0)) {
/* start overlaps - pick the largest overlap */
if ( ((ps && ns) && (*ps > *ns)) || (ps) )
nls->blendin= *ps - nls->start;
@@ -1406,8 +1404,7 @@ static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls)
else /* no overlap allowed/needed */
nls->blendin= 0.0f;
- if ( (pe || ne) && ((nls->next == NULL) || IS_EQF(nls->next->start, nls->end)==0) )
- {
+ if ((pe || ne) && ((nls->next == NULL) || IS_EQF(nls->next->start, nls->end)==0)) {
/* end overlaps - pick the largest overlap */
if ( ((pe && ne) && (*pe > *ne)) || (pe) )
nls->blendout= nls->end - *pe;
diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c
index dd9444d87e0..87929d6a185 100644
--- a/source/blender/blenkernel/intern/ocean.c
+++ b/source/blender/blenkernel/intern/ocean.c
@@ -435,8 +435,7 @@ void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u
ocr->disp[0] = INTERP(oc->_disp_x);
ocr->disp[2] = INTERP(oc->_disp_z);
}
- else
- {
+ else {
ocr->disp[0] = 0.0;
ocr->disp[2] = 0.0;
}
@@ -479,8 +478,7 @@ void BKE_ocean_eval_ij(struct Ocean *oc, struct OceanResult *ocr, int i,int j)
ocr->disp[0] = oc->_disp_x[i*oc->_N+j];
ocr->disp[2] = oc->_disp_z[i*oc->_N+j];
}
- else
- {
+ else {
ocr->disp[0] = 0.0f;
ocr->disp[2] = 0.0f;
}
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 78df8d26c4d..d86b3c7a9d3 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -543,11 +543,9 @@ void psys_free(Object *ob, ParticleSystem * psys)
}
// check if we are last non-visible particle system
- for(tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next) {
- if(tpsys->part)
- {
- if(ELEM(tpsys->part->ren_as,PART_DRAW_OB,PART_DRAW_GR))
- {
+ for (tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next) {
+ if (tpsys->part) {
+ if (ELEM(tpsys->part->ren_as,PART_DRAW_OB,PART_DRAW_GR)) {
nr++;
break;
}
@@ -3487,16 +3485,14 @@ void object_remove_particle_system(Scene *scene, Object *ob)
return;
/* clear all other appearances of this pointer (like on smoke flow modifier) */
- if((md = modifiers_findByType(ob, eModifierType_Smoke)))
- {
+ if ((md = modifiers_findByType(ob, eModifierType_Smoke))) {
SmokeModifierData *smd = (SmokeModifierData *)md;
if((smd->type == MOD_SMOKE_TYPE_FLOW) && smd->flow && smd->flow->psys)
if(smd->flow->psys == psys)
smd->flow->psys = NULL;
}
- if((md = modifiers_findByType(ob, eModifierType_DynamicPaint)))
- {
+ if ((md = modifiers_findByType(ob, eModifierType_DynamicPaint))) {
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
if(pmd->brush && pmd->brush->psys)
if(pmd->brush->psys == psys)
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index a98834c5e35..6800c210963 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -236,8 +236,7 @@ int normal_projection_project_vertex(char options, const float *vert, const floa
hit_tmp.dist *= mat4_to_scale( ((SpaceTransform*)transf)->local2target );
}
- else
- {
+ else {
co = vert;
no = dir;
}
@@ -303,8 +302,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
{
if(calc->vert == NULL) return;
}
- else
- {
+ else {
//The code supports any axis that is a combination of X,Y,Z
//although currently UI only allows to set the 3 different axis
if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) proj_axis[0] = 1.0f;
@@ -355,8 +353,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
copy_v3_v3(tmp_no, proj_axis);
}
}
- else
- {
+ else {
copy_v3_v3(tmp_co, co);
copy_v3_v3(tmp_no, proj_axis);
}
@@ -439,12 +436,10 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
if(weight == 0.0f) continue;
//Convert the vertex to tree coordinates
- if(calc->vert)
- {
+ if(calc->vert) {
copy_v3_v3(tmp_co, calc->vert[i].co);
}
- else
- {
+ else {
copy_v3_v3(tmp_co, co);
}
space_transform_apply(&calc->local2target, tmp_co);
@@ -469,8 +464,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
//Make the vertex stay on the front side of the face
madd_v3_v3v3fl(tmp_co, nearest.co, nearest.no, calc->keepDist);
}
- else
- {
+ else {
//Adjusting the vertex weight, so that after interpolating it keeps a certain distance from the nearest position
float dist = sasqrt( nearest.dist );
if(dist > FLT_EPSILON)
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 8f0fcc04e1e..bffd4703ce4 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -211,8 +211,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
smd->domain->res[1] = (int)(size[1] * scale + 0.5);
smd->domain->res[2] = (int)(size[2] * scale + 0.5);
}
- else
- {
+ else {
scale = res / size[2];
smd->domain->dx = size[2] / res;
smd->domain->res[2] = res;
@@ -220,8 +219,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
smd->domain->res[1] = (int)(size[1] * scale + 0.5);
}
}
- else
- {
+ else {
if(size[1] > size[2])
{
scale = res / size[1];
@@ -230,8 +228,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
smd->domain->res[0] = (int)(size[0] * scale + 0.5);
smd->domain->res[2] = (int)(size[2] * scale + 0.5);
}
- else
- {
+ else {
scale = res / size[2];
smd->domain->dx = size[2] / res;
smd->domain->res[2] = res;
@@ -378,8 +375,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
sub_v3_v3v3(side1, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
sub_v3_v3v3(side2, mvert[ mface[i].v4 ].co, mvert[ mface[i].v1 ].co);
}
- else
- {
+ else {
sub_v3_v3v3(side1, mvert[ mface[i].v2 ].co, mvert[ mface[i].v1 ].co);
sub_v3_v3v3(side2, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
}
@@ -410,8 +406,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
copy_v3_v3(p2, mvert[ mface[i].v3 ].co);
copy_v3_v3(p3, mvert[ mface[i].v4 ].co);
}
- else
- {
+ else {
copy_v3_v3(p2, mvert[ mface[i].v2 ].co);
copy_v3_v3(p3, mvert[ mface[i].v3 ].co);
}
@@ -1073,8 +1068,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
if(psys->particles[p].flag & (PARS_NO_DISP|PARS_UNEXIST))
continue;
}
- else
- {
+ else {
/* handle child particle */
ChildParticle *cpa = &psys->child[p - totpart];
@@ -1272,8 +1266,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
}
- else
- {
+ else {
/*
for()
{
@@ -1630,14 +1623,12 @@ static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int
sub_v3_v3v3(tmp, pos, p0);
mul_v3_fl(tmp, 1.0 / dx);
- if(correct)
- {
+ if (correct) {
cell[0] = MIN2(res[0] - 1, MAX2(0, (int)floor(tmp[0])));
cell[1] = MIN2(res[1] - 1, MAX2(0, (int)floor(tmp[1])));
cell[2] = MIN2(res[2] - 1, MAX2(0, (int)floor(tmp[2])));
}
- else
- {
+ else {
cell[0] = (int)floor(tmp[0]);
cell[1] = (int)floor(tmp[1]);
cell[2] = (int)floor(tmp[2]);
@@ -1687,8 +1678,7 @@ static void smoke_calc_transparency(float *result, float *input, float *p0, floa
// we're ouside
get_cell(p0, res, dx, pos, cell, 1);
}
- else
- {
+ else {
// we're inside
get_cell(p0, res, dx, light, cell, 1);
}
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 594c7a9a2f3..a41e765695e 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -628,19 +628,16 @@ void sound_seek_scene(struct Main *bmain, struct Scene *scene)
AUD_resume(scene->sound_scene_handle);
if (scene->sound_scrub_handle && AUD_getStatus(scene->sound_scrub_handle) != AUD_STATUS_INVALID)
AUD_seek(scene->sound_scrub_handle, 0);
- else
- {
+ else {
if (scene->sound_scrub_handle)
AUD_stop(scene->sound_scrub_handle);
scene->sound_scrub_handle = AUD_pauseAfter(scene->sound_scene_handle, 1 / FPS);
}
}
- else
- {
+ else {
if (scene->audio.flag & AUDIO_SYNC)
AUD_seekSequencer(scene->sound_scene_handle, CFRA / FPS);
- else
- {
+ else {
if (status == AUD_STATUS_PLAYING)
AUD_seek(scene->sound_scene_handle, CFRA / FPS);
}
@@ -731,14 +728,12 @@ void sound_update_scene(struct Scene* scene)
{
if (speaker->sound)
AUD_moveSequence(strip->speaker_handle, strip->start / FPS, -1, 0);
- else
- {
+ else {
AUD_removeSequence(scene->sound_scene, strip->speaker_handle);
strip->speaker_handle = NULL;
}
}
- else
- {
+ else {
if (speaker->sound)
{
strip->speaker_handle = AUD_addSequence(scene->sound_scene, speaker->sound->playback_handle, strip->start / FPS, -1, 0);
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index c3ba8f1ad6a..3b84cb4eb5f 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -689,8 +689,7 @@ void bUnit_ToUnitAltName(char *str, int len_max, const char *orig_str, int syste
/* find and substitute all units */
for (unit= usys->units; unit->name; unit++) {
- if (len_max > 0 && (unit->name_alt || unit == unit_def))
- {
+ if (len_max > 0 && (unit->name_alt || unit == unit_def)) {
const char *found= unit_find_str(orig_str, unit->name_short);
if (found) {
int offset= (int)(found - orig_str);
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 9d68e1d899c..bca7f6ff7bb 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -627,8 +627,7 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex
if((c->codec_id >= CODEC_ID_PCM_S16LE) && (c->codec_id <= CODEC_ID_PCM_DVD))
audio_input_samples = audio_outbuf_size * 8 / c->bits_per_coded_sample / c->channels;
- else
- {
+ else {
audio_input_samples = c->frame_size;
if(c->frame_size * c->channels * sizeof(int16_t) * 4 > audio_outbuf_size)
audio_outbuf_size = c->frame_size * c->channels * sizeof(int16_t) * 4;
@@ -994,8 +993,7 @@ void end_ffmpeg(void)
}*/
#ifdef WITH_AUDASPACE
- if(audio_mixdown_device)
- {
+ if (audio_mixdown_device) {
AUD_closeReadDevice(audio_mixdown_device);
audio_mixdown_device = 0;
}