diff options
218 files changed, 1296 insertions, 1301 deletions
diff --git a/intern/container/CTR_TaggedIndex.h b/intern/container/CTR_TaggedIndex.h index 8420414d6c7..0eb4e02e84f 100644 --- a/intern/container/CTR_TaggedIndex.h +++ b/intern/container/CTR_TaggedIndex.h @@ -29,13 +29,6 @@ * \ingroup ctr */ - -/** - - * Copyright (C) 2001 NaN Technologies B.V. - * Simple tagged index class. - */ - #ifndef __CTR_TAGGEDINDEX_H__ #define __CTR_TAGGEDINDEX_H__ @@ -53,7 +46,6 @@ #include "MEM_sys_types.h" enum { - empty_tag = 0x0, empty_index = 0xffffffff }; @@ -191,7 +183,7 @@ public: return (Tag() == Empty().Tag()); } - // functionals + /* functionals */ struct greater : std::binary_function<CTR_TaggedIndex, CTR_TaggedIndex, bool> { @@ -213,7 +205,6 @@ private : unsigned int m_val; -}; - -#endif +}; +#endif /* __CTR_TAGGEDINDEX_H__ */ diff --git a/intern/container/CTR_TaggedSetOps.h b/intern/container/CTR_TaggedSetOps.h index d30081d2d60..6ebf20b77bf 100644 --- a/intern/container/CTR_TaggedSetOps.h +++ b/intern/container/CTR_TaggedSetOps.h @@ -50,16 +50,16 @@ * type ObjectType must have the following public methods to be used by * this template class: * - * int + * int * OpenTag(void) --- return a persistent tag value for the primitive * - * void + * void * SetOpenTag(int bla) --- set the persistent tag value for this primitive to bla. * - * bool + * bool * SelectTag() --- return a persistent boolean tag for this primitive * - * void + * void * SetSelectTag(bool bla) --- set the persistent boolean tag for this primitive to bla. * * Here persistent means that the tag should be associated with the object for the @@ -86,16 +86,16 @@ public : unsigned int shift ) { - // iterate through vectors in index_list - // iterate through individual members of each vector - // mark each obejct that the index points to + /* iterate through vectors in index_list + * iterate through individual members of each vector + * mark each obejct that the index points to */ typename std::vector< std::vector<IndexType> >::const_iterator last_vector = index_list.end(); typename std::vector< std::vector<IndexType> >::const_iterator start_vector = index_list.begin(); - // FIXME some temporary space + /* FIXME some temporary space */ std::vector<IndexType> temp_union; temp_union.reserve(64); @@ -114,7 +114,7 @@ public : ObjectType & prim = primitives[*start_index]; if (!prim.OpenTag()) { - // compute the union + /* compute the union */ temp_union.push_back(*start_index); } int tag = prim.OpenTag(); @@ -126,7 +126,7 @@ public : ++tag_num; } - // now iterate through the union and pull out all those with the right tag + /* now iterate through the union and pull out all those with the right tag */ typename std::vector<IndexType>::const_iterator last_index = temp_union.end(); @@ -138,20 +138,20 @@ public : ObjectType & prim = primitives[*start_index]; if (prim.OpenTag() == tag_num) { - //it's part of the intersection! + /* it's part of the intersection! */ output.push_back(*start_index); - // because we're iterating through the union - // it's safe to remove the tag at this point + /* because we're iterating through the union + * it's safe to remove the tag at this point */ prim.SetOpenTag(prim.OpenTag() & ~mask); } } }; - // note not a strict set intersection! - // if x appears twice in b and is part of the intersection - // it will appear twice in the intersection + /* note not a strict set intersection! + * if x appears twice in b and is part of the intersection + * it will appear twice in the intersection */ static void @@ -180,7 +180,7 @@ public : output.push_back(*start_index); } } - // deselect + /* deselect */ last_index = a.end(); start_index = a.begin(); @@ -199,9 +199,9 @@ public : std::vector<IndexType> &output ) { - // iterate through vectors in index_list - // iterate through individual members of each vector - // mark each obejct that the index points to + /* iterate through vectors in index_list + * iterate through individual members of each vector + * mark each obejct that the index points to */ typename std::vector< std::vector<IndexType> >::const_iterator last_vector = index_list.end(); @@ -220,15 +220,15 @@ public : ObjectType & prim = primitives[*start_index]; if (!prim.SelectTag()) { - // compute the union + /* compute the union */ output.push_back(*start_index); prim.SetSelectTag(true); } } } - // now iterate through the union and reset the tags - + /* now iterate through the union and reset the tags */ + typename std::vector<IndexType>::const_iterator last_index = output.end(); typename std::vector<IndexType>::iterator start_index = @@ -238,7 +238,7 @@ public : ObjectType & prim = primitives[*start_index]; prim.SetSelectTag(false); - } + } } @@ -251,8 +251,8 @@ public : std::vector< IndexType> &output ) { - // iterate through b mark all - // iterate through a and add to output all unmarked + /* iterate through b mark all + * iterate through a and add to output all unmarked */ typename std::vector<IndexType>::const_iterator last_index = b.end(); @@ -276,7 +276,7 @@ public : } } - // clean up the tags + /* clean up the tags */ last_index = b.end(); start_index = b.begin(); @@ -290,12 +290,11 @@ public : private : - // private constructor - this class is not meant for - // instantiation + /* private constructor - this class is not meant for + * instantiation */ CTR_TaggedSetOps(); }; -#endif - +#endif /* __CTR_TAGGEDSETOPS_H__ */ diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index aafc7fe89b4..43f795eeee5 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -956,7 +956,8 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) // } //} - bbd->wanted_co[0]=bbd->wanted_co[1]=bbd->wanted_co[2]=bbd->wanted_speed=0.0f; + zero_v3(bbd->wanted_co); + bbd->wanted_speed = 0.0f; /* create random seed for every particle & frame */ rand = (int)(PSYS_FRAND(psys->seed + p) * 1000); @@ -990,7 +991,8 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) add_v3_v3(wanted_co, bbd->wanted_co); wanted_speed += bbd->wanted_speed; n++; - bbd->wanted_co[0]=bbd->wanted_co[1]=bbd->wanted_co[2]=bbd->wanted_speed=0.0f; + zero_v3(bbd->wanted_co); + bbd->wanted_speed = 0.0f; } } @@ -1266,9 +1268,9 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) { float grav[3]; - grav[0]= 0.0f; - grav[1]= 0.0f; - grav[2]= bbd->sim->scene->physics_settings.gravity[2] < 0.0f ? -1.0f : 0.0f; + grav[0] = 0.0f; + grav[1] = 0.0f; + grav[2] = bbd->sim->scene->physics_settings.gravity[2] < 0.0f ? -1.0f : 0.0f; /* don't take forward acceleration into account (better banking) */ if (dot_v3v3(bpa->data.acc, pa->state.vel) > 0.0f) { @@ -1309,9 +1311,9 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) { float grav[3]; - grav[0]= 0.0f; - grav[1]= 0.0f; - grav[2]= bbd->sim->scene->physics_settings.gravity[2] < 0.0f ? -1.0f : 0.0f; + grav[0] = 0.0f; + grav[1] = 0.0f; + grav[2] = bbd->sim->scene->physics_settings.gravity[2] < 0.0f ? -1.0f : 0.0f; /* gather apparent gravity */ diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 4e00e1bce0b..88dfb4577d5 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -824,7 +824,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d int i = 0; MVert *mvert = NULL; ClothVertex *verts = NULL; - float (*shapekey_rest)[3]= NULL; + float (*shapekey_rest)[3] = NULL; float tnull[3] = {0, 0, 0}; Cloth *cloth = NULL; float maxdist = 0; diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 9b2439d285a..88490dbb960 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -828,7 +828,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected { PartDeflect *pd = eff->pd; RNG *rng = pd->rng; - float force[3]={0, 0, 0}; + float force[3] = {0, 0, 0}; float temp[3]; float fac; float strength = pd->f_strength; @@ -1020,7 +1020,7 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we do_texture_effector(eff, &efd, point, force); } else { - float temp1[3]={0, 0, 0}, temp2[3]; + float temp1[3] = {0, 0, 0}, temp2[3]; copy_v3_v3(temp1, force); do_physical_effector(eff, &efd, point, force); diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index d1ef5d7376b..9201ac463e3 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -1218,7 +1218,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s, float stretch_force[3] = {0, 0, 0}; float bending_force[3] = {0, 0, 0}; float damping_force[3] = {0, 0, 0}; - float nulldfdx[3][3]={ {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + float nulldfdx[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; float scaling = 0.0; @@ -1356,15 +1356,15 @@ static void CalcFloat( float *v1, float *v2, float *v3, float *n) { float n1[3], n2[3]; - n1[0]= v1[0]-v2[0]; - n2[0]= v2[0]-v3[0]; - n1[1]= v1[1]-v2[1]; - n2[1]= v2[1]-v3[1]; - n1[2]= v1[2]-v2[2]; - n2[2]= v2[2]-v3[2]; - n[0]= n1[1]*n2[2]-n1[2]*n2[1]; - n[1]= n1[2]*n2[0]-n1[0]*n2[2]; - n[2]= n1[0]*n2[1]-n1[1]*n2[0]; + n1[0] = v1[0]-v2[0]; + n2[0] = v2[0]-v3[0]; + n1[1] = v1[1]-v2[1]; + n2[1] = v2[1]-v3[1]; + n1[2] = v1[2]-v2[2]; + n2[2] = v2[2]-v3[2]; + n[0] = n1[1]*n2[2]-n1[2]*n2[1]; + n[1] = n1[2]*n2[0]-n1[0]*n2[2]; + n[2] = n1[0]*n2[1]-n1[1]*n2[0]; } static void CalcFloat4( float *v1, float *v2, float *v3, float *v4, float *n) @@ -1372,17 +1372,17 @@ static void CalcFloat4( float *v1, float *v2, float *v3, float *v4, float *n) /* real cross! */ float n1[3], n2[3]; - n1[0]= v1[0]-v3[0]; - n1[1]= v1[1]-v3[1]; - n1[2]= v1[2]-v3[2]; + n1[0] = v1[0]-v3[0]; + n1[1] = v1[1]-v3[1]; + n1[2] = v1[2]-v3[2]; - n2[0]= v2[0]-v4[0]; - n2[1]= v2[1]-v4[1]; - n2[2]= v2[2]-v4[2]; + n2[0] = v2[0]-v4[0]; + n2[1] = v2[1]-v4[1]; + n2[2] = v2[2]-v4[2]; - n[0]= n1[1]*n2[2]-n1[2]*n2[1]; - n[1]= n1[2]*n2[0]-n1[0]*n2[2]; - n[2]= n1[0]*n2[1]-n1[1]*n2[0]; + n[0] = n1[1]*n2[2]-n1[2]*n2[1]; + n[1] = n1[2]*n2[0]-n1[0]*n2[2]; + n[2] = n1[0]*n2[1]-n1[1]*n2[0]; } static float calculateVertexWindForce(float wind[3], float vertexnormal[3]) @@ -1544,7 +1544,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec lfVector *winvec; EffectedPoint epoint; - tm2[0][0]= tm2[1][1]= tm2[2][2]= -spring_air; + tm2[0][0] = tm2[1][1] = tm2[2][2] = -spring_air; /* global acceleration (gravitation) */ if (clmd->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) { @@ -1588,9 +1588,9 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec } for (i = 0; i < cloth->numfaces; i++) { - float trinormal[3]={0, 0, 0}; // normalized triangle normal - float triunnormal[3]={0, 0, 0}; // not-normalized-triangle normal - float tmp[3]={0, 0, 0}; + float trinormal[3] = {0, 0, 0}; // normalized triangle normal + float triunnormal[3] = {0, 0, 0}; // not-normalized-triangle normal + float tmp[3] = {0, 0, 0}; float factor = (mfaces[i].v4) ? 0.25 : 1.0 / 3.0; factor *= 0.02; @@ -1628,9 +1628,9 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec /* Hair has only edges */ if (cloth->numfaces == 0) { ClothSpring *spring; - float edgevec[3]={0, 0, 0}; //edge vector - float edgeunnormal[3]={0, 0, 0}; // not-normalized-edge normal - float tmp[3]={0, 0, 0}; + float edgevec[3] = {0, 0, 0}; //edge vector + float edgeunnormal[3] = {0, 0, 0}; // not-normalized-edge normal + float tmp[3] = {0, 0, 0}; float factor = 0.01; search = cloth->springs; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 83e7274dfc9..2f5e48e0ac6 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1200,7 +1200,7 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name) char left[MAX_ID_NAME + 8], leftest[MAX_ID_NAME + 8]; /* make sure input name is terminated properly */ - /* if ( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3]= 0; */ + /* if ( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3] = 0; */ /* removed since this is only ever called from one place - campbell */ while (1) { diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 2f04df06d66..ea317956255 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1159,7 +1159,7 @@ void material_drivers_update(Scene *scene, Material *ma, float ctime) /* ****************** */ #if 0 /* UNUSED */ -static char colname_array[125][20]= { +static char colname_array[125][20] = { "Black", "DarkRed", "HalfRed", "Red", "Red", "DarkGreen", "DarkOlive", "Brown", "Chocolate", "OrangeRed", "HalfGreen", "GreenOlive", "DryOlive", "Goldenrod", "DarkOrange", diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index c1501ccc359..d3f416b34ae 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -369,10 +369,10 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys) if (nodearray[*origindex]) { /* prepend */ node->next = nodearray[*origindex]; - nodearray[*origindex]= node; + nodearray[*origindex] = node; } else - nodearray[*origindex]= node; + nodearray[*origindex] = node; } } @@ -633,8 +633,8 @@ static void hammersley_create(float *out, int n, int seed, float amount) int k, kk; rng = rng_new(31415926 + n + seed); - offs[0]= rng_getDouble(rng) + (double)amount; - offs[1]= rng_getDouble(rng) + (double)amount; + offs[0] = rng_getDouble(rng) + (double)amount; + offs[1] = rng_getDouble(rng) + (double)amount; rng_free(rng); for (k = 0; k < n; k++) { @@ -643,8 +643,8 @@ static void hammersley_create(float *out, int n, int seed, float amount) if (kk & 1) /* kk mod 2 = 1 */ t += p; - out[2*k + 0]= fmod((double)k/(double)n + offs[0], 1.0); - out[2*k + 1]= fmod(t + offs[1], 1.0); + out[2*k + 0] = fmod((double)k/(double)n + offs[0], 1.0); + out[2*k + 1] = fmod(t + offs[1], 1.0); } } @@ -666,8 +666,8 @@ static void init_mv_jit(float *jit, int num, int seed2, float amount) num2 = 2 * num; for (i=0; i<num2; i+=2) { - jit[i]= x + amount*rad1*(0.5f - rng_getFloat(rng)); - jit[i+1]= i/(2.0f*num) + amount*rad1*(0.5f - rng_getFloat(rng)); + jit[i] = x + amount*rad1*(0.5f - rng_getFloat(rng)); + jit[i+1] = i/(2.0f*num) + amount*rad1*(0.5f - rng_getFloat(rng)); jit[i]-= (float)floor(jit[i]); jit[i+1]-= (float)floor(jit[i+1]); @@ -698,21 +698,21 @@ static void psys_uv_to_w(float u, float v, int quad, float *w) u= 1.0f-u; } - vert[0][0]= 0.0f; vert[0][1]= 0.0f; vert[0][2]= 0.0f; - vert[1][0]= 1.0f; vert[1][1]= 0.0f; vert[1][2]= 0.0f; - vert[2][0]= 1.0f; vert[2][1]= 1.0f; vert[2][2]= 0.0f; + vert[0][0] = 0.0f; vert[0][1] = 0.0f; vert[0][2] = 0.0f; + vert[1][0] = 1.0f; vert[1][1] = 0.0f; vert[1][2] = 0.0f; + vert[2][0] = 1.0f; vert[2][1] = 1.0f; vert[2][2] = 0.0f; - co[0]= u; - co[1]= v; - co[2]= 0.0f; + co[0] = u; + co[1] = v; + co[2] = 0.0f; if (quad) { - vert[3][0]= 0.0f; vert[3][1]= 1.0f; vert[3][2]= 0.0f; + vert[3][0] = 0.0f; vert[3][1] = 1.0f; vert[3][2] = 0.0f; interp_weights_poly_v3( w,vert, 4, co); } else { interp_weights_poly_v3( w,vert, 3, co); - w[3]= 0.0f; + w[3] = 0.0f; } } @@ -1000,7 +1000,7 @@ static void distribute_invalid(Scene *scene, ParticleSystem *psys, int from) if (psys->child && totchild) { for (p=0,cpa=psys->child; p<totchild; p++,cpa++) { - cpa->fuv[0]=cpa->fuv[1]=cpa->fuv[2]=cpa->fuv[3]= 0.0; + cpa->fuv[0]=cpa->fuv[1]=cpa->fuv[2]=cpa->fuv[3] = 0.0; cpa->foffset= 0.0f; cpa->parent=0; cpa->pa[0]=cpa->pa[1]=cpa->pa[2]=cpa->pa[3]=0; @@ -1011,7 +1011,7 @@ static void distribute_invalid(Scene *scene, ParticleSystem *psys, int from) else { PARTICLE_P; LOOP_PARTICLES { - pa->fuv[0]=pa->fuv[1]=pa->fuv[2]= pa->fuv[3]= 0.0; + pa->fuv[0] = pa->fuv[1] = pa->fuv[2] = pa->fuv[3] = 0.0; pa->foffset= 0.0f; pa->num= -1; } @@ -1113,7 +1113,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D if (from == PART_FROM_VERT) { MVert *mv= dm->getVertDataArray(dm, CD_MVERT); - float (*orcodata)[3]= dm->getVertDataArray(dm, CD_ORCO); + float (*orcodata)[3] = dm->getVertDataArray(dm, CD_ORCO); int totvert = dm->getNumVerts(dm); tree=BLI_kdtree_new(totvert); @@ -1245,9 +1245,9 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D inv_totweight = (totweight > 0.f ? 1.f/totweight : 0.f); /* Calculate cumulative weights */ - element_sum[0]= 0.0f; + element_sum[0] = 0.0f; for (i=0; i<totelem; i++) - element_sum[i+1]= element_sum[i] + element_weight[i] * inv_totweight; + element_sum[i+1] = element_sum[i] + element_weight[i] * inv_totweight; /* Finally assign elements to particles */ if ((part->flag&PART_TRAND) || (part->simplify_flag&PART_SIMPLIFY_ENABLE)) { @@ -1256,9 +1256,9 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D for (p=0; p<totpart; p++) { /* In theory element_sum[totelem] should be 1.0, but due to float errors this is not necessarily always true, so scale pos accordingly. */ pos= BLI_frand() * element_sum[totelem]; - particle_element[p]= distribute_binary_search(element_sum, totelem, pos); - particle_element[p]= MIN2(totelem-1, particle_element[p]); - jitter_offset[particle_element[p]]= pos; + particle_element[p] = distribute_binary_search(element_sum, totelem, pos); + particle_element[p] = MIN2(totelem-1, particle_element[p]); + jitter_offset[particle_element[p]] = pos; } } else { @@ -1272,13 +1272,13 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D while ((i < totelem) && (pos > element_sum[i+1])) i++; - particle_element[p]= MIN2(totelem-1, i); + particle_element[p] = MIN2(totelem-1, i); /* avoid zero weight face */ if (p == totpart-1 && element_weight[particle_element[p]] == 0.0f) - particle_element[p]= particle_element[p-1]; + particle_element[p] = particle_element[p-1]; - jitter_offset[particle_element[p]]= pos; + jitter_offset[particle_element[p]] = pos; } } @@ -1622,9 +1622,9 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P ParticleSystem *psys = sim->psys; ParticleSettings *part; ParticleTexture ptex; - float fac, phasefac, nor[3]={0,0,0},loc[3],vel[3]={0.0,0.0,0.0},rot[4],q2[4]; - float r_vel[3],r_ave[3],r_rot[4],vec[3],p_vel[3]={0.0,0.0,0.0}; - float x_vec[3]={1.0,0.0,0.0}, utan[3]={0.0,1.0,0.0}, vtan[3]={0.0,0.0,1.0}, rot_vec[3]={0.0,0.0,0.0}; + float fac, phasefac, nor[3] = {0,0,0},loc[3],vel[3] = {0.0,0.0,0.0},rot[4],q2[4]; + float r_vel[3],r_ave[3],r_rot[4],vec[3],p_vel[3] = {0.0,0.0,0.0}; + float x_vec[3] = {1.0,0.0,0.0}, utan[3] = {0.0,1.0,0.0}, vtan[3] = {0.0,0.0,1.0}, rot_vec[3] = {0.0,0.0,0.0}; float q_phase[4]; int p = pa - psys->particles; part=psys->part; @@ -2736,7 +2736,7 @@ static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, floa } static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, float timestep) { - float rotfac, rot1[4], rot2[4]={1.0,0.0,0.0,0.0}, dtime=dfra*timestep, extrotfac; + float rotfac, rot1[4], rot2[4] = {1.0,0.0,0.0,0.0}, dtime=dfra*timestep, extrotfac; if ((part->flag & PART_ROTATIONS) == 0) { unit_qt(pa->state.rot); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 88f3eb15610..c9b923cde32 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -249,9 +249,9 @@ static int ptcache_particle_write(int index, void *psys_v, void **data, int cfr if (data[BPHYS_DATA_INDEX] && (cfra < pa->time - step || cfra > pa->dietime + step)) return 0; - times[0]= pa->time; - times[1]= pa->dietime; - times[2]= pa->lifetime; + times[0] = pa->time; + times[1] = pa->dietime; + times[2] = pa->lifetime; PTCACHE_DATA_FROM(data, BPHYS_DATA_INDEX, &index); PTCACHE_DATA_FROM(data, BPHYS_DATA_LOCATION, pa->state.co); diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 6c1fbbfa9a0..eb4e0d9c679 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -552,7 +552,7 @@ void set_sca_new_poins_ob(Object *ob) if (sens->flag & SENS_NEW) { for (a=0; a<sens->totlinks; a++) { if (sens->links[a] && sens->links[a]->mynew) - sens->links[a]= sens->links[a]->mynew; + sens->links[a] = sens->links[a]->mynew; } } sens= sens->next; @@ -563,7 +563,7 @@ void set_sca_new_poins_ob(Object *ob) if (cont->flag & CONT_NEW) { for (a=0; a<cont->totlinks; a++) { if ( cont->links[a] && cont->links[a]->mynew) - cont->links[a]= cont->links[a]->mynew; + cont->links[a] = cont->links[a]->mynew; } } cont= cont->next; diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index f47c931e309..8fea83b202e 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1598,7 +1598,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow, /*see if we have wind*/ if (do_effector) { EffectedPoint epoint; - float speed[3]={0.0f, 0.0f, 0.0f}; + float speed[3] = {0.0f, 0.0f, 0.0f}; float pos[3]; mid_v3_v3v3(pos, sb->bpoint[bs->v1].pos, sb->bpoint[bs->v2].pos); mid_v3_v3v3(vel, sb->bpoint[bs->v1].vec, sb->bpoint[bs->v2].vec); @@ -1749,8 +1749,8 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], Object *ob= NULL; GHash *hash; GHashIterator *ihash; - float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3], d_nvect[3], dv1[3], ve[3], avel[3]={0.0, 0.0, 0.0}, - vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f, + float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3], d_nvect[3], dv1[3], ve[3], avel[3] = {0.0, 0.0, 0.0}, + vv1[3], vv2[3], vv3[3], vv4[3], coledge[3] = {0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f, outerforceaccu[3], innerforceaccu[3], facedist, /* n_mag, */ /* UNUSED */ force_mag_norm, minx, miny, minz, maxx, maxy, maxz, innerfacethickness = -0.5f, outerfacethickness = 0.2f, @@ -2209,7 +2209,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo bp = &sb->bpoint[ifirst]; for (bb=number_of_points_here; bb>0; bb--, bp++) { /* clear forces accumulator */ - bp->force[0]= bp->force[1]= bp->force[2]= 0.0; + bp->force[0] = bp->force[1] = bp->force[2] = 0.0; /* naive ball self collision */ /* needs to be done if goal snaps or not */ if (do_selfcollision) { @@ -2304,8 +2304,8 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo if (do_effector) { EffectedPoint epoint; float kd; - float force[3]= {0.0f, 0.0f, 0.0f}; - float speed[3]= {0.0f, 0.0f, 0.0f}; + float force[3] = {0.0f, 0.0f, 0.0f}; + float speed[3] = {0.0f, 0.0f, 0.0f}; float eval_sb_fric_force_scale = sb_fric_force_scale(ob); /* just for calling function once */ pd_point_from_soft(scene, bp->pos, bp->vec, sb->bpoint-bp, &epoint); pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed); @@ -2557,7 +2557,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { /* clear forces accumulator */ - bp->force[0]= bp->force[1]= bp->force[2]= 0.0; + bp->force[0] = bp->force[1] = bp->force[2] = 0.0; if (nl_flags & NLF_BUILD) { //int ia =3*(sb->totpoint-a); //int op =3*sb->totpoint; @@ -2712,8 +2712,8 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa /* particle field & vortex */ if (do_effector) { EffectedPoint epoint; - float force[3]= {0.0f, 0.0f, 0.0f}; - float speed[3]= {0.0f, 0.0f, 0.0f}; + float force[3] = {0.0f, 0.0f, 0.0f}; + float speed[3] = {0.0f, 0.0f, 0.0f}; float eval_sb_fric_force_scale = sb_fric_force_scale(ob); /* just for calling function once */ pd_point_from_soft(scene, bp->pos, bp->vec, sb->bpoint-bp, &epoint); pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed); @@ -2905,7 +2905,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * /* or heun ~ 2nd order runge-kutta steps, mode 1, 2 */ SoftBody *sb= ob->soft; /* is supposed to be there */ BodyPoint *bp; - float dx[3]={0}, dv[3], aabbmin[3], aabbmax[3], cm[3]={0.0f, 0.0f, 0.0f}; + float dx[3] = {0}, dv[3], aabbmin[3], aabbmax[3], cm[3] = {0.0f, 0.0f, 0.0f}; float timeovermass/*, freezeloc=0.00001f, freezeforce=0.00000000001f*/; float maxerrpos= 0.0f, maxerrvel = 0.0f; int a, fuzzy=0; @@ -3865,7 +3865,7 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int copy_v3_v3(bp->origS, bp->pos); copy_v3_v3(bp->origE, bp->pos); copy_v3_v3(bp->origT, bp->pos); - bp->vec[0]= bp->vec[1]= bp->vec[2]= 0.0f; + bp->vec[0] = bp->vec[1] = bp->vec[2] = 0.0f; /* the bp->prev*'s are for rolling back from a canceled try to propagate in time * adaptive step size algo in a nutshell: diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c index d3b1bdfa8fa..42dca360f4c 100644 --- a/source/blender/blenlib/intern/BLI_heap.c +++ b/source/blender/blenlib/intern/BLI_heap.c @@ -122,6 +122,7 @@ static void heap_up(Heap *heap, unsigned int i) Heap *BLI_heap_new_ex(unsigned int tot_reserve) { Heap *heap = (Heap *)MEM_callocN(sizeof(Heap), __func__); + /* ensure we have at least one so we can keep doubling it */ heap->bufsize = MAX2(1, tot_reserve); heap->tree = (HeapNode **)MEM_mallocN(heap->bufsize * sizeof(HeapNode *), "BLIHeapTree"); heap->arena = BLI_memarena_new(1 << 16, "heap arena"); @@ -151,8 +152,8 @@ HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr) { HeapNode *node; - if ((heap->size + 1) > heap->bufsize) { - heap->bufsize = heap->bufsize * 2; + if (UNLIKELY((heap->size + 1) > heap->bufsize)) { + heap->bufsize *= 2; heap->tree = MEM_reallocN(heap->tree, heap->bufsize * sizeof(*heap->tree)); } @@ -199,8 +200,9 @@ void *BLI_heap_popmin(Heap *heap) heap->tree[0]->ptr = heap->freenodes; heap->freenodes = heap->tree[0]; - if (heap->size == 1) + if (UNLIKELY(heap->size == 1)) { heap->size--; + } else { heap_swap(heap, 0, heap->size - 1); heap->size--; diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index ce13a278274..70d9ef27734 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -1679,34 +1679,34 @@ void vec_apply_track(float vec[3], short axis) switch (axis) { case 0: /* pos-x */ - /* vec[0]= 0.0; */ + /* vec[0] = 0.0; */ vec[1] = tvec[2]; vec[2] = -tvec[1]; break; case 1: /* pos-y */ - /* vec[0]= tvec[0]; */ - /* vec[1]= 0.0; */ - /* vec[2]= tvec[2]; */ + /* vec[0] = tvec[0]; */ + /* vec[1] = 0.0; */ + /* vec[2] = tvec[2]; */ break; case 2: /* pos-z */ - /* vec[0]= tvec[0]; */ - /* vec[1]= tvec[1]; */ - /* vec[2]= 0.0; */ + /* vec[0] = tvec[0]; */ + /* vec[1] = tvec[1]; */ + /* vec[2] = 0.0; */ break; case 3: /* neg-x */ - /* vec[0]= 0.0; */ + /* vec[0] = 0.0; */ vec[1] = tvec[2]; vec[2] = -tvec[1]; break; case 4: /* neg-y */ vec[0] = -tvec[2]; - /* vec[1]= 0.0; */ + /* vec[1] = 0.0; */ vec[2] = tvec[0]; break; case 5: /* neg-z */ vec[0] = -tvec[0]; vec[1] = -tvec[1]; - /* vec[2]= 0.0; */ + /* vec[2] = 0.0; */ break; } } diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 17b9ed7ea8d..2543a1637b2 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -214,7 +214,7 @@ size_t BLI_strncpy_wchar_as_utf8(char *dst, const wchar_t *src, const size_t max len += BLI_str_utf8_from_unicode(*src++, dst + len); } - dst[len]= '\0'; + dst[len] = '\0'; return len; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7ba189d2a36..b6096ea278e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2811,7 +2811,7 @@ static void lib_link_mball(FileData *fd, Main *main) if (mb->adt) lib_link_animdata(fd, &mb->id, mb->adt); for (a = 0; a < mb->totcol; a++) - mb->mat[a]= newlibadr_us(fd, mb->id.lib, mb->mat[a]); + mb->mat[a] = newlibadr_us(fd, mb->id.lib, mb->mat[a]); mb->ipo = newlibadr_us(fd, mb->id.lib, mb->ipo); // XXX deprecated - old animation system @@ -7271,10 +7271,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if ( (ob->dsize[i] == 0.0f) || /* simple case, user never touched dsize */ (ob->size[i] == 0.0f)) /* cant scale the dsize to give a non zero result, so fallback to 1.0f */ { - ob->dscale[i]= 1.0f; + ob->dscale[i] = 1.0f; } else { - ob->dscale[i]= (ob->size[i] + ob->dsize[i]) / ob->size[i]; + ob->dscale[i] = (ob->size[i] + ob->dsize[i]) / ob->size[i]; } } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index ad83b426c51..a162187e2cd 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -197,7 +197,7 @@ static WriteData *writedata_new(int file) if (wd == NULL) return NULL; - wd->sdna= DNA_sdna_from_data(DNAstr, DNAlen, 0); + wd->sdna = DNA_sdna_from_data(DNAstr, DNAlen, 0); wd->file= file; @@ -2540,7 +2540,7 @@ static void write_bone(WriteData *wd, Bone *bone) Bone* cbone; // PATCH for upward compatibility after 2.37+ armature recode - bone->size[0]= bone->size[1]= bone->size[2]= 1.0f; + bone->size[0] = bone->size[1] = bone->size[2] = 1.0f; // Write this bone writestruct(wd, DATA, "Bone", 1, bone); diff --git a/source/blender/bmesh/intern/bmesh_decimate.c b/source/blender/bmesh/intern/bmesh_decimate.c index dbdd6008e89..dd836c7c4fc 100644 --- a/source/blender/bmesh/intern/bmesh_decimate.c +++ b/source/blender/bmesh/intern/bmesh_decimate.c @@ -876,6 +876,7 @@ void BM_mesh_decimate(BMesh *bm, const float factor) /* alloc vars */ vquadrics = MEM_callocN(sizeof(Quadric) * bm->totvert, __func__); + /* since some edges may be degenerate, we might be over allocing a little here */ eheap = BLI_heap_new_ex(bm->totedge); eheap_table = MEM_callocN(sizeof(HeapNode *) * bm->totedge, __func__); tot_edge_orig = bm->totedge; diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 1039453e93a..d18c611166f 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -628,8 +628,8 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut // but->selend= oldbut->selend; // but->softmin= oldbut->softmin; // but->softmax= oldbut->softmax; -// but->linkto[0]= oldbut->linkto[0]; -// but->linkto[1]= oldbut->linkto[1]; +// but->linkto[0] = oldbut->linkto[0]; +// but->linkto[1] = oldbut->linkto[1]; found = 1; // oldbut->active= NULL; diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index e8846b3236c..3b505f24d2d 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -603,7 +603,7 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected ParticleSystemModifierData *psmd = NULL; ParticleEditSettings *pset= PE_settings(data->scene); POINT_P; KEY_K; - float mat[4][4]= MAT4_UNITY, imat[4][4]= MAT4_UNITY; + float mat[4][4] = MAT4_UNITY, imat[4][4] = MAT4_UNITY; if (edit->psys) psmd= psys_get_modifier(data->ob, edit->psys); @@ -744,15 +744,15 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys) psys_mat_hair_to_orco(ob, psmd->dm, psys->part->from, pa, mat); copy_v3_v3(co, key->co); mul_m4_v3(mat, co); - co[0]= -co[0]; + co[0] = -co[0]; index= BLI_kdtree_find_nearest(tree, co, NULL, &nearest); /* this needs a custom threshold still, duplicated for editmode mirror */ if (index != -1 && index != p && (nearest.dist <= 0.0002f)) - edit->mirror_cache[p]= index; + edit->mirror_cache[p] = index; else - edit->mirror_cache[p]= -1; + edit->mirror_cache[p] = -1; } /* make sure mirrors are in two directions */ @@ -760,7 +760,7 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys) if (edit->mirror_cache[p]) { index= edit->mirror_cache[p]; if (edit->mirror_cache[index] != p) - edit->mirror_cache[p]= -1; + edit->mirror_cache[p] = -1; } } @@ -829,7 +829,7 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys for (k=0; k<pa->totkey; k++, hkey++, mhkey++, key++, mkey++) { copy_v3_v3(mhkey->co, hkey->co); mul_m4_v3(mat, mhkey->co); - mhkey->co[0]= -mhkey->co[0]; + mhkey->co[0] = -mhkey->co[0]; mul_m4_v3(immat, mhkey->co); if (key->flag & PEK_TAG) @@ -986,9 +986,9 @@ static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit) PTCacheEditKey *key; int j, k; float tlen; - float dv0[3]= {0.0f, 0.0f, 0.0f}; - float dv1[3]= {0.0f, 0.0f, 0.0f}; - float dv2[3]= {0.0f, 0.0f, 0.0f}; + float dv0[3] = {0.0f, 0.0f, 0.0f}; + float dv1[3] = {0.0f, 0.0f, 0.0f}; + float dv2[3] = {0.0f, 0.0f, 0.0f}; if (edit==0 || (pset->flag & PE_KEEP_LENGTHS)==0) return; @@ -1003,12 +1003,12 @@ static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit) if (pset->flag & PE_LOCK_FIRST) { key= point->keys + 1; k= 1; - dv1[0]= dv1[1]= dv1[2]= 0.0; + dv1[0] = dv1[1] = dv1[2] = 0.0; } else { key= point->keys; k= 0; - dv0[0]= dv0[1]= dv0[2]= 0.0; + dv0[0] = dv0[1] = dv0[2] = 0.0; } for (; k<point->totkey; k++, key++) { @@ -1527,8 +1527,8 @@ static int select_linked_exec(bContext *C, wmOperator *op) int location[2]; RNA_int_get_array(op->ptr, "location", location); - mval[0]= location[0]; - mval[1]= location[1]; + mval[0] = location[0]; + mval[1] = location[1]; PE_set_view3d_data(C, &data); data.mval= mval; @@ -1643,7 +1643,7 @@ int PE_lasso_select(bContext *C, const int mcords[][2], const short moves, short ParticleSystem *psys = edit->psys; ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys); POINT_P; KEY_K; - float co[3], mat[4][4]= MAT4_UNITY; + float co[3], mat[4][4] = MAT4_UNITY; int screen_co[2]; PEData data; @@ -2535,7 +2535,7 @@ static void toggle_particle_cursor(bContext *C, int enable) enum { DEL_PARTICLE, DEL_KEY }; -static EnumPropertyItem delete_type_items[]= { +static EnumPropertyItem delete_type_items[] = { {DEL_PARTICLE, "PARTICLE", 0, "Particle", ""}, {DEL_KEY, "KEY", 0, "Key", ""}, {0, NULL, 0, NULL, NULL}}; @@ -2691,10 +2691,10 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged) /* rotate weights according to vertex index rotation */ rotation= mirrorfaces[pa->num*2+1]; - newpa->fuv[0]= pa->fuv[2]; - newpa->fuv[1]= pa->fuv[1]; - newpa->fuv[2]= pa->fuv[0]; - newpa->fuv[3]= pa->fuv[3]; + newpa->fuv[0] = pa->fuv[2]; + newpa->fuv[1] = pa->fuv[1]; + newpa->fuv[2] = pa->fuv[0]; + newpa->fuv[3] = pa->fuv[3]; while (rotation-- > 0) if (me->mface[pa->num].v4) { SHIFT4(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2], newpa->fuv[3]); @@ -3088,9 +3088,9 @@ static void intersect_dm_quad_weights(const float v1[3], const float v2[3], cons copy_v3_v3(vert[2], v3); copy_v3_v3(vert[3], v4); - co[0]= v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2] + v4[0]*w[3]; - co[1]= v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2] + v4[1]*w[3]; - co[2]= v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2] + v4[2]*w[3]; + co[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2] + v4[0]*w[3]; + co[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2] + v4[1]*w[3]; + co[2] = v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2] + v4[2]*w[3]; interp_weights_poly_v3(w, vert, 4, co); } @@ -3198,10 +3198,10 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, if (isect_line_tri_v3(co1, co2, v1, v2, v3, &cur_d, cur_uv)) { if (cur_d<*min_d) { *min_d=cur_d; - min_w[0]= 1.0f - cur_uv[0] - cur_uv[1]; - min_w[1]= cur_uv[0]; - min_w[2]= cur_uv[1]; - min_w[3]= 0.0f; + min_w[0] = 1.0f - cur_uv[0] - cur_uv[1]; + min_w[1] = cur_uv[0]; + min_w[2] = cur_uv[1]; + min_w[3] = 0.0f; if (mface->v4) intersect_dm_quad_weights(v1, v2, v3, v4, min_w); *min_face=i; @@ -3212,10 +3212,10 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, if (isect_line_tri_v3(co1, co2, v1, v3, v4, &cur_d, cur_uv)) { if (cur_d<*min_d) { *min_d=cur_d; - min_w[0]= 1.0f - cur_uv[0] - cur_uv[1]; - min_w[1]= 0.0f; - min_w[2]= cur_uv[0]; - min_w[3]= cur_uv[1]; + min_w[0] = 1.0f - cur_uv[0] - cur_uv[1]; + min_w[1] = 0.0f; + min_w[2] = cur_uv[0]; + min_w[3] = cur_uv[1]; intersect_dm_quad_weights(v1, v2, v3, v4, min_w); *min_face=i; intersect=1; @@ -3274,8 +3274,8 @@ static int brush_add(PEData *data, short number) } } - mco[0]= data->mval[0] + dmx; - mco[1]= data->mval[1] + dmy; + mco[0] = data->mval[0] + dmx; + mco[1] = data->mval[1] + dmy; ED_view3d_win_to_segment_clip(data->vc.ar, data->vc.v3d, mco, co1, co2); mul_m4_v3(imat, co1); @@ -3368,11 +3368,11 @@ static int brush_add(PEData *data, short number) maxd= ptn[maxw-1].dist; for (w=0; w<maxw; w++) { - weight[w]= (float)pow(2.0, (double)(-6.0f * ptn[w].dist / maxd)); + weight[w] = (float)pow(2.0, (double)(-6.0f * ptn[w].dist / maxd)); totw += weight[w]; } for (;w<3; w++) { - weight[w]= 0.0f; + weight[w] = 0.0f; } for (w=0; w<maxw; w++) @@ -3506,15 +3506,15 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) flip= RNA_boolean_get(itemptr, "pen_flip"); if (bedit->first) { - bedit->lastmouse[0]= mouse[0]; - bedit->lastmouse[1]= mouse[1]; + bedit->lastmouse[0] = mouse[0]; + bedit->lastmouse[1] = mouse[1]; } dx= mouse[0] - bedit->lastmouse[0]; dy= mouse[1] - bedit->lastmouse[1]; - mval[0]= mouse[0]; - mval[1]= mouse[1]; + mval[0] = mouse[0]; + mval[1] = mouse[1]; /* disable locking temporatily for disconnected hair */ @@ -3639,7 +3639,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) data.mval= mval; data.rad= (float)brush->size; - data.vec[0]= data.vec[1]= data.vec[2]= 0.0f; + data.vec[0] = data.vec[1] = data.vec[2] = 0.0f; data.tot= 0; data.smoothfac= brush->strength; @@ -3693,8 +3693,8 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); } - bedit->lastmouse[0]= mouse[0]; - bedit->lastmouse[1]= mouse[1]; + bedit->lastmouse[0] = mouse[0]; + bedit->lastmouse[1] = mouse[1]; bedit->first= 0; } diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index a318837b585..cf3f2ad741b 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -113,26 +113,26 @@ #define IMAPAINT_CHAR_TO_FLOAT(c) ((c) / 255.0f) #define IMAPAINT_FLOAT_RGB_TO_CHAR(c, f) { \ - (c)[0]= FTOCHAR((f)[0]); \ - (c)[1]= FTOCHAR((f)[1]); \ - (c)[2]= FTOCHAR((f)[2]); \ + (c)[0] = FTOCHAR((f)[0]); \ + (c)[1] = FTOCHAR((f)[1]); \ + (c)[2] = FTOCHAR((f)[2]); \ } (void)0 #define IMAPAINT_FLOAT_RGBA_TO_CHAR(c, f) { \ - (c)[0]= FTOCHAR((f)[0]); \ - (c)[1]= FTOCHAR((f)[1]); \ - (c)[2]= FTOCHAR((f)[2]); \ - (c)[3]= FTOCHAR((f)[3]); \ + (c)[0] = FTOCHAR((f)[0]); \ + (c)[1] = FTOCHAR((f)[1]); \ + (c)[2] = FTOCHAR((f)[2]); \ + (c)[3] = FTOCHAR((f)[3]); \ } (void)0 #define IMAPAINT_CHAR_RGB_TO_FLOAT(f, c) { \ - (f)[0]= IMAPAINT_CHAR_TO_FLOAT((c)[0]); \ - (f)[1]= IMAPAINT_CHAR_TO_FLOAT((c)[1]); \ - (f)[2]= IMAPAINT_CHAR_TO_FLOAT((c)[2]); \ + (f)[0] = IMAPAINT_CHAR_TO_FLOAT((c)[0]); \ + (f)[1] = IMAPAINT_CHAR_TO_FLOAT((c)[1]); \ + (f)[2] = IMAPAINT_CHAR_TO_FLOAT((c)[2]); \ } (void)0 #define IMAPAINT_CHAR_RGBA_TO_FLOAT(f, c) { \ - (f)[0]= IMAPAINT_CHAR_TO_FLOAT((c)[0]); \ - (f)[1]= IMAPAINT_CHAR_TO_FLOAT((c)[1]); \ - (f)[2]= IMAPAINT_CHAR_TO_FLOAT((c)[2]); \ - (f)[3]= IMAPAINT_CHAR_TO_FLOAT((c)[3]); \ + (f)[0] = IMAPAINT_CHAR_TO_FLOAT((c)[0]); \ + (f)[1] = IMAPAINT_CHAR_TO_FLOAT((c)[1]); \ + (f)[2] = IMAPAINT_CHAR_TO_FLOAT((c)[2]); \ + (f)[3] = IMAPAINT_CHAR_TO_FLOAT((c)[3]); \ } (void)0 #define IMAPAINT_FLOAT_RGB_COPY(a, b) copy_v3_v3(a, b) diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 4adbce8f19c..4b151734dc7 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -149,22 +149,22 @@ void make_unique_prop_names(bContext *C, char *str) ob= (Object *)idar[a]; prop= ob->prop.first; while (prop) { - names[nr++]= prop->name; + names[nr++] = prop->name; prop= prop->next; } sens= ob->sensors.first; while (sens) { - names[nr++]= sens->name; + names[nr++] = sens->name; sens= sens->next; } cont= ob->controllers.first; while (cont) { - names[nr++]= cont->name; + names[nr++] = cont->name; cont= cont->next; } act= ob->actuators.first; while (act) { - names[nr++]= act->name; + names[nr++] = act->name; act= act->next; } } @@ -697,13 +697,13 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf /* make the active object always the first one of the list */ if (obact) { - idar[0]= (ID *)obact; + idar[0] = (ID *)obact; nr++; } while (ob) { if ((ob->scavisflag) && (ob != obact)) { - idar[nr]= (ID *)ob; + idar[nr] = (ID *)ob; nr++; } if (nr>=24) break; diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c index 1a50f72153a..4ee522952d4 100644 --- a/source/blender/editors/space_logic/space_logic.c +++ b/source/blender/editors/space_logic/space_logic.c @@ -129,18 +129,18 @@ static SpaceLink *logic_new(const bContext *UNUSED(C)) ar->v2d.cur.xmax = 1280.0f; ar->v2d.cur.ymax = 240.0f; - ar->v2d.min[0]= 1.0f; - ar->v2d.min[1]= 1.0f; + ar->v2d.min[0] = 1.0f; + ar->v2d.min[1] = 1.0f; - ar->v2d.max[0]= 32000.0f; - ar->v2d.max[1]= 32000.0f; + ar->v2d.max[0] = 32000.0f; + ar->v2d.max[1] = 32000.0f; - ar->v2d.minzoom= 0.5f; - ar->v2d.maxzoom= 1.21f; + ar->v2d.minzoom = 0.5f; + ar->v2d.maxzoom = 1.21f; - ar->v2d.scroll= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM); - ar->v2d.keepzoom= V2D_LIMITZOOM|V2D_KEEPASPECT; - ar->v2d.keeptot= 0; + ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM); + ar->v2d.keepzoom = V2D_LIMITZOOM | V2D_KEEPASPECT; + ar->v2d.keeptot = 0; return (SpaceLink *)slogic; diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index c603605aa0e..c506abd9bd3 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -636,7 +636,7 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl) int a, totpoly = me->totpoly; /* fake values to pass to GPU_render_text() */ - MCol tmp_mcol[4] = {{0}}; + MCol tmp_mcol[4] = {{0}}; MCol *tmp_mcol_pt = mloopcol ? tmp_mcol : NULL; MTFace tmp_tf = {{{0}}}; diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 0f0a5d2b9a3..4babb03f374 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -795,8 +795,8 @@ static int flyApply(bContext *C, FlyInfo *fly) ymargin = ar->winy / 20.0f; // UNUSED - // cent_orig[0]= ar->winrct.xmin + ar->winx/2; - // cent_orig[1]= ar->winrct.ymin + ar->winy/2; + // cent_orig[0] = ar->winrct.xmin + ar->winx / 2; + // cent_orig[1] = ar->winrct.ymin + ar->winy / 2; { diff --git a/source/blender/makesdna/DNA_genfile.h b/source/blender/makesdna/DNA_genfile.h index 20f7bb44e92..2d1549ff487 100644 --- a/source/blender/makesdna/DNA_genfile.h +++ b/source/blender/makesdna/DNA_genfile.h @@ -35,8 +35,8 @@ struct SDNA; -extern unsigned char DNAstr[]; /* DNA.c */ -extern int DNAlen; +extern const unsigned char DNAstr[]; /* DNA.c */ +extern const int DNAlen; typedef enum eSDNA_Type { SDNA_TYPE_CHAR = 0, @@ -56,7 +56,7 @@ typedef enum eSDNA_Type { /* define so switch statements don't complain */ #define SDNA_TYPE_VOID 9 -struct SDNA *DNA_sdna_from_data(void *data, int datalen, int do_endian_swap); +struct SDNA *DNA_sdna_from_data(const void *data, const int datalen, int do_endian_swap); void DNA_sdna_free(struct SDNA *sdna); int DNA_struct_find_nr(struct SDNA *sdna, const char *str); diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index e37da0e7d21..10c3b0bbee4 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -506,7 +506,7 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap) } } -SDNA *DNA_sdna_from_data(void *data, int datalen, int do_endian_swap) +SDNA *DNA_sdna_from_data(const void *data, const int datalen, int do_endian_swap) { SDNA *sdna = MEM_mallocN(sizeof(*sdna), "sdna"); diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 72e34fe7228..77d2b00dfc2 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -1174,7 +1174,7 @@ int main(int argc, char **argv) strcpy(baseDirectory, BASE_HEADER); } - fprintf(file, "unsigned char DNAstr[]= {\n"); + fprintf(file, "const unsigned char DNAstr[] = {\n"); if (make_structDNA(baseDirectory, file)) { /* error */ fclose(file); @@ -1183,7 +1183,7 @@ int main(int argc, char **argv) } else { fprintf(file, "};\n"); - fprintf(file, "int DNAlen = sizeof(DNAstr);\n"); + fprintf(file, "const int DNAlen = sizeof(DNAstr);\n"); fclose(file); } diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index 3387eaf679b..49da4ec22a0 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -475,7 +475,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, /*printf("\t\tVERT: %i\n", lt_iter.v);*/ if (lt_iter.v_poin->flag) { /*printf("\t\t\tBreaking Found end\n");*/ - //endpoints[0]= endpoints[1]= -1; + //endpoints[0] = endpoints[1] = -1; ed_loop_closed = 1; /* circle */ break; } @@ -490,7 +490,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, screwvert_iter_step(<_iter); if (!lt_iter.v_poin) { /*printf("\t\t\tFound End Also Num %i\n", j);*/ - /*endpoints[j]= lt_iter.v_other;*/ /* other is still valid */ + /*endpoints[j] = lt_iter.v_other;*/ /* other is still valid */ break; } } diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c index 9e9810e2770..57eb99021f6 100644 --- a/source/blender/nodes/composite/node_composite_util.c +++ b/source/blender/nodes/composite/node_composite_util.c @@ -213,53 +213,53 @@ void typecheck_compbuf_color(float *out, float *in, int outtype, int intype) } else if (outtype==CB_VEC2) { if (intype==CB_VAL) { - out[0]= in[0]; - out[1]= in[0]; + out[0] = in[0]; + out[1] = in[0]; } else if (intype==CB_VEC3) { - out[0]= in[0]; - out[1]= in[1]; + out[0] = in[0]; + out[1] = in[1]; } else if (intype==CB_RGBA) { - out[0]= in[0]; - out[1]= in[1]; + out[0] = in[0]; + out[1] = in[1]; } } else if (outtype==CB_VEC3) { if (intype==CB_VAL) { - out[0]= in[0]; - out[1]= in[0]; - out[2]= in[0]; + out[0] = in[0]; + out[1] = in[0]; + out[2] = in[0]; } else if (intype==CB_VEC2) { - out[0]= in[0]; - out[1]= in[1]; - out[2]= 0.0f; + out[0] = in[0]; + out[1] = in[1]; + out[2] = 0.0f; } else if (intype==CB_RGBA) { - out[0]= in[0]; - out[1]= in[1]; - out[2]= in[2]; + out[0] = in[0]; + out[1] = in[1]; + out[2] = in[2]; } } else if (outtype==CB_RGBA) { if (intype==CB_VAL) { - out[0]= in[0]; - out[1]= in[0]; - out[2]= in[0]; - out[3]= 1.0f; + out[0] = in[0]; + out[1] = in[0]; + out[2] = in[0]; + out[3] = 1.0f; } else if (intype==CB_VEC2) { - out[0]= in[0]; - out[1]= in[1]; - out[2]= 0.0f; - out[3]= 1.0f; + out[0] = in[0]; + out[1] = in[1]; + out[2] = 0.0f; + out[3] = 1.0f; } else if (intype==CB_VEC3) { - out[0]= in[0]; - out[1]= in[1]; - out[2]= in[2]; - out[3]= 1.0f; + out[0] = in[0]; + out[1] = in[1]; + out[2] = in[2]; + out[3] = 1.0f; } } } @@ -307,69 +307,69 @@ CompBuf *typecheck_compbuf(CompBuf *inbuf, int type) else if (type==CB_VEC2) { if (inbuf->type==CB_VAL) { for (; x>0; x--, outrf+= 2, inrf+= 1) { - outrf[0]= inrf[0]; - outrf[1]= inrf[0]; + outrf[0] = inrf[0]; + outrf[1] = inrf[0]; } } else if (inbuf->type==CB_VEC3) { for (; x>0; x--, outrf+= 2, inrf+= 3) { - outrf[0]= inrf[0]; - outrf[1]= inrf[1]; + outrf[0] = inrf[0]; + outrf[1] = inrf[1]; } } else if (inbuf->type==CB_RGBA) { for (; x>0; x--, outrf+= 2, inrf+= 4) { - outrf[0]= inrf[0]; - outrf[1]= inrf[1]; + outrf[0] = inrf[0]; + outrf[1] = inrf[1]; } } } else if (type==CB_VEC3) { if (inbuf->type==CB_VAL) { for (; x>0; x--, outrf+= 3, inrf+= 1) { - outrf[0]= inrf[0]; - outrf[1]= inrf[0]; - outrf[2]= inrf[0]; + outrf[0] = inrf[0]; + outrf[1] = inrf[0]; + outrf[2] = inrf[0]; } } else if (inbuf->type==CB_VEC2) { for (; x>0; x--, outrf+= 3, inrf+= 2) { - outrf[0]= inrf[0]; - outrf[1]= inrf[1]; - outrf[2]= 0.0f; + outrf[0] = inrf[0]; + outrf[1] = inrf[1]; + outrf[2] = 0.0f; } } else if (inbuf->type==CB_RGBA) { for (; x>0; x--, outrf+= 3, inrf+= 4) { - outrf[0]= inrf[0]; - outrf[1]= inrf[1]; - outrf[2]= inrf[2]; + outrf[0] = inrf[0]; + outrf[1] = inrf[1]; + outrf[2] = inrf[2]; } } } else if (type==CB_RGBA) { if (inbuf->type==CB_VAL) { for (; x>0; x--, outrf+= 4, inrf+= 1) { - outrf[0]= inrf[0]; - outrf[1]= inrf[0]; - outrf[2]= inrf[0]; - outrf[3]= 1.0f; + outrf[0] = inrf[0]; + outrf[1] = inrf[0]; + outrf[2] = inrf[0]; + outrf[3] = 1.0f; } } else if (inbuf->type==CB_VEC2) { for (; x>0; x--, outrf+= 4, inrf+= 2) { - outrf[0]= inrf[0]; - outrf[1]= inrf[1]; - outrf[2]= 0.0f; - outrf[3]= 1.0f; + outrf[0] = inrf[0]; + outrf[1] = inrf[1]; + outrf[2] = 0.0f; + outrf[3] = 1.0f; } } else if (inbuf->type==CB_VEC3) { for (; x>0; x--, outrf+= 4, inrf+= 3) { - outrf[0]= inrf[0]; - outrf[1]= inrf[1]; - outrf[2]= inrf[2]; - outrf[3]= 1.0f; + outrf[0] = inrf[0]; + outrf[1] = inrf[1]; + outrf[2] = inrf[2]; + outrf[3] = 1.0f; } } } @@ -387,7 +387,7 @@ float *compbuf_get_pixel(CompBuf *cbuf, float *defcol, float *use, int x, int y, return use; } else { - static float col[4]= {0.0f, 0.0f, 0.0f, 0.0f}; + static float col[4] = {0.0f, 0.0f, 0.0f, 0.0f}; /* map coords */ x-= cbuf->xof; @@ -707,18 +707,18 @@ void do_copy_rgba(bNode *UNUSED(node), float *out, float *in) void do_copy_rgb(bNode *UNUSED(node), float *out, float *in) { copy_v3_v3(out, in); - out[3]= 1.0f; + out[3] = 1.0f; } void do_copy_value(bNode *UNUSED(node), float *out, float *in) { - out[0]= in[0]; + out[0] = in[0]; } void do_copy_a_rgba(bNode *UNUSED(node), float *out, float *in, float *fac) { copy_v3_v3(out, in); - out[3]= *fac; + out[3] = *fac; } /* only accepts RGBA buffers */ @@ -732,16 +732,16 @@ void gamma_correct_compbuf(CompBuf *img, int inversed) drect= img->rect; if (inversed) { for (x=img->x*img->y; x>0; x--, drect+=4) { - if (drect[0]>0.0f) drect[0]= sqrt(drect[0]); else drect[0]= 0.0f; - if (drect[1]>0.0f) drect[1]= sqrt(drect[1]); else drect[1]= 0.0f; - if (drect[2]>0.0f) drect[2]= sqrt(drect[2]); else drect[2]= 0.0f; + if (drect[0]>0.0f) drect[0] = sqrt(drect[0]); else drect[0] = 0.0f; + if (drect[1]>0.0f) drect[1] = sqrt(drect[1]); else drect[1] = 0.0f; + if (drect[2]>0.0f) drect[2] = sqrt(drect[2]); else drect[2] = 0.0f; } } else { for (x=img->x*img->y; x>0; x--, drect+=4) { - if (drect[0]>0.0f) drect[0]*= drect[0]; else drect[0]= 0.0f; - if (drect[1]>0.0f) drect[1]*= drect[1]; else drect[1]= 0.0f; - if (drect[2]>0.0f) drect[2]*= drect[2]; else drect[2]= 0.0f; + if (drect[0]>0.0f) drect[0]*= drect[0]; else drect[0] = 0.0f; + if (drect[1]>0.0f) drect[1]*= drect[1]; else drect[1] = 0.0f; + if (drect[2]>0.0f) drect[2]*= drect[2]; else drect[2] = 0.0f; } } } @@ -757,9 +757,9 @@ void premul_compbuf(CompBuf *img, int inversed) if (inversed) { for (x=img->x*img->y; x>0; x--, drect+=4) { if (fabsf(drect[3]) < 1e-5f) { - drect[0]= 0.0f; - drect[1]= 0.0f; - drect[2]= 0.0f; + drect[0] = 0.0f; + drect[1] = 0.0f; + drect[2] = 0.0f; } else { drect[0] /= drect[3]; diff --git a/source/blender/nodes/composite/nodes/node_composite_alphaOver.c b/source/blender/nodes/composite/nodes/node_composite_alphaOver.c index 26f2789b9bb..72c2204d8c5 100644 --- a/source/blender/nodes/composite/nodes/node_composite_alphaOver.c +++ b/source/blender/nodes/composite/nodes/node_composite_alphaOver.c @@ -32,13 +32,13 @@ #include "node_composite_util.h" /* **************** ALPHAOVER ******************** */ -static bNodeSocketTemplate cmp_node_alphaover_in[]= { +static bNodeSocketTemplate cmp_node_alphaover_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_alphaover_out[]= { +static bNodeSocketTemplate cmp_node_alphaover_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; @@ -58,10 +58,10 @@ static void do_alphaover_premul(bNode *UNUSED(node), float *out, float *src, flo else { float mul= 1.0f - fac[0]*over[3]; - out[0]= (mul*src[0]) + fac[0]*over[0]; - out[1]= (mul*src[1]) + fac[0]*over[1]; - out[2]= (mul*src[2]) + fac[0]*over[2]; - out[3]= (mul*src[3]) + fac[0]*over[3]; + out[0] = (mul*src[0]) + fac[0]*over[0]; + out[1] = (mul*src[1]) + fac[0]*over[1]; + out[2] = (mul*src[2]) + fac[0]*over[2]; + out[3] = (mul*src[3]) + fac[0]*over[3]; } } @@ -79,10 +79,10 @@ static void do_alphaover_key(bNode *UNUSED(node), float *out, float *src, float float premul= fac[0]*over[3]; float mul= 1.0f - premul; - out[0]= (mul*src[0]) + premul*over[0]; - out[1]= (mul*src[1]) + premul*over[1]; - out[2]= (mul*src[2]) + premul*over[2]; - out[3]= (mul*src[3]) + fac[0]*over[3]; + out[0] = (mul*src[0]) + premul*over[0]; + out[1] = (mul*src[1]) + premul*over[1]; + out[2] = (mul*src[2]) + premul*over[2]; + out[3] = (mul*src[3]) + fac[0]*over[3]; } } @@ -102,10 +102,10 @@ static void do_alphaover_mixed(bNode *node, float *out, float *src, float *over, float premul= fac[0]*addfac; float mul= 1.0f - fac[0]*over[3]; - out[0]= (mul*src[0]) + premul*over[0]; - out[1]= (mul*src[1]) + premul*over[1]; - out[2]= (mul*src[2]) + premul*over[2]; - out[3]= (mul*src[3]) + fac[0]*over[3]; + out[0] = (mul*src[0]) + premul*over[0]; + out[1] = (mul*src[1]) + premul*over[1]; + out[2] = (mul*src[2]) + premul*over[2]; + out[3] = (mul*src[3]) + fac[0]*over[3]; } } diff --git a/source/blender/nodes/composite/nodes/node_composite_bokehimage.c b/source/blender/nodes/composite/nodes/node_composite_bokehimage.c index c5697679f90..8324b77b2d1 100644 --- a/source/blender/nodes/composite/nodes/node_composite_bokehimage.c +++ b/source/blender/nodes/composite/nodes/node_composite_bokehimage.c @@ -37,7 +37,7 @@ /* **************** Bokeh image Tools ******************** */ -static bNodeSocketTemplate cmp_node_bokehimage_out[]= { +static bNodeSocketTemplate cmp_node_bokehimage_out[] = { { SOCK_RGBA, 0, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_boxmask.c b/source/blender/nodes/composite/nodes/node_composite_boxmask.c index ff0fa0c971d..0f82fdb481a 100644 --- a/source/blender/nodes/composite/nodes/node_composite_boxmask.c +++ b/source/blender/nodes/composite/nodes/node_composite_boxmask.c @@ -35,13 +35,13 @@ #include "../node_composite_util.h" /* **************** SCALAR MATH ******************** */ -static bNodeSocketTemplate cmp_node_boxmask_in[]= { +static bNodeSocketTemplate cmp_node_boxmask_in[] = { { SOCK_FLOAT, 1, N_("Mask"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_boxmask_out[]= { +static bNodeSocketTemplate cmp_node_boxmask_out[] = { { SOCK_FLOAT, 0, N_("Mask"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_brightness.c b/source/blender/nodes/composite/nodes/node_composite_brightness.c index b58c1c27b2a..ecf572f59c7 100644 --- a/source/blender/nodes/composite/nodes/node_composite_brightness.c +++ b/source/blender/nodes/composite/nodes/node_composite_brightness.c @@ -36,13 +36,13 @@ /* **************** Brigh and contrsast ******************** */ -static bNodeSocketTemplate cmp_node_brightcontrast_in[]= { +static bNodeSocketTemplate cmp_node_brightcontrast_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Bright"), 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Contrast"), 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_brightcontrast_out[]= { +static bNodeSocketTemplate cmp_node_brightcontrast_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c index fdb656ead74..40dbbbb8dca 100644 --- a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c @@ -34,12 +34,12 @@ /* ******************* Channel Matte Node ********************************* */ -static bNodeSocketTemplate cmp_node_channel_matte_in[]={ +static bNodeSocketTemplate cmp_node_channel_matte_in[] ={ {SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, {-1, 0, ""} }; -static bNodeSocketTemplate cmp_node_channel_matte_out[]={ +static bNodeSocketTemplate cmp_node_channel_matte_out[] ={ {SOCK_RGBA, 0, N_("Image")}, {SOCK_FLOAT, 0, N_("Matte")}, {-1, 0, ""} diff --git a/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c b/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c index 55ee1b090bb..f343f806d57 100644 --- a/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c @@ -33,13 +33,13 @@ #include "node_composite_util.h" /* ******************* Chroma Key ********************************************************** */ -static bNodeSocketTemplate cmp_node_chroma_in[]={ +static bNodeSocketTemplate cmp_node_chroma_in[] = { {SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, {SOCK_RGBA, 1, N_("Key Color"), 1.0f, 1.0f, 1.0f, 1.0f}, {-1, 0, ""} }; -static bNodeSocketTemplate cmp_node_chroma_out[]={ +static bNodeSocketTemplate cmp_node_chroma_out[] = { {SOCK_RGBA, 0, N_("Image")}, {SOCK_FLOAT, 0, N_("Matte")}, {-1, 0, ""} diff --git a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c index 37fb29811ba..07a6647d976 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c @@ -33,13 +33,13 @@ #include "node_composite_util.h" /* ******************* Color Key ********************************************************** */ -static bNodeSocketTemplate cmp_node_color_in[]={ +static bNodeSocketTemplate cmp_node_color_in[] = { {SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, {SOCK_RGBA, 1, N_("Key Color"), 1.0f, 1.0f, 1.0f, 1.0f}, {-1, 0, ""} }; -static bNodeSocketTemplate cmp_node_color_out[]={ +static bNodeSocketTemplate cmp_node_color_out[] = { {SOCK_RGBA, 0, N_("Image")}, {SOCK_FLOAT, 0, N_("Matte")}, {-1, 0, ""} diff --git a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c index c4120ab22c6..e8965d50b47 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c @@ -36,13 +36,13 @@ #define AVG(a, b) ((a + b) / 2) /* ******************* Color Spill Supression ********************************* */ -static bNodeSocketTemplate cmp_node_color_spill_in[]={ +static bNodeSocketTemplate cmp_node_color_spill_in[] = { {SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, {SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, {-1, 0, ""} }; -static bNodeSocketTemplate cmp_node_color_spill_out[]={ +static bNodeSocketTemplate cmp_node_color_spill_out[] = { {SOCK_RGBA, 0, N_("Image")}, {-1, 0, ""} }; diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c index a9f930f9cf2..e9d26ebebbc 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c @@ -35,13 +35,13 @@ /* ******************* Color Balance ********************************* */ -static bNodeSocketTemplate cmp_node_colorbalance_in[]={ +static bNodeSocketTemplate cmp_node_colorbalance_in[] = { {SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, {SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, {-1, 0, ""} }; -static bNodeSocketTemplate cmp_node_colorbalance_out[]={ +static bNodeSocketTemplate cmp_node_colorbalance_out[] = { {SOCK_RGBA, 0, N_("Image")}, {-1, 0, ""} }; diff --git a/source/blender/nodes/composite/nodes/node_composite_colorcorrection.c b/source/blender/nodes/composite/nodes/node_composite_colorcorrection.c index ce43b2f0f2b..526f8472992 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorcorrection.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorcorrection.c @@ -36,13 +36,13 @@ /* ******************* Color Balance ********************************* */ -static bNodeSocketTemplate cmp_node_colorcorrection_in[]={ +static bNodeSocketTemplate cmp_node_colorcorrection_in[] = { { SOCK_RGBA,1,N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Mask"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, { -1,0,""} }; -static bNodeSocketTemplate cmp_node_colorcorrection_out[]={ +static bNodeSocketTemplate cmp_node_colorcorrection_out[] = { { SOCK_RGBA,0,N_("Image")}, { -1,0,""} }; diff --git a/source/blender/nodes/composite/nodes/node_composite_composite.c b/source/blender/nodes/composite/nodes/node_composite_composite.c index dadc863873d..edbb627265d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_composite.c +++ b/source/blender/nodes/composite/nodes/node_composite_composite.c @@ -32,7 +32,7 @@ #include "node_composite_util.h" /* **************** COMPOSITE ******************** */ -static bNodeSocketTemplate cmp_node_composite_in[]= { +static bNodeSocketTemplate cmp_node_composite_in[] = { { SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { SOCK_FLOAT, 1, N_("Z"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, diff --git a/source/blender/nodes/composite/nodes/node_composite_crop.c b/source/blender/nodes/composite/nodes/node_composite_crop.c index f93a4817c01..ad51fae1998 100644 --- a/source/blender/nodes/composite/nodes/node_composite_crop.c +++ b/source/blender/nodes/composite/nodes/node_composite_crop.c @@ -34,11 +34,11 @@ /* **************** Crop ******************** */ -static bNodeSocketTemplate cmp_node_crop_in[]= { +static bNodeSocketTemplate cmp_node_crop_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_crop_out[]= { +static bNodeSocketTemplate cmp_node_crop_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_curves.c b/source/blender/nodes/composite/nodes/node_composite_curves.c index 1948709ec84..a1999ec8887 100644 --- a/source/blender/nodes/composite/nodes/node_composite_curves.c +++ b/source/blender/nodes/composite/nodes/node_composite_curves.c @@ -36,7 +36,7 @@ /* **************** CURVE Time ******************** */ /* custom1 = sfra, custom2 = efra */ -static bNodeSocketTemplate cmp_node_time_out[]= { +static bNodeSocketTemplate cmp_node_time_out[] = { { SOCK_FLOAT, 0, N_("Fac")}, { -1, 0, "" } }; @@ -55,7 +55,7 @@ static void node_composit_exec_curves_time(void *data, bNode *node, bNodeStack * curvemapping_initialize(node->storage); fac = curvemapping_evaluateF(node->storage, 0, fac); - out[0]->vec[0]= CLAMPIS(fac, 0.0f, 1.0f); + out[0]->vec[0] = CLAMPIS(fac, 0.0f, 1.0f); } #endif /* WITH_COMPOSITOR_LEGACY */ @@ -86,12 +86,12 @@ void register_node_type_cmp_curve_time(bNodeTreeType *ttype) /* **************** CURVE VEC ******************** */ -static bNodeSocketTemplate cmp_node_curve_vec_in[]= { +static bNodeSocketTemplate cmp_node_curve_vec_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_curve_vec_out[]= { +static bNodeSocketTemplate cmp_node_curve_vec_out[] = { { SOCK_VECTOR, 0, N_("Vector")}, { -1, 0, "" } }; @@ -132,7 +132,7 @@ void register_node_type_cmp_curve_vec(bNodeTreeType *ttype) /* **************** CURVE RGB ******************** */ -static bNodeSocketTemplate cmp_node_curve_rgb_in[]= { +static bNodeSocketTemplate cmp_node_curve_rgb_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_FACTOR}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_RGBA, 1, N_("Black Level"), 0.0f, 0.0f, 0.0f, 1.0f}, @@ -140,7 +140,7 @@ static bNodeSocketTemplate cmp_node_curve_rgb_in[]= { { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_curve_rgb_out[]= { +static bNodeSocketTemplate cmp_node_curve_rgb_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; @@ -151,7 +151,7 @@ static void do_curves(bNode *node, float *out, float *in) { curvemapping_initialize(node->storage); curvemapping_evaluate_premulRGBF(node->storage, out, in); - out[3]= in[3]; + out[3] = in[3]; } static void do_curves_fac(bNode *node, float *out, float *in, float *fac) @@ -166,11 +166,11 @@ static void do_curves_fac(bNode *node, float *out, float *in, float *fac) else { float col[4], mfac= 1.0f-*fac; curvemapping_evaluate_premulRGBF(node->storage, col, in); - out[0]= mfac*in[0] + *fac*col[0]; - out[1]= mfac*in[1] + *fac*col[1]; - out[2]= mfac*in[2] + *fac*col[2]; + out[0] = mfac*in[0] + *fac*col[0]; + out[1] = mfac*in[1] + *fac*col[1]; + out[2] = mfac*in[2] + *fac*col[2]; } - out[3]= in[3]; + out[3] = in[3]; } static void node_composit_exec_curve_rgb(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) diff --git a/source/blender/nodes/composite/nodes/node_composite_defocus.c b/source/blender/nodes/composite/nodes/node_composite_defocus.c index 34433f894f3..826c555d2c6 100644 --- a/source/blender/nodes/composite/nodes/node_composite_defocus.c +++ b/source/blender/nodes/composite/nodes/node_composite_defocus.c @@ -34,12 +34,12 @@ #include <limits.h> /* ************ qdn: Defocus node ****************** */ -static bNodeSocketTemplate cmp_node_defocus_in[]= { +static bNodeSocketTemplate cmp_node_defocus_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Z"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_defocus_out[]= { +static bNodeSocketTemplate cmp_node_defocus_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_despeckle.c b/source/blender/nodes/composite/nodes/node_composite_despeckle.c index 21b703dc9a8..9d47e4bc276 100644 --- a/source/blender/nodes/composite/nodes/node_composite_despeckle.c +++ b/source/blender/nodes/composite/nodes/node_composite_despeckle.c @@ -32,12 +32,12 @@ #include "node_composite_util.h" /* **************** FILTER ******************** */ -static bNodeSocketTemplate cmp_node_despeckle_in[]= { +static bNodeSocketTemplate cmp_node_despeckle_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_despeckle_out[]= { +static bNodeSocketTemplate cmp_node_despeckle_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c index ed43baef420..8a761caea21 100644 --- a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c @@ -33,13 +33,13 @@ #include "node_composite_util.h" /* ******************* channel Difference Matte ********************************* */ -static bNodeSocketTemplate cmp_node_diff_matte_in[]={ +static bNodeSocketTemplate cmp_node_diff_matte_in[] = { {SOCK_RGBA, 1, N_("Image 1"), 1.0f, 1.0f, 1.0f, 1.0f}, {SOCK_RGBA, 1, N_("Image 2"), 1.0f, 1.0f, 1.0f, 1.0f}, {-1, 0, ""} }; -static bNodeSocketTemplate cmp_node_diff_matte_out[]={ +static bNodeSocketTemplate cmp_node_diff_matte_out[] = { {SOCK_RGBA, 0, N_("Image")}, {SOCK_FLOAT, 0, N_("Matte")}, {-1, 0, ""} diff --git a/source/blender/nodes/composite/nodes/node_composite_displace.c b/source/blender/nodes/composite/nodes/node_composite_displace.c index 51ccc2a4d39..c283512e461 100644 --- a/source/blender/nodes/composite/nodes/node_composite_displace.c +++ b/source/blender/nodes/composite/nodes/node_composite_displace.c @@ -35,14 +35,14 @@ /* **************** Displace ******************** */ -static bNodeSocketTemplate cmp_node_displace_in[]= { +static bNodeSocketTemplate cmp_node_displace_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_VECTOR, 1, N_("Vector"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_TRANSLATION}, { SOCK_FLOAT, 1, N_("X Scale"), 0.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f, PROP_FACTOR}, { SOCK_FLOAT, 1, N_("Y Scale"), 0.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f, PROP_FACTOR}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_displace_out[]= { +static bNodeSocketTemplate cmp_node_displace_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c index 7a101ff43b5..7e605865cd2 100644 --- a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c @@ -33,13 +33,13 @@ #include "node_composite_util.h" /* ******************* channel Distance Matte ********************************* */ -static bNodeSocketTemplate cmp_node_distance_matte_in[]={ +static bNodeSocketTemplate cmp_node_distance_matte_in[] = { {SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, {SOCK_RGBA, 1, N_("Key Color"), 1.0f, 1.0f, 1.0f, 1.0f}, {-1, 0, ""} }; -static bNodeSocketTemplate cmp_node_distance_matte_out[]={ +static bNodeSocketTemplate cmp_node_distance_matte_out[] = { {SOCK_RGBA, 0, N_("Image")}, {SOCK_FLOAT, 0, N_("Matte")}, {-1, 0, ""} @@ -159,9 +159,9 @@ static void node_composit_exec_distance_matte(void *data, bNode *node, bNodeStac workbuf=dupalloc_compbuf(inbuf); /*use the input color*/ - c->key[0]= in[1]->vec[0]; - c->key[1]= in[1]->vec[1]; - c->key[2]= in[1]->vec[2]; + c->key[0] = in[1]->vec[0]; + c->key[1] = in[1]->vec[1]; + c->key[2] = in[1]->vec[2]; /* work in RGB color space */ if (c->channel == 1) { diff --git a/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c b/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c index 63a54efea74..3c1e3ee443e 100644 --- a/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c +++ b/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c @@ -32,12 +32,12 @@ /* **************** Double Edge Mask ******************** */ -static bNodeSocketTemplate cmp_node_doubleedgemask_in[]= { +static bNodeSocketTemplate cmp_node_doubleedgemask_in[] = { { SOCK_FLOAT, 1, "Inner Mask", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE}, // inner mask socket definition { SOCK_FLOAT, 1, "Outer Mask", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE}, // outer mask socket definition { -1, 0, "" } // input socket array terminator }; -static bNodeSocketTemplate cmp_node_doubleedgemask_out[]= { +static bNodeSocketTemplate cmp_node_doubleedgemask_out[] = { { SOCK_FLOAT, 0, "Mask"}, // output socket definition { -1, 0, "" } // output socket array terminator }; diff --git a/source/blender/nodes/composite/nodes/node_composite_ellipsemask.c b/source/blender/nodes/composite/nodes/node_composite_ellipsemask.c index 905090e93ad..5e7bd26d34a 100644 --- a/source/blender/nodes/composite/nodes/node_composite_ellipsemask.c +++ b/source/blender/nodes/composite/nodes/node_composite_ellipsemask.c @@ -35,13 +35,13 @@ #include "../node_composite_util.h" /* **************** SCALAR MATH ******************** */ -static bNodeSocketTemplate cmp_node_ellipsemask_in[]= { +static bNodeSocketTemplate cmp_node_ellipsemask_in[] = { { SOCK_FLOAT, 1, N_("Mask"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_ellipsemask_out[]= { +static bNodeSocketTemplate cmp_node_ellipsemask_out[] = { { SOCK_FLOAT, 0, N_("Mask"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_filter.c b/source/blender/nodes/composite/nodes/node_composite_filter.c index 0b12c03682b..a27116ab077 100644 --- a/source/blender/nodes/composite/nodes/node_composite_filter.c +++ b/source/blender/nodes/composite/nodes/node_composite_filter.c @@ -33,12 +33,12 @@ #include "node_composite_util.h" /* **************** FILTER ******************** */ -static bNodeSocketTemplate cmp_node_filter_in[]= { +static bNodeSocketTemplate cmp_node_filter_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_filter_out[]= { +static bNodeSocketTemplate cmp_node_filter_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; @@ -73,10 +73,10 @@ static void do_filter_edge(CompBuf *out, CompBuf *in, float *filter, float fac) for (c=0; c<3; c++) { f1= filter[0]*row1[0] + filter[1]*row1[4] + filter[2]*row1[8] + filter[3]*row2[0] + filter[4]*row2[4] + filter[5]*row2[8] + filter[6]*row3[0] + filter[7]*row3[4] + filter[8]*row3[8]; f2= filter[0]*row1[0] + filter[3]*row1[4] + filter[6]*row1[8] + filter[1]*row2[0] + filter[4]*row2[4] + filter[7]*row2[8] + filter[2]*row3[0] + filter[5]*row3[4] + filter[8]*row3[8]; - fp[0]= mfac*row2[4] + fac*sqrt(f1*f1 + f2*f2); + fp[0] = mfac*row2[4] + fac*sqrt(f1*f1 + f2*f2); fp++; row1++; row2++; row3++; } - fp[0]= row2[4]; + fp[0] = row2[4]; /* no alpha... will clear it completely */ fp++; row1++; row2++; row3++; } @@ -87,7 +87,7 @@ static void do_filter_edge(CompBuf *out, CompBuf *in, float *filter, float fac) for (x=2; x<rowlen; x++) { f1= filter[0]*row1[0] + filter[1]*row1[1] + filter[2]*row1[2] + filter[3]*row2[0] + filter[4]*row2[1] + filter[5]*row2[2] + filter[6]*row3[0] + filter[7]*row3[1] + filter[8]*row3[2]; f2= filter[0]*row1[0] + filter[3]*row1[1] + filter[6]*row1[2] + filter[1]*row2[0] + filter[4]*row2[1] + filter[7]*row2[2] + filter[2]*row3[0] + filter[5]*row3[1] + filter[8]*row3[2]; - fp[0]= mfac*row2[1] + fac*sqrt(f1*f1 + f2*f2); + fp[0] = mfac*row2[1] + fac*sqrt(f1*f1 + f2*f2); fp++; row1++; row2++; row3++; } } @@ -116,28 +116,28 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac) fp= out->rect + pixlen*(y)*rowlen; if (pixlen==1) { - fp[0]= row2[0]; + fp[0] = row2[0]; fp+= 1; for (x=2; x<rowlen; x++) { - fp[0]= mfac*row2[1] + fac*(filter[0]*row1[0] + filter[1]*row1[1] + filter[2]*row1[2] + filter[3]*row2[0] + filter[4]*row2[1] + filter[5]*row2[2] + filter[6]*row3[0] + filter[7]*row3[1] + filter[8]*row3[2]); + fp[0] = mfac*row2[1] + fac*(filter[0]*row1[0] + filter[1]*row1[1] + filter[2]*row1[2] + filter[3]*row2[0] + filter[4]*row2[1] + filter[5]*row2[2] + filter[6]*row3[0] + filter[7]*row3[1] + filter[8]*row3[2]); fp++; row1++; row2++; row3++; } - fp[0]= row2[1]; + fp[0] = row2[1]; } else if (pixlen==2) { - fp[0]= row2[0]; - fp[1]= row2[1]; + fp[0] = row2[0]; + fp[1] = row2[1]; fp+= 2; for (x=2; x<rowlen; x++) { for (c=0; c<2; c++) { - fp[0]= mfac*row2[2] + fac*(filter[0]*row1[0] + filter[1]*row1[2] + filter[2]*row1[4] + filter[3]*row2[0] + filter[4]*row2[2] + filter[5]*row2[4] + filter[6]*row3[0] + filter[7]*row3[2] + filter[8]*row3[4]); + fp[0] = mfac*row2[2] + fac*(filter[0]*row1[0] + filter[1]*row1[2] + filter[2]*row1[4] + filter[3]*row2[0] + filter[4]*row2[2] + filter[5]*row2[4] + filter[6]*row3[0] + filter[7]*row3[2] + filter[8]*row3[4]); fp++; row1++; row2++; row3++; } } - fp[0]= row2[2]; - fp[1]= row2[3]; + fp[0] = row2[2]; + fp[1] = row2[3]; } else if (pixlen==3) { copy_v3_v3(fp, row2); @@ -145,7 +145,7 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac) for (x=2; x<rowlen; x++) { for (c=0; c<3; c++) { - fp[0]= mfac*row2[3] + fac*(filter[0]*row1[0] + filter[1]*row1[3] + filter[2]*row1[6] + filter[3]*row2[0] + filter[4]*row2[3] + filter[5]*row2[6] + filter[6]*row3[0] + filter[7]*row3[3] + filter[8]*row3[6]); + fp[0] = mfac*row2[3] + fac*(filter[0]*row1[0] + filter[1]*row1[3] + filter[2]*row1[6] + filter[3]*row2[0] + filter[4]*row2[3] + filter[5]*row2[6] + filter[6]*row3[0] + filter[7]*row3[3] + filter[8]*row3[6]); fp++; row1++; row2++; row3++; } } @@ -157,7 +157,7 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac) for (x=2; x<rowlen; x++) { for (c=0; c<4; c++) { - fp[0]= mfac*row2[4] + fac*(filter[0]*row1[0] + filter[1]*row1[4] + filter[2]*row1[8] + filter[3]*row2[0] + filter[4]*row2[4] + filter[5]*row2[8] + filter[6]*row3[0] + filter[7]*row3[4] + filter[8]*row3[8]); + fp[0] = mfac*row2[4] + fac*(filter[0]*row1[0] + filter[1]*row1[4] + filter[2]*row1[8] + filter[3]*row2[0] + filter[4]*row2[4] + filter[5]*row2[8] + filter[6]*row3[0] + filter[7]*row3[4] + filter[8]*row3[8]); fp++; row1++; row2++; row3++; } } @@ -169,13 +169,13 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac) static void node_composit_exec_filter(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { - static float soft[9]= {1/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 4/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 1/16.0f}; - float sharp[9]= {-1, -1, -1, -1, 9, -1, -1, -1, -1}; - float laplace[9]= {-1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f, 1.0f, -1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f}; - float sobel[9]= {1, 2, 1, 0, 0, 0, -1, -2, -1}; - float prewitt[9]= {1, 1, 1, 0, 0, 0, -1, -1, -1}; - float kirsch[9]= {5, 5, 5, -3, -3, -3, -2, -2, -2}; - float shadow[9]= {1, 2, 1, 0, 1, 0, -1, -2, -1}; + static float soft[9] = {1/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 4/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 1/16.0f}; + float sharp[9] = {-1, -1, -1, -1, 9, -1, -1, -1, -1}; + float laplace[9] = {-1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f, 1.0f, -1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f}; + float sobel[9] = {1, 2, 1, 0, 0, 0, -1, -2, -1}; + float prewitt[9] = {1, 1, 1, 0, 0, 0, -1, -1, -1}; + float kirsch[9] = {5, 5, 5, -3, -3, -3, -2, -2, -2}; + float shadow[9] = {1, 2, 1, 0, 1, 0, -1, -2, -1}; if (out[0]->hasoutput==0) return; diff --git a/source/blender/nodes/composite/nodes/node_composite_flip.c b/source/blender/nodes/composite/nodes/node_composite_flip.c index 147e7591af7..4aa98d173e7 100644 --- a/source/blender/nodes/composite/nodes/node_composite_flip.c +++ b/source/blender/nodes/composite/nodes/node_composite_flip.c @@ -33,12 +33,12 @@ #include "node_composite_util.h" /* **************** Flip ******************** */ -static bNodeSocketTemplate cmp_node_flip_in[]= { +static bNodeSocketTemplate cmp_node_flip_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_flip_out[]= { +static bNodeSocketTemplate cmp_node_flip_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; @@ -75,7 +75,7 @@ static void node_composit_exec_flip(void *UNUSED(data), bNode *node, bNodeStack outfp += (src_width-1)*src_pix; for (x=0; x<src_width; x++) { for (i=0; i<src_pix; i++) { - outfp[i]= srcfp[i]; + outfp[i] = srcfp[i]; } outfp -= src_pix; srcfp += src_pix; diff --git a/source/blender/nodes/composite/nodes/node_composite_gamma.c b/source/blender/nodes/composite/nodes/node_composite_gamma.c index 87155478035..b8c99894301 100644 --- a/source/blender/nodes/composite/nodes/node_composite_gamma.c +++ b/source/blender/nodes/composite/nodes/node_composite_gamma.c @@ -35,12 +35,12 @@ /* **************** Gamma Tools ******************** */ -static bNodeSocketTemplate cmp_node_gamma_in[]= { +static bNodeSocketTemplate cmp_node_gamma_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Gamma"), 1.0f, 0.0f, 0.0f, 0.0f, 0.001f, 10.0f, PROP_UNSIGNED}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_gamma_out[]= { +static bNodeSocketTemplate cmp_node_gamma_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_glare.c b/source/blender/nodes/composite/nodes/node_composite_glare.c index 7d6c0cb1a29..950d8a56f58 100644 --- a/source/blender/nodes/composite/nodes/node_composite_glare.c +++ b/source/blender/nodes/composite/nodes/node_composite_glare.c @@ -32,11 +32,11 @@ #include "node_composite_util.h" -static bNodeSocketTemplate cmp_node_glare_in[]= { +static bNodeSocketTemplate cmp_node_glare_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_glare_out[]= { +static bNodeSocketTemplate cmp_node_glare_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c index 793ea2eb756..d52e3d01a32 100644 --- a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c +++ b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c @@ -34,12 +34,12 @@ /* **************** Hue Saturation ******************** */ -static bNodeSocketTemplate cmp_node_hue_sat_in[]= { +static bNodeSocketTemplate cmp_node_hue_sat_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_hue_sat_out[]= { +static bNodeSocketTemplate cmp_node_hue_sat_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; @@ -60,10 +60,10 @@ static void do_hue_sat_fac(bNode *node, float *out, float *in, float *fac) hsv[2]*= nhs->val; hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); - out[0]= mfac*in[0] + *fac*col[0]; - out[1]= mfac*in[1] + *fac*col[1]; - out[2]= mfac*in[2] + *fac*col[2]; - out[3]= in[3]; + out[0] = mfac*in[0] + *fac*col[0]; + out[1] = mfac*in[1] + *fac*col[1]; + out[2] = mfac*in[2] + *fac*col[2]; + out[3] = in[3]; } else { copy_v4_v4(out, in); diff --git a/source/blender/nodes/composite/nodes/node_composite_huecorrect.c b/source/blender/nodes/composite/nodes/node_composite_huecorrect.c index 42077cd5c06..f751dbea8d2 100644 --- a/source/blender/nodes/composite/nodes/node_composite_huecorrect.c +++ b/source/blender/nodes/composite/nodes/node_composite_huecorrect.c @@ -32,13 +32,13 @@ #include "node_composite_util.h" -static bNodeSocketTemplate cmp_node_huecorrect_in[]= { +static bNodeSocketTemplate cmp_node_huecorrect_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_huecorrect_out[]= { +static bNodeSocketTemplate cmp_node_huecorrect_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; @@ -71,7 +71,7 @@ static void do_huecorrect(bNode *node, float *out, float *in) /* convert back to rgb */ hsv_to_rgb(hsv[0], hsv[1], hsv[2], out, out+1, out+2); - out[3]= in[3]; + out[3] = in[3]; } static void do_huecorrect_fac(bNode *node, float *out, float *in, float *fac) @@ -101,10 +101,10 @@ static void do_huecorrect_fac(bNode *node, float *out, float *in, float *fac) /* convert back to rgb */ hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2); - out[0]= mfac*in[0] + *fac*rgb[0]; - out[1]= mfac*in[1] + *fac*rgb[1]; - out[2]= mfac*in[2] + *fac*rgb[2]; - out[3]= in[3]; + out[0] = mfac*in[0] + *fac*rgb[0]; + out[1] = mfac*in[1] + *fac*rgb[1]; + out[2] = mfac*in[2] + *fac*rgb[2]; + out[3] = in[3]; } static void node_composit_exec_huecorrect(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) diff --git a/source/blender/nodes/composite/nodes/node_composite_idMask.c b/source/blender/nodes/composite/nodes/node_composite_idMask.c index 31a3a765ebe..ef0c5021192 100644 --- a/source/blender/nodes/composite/nodes/node_composite_idMask.c +++ b/source/blender/nodes/composite/nodes/node_composite_idMask.c @@ -35,11 +35,11 @@ /* **************** ID Mask ******************** */ -static bNodeSocketTemplate cmp_node_idmask_in[]= { +static bNodeSocketTemplate cmp_node_idmask_in[] = { { SOCK_FLOAT, 1, N_("ID value"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_idmask_out[]= { +static bNodeSocketTemplate cmp_node_idmask_out[] = { { SOCK_FLOAT, 0, N_("Alpha")}, { -1, 0, "" } }; @@ -56,14 +56,14 @@ static void do_idmask(CompBuf *stackbuf, CompBuf *cbuf, float idnr) rect= cbuf->rect; for (x= cbuf->x*cbuf->y - 1; x>=0; x--) if (rect[x]==idnr) - abuf[x]= 255; + abuf[x] = 255; antialias_tagbuf(cbuf->x, cbuf->y, abuf); rect= stackbuf->rect; for (x= cbuf->x*cbuf->y - 1; x>=0; x--) if (abuf[x]>1) - rect[x]= (1.0f/255.0f)*(float)abuf[x]; + rect[x] = (1.0f/255.0f)*(float)abuf[x]; MEM_freeN(abuf); } @@ -78,7 +78,7 @@ static void do_idmask_fsa(CompBuf *stackbuf, CompBuf *cbuf, float idnr) rs= stackbuf->rect; for (x= cbuf->x*cbuf->y - 1; x>=0; x--) if (rect[x]==idnr) - rs[x]= 1.0f; + rs[x] = 1.0f; } diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c index 4f6a73c34c9..150382c1f8f 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.c +++ b/source/blender/nodes/composite/nodes/node_composite_image.c @@ -34,7 +34,7 @@ /* **************** IMAGE (and RenderResult, multilayer image) ******************** */ -static bNodeSocketTemplate cmp_node_rlayers_out[]= { +static bNodeSocketTemplate cmp_node_rlayers_out[] = { { SOCK_RGBA, 0, N_("Image"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Z"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, diff --git a/source/blender/nodes/composite/nodes/node_composite_invert.c b/source/blender/nodes/composite/nodes/node_composite_invert.c index 277998ee355..2db6e42f603 100644 --- a/source/blender/nodes/composite/nodes/node_composite_invert.c +++ b/source/blender/nodes/composite/nodes/node_composite_invert.c @@ -32,13 +32,13 @@ #include "node_composite_util.h" /* **************** INVERT ******************** */ -static bNodeSocketTemplate cmp_node_invert_in[]= { +static bNodeSocketTemplate cmp_node_invert_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { SOCK_RGBA, 1, N_("Color"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_invert_out[]= { +static bNodeSocketTemplate cmp_node_invert_out[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_lensdist.c b/source/blender/nodes/composite/nodes/node_composite_lensdist.c index a4983cce8b8..c3f64f0eacb 100644 --- a/source/blender/nodes/composite/nodes/node_composite_lensdist.c +++ b/source/blender/nodes/composite/nodes/node_composite_lensdist.c @@ -32,13 +32,13 @@ #include "node_composite_util.h" -static bNodeSocketTemplate cmp_node_lensdist_in[]= { +static bNodeSocketTemplate cmp_node_lensdist_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Distort"), 0.f, 0.f, 0.f, 0.f, -0.999f, 1.f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Dispersion"), 0.f, 0.f, 0.f, 0.f, 0.f, 1.f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_lensdist_out[]= { +static bNodeSocketTemplate cmp_node_lensdist_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; @@ -74,7 +74,7 @@ static void lensDistort(CompBuf *dst, CompBuf *src, float kr, float kg, float kb qd_getPixelLerpChan(tsrc, (u*dst->x - kr) - 0.5f, v*dst->y - 0.5f, 2, colp[x]+2); /* set alpha */ - colp[x][3]= 1.0f; + colp[x][3] = 1.0f; } } free_compbuf(tsrc); @@ -159,7 +159,7 @@ static void lensDistort(CompBuf *dst, CompBuf *src, float kr, float kg, float kb if (db) colp[x][2] = 2.f*tc[2] / (float)db; /* set alpha */ - colp[x][3]= 1.0f; + colp[x][3] = 1.0f; } } } diff --git a/source/blender/nodes/composite/nodes/node_composite_levels.c b/source/blender/nodes/composite/nodes/node_composite_levels.c index 4cc927aaa33..57d94d6cb4d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_levels.c +++ b/source/blender/nodes/composite/nodes/node_composite_levels.c @@ -34,12 +34,12 @@ /* **************** LEVELS ******************** */ -static bNodeSocketTemplate cmp_node_view_levels_in[]= { +static bNodeSocketTemplate cmp_node_view_levels_in[] = { { SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_view_levels_out[]={ +static bNodeSocketTemplate cmp_node_view_levels_out[] = { {SOCK_FLOAT, 0, N_("Mean")}, {SOCK_FLOAT, 0, N_("Std Dev")}, {-1, 0, ""} @@ -300,9 +300,9 @@ static void node_composit_exec_view_levels(void *data, bNode *node, bNodeStack * #endif if (out[0]->hasoutput) - out[0]->vec[0]= mean; + out[0]->vec[0] = mean; if (out[1]->hasoutput) - out[1]->vec[0]= std_dev; + out[1]->vec[0] = std_dev; generate_preview(data, node, histogram); diff --git a/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c b/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c index 61cd4493f39..ed232933139 100644 --- a/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c @@ -34,12 +34,12 @@ /* ******************* Luma Matte Node ********************************* */ -static bNodeSocketTemplate cmp_node_luma_matte_in[]={ +static bNodeSocketTemplate cmp_node_luma_matte_in[] = { {SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, {-1, 0, ""} }; -static bNodeSocketTemplate cmp_node_luma_matte_out[]={ +static bNodeSocketTemplate cmp_node_luma_matte_out[] = { {SOCK_RGBA, 0, N_("Image")}, {SOCK_FLOAT, 0, N_("Matte")}, {-1, 0, ""} diff --git a/source/blender/nodes/composite/nodes/node_composite_mapUV.c b/source/blender/nodes/composite/nodes/node_composite_mapUV.c index e6c9d72294f..40092a84367 100644 --- a/source/blender/nodes/composite/nodes/node_composite_mapUV.c +++ b/source/blender/nodes/composite/nodes/node_composite_mapUV.c @@ -34,12 +34,12 @@ /* **************** Map UV ******************** */ -static bNodeSocketTemplate cmp_node_mapuv_in[]= { +static bNodeSocketTemplate cmp_node_mapuv_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_VECTOR, 1, N_("UV"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_mapuv_out[]= { +static bNodeSocketTemplate cmp_node_mapuv_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_mapValue.c b/source/blender/nodes/composite/nodes/node_composite_mapValue.c index be69c11b35f..677d5bd5013 100644 --- a/source/blender/nodes/composite/nodes/node_composite_mapValue.c +++ b/source/blender/nodes/composite/nodes/node_composite_mapValue.c @@ -33,11 +33,11 @@ #include "node_composite_util.h" /* **************** MAP VALUE ******************** */ -static bNodeSocketTemplate cmp_node_map_value_in[]= { +static bNodeSocketTemplate cmp_node_map_value_in[] = { { SOCK_FLOAT, 1, N_("Value"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_map_value_out[]= { +static bNodeSocketTemplate cmp_node_map_value_out[] = { { SOCK_FLOAT, 0, N_("Value")}, { -1, 0, "" } }; @@ -48,13 +48,13 @@ static void do_map_value(bNode *node, float *out, float *src) { TexMapping *texmap= node->storage; - out[0]= (src[0] + texmap->loc[0])*texmap->size[0]; + out[0] = (src[0] + texmap->loc[0])*texmap->size[0]; if (texmap->flag & TEXMAP_CLIP_MIN) if (out[0]<texmap->min[0]) - out[0]= texmap->min[0]; + out[0] = texmap->min[0]; if (texmap->flag & TEXMAP_CLIP_MAX) if (out[0]>texmap->max[0]) - out[0]= texmap->max[0]; + out[0] = texmap->max[0]; } static void node_composit_exec_map_value(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) diff --git a/source/blender/nodes/composite/nodes/node_composite_math.c b/source/blender/nodes/composite/nodes/node_composite_math.c index 96504b21365..c99e12a95b9 100644 --- a/source/blender/nodes/composite/nodes/node_composite_math.c +++ b/source/blender/nodes/composite/nodes/node_composite_math.c @@ -33,13 +33,13 @@ #include "node_composite_util.h" /* **************** SCALAR MATH ******************** */ -static bNodeSocketTemplate cmp_node_math_in[]= { +static bNodeSocketTemplate cmp_node_math_in[] = { { SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_math_out[]= { +static bNodeSocketTemplate cmp_node_math_out[] = { { SOCK_FLOAT, 0, N_("Value")}, { -1, 0, "" } }; @@ -50,63 +50,63 @@ static void do_math(bNode *node, float *out, float *in, float *in2) { switch (node->custom1) { case 0: /* Add */ - out[0]= in[0] + in2[0]; + out[0] = in[0] + in2[0]; break; case 1: /* Subtract */ - out[0]= in[0] - in2[0]; + out[0] = in[0] - in2[0]; break; case 2: /* Multiply */ - out[0]= in[0] * in2[0]; + out[0] = in[0] * in2[0]; break; case 3: /* Divide */ { if (in2[0]==0) /* We don't want to divide by zero. */ - out[0]= 0.0; + out[0] = 0.0; else - out[0]= in[0] / in2[0]; + out[0] = in[0] / in2[0]; } break; case 4: /* Sine */ - out[0]= sin(in[0]); + out[0] = sin(in[0]); break; case 5: /* Cosine */ - out[0]= cos(in[0]); + out[0] = cos(in[0]); break; case 6: /* Tangent */ - out[0]= tan(in[0]); + out[0] = tan(in[0]); break; case 7: /* Arc-Sine */ { /* Can't do the impossible... */ if (in[0] <= 1 && in[0] >= -1 ) - out[0]= asin(in[0]); + out[0] = asin(in[0]); else - out[0]= 0.0; + out[0] = 0.0; } break; case 8: /* Arc-Cosine */ { /* Can't do the impossible... */ if ( in[0] <= 1 && in[0] >= -1 ) - out[0]= acos(in[0]); + out[0] = acos(in[0]); else - out[0]= 0.0; + out[0] = 0.0; } break; case 9: /* Arc-Tangent */ - out[0]= atan(in[0]); + out[0] = atan(in[0]); break; case 10: /* Power */ { /* Only raise negative numbers by full integers */ if ( in[0] >= 0 ) { - out[0]= pow(in[0], in2[0]); + out[0] = pow(in[0], in2[0]); } else { float y_mod_1 = fmod(in2[0], 1); /* if input value is not nearly an integer, fall back to zero, nicer than straight rounding */ if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) { - out[0]= powf(in[0], floorf(in2[0] + 0.5f)); + out[0] = powf(in[0], floorf(in2[0] + 0.5f)); } else { out[0] = 0.0f; @@ -118,50 +118,50 @@ static void do_math(bNode *node, float *out, float *in, float *in2) { /* Don't want any imaginary numbers... */ if ( in[0] > 0 && in2[0] > 0 ) - out[0]= log(in[0]) / log(in2[0]); + out[0] = log(in[0]) / log(in2[0]); else - out[0]= 0.0; + out[0] = 0.0; } break; case 12: /* Minimum */ { if ( in[0] < in2[0] ) - out[0]= in[0]; + out[0] = in[0]; else - out[0]= in2[0]; + out[0] = in2[0]; } break; case 13: /* Maximum */ { if ( in[0] > in2[0] ) - out[0]= in[0]; + out[0] = in[0]; else - out[0]= in2[0]; + out[0] = in2[0]; } break; case 14: /* Round */ { /* round by the second value */ if ( in2[0] != 0.0f ) - out[0]= floorf(in[0] / in2[0] + 0.5f) * in2[0]; + out[0] = floorf(in[0] / in2[0] + 0.5f) * in2[0]; else - out[0]= floorf(in[0] + 0.5f); + out[0] = floorf(in[0] + 0.5f); } break; case 15: /* Less Than */ { if ( in[0] < in2[0] ) - out[0]= 1.0f; + out[0] = 1.0f; else - out[0]= 0.0f; + out[0] = 0.0f; } break; case 16: /* Greater Than */ { if ( in[0] > in2[0] ) - out[0]= 1.0f; + out[0] = 1.0f; else - out[0]= 0.0f; + out[0] = 0.0f; } break; } diff --git a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c index e2c9a5abcb1..5d3ee480612 100644 --- a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c +++ b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c @@ -32,13 +32,13 @@ #include "node_composite_util.h" /* **************** MIX RGB ******************** */ -static bNodeSocketTemplate cmp_node_mix_rgb_in[]= { +static bNodeSocketTemplate cmp_node_mix_rgb_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 5.0f, PROP_FACTOR}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_mix_rgb_out[]= { +static bNodeSocketTemplate cmp_node_mix_rgb_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; @@ -55,7 +55,7 @@ static void do_mix_rgb(bNode *node, float *out, float *in1, float *in2, float *f else ramp_blend(node->custom1, col, fac[0], in2); copy_v3_v3(out, col); - out[3]= in1[3]; + out[3] = in1[3]; } static void node_composit_exec_mix_rgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) diff --git a/source/blender/nodes/composite/nodes/node_composite_normal.c b/source/blender/nodes/composite/nodes/node_composite_normal.c index 6f1e86e2760..93fd7ca1c1b 100644 --- a/source/blender/nodes/composite/nodes/node_composite_normal.c +++ b/source/blender/nodes/composite/nodes/node_composite_normal.c @@ -34,12 +34,12 @@ /* **************** NORMAL ******************** */ -static bNodeSocketTemplate cmp_node_normal_in[]= { +static bNodeSocketTemplate cmp_node_normal_in[] = { { SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_DIRECTION}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_normal_out[]= { +static bNodeSocketTemplate cmp_node_normal_out[] = { { SOCK_VECTOR, 0, N_("Normal")}, { SOCK_FLOAT, 0, N_("Dot")}, { -1, 0, "" } @@ -53,7 +53,7 @@ static void do_normal(bNode *node, float *out, float *in) float *nor= ((bNodeSocketValueVector*)sock->default_value)->value; /* render normals point inside... the widget points outside */ - out[0]= -dot_v3v3(nor, in); + out[0] = -dot_v3v3(nor, in); } /* generates normal, does dot product */ @@ -68,7 +68,7 @@ static void node_composit_exec_normal(void *UNUSED(data), bNode *node, bNodeStac if (in[0]->data==NULL) { copy_v3_v3(out[0]->vec, nor); /* render normals point inside... the widget points outside */ - out[1]->vec[0]= -dot_v3v3(out[0]->vec, in[0]->vec); + out[1]->vec[0] = -dot_v3v3(out[0]->vec, in[0]->vec); } else if (out[1]->hasoutput) { /* make output size of input image */ diff --git a/source/blender/nodes/composite/nodes/node_composite_normalize.c b/source/blender/nodes/composite/nodes/node_composite_normalize.c index 1d2312d8280..19b543dce5d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_normalize.c +++ b/source/blender/nodes/composite/nodes/node_composite_normalize.c @@ -34,11 +34,11 @@ /* **************** NORMALIZE single channel, useful for Z buffer ******************** */ -static bNodeSocketTemplate cmp_node_normalize_in[]= { +static bNodeSocketTemplate cmp_node_normalize_in[] = { { SOCK_FLOAT, 1, N_("Value"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_normalize_out[]= { +static bNodeSocketTemplate cmp_node_normalize_out[] = { { SOCK_FLOAT, 0, N_("Value")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_premulkey.c b/source/blender/nodes/composite/nodes/node_composite_premulkey.c index d791983b069..7f7b7692b02 100644 --- a/source/blender/nodes/composite/nodes/node_composite_premulkey.c +++ b/source/blender/nodes/composite/nodes/node_composite_premulkey.c @@ -35,11 +35,11 @@ /* **************** Premul and Key Alpha Convert ******************** */ -static bNodeSocketTemplate cmp_node_premulkey_in[]= { +static bNodeSocketTemplate cmp_node_premulkey_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_premulkey_out[]= { +static bNodeSocketTemplate cmp_node_premulkey_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_rgb.c b/source/blender/nodes/composite/nodes/node_composite_rgb.c index 65c1dcdb7bb..54fba650783 100644 --- a/source/blender/nodes/composite/nodes/node_composite_rgb.c +++ b/source/blender/nodes/composite/nodes/node_composite_rgb.c @@ -34,7 +34,7 @@ /* **************** RGB ******************** */ -static bNodeSocketTemplate cmp_node_rgb_out[]= { +static bNodeSocketTemplate cmp_node_rgb_out[] = { { SOCK_RGBA, 0, N_("RGBA"), 0.5f, 0.5f, 0.5f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_rotate.c b/source/blender/nodes/composite/nodes/node_composite_rotate.c index 8968fd5fb3a..9a76764b97e 100644 --- a/source/blender/nodes/composite/nodes/node_composite_rotate.c +++ b/source/blender/nodes/composite/nodes/node_composite_rotate.c @@ -34,12 +34,12 @@ /* **************** Rotate ******************** */ -static bNodeSocketTemplate cmp_node_rotate_in[]= { +static bNodeSocketTemplate cmp_node_rotate_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Degr"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_ANGLE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_rotate_out[]= { +static bNodeSocketTemplate cmp_node_rotate_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c index 97150020cfb..f1a75493718 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c +++ b/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c @@ -34,11 +34,11 @@ /* **************** SEPARATE HSVA ******************** */ -static bNodeSocketTemplate cmp_node_sephsva_in[]= { +static bNodeSocketTemplate cmp_node_sephsva_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_sephsva_out[]= { +static bNodeSocketTemplate cmp_node_sephsva_out[] = { { SOCK_FLOAT, 0, N_("H")}, { SOCK_FLOAT, 0, N_("S")}, { SOCK_FLOAT, 0, N_("V")}, @@ -54,10 +54,10 @@ static void do_sephsva(bNode *UNUSED(node), float *out, float *in) rgb_to_hsv(in[0], in[1], in[2], &h, &s, &v); - out[0]= h; - out[1]= s; - out[2]= v; - out[3]= in[3]; + out[0] = h; + out[1] = s; + out[2] = v; + out[3] = in[3]; } static void node_composit_exec_sephsva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) @@ -126,7 +126,7 @@ static bNodeSocketTemplate cmp_node_combhsva_in[] = { { SOCK_FLOAT, 1, N_("A"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_combhsva_out[]= { +static bNodeSocketTemplate cmp_node_combhsva_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c index aaa10d45445..83b2c731020 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c +++ b/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c @@ -33,11 +33,11 @@ #include "node_composite_util.h" /* **************** SEPARATE RGBA ******************** */ -static bNodeSocketTemplate cmp_node_seprgba_in[]= { +static bNodeSocketTemplate cmp_node_seprgba_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_seprgba_out[]= { +static bNodeSocketTemplate cmp_node_seprgba_out[] = { { SOCK_FLOAT, 0, N_("R")}, { SOCK_FLOAT, 0, N_("G")}, { SOCK_FLOAT, 0, N_("B")}, @@ -98,14 +98,14 @@ void register_node_type_cmp_seprgba(bNodeTreeType *ttype) /* **************** COMBINE RGBA ******************** */ -static bNodeSocketTemplate cmp_node_combrgba_in[]= { +static bNodeSocketTemplate cmp_node_combrgba_in[] = { { SOCK_FLOAT, 1, N_("R"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("G"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("B"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("A"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_combrgba_out[]= { +static bNodeSocketTemplate cmp_node_combrgba_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c index 0d862d063f3..982d674708c 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c +++ b/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c @@ -34,11 +34,11 @@ /* **************** SEPARATE YCCA ******************** */ -static bNodeSocketTemplate cmp_node_sepycca_in[]= { +static bNodeSocketTemplate cmp_node_sepycca_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_sepycca_out[]= { +static bNodeSocketTemplate cmp_node_sepycca_out[] = { { SOCK_FLOAT, 0, N_("Y")}, { SOCK_FLOAT, 0, N_("Cb")}, { SOCK_FLOAT, 0, N_("Cr")}, @@ -55,10 +55,10 @@ static void do_sepycca_601(bNode *UNUSED(node), float *out, float *in) rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_ITU_BT601); /*divided by 255 to normalize for viewing in */ - out[0]= y/255.0f; - out[1]= cb/255.0f; - out[2]= cr/255.0f; - out[3]= in[3]; + out[0] = y/255.0f; + out[1] = cb/255.0f; + out[2] = cr/255.0f; + out[3] = in[3]; } static void do_sepycca_709(bNode *UNUSED(node), float *out, float *in) @@ -68,10 +68,10 @@ static void do_sepycca_709(bNode *UNUSED(node), float *out, float *in) rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_ITU_BT709); /*divided by 255 to normalize for viewing in */ - out[0]= y/255.0f; - out[1]= cb/255.0f; - out[2]= cr/255.0f; - out[3]= in[3]; + out[0] = y/255.0f; + out[1] = cb/255.0f; + out[2] = cr/255.0f; + out[3] = in[3]; } static void do_sepycca_jfif(bNode *UNUSED(node), float *out, float *in) @@ -81,10 +81,10 @@ static void do_sepycca_jfif(bNode *UNUSED(node), float *out, float *in) rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_JFIF_0_255); /*divided by 255 to normalize for viewing in */ - out[0]= y/255.0f; - out[1]= cb/255.0f; - out[2]= cr/255.0f; - out[3]= in[3]; + out[0] = y/255.0f; + out[1] = cb/255.0f; + out[2] = cr/255.0f; + out[3] = in[3]; } static void node_composit_exec_sepycca(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) @@ -167,14 +167,14 @@ void register_node_type_cmp_sepycca(bNodeTreeType *ttype) /* **************** COMBINE YCCA ******************** */ -static bNodeSocketTemplate cmp_node_combycca_in[]= { +static bNodeSocketTemplate cmp_node_combycca_in[] = { { SOCK_FLOAT, 1, N_("Y"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Cb"), 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Cr"), 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("A"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_combycca_out[]= { +static bNodeSocketTemplate cmp_node_combycca_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c index 9b8c805b0f0..0a9575971b4 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c +++ b/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c @@ -34,11 +34,11 @@ /* **************** SEPARATE YUVA ******************** */ -static bNodeSocketTemplate cmp_node_sepyuva_in[]= { +static bNodeSocketTemplate cmp_node_sepyuva_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_sepyuva_out[]= { +static bNodeSocketTemplate cmp_node_sepyuva_out[] = { { SOCK_FLOAT, 0, N_("Y")}, { SOCK_FLOAT, 0, N_("U")}, { SOCK_FLOAT, 0, N_("V")}, @@ -54,10 +54,10 @@ static void do_sepyuva(bNode *UNUSED(node), float *out, float *in) rgb_to_yuv(in[0], in[1], in[2], &y, &u, &v); - out[0]= y; - out[1]= u; - out[2]= v; - out[3]= in[3]; + out[0] = y; + out[1] = u; + out[2] = v; + out[3] = in[3]; } static void node_composit_exec_sepyuva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) @@ -121,14 +121,14 @@ void register_node_type_cmp_sepyuva(bNodeTreeType *ttype) /* **************** COMBINE YUVA ******************** */ -static bNodeSocketTemplate cmp_node_combyuva_in[]= { +static bNodeSocketTemplate cmp_node_combyuva_in[] = { { SOCK_FLOAT, 1, N_("Y"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("U"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("V"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("A"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_combyuva_out[]= { +static bNodeSocketTemplate cmp_node_combyuva_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_setalpha.c b/source/blender/nodes/composite/nodes/node_composite_setalpha.c index 503815b74a0..59c104869fe 100644 --- a/source/blender/nodes/composite/nodes/node_composite_setalpha.c +++ b/source/blender/nodes/composite/nodes/node_composite_setalpha.c @@ -33,12 +33,12 @@ #include "node_composite_util.h" /* **************** SET ALPHA ******************** */ -static bNodeSocketTemplate cmp_node_setalpha_in[]= { +static bNodeSocketTemplate cmp_node_setalpha_in[] = { { SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_setalpha_out[]= { +static bNodeSocketTemplate cmp_node_setalpha_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_splitViewer.c b/source/blender/nodes/composite/nodes/node_composite_splitViewer.c index f6811f526f7..70c1bf8f23f 100644 --- a/source/blender/nodes/composite/nodes/node_composite_splitViewer.c +++ b/source/blender/nodes/composite/nodes/node_composite_splitViewer.c @@ -33,7 +33,7 @@ #include "node_composite_util.h" /* **************** SPLIT VIEWER ******************** */ -static bNodeSocketTemplate cmp_node_splitviewer_in[]= { +static bNodeSocketTemplate cmp_node_splitviewer_in[] = { { SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c b/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c index fdf0b38e844..1787e075a14 100644 --- a/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c +++ b/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c @@ -35,12 +35,12 @@ /* **************** Translate ******************** */ -static bNodeSocketTemplate cmp_node_stabilize2d_in[]= { +static bNodeSocketTemplate cmp_node_stabilize2d_in[] = { { SOCK_RGBA, 1, N_("Image"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_stabilize2d_out[]= { +static bNodeSocketTemplate cmp_node_stabilize2d_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_switch.c b/source/blender/nodes/composite/nodes/node_composite_switch.c index 258fac18c11..7f9127c969f 100644 --- a/source/blender/nodes/composite/nodes/node_composite_switch.c +++ b/source/blender/nodes/composite/nodes/node_composite_switch.c @@ -34,13 +34,13 @@ #include "../node_composite_util.h" /* **************** MIX RGB ******************** */ -static bNodeSocketTemplate cmp_node_switch_in[]= { +static bNodeSocketTemplate cmp_node_switch_in[] = { { SOCK_RGBA, 1, N_("Off"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_RGBA, 1, N_("On"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_switch_out[]= { +static bNodeSocketTemplate cmp_node_switch_out[] = { { SOCK_RGBA, 0, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_texture.c b/source/blender/nodes/composite/nodes/node_composite_texture.c index 01baa39807a..b6518c48638 100644 --- a/source/blender/nodes/composite/nodes/node_composite_texture.c +++ b/source/blender/nodes/composite/nodes/node_composite_texture.c @@ -33,12 +33,12 @@ #include "node_composite_util.h" /* **************** TEXTURE ******************** */ -static bNodeSocketTemplate cmp_node_texture_in[]= { +static bNodeSocketTemplate cmp_node_texture_in[] = { { SOCK_VECTOR, 1, N_("Offset"), 0.0f, 0.0f, 0.0f, 0.0f, -2.0f, 2.0f, PROP_TRANSLATION}, { SOCK_VECTOR, 1, N_("Scale"), 1.0f, 1.0f, 1.0f, 1.0f, -10.0f, 10.0f, PROP_XYZ}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_texture_out[]= { +static bNodeSocketTemplate cmp_node_texture_out[] = { { SOCK_FLOAT, 0, N_("Value")}, { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } @@ -51,28 +51,28 @@ static void texture_procedural(CompBuf *cbuf, float *out, float xco, float yco) { bNode *node= cbuf->node; TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL}; - float vec[3], *size, nor[3]={0.0f, 0.0f, 0.0f}, col[4]; + float vec[3], *size, nor[3] = {0.0f, 0.0f, 0.0f}, col[4]; int retval, type= cbuf->procedural_type; size= cbuf->procedural_size; - vec[0]= size[0]*(xco + cbuf->procedural_offset[0]); - vec[1]= size[1]*(yco + cbuf->procedural_offset[1]); - vec[2]= size[2]*cbuf->procedural_offset[2]; + vec[0] = size[0]*(xco + cbuf->procedural_offset[0]); + vec[1] = size[1]*(yco + cbuf->procedural_offset[1]); + vec[2] = size[2]*cbuf->procedural_offset[2]; retval= multitex_ext((Tex *)node->id, vec, NULL, NULL, 0, &texres); if (type==CB_VAL) { if (texres.talpha) - col[0]= texres.ta; + col[0] = texres.ta; else - col[0]= texres.tin; + col[0] = texres.tin; } else if (type==CB_RGBA) { if (texres.talpha) - col[3]= texres.ta; + col[3] = texres.ta; else - col[3]= texres.tin; + col[3] = texres.tin; if ((retval & TEX_RGB)) { copy_v3_v3(col, &texres.tr); diff --git a/source/blender/nodes/composite/nodes/node_composite_tonemap.c b/source/blender/nodes/composite/nodes/node_composite_tonemap.c index 5e4efe2f3b1..00b1a5514dc 100644 --- a/source/blender/nodes/composite/nodes/node_composite_tonemap.c +++ b/source/blender/nodes/composite/nodes/node_composite_tonemap.c @@ -32,11 +32,11 @@ #include "node_composite_util.h" -static bNodeSocketTemplate cmp_node_tonemap_in[]= { +static bNodeSocketTemplate cmp_node_tonemap_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_tonemap_out[]= { +static bNodeSocketTemplate cmp_node_tonemap_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_translate.c b/source/blender/nodes/composite/nodes/node_composite_translate.c index 649902ff908..1c2963a2f08 100644 --- a/source/blender/nodes/composite/nodes/node_composite_translate.c +++ b/source/blender/nodes/composite/nodes/node_composite_translate.c @@ -35,13 +35,13 @@ /* **************** Translate ******************** */ -static bNodeSocketTemplate cmp_node_translate_in[]= { +static bNodeSocketTemplate cmp_node_translate_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, N_("X"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Y"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_translate_out[]= { +static bNodeSocketTemplate cmp_node_translate_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_valToRgb.c b/source/blender/nodes/composite/nodes/node_composite_valToRgb.c index 87a776c7bea..5c111998b18 100644 --- a/source/blender/nodes/composite/nodes/node_composite_valToRgb.c +++ b/source/blender/nodes/composite/nodes/node_composite_valToRgb.c @@ -34,11 +34,11 @@ /* **************** VALTORGB ******************** */ -static bNodeSocketTemplate cmp_node_valtorgb_in[]= { +static bNodeSocketTemplate cmp_node_valtorgb_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_valtorgb_out[]= { +static bNodeSocketTemplate cmp_node_valtorgb_out[] = { { SOCK_RGBA, 0, N_("Image")}, { SOCK_FLOAT, 0, N_("Alpha")}, { -1, 0, "" } @@ -106,11 +106,11 @@ void register_node_type_cmp_valtorgb(bNodeTreeType *ttype) /* **************** RGBTOBW ******************** */ -static bNodeSocketTemplate cmp_node_rgbtobw_in[]= { +static bNodeSocketTemplate cmp_node_rgbtobw_in[] = { { SOCK_RGBA, 1, N_("Image"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_rgbtobw_out[]= { +static bNodeSocketTemplate cmp_node_rgbtobw_out[] = { { SOCK_FLOAT, 0, N_("Val"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_value.c b/source/blender/nodes/composite/nodes/node_composite_value.c index 63ab4fcb58f..2c65fe6be19 100644 --- a/source/blender/nodes/composite/nodes/node_composite_value.c +++ b/source/blender/nodes/composite/nodes/node_composite_value.c @@ -33,7 +33,7 @@ #include "node_composite_util.h" /* **************** VALUE ******************** */ -static bNodeSocketTemplate cmp_node_value_out[]= { +static bNodeSocketTemplate cmp_node_value_out[] = { /* XXX value nodes use the output sockets for buttons, so we need explicit limits here! */ { SOCK_FLOAT, 0, N_("Value"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX}, { -1, 0, "" } @@ -56,7 +56,7 @@ static void node_composit_exec_value(void *UNUSED(data), bNode *node, bNodeStack bNodeSocket *sock= node->outputs.first; float val= ((bNodeSocketValueFloat*)sock->default_value)->value; - out[0]->vec[0]= val; + out[0]->vec[0] = val; } #endif /* WITH_COMPOSITOR_LEGACY */ diff --git a/source/blender/nodes/composite/nodes/node_composite_zcombine.c b/source/blender/nodes/composite/nodes/node_composite_zcombine.c index 3decbe8d230..8e639aaa357 100644 --- a/source/blender/nodes/composite/nodes/node_composite_zcombine.c +++ b/source/blender/nodes/composite/nodes/node_composite_zcombine.c @@ -35,14 +35,14 @@ /* **************** Z COMBINE ******************** */ /* lazy coder note: node->custom2 is abused to send signal */ -static bNodeSocketTemplate cmp_node_zcombine_in[]= { +static bNodeSocketTemplate cmp_node_zcombine_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Z"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 10000.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Z"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 10000.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate cmp_node_zcombine_out[]= { +static bNodeSocketTemplate cmp_node_zcombine_out[] = { { SOCK_RGBA, 0, N_("Image")}, { SOCK_FLOAT, 0, N_("Z")}, { -1, 0, "" } @@ -60,10 +60,10 @@ static void do_zcombine(bNode *node, float *out, float *src1, float *z1, float * // use alpha in combine operation alpha= src1[3]; malpha= 1.0f - alpha; - out[0]= malpha*src2[0] + alpha*src1[0]; - out[1]= malpha*src2[1] + alpha*src1[1]; - out[2]= malpha*src2[2] + alpha*src1[2]; - out[3]= malpha*src2[3] + alpha*src1[3]; + out[0] = malpha*src2[0] + alpha*src1[0]; + out[1] = malpha*src2[1] + alpha*src1[1]; + out[2] = malpha*src2[2] + alpha*src1[2]; + out[3] = malpha*src2[3] + alpha*src1[3]; } else { // do combination based solely on z value @@ -75,10 +75,10 @@ static void do_zcombine(bNode *node, float *out, float *src1, float *z1, float * // use alpha in combine operation alpha= src2[3]; malpha= 1.0f - alpha; - out[0]= malpha*src1[0] + alpha*src2[0]; - out[1]= malpha*src1[1] + alpha*src2[1]; - out[2]= malpha*src1[2] + alpha*src2[2]; - out[3]= malpha*src1[3] + alpha*src2[3]; + out[0] = malpha*src1[0] + alpha*src2[0]; + out[1] = malpha*src1[1] + alpha*src2[1]; + out[2] = malpha*src1[2] + alpha*src2[2]; + out[3] = malpha*src1[3] + alpha*src2[3]; } else { // do combination based solely on z value @@ -111,20 +111,20 @@ static void do_zcombine_add(bNode *node, float *out, float *col1, float *col2, f malpha= 1.0f - alpha; - out[0]= malpha*col1[0] + alpha*col2[0]; - out[1]= malpha*col1[1] + alpha*col2[1]; - out[2]= malpha*col1[2] + alpha*col2[2]; - out[3]= malpha*col1[3] + alpha*col2[3]; + out[0] = malpha*col1[0] + alpha*col2[0]; + out[1] = malpha*col1[1] + alpha*col2[1]; + out[2] = malpha*col1[2] + alpha*col2[2]; + out[3] = malpha*col1[3] + alpha*col2[3]; } else { alpha= col1[3]; malpha= 1.0f - alpha; - out[0]= malpha*col2[0] + alpha*col1[0]; - out[1]= malpha*col2[1] + alpha*col1[1]; - out[2]= malpha*col2[2] + alpha*col1[2]; - out[3]= malpha*col2[3] + alpha*col1[3]; + out[0] = malpha*col2[0] + alpha*col1[0]; + out[1] = malpha*col2[1] + alpha*col1[1]; + out[2] = malpha*col2[2] + alpha*col1[2]; + out[3] = malpha*col2[3] + alpha*col1[3]; } } else { @@ -132,10 +132,10 @@ static void do_zcombine_add(bNode *node, float *out, float *col1, float *col2, f alpha = *acol; malpha= 1.0f - alpha; - out[0]= malpha*col1[0] + alpha*col2[0]; - out[1]= malpha*col1[1] + alpha*col2[1]; - out[2]= malpha*col1[2] + alpha*col2[2]; - out[3]= malpha*col1[3] + alpha*col2[3]; + out[0] = malpha*col1[0] + alpha*col2[0]; + out[1] = malpha*col1[1] + alpha*col2[1]; + out[2] = malpha*col1[2] + alpha*col2[2]; + out[3] = malpha*col1[3] + alpha*col2[3]; } } @@ -202,8 +202,8 @@ static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in aabuf= MEM_mallocN(cbuf->x*cbuf->y, "aa buf"); fp= mbuf->rect; for (x= cbuf->x*cbuf->y-1; x>=0; x--) - if (fp[x]==0.0f) aabuf[x]= 0; - else aabuf[x]= 255; + if (fp[x]==0.0f) aabuf[x] = 0; + else aabuf[x] = 255; antialias_tagbuf(cbuf->x, cbuf->y, aabuf); @@ -211,7 +211,7 @@ static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in fp= mbuf->rect; for (x= cbuf->x*cbuf->y-1; x>=0; x--) if (aabuf[x]>1) - fp[x]= (1.0f/255.0f)*(float)aabuf[x]; + fp[x] = (1.0f/255.0f)*(float)aabuf[x]; composit3_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[2]->data, in[2]->vec, mbuf, NULL, do_zcombine_add, CB_RGBA, CB_RGBA, CB_VAL); diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c index d01ef2e2d52..d63a13fad00 100644 --- a/source/blender/nodes/intern/node_exec.c +++ b/source/blender/nodes/intern/node_exec.c @@ -88,7 +88,7 @@ void node_init_output_index(bNodeSocket *sock, int *index) static struct bNodeStack *setup_stack(bNodeStack *stack, bNodeSocket *sock) { bNodeStack *ns = node_get_socket_stack(stack, sock); - float null_value[4]= {0.0f, 0.0f, 0.0f, 0.0f}; + float null_value[4] = {0.0f, 0.0f, 0.0f, 0.0f}; /* don't mess with remote socket stacks, these are initialized by other nodes! */ if (sock->link) diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c index 56704b981be..6130fe72af3 100644 --- a/source/blender/nodes/shader/node_shader_util.c +++ b/source/blender/nodes/shader/node_shader_util.c @@ -50,9 +50,9 @@ void nodestack_get_vec(float *in, short type_in, bNodeStack *ns) } else if (type_in==SOCK_VECTOR) { if (ns->sockettype==SOCK_FLOAT) { - in[0]= from[0]; - in[1]= from[0]; - in[2]= from[0]; + in[0] = from[0]; + in[1] = from[0]; + in[2] = from[0]; } else { copy_v3_v3(in, from); @@ -63,14 +63,14 @@ void nodestack_get_vec(float *in, short type_in, bNodeStack *ns) copy_v4_v4(in, from); } else if (ns->sockettype==SOCK_FLOAT) { - in[0]= from[0]; - in[1]= from[0]; - in[2]= from[0]; - in[3]= 1.0f; + in[0] = from[0]; + in[1] = from[0]; + in[2] = from[0]; + in[3] = 1.0f; } else { copy_v3_v3(in, from); - in[3]= 1.0f; + in[3] = 1.0f; } } } diff --git a/source/blender/nodes/shader/nodes/node_shader_add_shader.c b/source/blender/nodes/shader/nodes/node_shader_add_shader.c index ee8513a4119..ec868b2cc38 100644 --- a/source/blender/nodes/shader/nodes/node_shader_add_shader.c +++ b/source/blender/nodes/shader/nodes/node_shader_add_shader.c @@ -29,13 +29,13 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_add_shader_in[]= { +static bNodeSocketTemplate sh_node_add_shader_in[] = { { SOCK_SHADER, 1, N_("Shader")}, { SOCK_SHADER, 1, N_("Shader")}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_add_shader_out[]= { +static bNodeSocketTemplate sh_node_add_shader_out[] = { { SOCK_SHADER, 0, N_("Shader")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_attribute.c b/source/blender/nodes/shader/nodes/node_shader_attribute.c index 9c65323337e..9b2ed2f14f0 100644 --- a/source/blender/nodes/shader/nodes/node_shader_attribute.c +++ b/source/blender/nodes/shader/nodes/node_shader_attribute.c @@ -29,7 +29,7 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_attribute_out[]= { +static bNodeSocketTemplate sh_node_attribute_out[] = { { SOCK_RGBA, 0, N_("Color")}, { SOCK_VECTOR, 0, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX}, diff --git a/source/blender/nodes/shader/nodes/node_shader_background.c b/source/blender/nodes/shader/nodes/node_shader_background.c index 7d13c359a2b..d82c513540c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_background.c +++ b/source/blender/nodes/shader/nodes/node_shader_background.c @@ -29,13 +29,13 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_background_in[]= { +static bNodeSocketTemplate sh_node_background_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Strength"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000000.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_background_out[]= { +static bNodeSocketTemplate sh_node_background_out[] = { { SOCK_SHADER, 0, N_("Background")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_brightness.c b/source/blender/nodes/shader/nodes/node_shader_brightness.c index 2735553cdad..9c23a29cae9 100644 --- a/source/blender/nodes/shader/nodes/node_shader_brightness.c +++ b/source/blender/nodes/shader/nodes/node_shader_brightness.c @@ -31,14 +31,14 @@ /* **************** Brigh and contrsast ******************** */ -static bNodeSocketTemplate sh_node_brightcontrast_in[]= { +static bNodeSocketTemplate sh_node_brightcontrast_in[] = { { SOCK_RGBA, 1, N_("Color"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Bright"), 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Contrast"), 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_brightcontrast_out[]= { +static bNodeSocketTemplate sh_node_brightcontrast_out[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c index af4b6e1b8d0..7e023ff8547 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c @@ -29,7 +29,7 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_bsdf_anisotropic_in[]= { +static bNodeSocketTemplate sh_node_bsdf_anisotropic_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Roughness U"), 0.2f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Roughness V"), 0.2f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, @@ -38,7 +38,7 @@ static bNodeSocketTemplate sh_node_bsdf_anisotropic_in[]= { { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_bsdf_anisotropic_out[]= { +static bNodeSocketTemplate sh_node_bsdf_anisotropic_out[] = { { SOCK_SHADER, 0, N_("BSDF")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c index 021373ac40a..ad9f197afb8 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c @@ -29,14 +29,14 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_bsdf_diffuse_in[]= { +static bNodeSocketTemplate sh_node_bsdf_diffuse_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Roughness"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_bsdf_diffuse_out[]= { +static bNodeSocketTemplate sh_node_bsdf_diffuse_out[] = { { SOCK_SHADER, 0, N_("BSDF")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c index 827e349aca3..9e188092570 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c @@ -29,7 +29,7 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_bsdf_glass_in[]= { +static bNodeSocketTemplate sh_node_bsdf_glass_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Roughness"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("IOR"), 1.45f, 0.0f, 0.0f, 0.0f, 1.0f, 1000.0f}, @@ -37,7 +37,7 @@ static bNodeSocketTemplate sh_node_bsdf_glass_in[]= { { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_bsdf_glass_out[]= { +static bNodeSocketTemplate sh_node_bsdf_glass_out[] = { { SOCK_SHADER, 0, N_("BSDF")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c index 2c1adb4f0a3..5e32930b707 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c @@ -29,14 +29,14 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_bsdf_glossy_in[]= { +static bNodeSocketTemplate sh_node_bsdf_glossy_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Roughness"), 0.2f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_bsdf_glossy_out[]= { +static bNodeSocketTemplate sh_node_bsdf_glossy_out[] = { { SOCK_SHADER, 0, N_("BSDF")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c index 7412ce81dd1..3c7084886b7 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c @@ -29,13 +29,13 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_bsdf_translucent_in[]= { +static bNodeSocketTemplate sh_node_bsdf_translucent_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_bsdf_translucent_out[]= { +static bNodeSocketTemplate sh_node_bsdf_translucent_out[] = { { SOCK_SHADER, 0, N_("BSDF")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c index 8c945abdd0d..7fb452ad78d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c @@ -29,12 +29,12 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_bsdf_transparent_in[]= { +static bNodeSocketTemplate sh_node_bsdf_transparent_in[] = { { SOCK_RGBA, 1, N_("Color"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_bsdf_transparent_out[]= { +static bNodeSocketTemplate sh_node_bsdf_transparent_out[] = { { SOCK_SHADER, 0, N_("BSDF")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c index a32aec54b32..a4d25d42d4e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c @@ -29,14 +29,14 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_bsdf_velvet_in[]= { +static bNodeSocketTemplate sh_node_bsdf_velvet_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Sigma"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_bsdf_velvet_out[]= { +static bNodeSocketTemplate sh_node_bsdf_velvet_out[] = { { SOCK_SHADER, 0, N_("BSDF")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_bump.c b/source/blender/nodes/shader/nodes/node_shader_bump.c index 665ff582aa8..24ed825c36e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bump.c +++ b/source/blender/nodes/shader/nodes/node_shader_bump.c @@ -35,13 +35,13 @@ /* **************** BUMP ******************** */ -static bNodeSocketTemplate sh_node_bump_in[]= { +static bNodeSocketTemplate sh_node_bump_in[] = { { SOCK_FLOAT, 1, "Strength", 0.1f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f}, { SOCK_FLOAT, 1, "Height", 1.0f, 1.0f, 1.0f, 1.0f, -1000.0f, 1000.0f, PROP_NONE, SOCK_HIDE_VALUE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_bump_out[]= { +static bNodeSocketTemplate sh_node_bump_out[] = { { SOCK_VECTOR, 0, "Normal"}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_camera.c b/source/blender/nodes/shader/nodes/node_shader_camera.c index 17cec8196e8..fd36a94516e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_camera.c +++ b/source/blender/nodes/shader/nodes/node_shader_camera.c @@ -33,7 +33,7 @@ #include "node_shader_util.h" /* **************** CAMERA INFO ******************** */ -static bNodeSocketTemplate sh_node_camera_out[]= { +static bNodeSocketTemplate sh_node_camera_out[] = { { SOCK_VECTOR, 0, N_("View Vector")}, { SOCK_FLOAT, 0, N_("View Z Depth")}, { SOCK_FLOAT, 0, N_("View Distance")}, @@ -47,8 +47,8 @@ static void node_shader_exec_camera(void *data, bNode *UNUSED(node), bNodeStack ShadeInput *shi= ((ShaderCallData *)data)->shi; /* Data we need for shading. */ copy_v3_v3(out[0]->vec, shi->co); /* get view vector */ - out[1]->vec[0]= fabs(shi->co[2]); /* get view z-depth */ - out[2]->vec[0]= normalize_v3(out[0]->vec); /* get view distance */ + out[1]->vec[0] = fabs(shi->co[2]); /* get view z-depth */ + out[2]->vec[0] = normalize_v3(out[0]->vec); /* get view distance */ } } diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.c b/source/blender/nodes/shader/nodes/node_shader_curves.c index 83cb1d33628..9fa654c9740 100644 --- a/source/blender/nodes/shader/nodes/node_shader_curves.c +++ b/source/blender/nodes/shader/nodes/node_shader_curves.c @@ -34,13 +34,13 @@ /* **************** CURVE VEC ******************** */ -static bNodeSocketTemplate sh_node_curve_vec_in[]= { +static bNodeSocketTemplate sh_node_curve_vec_in[] = { { SOCK_FLOAT, 0, N_("Fac"), 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_curve_vec_out[]= { +static bNodeSocketTemplate sh_node_curve_vec_out[] = { { SOCK_VECTOR, 0, N_("Vector")}, { -1, 0, "" } }; @@ -88,13 +88,13 @@ void register_node_type_sh_curve_vec(bNodeTreeType *ttype) /* **************** CURVE RGB ******************** */ -static bNodeSocketTemplate sh_node_curve_rgb_in[]= { +static bNodeSocketTemplate sh_node_curve_rgb_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_FACTOR}, { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_curve_rgb_out[]= { +static bNodeSocketTemplate sh_node_curve_rgb_out[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_emission.c b/source/blender/nodes/shader/nodes/node_shader_emission.c index 4854d887592..0c4cb7ed51c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_emission.c +++ b/source/blender/nodes/shader/nodes/node_shader_emission.c @@ -29,13 +29,13 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_emission_in[]= { +static bNodeSocketTemplate sh_node_emission_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Strength"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000000.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_emission_out[]= { +static bNodeSocketTemplate sh_node_emission_out[] = { { SOCK_SHADER, 0, N_("Emission")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_fresnel.c b/source/blender/nodes/shader/nodes/node_shader_fresnel.c index 610a2149011..80913e6b07a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_fresnel.c +++ b/source/blender/nodes/shader/nodes/node_shader_fresnel.c @@ -28,12 +28,12 @@ #include "../node_shader_util.h" /* **************** Fresnel ******************** */ -static bNodeSocketTemplate sh_node_fresnel_in[]= { +static bNodeSocketTemplate sh_node_fresnel_in[] = { { SOCK_FLOAT, 1, N_("IOR"), 1.45f, 0.0f, 0.0f, 0.0f, 1.0f, 1000.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_fresnel_out[]= { +static bNodeSocketTemplate sh_node_fresnel_out[] = { { SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_gamma.c b/source/blender/nodes/shader/nodes/node_shader_gamma.c index 526868f73d3..c49554c44be 100644 --- a/source/blender/nodes/shader/nodes/node_shader_gamma.c +++ b/source/blender/nodes/shader/nodes/node_shader_gamma.c @@ -30,13 +30,13 @@ /* **************** Gamma Tools ******************** */ -static bNodeSocketTemplate sh_node_gamma_in[]= { +static bNodeSocketTemplate sh_node_gamma_in[] = { { SOCK_RGBA, 1, N_("Color"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Gamma"), 1.0f, 0.0f, 0.0f, 0.0f, 0.001f, 10.0f, PROP_UNSIGNED}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_gamma_out[]= { +static bNodeSocketTemplate sh_node_gamma_out[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_geom.c b/source/blender/nodes/shader/nodes/node_shader_geom.c index f23158ab5d4..eb3d462d616 100644 --- a/source/blender/nodes/shader/nodes/node_shader_geom.c +++ b/source/blender/nodes/shader/nodes/node_shader_geom.c @@ -37,7 +37,7 @@ /* **************** GEOMETRY ******************** */ /* output socket type definition */ -static bNodeSocketTemplate sh_node_geom_out[]= { +static bNodeSocketTemplate sh_node_geom_out[] = { { SOCK_VECTOR, 0, N_("Global")}, { SOCK_VECTOR, 0, N_("Local")}, { SOCK_VECTOR, 0, N_("View")}, @@ -92,12 +92,12 @@ static void node_shader_exec_geom(void *data, bNode *node, bNodeStack **UNUSED(i } copy_v3_v3(out[GEOM_OUT_VCOL]->vec, scol->col); - out[GEOM_OUT_VCOL]->vec[3]= scol->col[3]; - out[GEOM_OUT_VCOL_ALPHA]->vec[0]= scol->col[3]; + out[GEOM_OUT_VCOL]->vec[3] = scol->col[3]; + out[GEOM_OUT_VCOL_ALPHA]->vec[0] = scol->col[3]; } else { memcpy(out[GEOM_OUT_VCOL]->vec, defaultvcol, sizeof(defaultvcol)); - out[GEOM_OUT_VCOL_ALPHA]->vec[0]= 1.0f; + out[GEOM_OUT_VCOL_ALPHA]->vec[0] = 1.0f; } if (shi->osatex) { @@ -116,7 +116,7 @@ static void node_shader_exec_geom(void *data, bNode *node, bNodeStack **UNUSED(i } /* front/back, normal flipping was stored */ - out[GEOM_OUT_FRONTBACK]->vec[0]= (shi->flippednor)? 0.0f: 1.0f; + out[GEOM_OUT_FRONTBACK]->vec[0] = (shi->flippednor)? 0.0f: 1.0f; } } diff --git a/source/blender/nodes/shader/nodes/node_shader_geometry.c b/source/blender/nodes/shader/nodes/node_shader_geometry.c index 2ebd93218d6..acef885d2d4 100644 --- a/source/blender/nodes/shader/nodes/node_shader_geometry.c +++ b/source/blender/nodes/shader/nodes/node_shader_geometry.c @@ -29,7 +29,7 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_geometry_out[]= { +static bNodeSocketTemplate sh_node_geometry_out[] = { { SOCK_VECTOR, 0, N_("Position"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 0, N_("Normal"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 0, N_("Tangent"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, diff --git a/source/blender/nodes/shader/nodes/node_shader_holdout.c b/source/blender/nodes/shader/nodes/node_shader_holdout.c index dbd4ed8ab67..18ad4994c9b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_holdout.c +++ b/source/blender/nodes/shader/nodes/node_shader_holdout.c @@ -29,11 +29,11 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_holdout_in[]= { +static bNodeSocketTemplate sh_node_holdout_in[] = { { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_holdout_out[]= { +static bNodeSocketTemplate sh_node_holdout_out[] = { { SOCK_SHADER, 0, N_("Holdout")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c index b07650e33c0..b635ad1edd9 100644 --- a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c +++ b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c @@ -34,7 +34,7 @@ /* **************** Hue Saturation ******************** */ -static bNodeSocketTemplate sh_node_hue_sat_in[]= { +static bNodeSocketTemplate sh_node_hue_sat_in[] = { { SOCK_FLOAT, 1, N_("Hue"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Saturation"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_FACTOR}, { SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_FACTOR}, @@ -42,7 +42,7 @@ static bNodeSocketTemplate sh_node_hue_sat_in[]= { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_hue_sat_out[]= { +static bNodeSocketTemplate sh_node_hue_sat_out[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; @@ -60,9 +60,9 @@ static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float *hue, float *s hsv[2]*= *val; hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); - out[0]= mfac*in[0] + *fac*col[0]; - out[1]= mfac*in[1] + *fac*col[1]; - out[2]= mfac*in[2] + *fac*col[2]; + out[0] = mfac*in[0] + *fac*col[0]; + out[1] = mfac*in[1] + *fac*col[1]; + out[2] = mfac*in[2] + *fac*col[2]; } else { copy_v4_v4(out, in); diff --git a/source/blender/nodes/shader/nodes/node_shader_invert.c b/source/blender/nodes/shader/nodes/node_shader_invert.c index d1b773916d4..2ea858f4e34 100644 --- a/source/blender/nodes/shader/nodes/node_shader_invert.c +++ b/source/blender/nodes/shader/nodes/node_shader_invert.c @@ -35,13 +35,13 @@ /* **************** INVERT ******************** */ -static bNodeSocketTemplate sh_node_invert_in[]= { +static bNodeSocketTemplate sh_node_invert_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_invert_out[]= { +static bNodeSocketTemplate sh_node_invert_out[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_layer_weight.c b/source/blender/nodes/shader/nodes/node_shader_layer_weight.c index 6eacea10b5b..3058483ebef 100644 --- a/source/blender/nodes/shader/nodes/node_shader_layer_weight.c +++ b/source/blender/nodes/shader/nodes/node_shader_layer_weight.c @@ -29,12 +29,12 @@ /* **************** Layer Weight ******************** */ -static bNodeSocketTemplate sh_node_layer_weight_in[]= { +static bNodeSocketTemplate sh_node_layer_weight_in[] = { { SOCK_FLOAT, 1, N_("Blend"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_layer_weight_out[]= { +static bNodeSocketTemplate sh_node_layer_weight_out[] = { { SOCK_FLOAT, 0, N_("Fresnel"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Facing"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_light_falloff.c b/source/blender/nodes/shader/nodes/node_shader_light_falloff.c index aab5fa8060d..2dec244ae3a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_light_falloff.c +++ b/source/blender/nodes/shader/nodes/node_shader_light_falloff.c @@ -29,7 +29,7 @@ /* **************** INPUT ********************* */ -static bNodeSocketTemplate sh_node_light_falloff_in[]= { +static bNodeSocketTemplate sh_node_light_falloff_in[] = { { SOCK_FLOAT, 0, N_("Strength"), 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000000.0f}, { SOCK_FLOAT, 0, N_("Smooth"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, { -1, 0, "" } @@ -37,7 +37,7 @@ static bNodeSocketTemplate sh_node_light_falloff_in[]= { /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_light_falloff_out[]= { +static bNodeSocketTemplate sh_node_light_falloff_out[] = { { SOCK_FLOAT, 0, N_("Quadratic"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Linear"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Constant"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, diff --git a/source/blender/nodes/shader/nodes/node_shader_light_path.c b/source/blender/nodes/shader/nodes/node_shader_light_path.c index 264b1390688..b4a3d4e01e1 100644 --- a/source/blender/nodes/shader/nodes/node_shader_light_path.c +++ b/source/blender/nodes/shader/nodes/node_shader_light_path.c @@ -29,7 +29,7 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_light_path_out[]= { +static bNodeSocketTemplate sh_node_light_path_out[] = { { SOCK_FLOAT, 0, N_("Is Camera Ray"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Is Shadow Ray"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Is Diffuse Ray"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, diff --git a/source/blender/nodes/shader/nodes/node_shader_mapping.c b/source/blender/nodes/shader/nodes/node_shader_mapping.c index 4508f66543e..cedd3a4910c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mapping.c +++ b/source/blender/nodes/shader/nodes/node_shader_mapping.c @@ -33,12 +33,12 @@ #include "node_shader_util.h" /* **************** MAPPING ******************** */ -static bNodeSocketTemplate sh_node_mapping_in[]= { +static bNodeSocketTemplate sh_node_mapping_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_mapping_out[]= { +static bNodeSocketTemplate sh_node_mapping_out[] = { { SOCK_VECTOR, 0, N_("Vector")}, { -1, 0, "" } }; @@ -55,14 +55,14 @@ static void node_shader_exec_mapping(void *UNUSED(data), bNode *node, bNodeStack mul_m4_v3(texmap->mat, vec); if (texmap->flag & TEXMAP_CLIP_MIN) { - if (vec[0]<texmap->min[0]) vec[0]= texmap->min[0]; - if (vec[1]<texmap->min[1]) vec[1]= texmap->min[1]; - if (vec[2]<texmap->min[2]) vec[2]= texmap->min[2]; + if (vec[0]<texmap->min[0]) vec[0] = texmap->min[0]; + if (vec[1]<texmap->min[1]) vec[1] = texmap->min[1]; + if (vec[2]<texmap->min[2]) vec[2] = texmap->min[2]; } if (texmap->flag & TEXMAP_CLIP_MAX) { - if (vec[0]>texmap->max[0]) vec[0]= texmap->max[0]; - if (vec[1]>texmap->max[1]) vec[1]= texmap->max[1]; - if (vec[2]>texmap->max[2]) vec[2]= texmap->max[2]; + if (vec[0]>texmap->max[0]) vec[0] = texmap->max[0]; + if (vec[1]>texmap->max[1]) vec[1] = texmap->max[1]; + if (vec[2]>texmap->max[2]) vec[2] = texmap->max[2]; } } diff --git a/source/blender/nodes/shader/nodes/node_shader_material.c b/source/blender/nodes/shader/nodes/node_shader_material.c index bec43e05b24..bccf6d349cf 100644 --- a/source/blender/nodes/shader/nodes/node_shader_material.c +++ b/source/blender/nodes/shader/nodes/node_shader_material.c @@ -34,7 +34,7 @@ /* **************** MATERIAL ******************** */ -static bNodeSocketTemplate sh_node_material_in[]= { +static bNodeSocketTemplate sh_node_material_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_RGBA, 1, N_("Spec"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Refl"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, @@ -42,7 +42,7 @@ static bNodeSocketTemplate sh_node_material_in[]= { { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_material_out[]= { +static bNodeSocketTemplate sh_node_material_out[] = { { SOCK_RGBA, 0, N_("Color")}, { SOCK_FLOAT, 0, N_("Alpha")}, { SOCK_VECTOR, 0, N_("Normal")}, @@ -51,7 +51,7 @@ static bNodeSocketTemplate sh_node_material_out[]= { /* **************** EXTENDED MATERIAL ******************** */ -static bNodeSocketTemplate sh_node_material_ext_in[]= { +static bNodeSocketTemplate sh_node_material_ext_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_RGBA, 1, N_("Spec"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Refl"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, @@ -66,7 +66,7 @@ static bNodeSocketTemplate sh_node_material_ext_in[]= { { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_material_ext_out[]= { +static bNodeSocketTemplate sh_node_material_ext_out[] = { { SOCK_RGBA, 0, N_("Color")}, { SOCK_FLOAT, 0, N_("Alpha")}, { SOCK_VECTOR, 0, N_("Normal")}, @@ -84,7 +84,7 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in, ShaderCallData *shcd= data; float col[4]; bNodeSocket *sock; - char hasinput[NUM_MAT_IN]= {'\0'}; + char hasinput[NUM_MAT_IN] = {'\0'}; int i; /* note: cannot use the in[]->hasinput flags directly, as these are not necessarily @@ -157,20 +157,20 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in, copy_v3_v3(col, shrnode.spec); } else - col[0]= col[1]= col[2]= 0.0f; + col[0] = col[1] = col[2] = 0.0f; - col[3]= shrnode.alpha; + col[3] = shrnode.alpha; if (shi->do_preview) nodeAddToPreview(node, col, shi->xs, shi->ys, shi->do_manage); copy_v3_v3(out[MAT_OUT_COLOR]->vec, col); - out[MAT_OUT_ALPHA]->vec[0]= shrnode.alpha; + out[MAT_OUT_ALPHA]->vec[0] = shrnode.alpha; if (node->custom1 & SH_NODE_MAT_NEG) { - shi->vn[0]= -shi->vn[0]; - shi->vn[1]= -shi->vn[1]; - shi->vn[2]= -shi->vn[2]; + shi->vn[0] = -shi->vn[0]; + shi->vn[1] = -shi->vn[1]; + shi->vn[2] = -shi->vn[2]; } copy_v3_v3(out[MAT_OUT_NORMAL]->vec, shi->vn); @@ -222,7 +222,7 @@ static int gpu_shader_material(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUShadeInput shi; GPUShadeResult shr; bNodeSocket *sock; - char hasinput[NUM_MAT_IN]= {'\0'}; + char hasinput[NUM_MAT_IN] = {'\0'}; int i; /* note: cannot use the in[]->hasinput flags directly, as these are not necessarily diff --git a/source/blender/nodes/shader/nodes/node_shader_math.c b/source/blender/nodes/shader/nodes/node_shader_math.c index 956b4af8030..a70134b2325 100644 --- a/source/blender/nodes/shader/nodes/node_shader_math.c +++ b/source/blender/nodes/shader/nodes/node_shader_math.c @@ -34,13 +34,13 @@ /* **************** SCALAR MATH ******************** */ -static bNodeSocketTemplate sh_node_math_in[]= { +static bNodeSocketTemplate sh_node_math_in[] = { { SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_math_out[]= { +static bNodeSocketTemplate sh_node_math_out[] = { { SOCK_FLOAT, 0, N_("Value")}, { -1, 0, "" } }; @@ -51,44 +51,44 @@ bNodeStack **out) switch (node->custom1) { case 0: /* Add */ - out[0]->vec[0]= in[0]->vec[0] + in[1]->vec[0]; + out[0]->vec[0] = in[0]->vec[0] + in[1]->vec[0]; break; case 1: /* Subtract */ - out[0]->vec[0]= in[0]->vec[0] - in[1]->vec[0]; + out[0]->vec[0] = in[0]->vec[0] - in[1]->vec[0]; break; case 2: /* Multiply */ - out[0]->vec[0]= in[0]->vec[0] * in[1]->vec[0]; + out[0]->vec[0] = in[0]->vec[0] * in[1]->vec[0]; break; case 3: /* Divide */ { if (in[1]->vec[0]==0) /* We don't want to divide by zero. */ - out[0]->vec[0]= 0.0; + out[0]->vec[0] = 0.0; else - out[0]->vec[0]= in[0]->vec[0] / in[1]->vec[0]; + out[0]->vec[0] = in[0]->vec[0] / in[1]->vec[0]; } break; case 4: /* Sine */ { if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */ - out[0]->vec[0]= sin(in[0]->vec[0]); + out[0]->vec[0] = sin(in[0]->vec[0]); else - out[0]->vec[0]= sin(in[1]->vec[0]); + out[0]->vec[0] = sin(in[1]->vec[0]); } break; case 5: /* Cosine */ { if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */ - out[0]->vec[0]= cos(in[0]->vec[0]); + out[0]->vec[0] = cos(in[0]->vec[0]); else - out[0]->vec[0]= cos(in[1]->vec[0]); + out[0]->vec[0] = cos(in[1]->vec[0]); } break; case 6: /* Tangent */ { if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */ - out[0]->vec[0]= tan(in[0]->vec[0]); + out[0]->vec[0] = tan(in[0]->vec[0]); else - out[0]->vec[0]= tan(in[1]->vec[0]); + out[0]->vec[0] = tan(in[1]->vec[0]); } break; case 7: /* Arc-Sine */ @@ -96,16 +96,16 @@ bNodeStack **out) if (in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */ /* Can't do the impossible... */ if ( in[0]->vec[0] <= 1 && in[0]->vec[0] >= -1 ) - out[0]->vec[0]= asin(in[0]->vec[0]); + out[0]->vec[0] = asin(in[0]->vec[0]); else - out[0]->vec[0]= 0.0; + out[0]->vec[0] = 0.0; } else { /* Can't do the impossible... */ if ( in[1]->vec[0] <= 1 && in[1]->vec[0] >= -1 ) - out[0]->vec[0]= asin(in[1]->vec[0]); + out[0]->vec[0] = asin(in[1]->vec[0]); else - out[0]->vec[0]= 0.0; + out[0]->vec[0] = 0.0; } } break; @@ -114,83 +114,83 @@ bNodeStack **out) if (in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */ /* Can't do the impossible... */ if ( in[0]->vec[0] <= 1 && in[0]->vec[0] >= -1 ) - out[0]->vec[0]= acos(in[0]->vec[0]); + out[0]->vec[0] = acos(in[0]->vec[0]); else - out[0]->vec[0]= 0.0; + out[0]->vec[0] = 0.0; } else { /* Can't do the impossible... */ if ( in[1]->vec[0] <= 1 && in[1]->vec[0] >= -1 ) - out[0]->vec[0]= acos(in[1]->vec[0]); + out[0]->vec[0] = acos(in[1]->vec[0]); else - out[0]->vec[0]= 0.0; + out[0]->vec[0] = 0.0; } } break; case 9: /* Arc-Tangent */ { if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */ - out[0]->vec[0]= atan(in[0]->vec[0]); + out[0]->vec[0] = atan(in[0]->vec[0]); else - out[0]->vec[0]= atan(in[1]->vec[0]); + out[0]->vec[0] = atan(in[1]->vec[0]); } break; case 10: /* Power */ { /* Don't want any imaginary numbers... */ if ( in[0]->vec[0] >= 0 ) - out[0]->vec[0]= pow(in[0]->vec[0], in[1]->vec[0]); + out[0]->vec[0] = pow(in[0]->vec[0], in[1]->vec[0]); else - out[0]->vec[0]= 0.0; + out[0]->vec[0] = 0.0; } break; case 11: /* Logarithm */ { /* Don't want any imaginary numbers... */ if ( in[0]->vec[0] > 0 && in[1]->vec[0] > 0 ) - out[0]->vec[0]= log(in[0]->vec[0]) / log(in[1]->vec[0]); + out[0]->vec[0] = log(in[0]->vec[0]) / log(in[1]->vec[0]); else - out[0]->vec[0]= 0.0; + out[0]->vec[0] = 0.0; } break; case 12: /* Minimum */ { if ( in[0]->vec[0] < in[1]->vec[0] ) - out[0]->vec[0]= in[0]->vec[0]; + out[0]->vec[0] = in[0]->vec[0]; else - out[0]->vec[0]= in[1]->vec[0]; + out[0]->vec[0] = in[1]->vec[0]; } break; case 13: /* Maximum */ { if ( in[0]->vec[0] > in[1]->vec[0] ) - out[0]->vec[0]= in[0]->vec[0]; + out[0]->vec[0] = in[0]->vec[0]; else - out[0]->vec[0]= in[1]->vec[0]; + out[0]->vec[0] = in[1]->vec[0]; } break; case 14: /* Round */ { if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */ - out[0]->vec[0]= (in[0]->vec[0]<0)?(int)(in[0]->vec[0] - 0.5f):(int)(in[0]->vec[0] + 0.5f); + out[0]->vec[0] = (in[0]->vec[0]<0)?(int)(in[0]->vec[0] - 0.5f):(int)(in[0]->vec[0] + 0.5f); else - out[0]->vec[0]= (in[1]->vec[0]<0)?(int)(in[1]->vec[0] - 0.5f):(int)(in[1]->vec[0] + 0.5f); + out[0]->vec[0] = (in[1]->vec[0]<0)?(int)(in[1]->vec[0] - 0.5f):(int)(in[1]->vec[0] + 0.5f); } break; case 15: /* Less Than */ { if ( in[0]->vec[0] < in[1]->vec[0] ) - out[0]->vec[0]= 1.0f; + out[0]->vec[0] = 1.0f; else - out[0]->vec[0]= 0.0f; + out[0]->vec[0] = 0.0f; } break; case 16: /* Greater Than */ { if ( in[0]->vec[0] > in[1]->vec[0] ) - out[0]->vec[0]= 1.0f; + out[0]->vec[0] = 1.0f; else - out[0]->vec[0]= 0.0f; + out[0]->vec[0] = 0.0f; } break; } diff --git a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c index 53c1387ca1a..18dcc8f7fef 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c @@ -33,13 +33,13 @@ #include "node_shader_util.h" /* **************** MIX RGB ******************** */ -static bNodeSocketTemplate sh_node_mix_rgb_in[]= { +static bNodeSocketTemplate sh_node_mix_rgb_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { SOCK_RGBA, 1, N_("Color1"), 0.5f, 0.5f, 0.5f, 1.0f}, { SOCK_RGBA, 1, N_("Color2"), 0.5f, 0.5f, 0.5f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_mix_rgb_out[]= { +static bNodeSocketTemplate sh_node_mix_rgb_out[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_mix_shader.c b/source/blender/nodes/shader/nodes/node_shader_mix_shader.c index 80ee1a8499d..039e63a4dea 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mix_shader.c +++ b/source/blender/nodes/shader/nodes/node_shader_mix_shader.c @@ -29,14 +29,14 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_mix_shader_in[]= { +static bNodeSocketTemplate sh_node_mix_shader_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_SHADER, 1, N_("Shader")}, { SOCK_SHADER, 1, N_("Shader")}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_mix_shader_out[]= { +static bNodeSocketTemplate sh_node_mix_shader_out[] = { { SOCK_SHADER, 0, N_("Shader")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_normal.c b/source/blender/nodes/shader/nodes/node_shader_normal.c index bb0a85417d9..98a56c85279 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal.c +++ b/source/blender/nodes/shader/nodes/node_shader_normal.c @@ -33,12 +33,12 @@ #include "node_shader_util.h" /* **************** NORMAL ******************** */ -static bNodeSocketTemplate sh_node_normal_in[]= { +static bNodeSocketTemplate sh_node_normal_in[] = { { SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_normal_out[]= { +static bNodeSocketTemplate sh_node_normal_out[] = { { SOCK_VECTOR, 0, N_("Normal")}, { SOCK_FLOAT, 0, N_("Dot")}, { -1, 0, "" } @@ -68,7 +68,7 @@ static void node_shader_exec_normal(void *UNUSED(data), bNode *node, bNodeStack copy_v3_v3(out[0]->vec, ((bNodeSocketValueVector*)sock->default_value)->value); /* render normals point inside... the widget points outside */ - out[1]->vec[0]= -dot_v3v3(out[0]->vec, vec); + out[1]->vec[0] = -dot_v3v3(out[0]->vec, vec); } static int gpu_shader_normal(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/nodes/shader/nodes/node_shader_object_info.c b/source/blender/nodes/shader/nodes/node_shader_object_info.c index 1cafa01ecec..ef283004d46 100644 --- a/source/blender/nodes/shader/nodes/node_shader_object_info.c +++ b/source/blender/nodes/shader/nodes/node_shader_object_info.c @@ -29,7 +29,7 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_object_info_out[]= { +static bNodeSocketTemplate sh_node_object_info_out[] = { { SOCK_VECTOR, 0, N_("Location"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Object Index"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Material Index"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, diff --git a/source/blender/nodes/shader/nodes/node_shader_output.c b/source/blender/nodes/shader/nodes/node_shader_output.c index 24e10b65ed8..8d8c1a903a5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output.c +++ b/source/blender/nodes/shader/nodes/node_shader_output.c @@ -33,7 +33,7 @@ #include "node_shader_util.h" /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_output_in[]= { +static bNodeSocketTemplate sh_node_output_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_output_lamp.c b/source/blender/nodes/shader/nodes/node_shader_output_lamp.c index eb7208302fe..f24f5a85ff0 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_lamp.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_lamp.c @@ -29,7 +29,7 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_output_lamp_in[]= { +static bNodeSocketTemplate sh_node_output_lamp_in[] = { { SOCK_SHADER, 1, N_("Surface"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_output_material.c b/source/blender/nodes/shader/nodes/node_shader_output_material.c index e81744c44bd..03b0559fd8e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_material.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_material.c @@ -29,7 +29,7 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_output_material_in[]= { +static bNodeSocketTemplate sh_node_output_material_in[] = { { SOCK_SHADER, 1, N_("Surface")}, { SOCK_SHADER, 1, N_("Volume")}, { SOCK_FLOAT, 1, N_("Displacement"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, diff --git a/source/blender/nodes/shader/nodes/node_shader_output_world.c b/source/blender/nodes/shader/nodes/node_shader_output_world.c index 3a931c2af53..624805cd39f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_world.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_world.c @@ -29,7 +29,7 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_output_world_in[]= { +static bNodeSocketTemplate sh_node_output_world_in[] = { { SOCK_SHADER, 1, N_("Surface"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_SHADER, 1, N_("Volume"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_rgb.c b/source/blender/nodes/shader/nodes/node_shader_rgb.c index 5a19c61fe92..f37ff1d511b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_rgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_rgb.c @@ -33,7 +33,7 @@ #include "node_shader_util.h" /* **************** RGB ******************** */ -static bNodeSocketTemplate sh_node_rgb_out[]= { +static bNodeSocketTemplate sh_node_rgb_out[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c b/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c index 55f37b666e7..70fba161de9 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c +++ b/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c @@ -33,11 +33,11 @@ #include "node_shader_util.h" /* **************** SEPARATE RGBA ******************** */ -static bNodeSocketTemplate sh_node_seprgb_in[]= { +static bNodeSocketTemplate sh_node_seprgb_in[] = { { SOCK_RGBA, 1, N_("Image"), 0.8f, 0.8f, 0.8f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_seprgb_out[]= { +static bNodeSocketTemplate sh_node_seprgb_out[] = { { SOCK_FLOAT, 0, N_("R")}, { SOCK_FLOAT, 0, N_("G")}, { SOCK_FLOAT, 0, N_("B")}, @@ -73,13 +73,13 @@ void register_node_type_sh_seprgb(bNodeTreeType *ttype) /* **************** COMBINE RGB ******************** */ -static bNodeSocketTemplate sh_node_combrgb_in[]= { +static bNodeSocketTemplate sh_node_combrgb_in[] = { { SOCK_FLOAT, 1, N_("R"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_UNSIGNED}, { SOCK_FLOAT, 1, N_("G"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_UNSIGNED}, { SOCK_FLOAT, 1, N_("B"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_UNSIGNED}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_combrgb_out[]= { +static bNodeSocketTemplate sh_node_combrgb_out[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_squeeze.c b/source/blender/nodes/shader/nodes/node_shader_squeeze.c index afce712a38d..d95191de987 100644 --- a/source/blender/nodes/shader/nodes/node_shader_squeeze.c +++ b/source/blender/nodes/shader/nodes/node_shader_squeeze.c @@ -33,14 +33,14 @@ #include "node_shader_util.h" /* **************** VALUE SQUEEZE ******************** */ -static bNodeSocketTemplate sh_node_squeeze_in[]= { +static bNodeSocketTemplate sh_node_squeeze_in[] = { { SOCK_FLOAT, 1, N_("Value"), 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Width"), 1.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Center"), 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_squeeze_out[]= { +static bNodeSocketTemplate sh_node_squeeze_out[] = { { SOCK_FLOAT, 0, N_("Value")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_brick.c b/source/blender/nodes/shader/nodes/node_shader_tex_brick.c index 11f7fb94ae0..66bf0267586 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_brick.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_brick.c @@ -29,7 +29,7 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_tex_brick_in[]= { +static bNodeSocketTemplate sh_node_tex_brick_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { SOCK_RGBA, 1, N_("Color1"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_RGBA, 1, N_("Color2"), 0.2f, 0.2f, 0.2f, 1.0f, 0.0f, 1.0f}, @@ -42,7 +42,7 @@ static bNodeSocketTemplate sh_node_tex_brick_in[]= { { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_tex_brick_out[]= { +static bNodeSocketTemplate sh_node_tex_brick_out[] = { { SOCK_RGBA, 0, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_checker.c b/source/blender/nodes/shader/nodes/node_shader_tex_checker.c index 0c1e7dcb995..8a2ae2d40dc 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_checker.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_checker.c @@ -29,7 +29,7 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_tex_checker_in[]= { +static bNodeSocketTemplate sh_node_tex_checker_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { SOCK_RGBA, 1, N_("Color1"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_RGBA, 1, N_("Color2"), 0.2f, 0.2f, 0.2f, 1.0f, 0.0f, 1.0f}, @@ -37,7 +37,7 @@ static bNodeSocketTemplate sh_node_tex_checker_in[]= { { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_tex_checker_out[]= { +static bNodeSocketTemplate sh_node_tex_checker_out[] = { { SOCK_RGBA, 0, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c index 62b1cabd491..dd717874951 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c @@ -31,7 +31,7 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_tex_coord_out[]= { +static bNodeSocketTemplate sh_node_tex_coord_out[] = { { SOCK_VECTOR, 0, N_("Generated"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 0, N_("Normal"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 0, N_("UV"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c index ace0f0c8774..311ae3a9017 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c @@ -29,12 +29,12 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_tex_environment_in[]= { +static bNodeSocketTemplate sh_node_tex_environment_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_tex_environment_out[]= { +static bNodeSocketTemplate sh_node_tex_environment_out[] = { { SOCK_RGBA, 0, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c index a7f869155fa..0802ecdea1d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c @@ -29,12 +29,12 @@ /* **************** BLEND ******************** */ -static bNodeSocketTemplate sh_node_tex_gradient_in[]= { +static bNodeSocketTemplate sh_node_tex_gradient_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_tex_gradient_out[]= { +static bNodeSocketTemplate sh_node_tex_gradient_out[] = { { SOCK_RGBA, 0, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_image.c b/source/blender/nodes/shader/nodes/node_shader_tex_image.c index d6c757222b9..52f8c21fbb0 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c @@ -29,12 +29,12 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_tex_image_in[]= { +static bNodeSocketTemplate sh_node_tex_image_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_tex_image_out[]= { +static bNodeSocketTemplate sh_node_tex_image_out[] = { { SOCK_RGBA, 0, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Alpha"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_magic.c b/source/blender/nodes/shader/nodes/node_shader_tex_magic.c index b9f1b5c1d21..86feabbcc2b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_magic.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_magic.c @@ -29,14 +29,14 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_tex_magic_in[]= { +static bNodeSocketTemplate sh_node_tex_magic_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { SOCK_FLOAT, 1, N_("Scale"), 5.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f}, { SOCK_FLOAT, 1, N_("Distortion"), 1.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_tex_magic_out[]= { +static bNodeSocketTemplate sh_node_tex_magic_out[] = { { SOCK_RGBA, 0, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c index 60b4f65f0b4..cd4b5743e14 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c @@ -29,7 +29,7 @@ /* **************** MUSGRAVE ******************** */ -static bNodeSocketTemplate sh_node_tex_musgrave_in[]= { +static bNodeSocketTemplate sh_node_tex_musgrave_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { SOCK_FLOAT, 1, N_("Scale"), 5.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f}, { SOCK_FLOAT, 1, N_("Detail"), 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 16.0f}, @@ -40,7 +40,7 @@ static bNodeSocketTemplate sh_node_tex_musgrave_in[]= { { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_tex_musgrave_out[]= { +static bNodeSocketTemplate sh_node_tex_musgrave_out[] = { { SOCK_RGBA, 0, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c index bd049300048..18788f9e72c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c @@ -29,7 +29,7 @@ /* **************** NOISE ******************** */ -static bNodeSocketTemplate sh_node_tex_noise_in[]= { +static bNodeSocketTemplate sh_node_tex_noise_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { SOCK_FLOAT, 1, N_("Scale"), 5.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f}, { SOCK_FLOAT, 1, N_("Detail"), 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 16.0f}, @@ -37,7 +37,7 @@ static bNodeSocketTemplate sh_node_tex_noise_in[]= { { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_tex_noise_out[]= { +static bNodeSocketTemplate sh_node_tex_noise_out[] = { { SOCK_RGBA, 0, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c index 977d689ace6..7a1b853a7f4 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c @@ -29,12 +29,12 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_tex_sky_in[]= { +static bNodeSocketTemplate sh_node_tex_sky_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_tex_sky_out[]= { +static bNodeSocketTemplate sh_node_tex_sky_out[] = { { SOCK_RGBA, 0, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c index 22baa3853ac..d4cc24687b3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c @@ -29,13 +29,13 @@ /* **************** VORONOI ******************** */ -static bNodeSocketTemplate sh_node_tex_voronoi_in[]= { +static bNodeSocketTemplate sh_node_tex_voronoi_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { SOCK_FLOAT, 1, N_("Scale"), 5.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_tex_voronoi_out[]= { +static bNodeSocketTemplate sh_node_tex_voronoi_out[] = { { SOCK_RGBA, 0, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c index 8a099521ee9..8b23de0310c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c @@ -29,7 +29,7 @@ /* **************** WAVE ******************** */ -static bNodeSocketTemplate sh_node_tex_wave_in[]= { +static bNodeSocketTemplate sh_node_tex_wave_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, { SOCK_FLOAT, 1, N_("Scale"), 5.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f}, { SOCK_FLOAT, 1, N_("Distortion"), 0.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f}, @@ -38,7 +38,7 @@ static bNodeSocketTemplate sh_node_tex_wave_in[]= { { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_tex_wave_out[]= { +static bNodeSocketTemplate sh_node_tex_wave_out[] = { { SOCK_RGBA, 0, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_texture.c b/source/blender/nodes/shader/nodes/node_shader_texture.c index 73c3b846fe3..c27a95da5a0 100644 --- a/source/blender/nodes/shader/nodes/node_shader_texture.c +++ b/source/blender/nodes/shader/nodes/node_shader_texture.c @@ -35,11 +35,11 @@ #include "node_shader_util.h" /* **************** TEXTURE ******************** */ -static bNodeSocketTemplate sh_node_texture_in[]= { +static bNodeSocketTemplate sh_node_texture_in[] = { { SOCK_VECTOR, 1, "Vector", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, /* no limit */ { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_texture_out[]= { +static bNodeSocketTemplate sh_node_texture_out[] = { { SOCK_FLOAT, 0, N_("Value")}, { SOCK_RGBA, 0, N_("Color")}, { SOCK_VECTOR, 0, N_("Normal")}, @@ -52,7 +52,7 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b ShadeInput *shi= ((ShaderCallData *)data)->shi; TexResult texres; bNodeSocket *sock_vector= node->inputs.first; - float vec[3], nor[3]={0.0f, 0.0f, 0.0f}; + float vec[3], nor[3] = {0.0f, 0.0f, 0.0f}; int retval; short which_output = node->custom1; @@ -76,8 +76,8 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b float *fp= in[0]->data; float dxt[3], dyt[3]; - dxt[0]= fp[0]; dxt[1]= dxt[2]= 0.0f; - dyt[0]= fp[1]; dyt[1]= dyt[2]= 0.0f; + dxt[0] = fp[0]; dxt[1] = dxt[2] = 0.0f; + dyt[0] = fp[1]; dyt[1] = dyt[2] = 0.0f; retval= multitex_nodes((Tex *)node->id, vec, dxt, dyt, shi->osatex, &texres, thread, which_output, NULL, NULL); } else @@ -96,9 +96,9 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b /* intensity and color need some handling */ if (texres.talpha) - out[0]->vec[0]= texres.ta; + out[0]->vec[0] = texres.ta; else - out[0]->vec[0]= texres.tin; + out[0]->vec[0] = texres.tin; if ((retval & TEX_RGB) == 0) { copy_v3_fl(out[1]->vec, out[0]->vec[0]); diff --git a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c index d3094200f83..182487d343e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c @@ -33,11 +33,11 @@ #include "node_shader_util.h" /* **************** VALTORGB ******************** */ -static bNodeSocketTemplate sh_node_valtorgb_in[]= { +static bNodeSocketTemplate sh_node_valtorgb_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_valtorgb_out[]= { +static bNodeSocketTemplate sh_node_valtorgb_out[] = { { SOCK_RGBA, 0, N_("Color")}, { SOCK_FLOAT, 0, N_("Alpha")}, { -1, 0, "" } @@ -53,7 +53,7 @@ static void node_shader_exec_valtorgb(void *UNUSED(data), bNode *node, bNodeStac nodestack_get_vec(&fac, SOCK_FLOAT, in[0]); do_colorband(node->storage, fac, out[0]->vec); - out[1]->vec[0]= out[0]->vec[3]; + out[1]->vec[0] = out[0]->vec[3]; } } @@ -89,11 +89,11 @@ void register_node_type_sh_valtorgb(bNodeTreeType *ttype) /* **************** RGBTOBW ******************** */ -static bNodeSocketTemplate sh_node_rgbtobw_in[]= { +static bNodeSocketTemplate sh_node_rgbtobw_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_rgbtobw_out[]= { +static bNodeSocketTemplate sh_node_rgbtobw_out[] = { { SOCK_FLOAT, 0, N_("Val"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_value.c b/source/blender/nodes/shader/nodes/node_shader_value.c index 8a6c3c87e0d..a3d1e5afec2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_value.c +++ b/source/blender/nodes/shader/nodes/node_shader_value.c @@ -33,7 +33,7 @@ #include "node_shader_util.h" /* **************** VALUE ******************** */ -static bNodeSocketTemplate sh_node_value_out[]= { +static bNodeSocketTemplate sh_node_value_out[] = { /* XXX value nodes use the output sockets for buttons, so we need explicit limits here! */ { SOCK_FLOAT, 0, N_("Value"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX}, { -1, 0, "" } @@ -54,7 +54,7 @@ static void node_shader_exec_value(void *UNUSED(data), bNode *node, bNodeStack * bNodeSocket *sock= node->outputs.first; float val= ((bNodeSocketValueFloat*)sock->default_value)->value; - out[0]->vec[0]= val; + out[0]->vec[0] = val; } static int gpu_shader_value(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/nodes/shader/nodes/node_shader_vectMath.c b/source/blender/nodes/shader/nodes/node_shader_vectMath.c index 08f1cee6a02..2d9f1903c5b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vectMath.c +++ b/source/blender/nodes/shader/nodes/node_shader_vectMath.c @@ -35,13 +35,13 @@ /* **************** VECTOR MATH ******************** */ -static bNodeSocketTemplate sh_node_vect_math_in[]= { +static bNodeSocketTemplate sh_node_vect_math_in[] = { { SOCK_VECTOR, 1, N_("Vector"), 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE}, { SOCK_VECTOR, 1, N_("Vector"), 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_vect_math_out[]= { +static bNodeSocketTemplate sh_node_vect_math_out[] = { { SOCK_VECTOR, 0, N_("Vector")}, { SOCK_FLOAT, 0, N_("Value")}, { -1, 0, "" } @@ -55,46 +55,46 @@ static void node_shader_exec_vect_math(void *UNUSED(data), bNode *node, bNodeSta nodestack_get_vec(vec2, SOCK_VECTOR, in[1]); if (node->custom1 == 0) { /* Add */ - out[0]->vec[0]= vec1[0] + vec2[0]; - out[0]->vec[1]= vec1[1] + vec2[1]; - out[0]->vec[2]= vec1[2] + vec2[2]; + out[0]->vec[0] = vec1[0] + vec2[0]; + out[0]->vec[1] = vec1[1] + vec2[1]; + out[0]->vec[2] = vec1[2] + vec2[2]; - out[1]->vec[0]= (fabs(out[0]->vec[0]) + fabs(out[0]->vec[0]) + fabs(out[0]->vec[0])) / 3; + out[1]->vec[0] = (fabs(out[0]->vec[0]) + fabs(out[0]->vec[0]) + fabs(out[0]->vec[0])) / 3; } else if (node->custom1 == 1) { /* Subtract */ - out[0]->vec[0]= vec1[0] - vec2[0]; - out[0]->vec[1]= vec1[1] - vec2[1]; - out[0]->vec[2]= vec1[2] - vec2[2]; + out[0]->vec[0] = vec1[0] - vec2[0]; + out[0]->vec[1] = vec1[1] - vec2[1]; + out[0]->vec[2] = vec1[2] - vec2[2]; - out[1]->vec[0]= (fabs(out[0]->vec[0]) + fabs(out[0]->vec[0]) + fabs(out[0]->vec[0])) / 3; + out[1]->vec[0] = (fabs(out[0]->vec[0]) + fabs(out[0]->vec[0]) + fabs(out[0]->vec[0])) / 3; } else if (node->custom1 == 2) { /* Average */ - out[0]->vec[0]= vec1[0] + vec2[0]; - out[0]->vec[1]= vec1[1] + vec2[1]; - out[0]->vec[2]= vec1[2] + vec2[2]; + out[0]->vec[0] = vec1[0] + vec2[0]; + out[0]->vec[1] = vec1[1] + vec2[1]; + out[0]->vec[2] = vec1[2] + vec2[2]; out[1]->vec[0] = normalize_v3(out[0]->vec ); } else if (node->custom1 == 3) { /* Dot product */ - out[1]->vec[0]= (vec1[0] * vec2[0]) + (vec1[1] * vec2[1]) + (vec1[2] * vec2[2]); + out[1]->vec[0] = (vec1[0] * vec2[0]) + (vec1[1] * vec2[1]) + (vec1[2] * vec2[2]); } else if (node->custom1 == 4) { /* Cross product */ - out[0]->vec[0]= (vec1[1] * vec2[2]) - (vec1[2] * vec2[1]); - out[0]->vec[1]= (vec1[2] * vec2[0]) - (vec1[0] * vec2[2]); - out[0]->vec[2]= (vec1[0] * vec2[1]) - (vec1[1] * vec2[0]); + out[0]->vec[0] = (vec1[1] * vec2[2]) - (vec1[2] * vec2[1]); + out[0]->vec[1] = (vec1[2] * vec2[0]) - (vec1[0] * vec2[2]); + out[0]->vec[2] = (vec1[0] * vec2[1]) - (vec1[1] * vec2[0]); out[1]->vec[0] = normalize_v3(out[0]->vec ); } else if (node->custom1 == 5) { /* Normalize */ if (in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */ - out[0]->vec[0]= vec1[0]; - out[0]->vec[1]= vec1[1]; - out[0]->vec[2]= vec1[2]; + out[0]->vec[0] = vec1[0]; + out[0]->vec[1] = vec1[1]; + out[0]->vec[2] = vec1[2]; } else { - out[0]->vec[0]= vec2[0]; - out[0]->vec[1]= vec2[1]; - out[0]->vec[2]= vec2[2]; + out[0]->vec[0] = vec2[0]; + out[0]->vec[1] = vec2[1]; + out[0]->vec[2] = vec2[2]; } out[1]->vec[0] = normalize_v3(out[0]->vec ); diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c b/source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c index 366f50ab4fc..5451eb303cc 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c +++ b/source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c @@ -29,13 +29,13 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_volume_isotropic_in[]= { +static bNodeSocketTemplate sh_node_volume_isotropic_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Density"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_volume_isotropic_out[]= { +static bNodeSocketTemplate sh_node_volume_isotropic_out[] = { { SOCK_SHADER, 0, N_("Volume")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_transparent.c b/source/blender/nodes/shader/nodes/node_shader_volume_transparent.c index 9d48f613d34..ad7d7fceda3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_transparent.c +++ b/source/blender/nodes/shader/nodes/node_shader_volume_transparent.c @@ -29,13 +29,13 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_volume_transparent_in[]= { +static bNodeSocketTemplate sh_node_volume_transparent_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Density"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_volume_transparent_out[]= { +static bNodeSocketTemplate sh_node_volume_transparent_out[] = { { SOCK_SHADER, 0, N_("Volume")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_at.c b/source/blender/nodes/texture/nodes/node_texture_at.c index 9e557705b3f..4c2d276b902 100644 --- a/source/blender/nodes/texture/nodes/node_texture_at.c +++ b/source/blender/nodes/texture/nodes/node_texture_at.c @@ -33,12 +33,12 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Texture"), 0.0f, 0.0f, 0.0f, 1.0f }, { SOCK_VECTOR, 1, N_("Coordinates"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Texture") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_bricks.c b/source/blender/nodes/texture/nodes/node_texture_bricks.c index c575547b3ce..b4f81f08e43 100644 --- a/source/blender/nodes/texture/nodes/node_texture_bricks.c +++ b/source/blender/nodes/texture/nodes/node_texture_bricks.c @@ -35,7 +35,7 @@ #include <math.h> -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Bricks 1"), 0.596f, 0.282f, 0.0f, 1.0f }, { SOCK_RGBA, 1, N_("Bricks 2"), 0.632f, 0.504f, 0.05f, 1.0f }, { SOCK_RGBA, 1, N_("Mortar"), 0.0f, 0.0f, 0.0f, 1.0f }, @@ -45,7 +45,7 @@ static bNodeSocketTemplate inputs[]= { { SOCK_FLOAT, 1, N_("Row Height"), 0.25f, 0.0f, 0.0f, 0.0f, 0.001f, 99.0f, PROP_UNSIGNED }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_checker.c b/source/blender/nodes/texture/nodes/node_texture_checker.c index 72e3520ebd4..1f653d1f7b9 100644 --- a/source/blender/nodes/texture/nodes/node_texture_checker.c +++ b/source/blender/nodes/texture/nodes/node_texture_checker.c @@ -34,13 +34,13 @@ #include "NOD_texture.h" #include <math.h> -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color1"), 1.0f, 0.0f, 0.0f, 1.0f }, { SOCK_RGBA, 1, N_("Color2"), 1.0f, 1.0f, 1.0f, 1.0f }, { SOCK_FLOAT, 1, N_("Size"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 100.0f, PROP_UNSIGNED }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_compose.c b/source/blender/nodes/texture/nodes/node_texture_compose.c index 77521190590..25da4f19e52 100644 --- a/source/blender/nodes/texture/nodes/node_texture_compose.c +++ b/source/blender/nodes/texture/nodes/node_texture_compose.c @@ -33,14 +33,14 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_FLOAT, 1, N_("Red"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Green"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Blue"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_coord.c b/source/blender/nodes/texture/nodes/node_texture_coord.c index 2add5c820eb..971520ebc38 100644 --- a/source/blender/nodes/texture/nodes/node_texture_coord.c +++ b/source/blender/nodes/texture/nodes/node_texture_coord.c @@ -33,7 +33,7 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_VECTOR, 0, N_("Coordinates") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_curves.c b/source/blender/nodes/texture/nodes/node_texture_curves.c index 6ccb5e1e83f..5980f938938 100644 --- a/source/blender/nodes/texture/nodes/node_texture_curves.c +++ b/source/blender/nodes/texture/nodes/node_texture_curves.c @@ -36,7 +36,7 @@ /* **************** CURVE Time ******************** */ /* custom1 = sfra, custom2 = efra */ -static bNodeSocketTemplate time_outputs[]= { +static bNodeSocketTemplate time_outputs[] = { { SOCK_FLOAT, 0, N_("Value") }, { -1, 0, "" } }; @@ -83,12 +83,12 @@ void register_node_type_tex_curve_time(bNodeTreeType *ttype) } /* **************** CURVE RGB ******************** */ -static bNodeSocketTemplate rgb_inputs[]= { +static bNodeSocketTemplate rgb_inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate rgb_outputs[]= { +static bNodeSocketTemplate rgb_outputs[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_decompose.c b/source/blender/nodes/texture/nodes/node_texture_decompose.c index eae34e2ce47..a2875c31d9e 100644 --- a/source/blender/nodes/texture/nodes/node_texture_decompose.c +++ b/source/blender/nodes/texture/nodes/node_texture_decompose.c @@ -34,11 +34,11 @@ #include "NOD_texture.h" #include <math.h> -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_FLOAT, 0, N_("Red") }, { SOCK_FLOAT, 0, N_("Green") }, { SOCK_FLOAT, 0, N_("Blue") }, diff --git a/source/blender/nodes/texture/nodes/node_texture_distance.c b/source/blender/nodes/texture/nodes/node_texture_distance.c index 07424a81587..8c3b1555d5d 100644 --- a/source/blender/nodes/texture/nodes/node_texture_distance.c +++ b/source/blender/nodes/texture/nodes/node_texture_distance.c @@ -35,13 +35,13 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_VECTOR, 1, N_("Coordinate 1"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE }, { SOCK_VECTOR, 1, N_("Coordinate 2"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_FLOAT, 0, N_("Value") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c index 6863eab9150..b5e9969a830 100644 --- a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c +++ b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c @@ -34,7 +34,7 @@ #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_FLOAT, 1, N_("Hue"), 0.0f, 0.0f, 0.0f, 0.0f, -0.5f, 0.5f, PROP_NONE }, { SOCK_FLOAT, 1, N_("Saturation"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_FACTOR }, { SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_FACTOR }, @@ -42,7 +42,7 @@ static bNodeSocketTemplate inputs[]= { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color") }, { -1, 0, "" } }; @@ -56,14 +56,14 @@ static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float hue, float sat hsv[0]+= (hue - 0.5f); if (hsv[0]>1.0f) hsv[0]-=1.0f; else if (hsv[0]<0.0f) hsv[0]+= 1.0f; hsv[1]*= sat; - if (hsv[1]>1.0f) hsv[1]= 1.0f; else if (hsv[1]<0.0f) hsv[1]= 0.0f; + if (hsv[1]>1.0f) hsv[1] = 1.0f; else if (hsv[1]<0.0f) hsv[1] = 0.0f; hsv[2]*= val; - if (hsv[2]>1.0f) hsv[2]= 1.0f; else if (hsv[2]<0.0f) hsv[2]= 0.0f; + if (hsv[2]>1.0f) hsv[2] = 1.0f; else if (hsv[2]<0.0f) hsv[2] = 0.0f; hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); - out[0]= mfac*in[0] + fac*col[0]; - out[1]= mfac*in[1] + fac*col[1]; - out[2]= mfac*in[2] + fac*col[2]; + out[0] = mfac*in[0] + fac*col[0]; + out[1] = mfac*in[1] + fac*col[1]; + out[2] = mfac*in[2] + fac*col[2]; } else { copy_v4_v4(out, in); diff --git a/source/blender/nodes/texture/nodes/node_texture_image.c b/source/blender/nodes/texture/nodes/node_texture_image.c index 7ce91c37295..f3fdaf0bb64 100644 --- a/source/blender/nodes/texture/nodes/node_texture_image.c +++ b/source/blender/nodes/texture/nodes/node_texture_image.c @@ -33,7 +33,7 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_invert.c b/source/blender/nodes/texture/nodes/node_texture_invert.c index 934a60451a4..9c2963d2dc2 100644 --- a/source/blender/nodes/texture/nodes/node_texture_invert.c +++ b/source/blender/nodes/texture/nodes/node_texture_invert.c @@ -34,12 +34,12 @@ #include "NOD_texture.h" /* **************** INVERT ******************** */ -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_math.c b/source/blender/nodes/texture/nodes/node_texture_math.c index b5ebc1f2c45..95d70ccc7d6 100644 --- a/source/blender/nodes/texture/nodes/node_texture_math.c +++ b/source/blender/nodes/texture/nodes/node_texture_math.c @@ -35,13 +35,13 @@ /* **************** SCALAR MATH ******************** */ -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -100.0f, 100.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -100.0f, 100.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_FLOAT, 0, N_("Value")}, { -1, 0, "" } }; @@ -112,7 +112,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor { /* Only raise negative numbers by full integers */ if ( in0 >= 0 ) { - out[0]= pow(in0, in1); + out[0] = pow(in0, in1); } else { float y_mod_1 = fmod(in1, 1); diff --git a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c index bf6cb7a3262..fe04854c734 100644 --- a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c +++ b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c @@ -34,13 +34,13 @@ #include "NOD_texture.h" /* **************** MIX RGB ******************** */ -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_FLOAT, 1, N_("Factor"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR }, { SOCK_RGBA, 1, N_("Color1"), 0.5f, 0.5f, 0.5f, 1.0f }, { SOCK_RGBA, 1, N_("Color2"), 0.5f, 0.5f, 0.5f, 1.0f }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c index fdd3b97ad59..5867dc03050 100644 --- a/source/blender/nodes/texture/nodes/node_texture_output.c +++ b/source/blender/nodes/texture/nodes/node_texture_output.c @@ -34,7 +34,7 @@ #include "NOD_texture.h" /* **************** COMPOSITE ******************** */ -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, PROP_DIRECTION}, { -1, 0, "" } diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c index 1f724292661..8876d98b9b2 100644 --- a/source/blender/nodes/texture/nodes/node_texture_proc.c +++ b/source/blender/nodes/texture/nodes/node_texture_proc.c @@ -40,12 +40,12 @@ */ -static bNodeSocketTemplate outputs_both[]= { +static bNodeSocketTemplate outputs_both[] = { { SOCK_RGBA, 0, N_("Color"), 1.0f, 0.0f, 0.0f, 1.0f }, { SOCK_VECTOR, 0, N_("Normal"), 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, PROP_DIRECTION }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs_color_only[]= { +static bNodeSocketTemplate outputs_color_only[] = { { SOCK_RGBA, 0, N_("Color") }, { -1, 0, "" } }; @@ -138,7 +138,7 @@ static int count_outputs(bNode *node) /* --- VORONOI -- */ -static bNodeSocketTemplate voronoi_inputs[]= { +static bNodeSocketTemplate voronoi_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("W1"), 1.0f, 0.0f, 0.0f, 0.0f, -2.0f, 2.0f, PROP_NONE }, { SOCK_FLOAT, 1, N_("W2"), 0.0f, 0.0f, 0.0f, 0.0f, -2.0f, 2.0f, PROP_NONE }, @@ -163,7 +163,7 @@ static void voronoi_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short th ProcDef(voronoi) /* --- BLEND -- */ -static bNodeSocketTemplate blend_inputs[]= { +static bNodeSocketTemplate blend_inputs[] = { COMMON_INPUTS, { -1, 0, "" } }; @@ -171,7 +171,7 @@ ProcNoInputs(blend) ProcDef(blend) /* -- MAGIC -- */ -static bNodeSocketTemplate magic_inputs[]= { +static bNodeSocketTemplate magic_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("Turbulence"), 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f, PROP_UNSIGNED }, { -1, 0, "" } @@ -183,7 +183,7 @@ static void magic_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thre ProcDef(magic) /* --- MARBLE --- */ -static bNodeSocketTemplate marble_inputs[]= { +static bNodeSocketTemplate marble_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Turbulence"), 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f, PROP_UNSIGNED }, @@ -197,7 +197,7 @@ static void marble_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thr ProcDef(marble) /* --- CLOUDS --- */ -static bNodeSocketTemplate clouds_inputs[]= { +static bNodeSocketTemplate clouds_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED }, { -1, 0, "" } @@ -209,7 +209,7 @@ static void clouds_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thr ProcDef(clouds) /* --- DISTORTED NOISE --- */ -static bNodeSocketTemplate distnoise_inputs[]= { +static bNodeSocketTemplate distnoise_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Distortion"), 1.00f, 0.0f, 0.0f, 0.0f, 0.0000f, 10.0f, PROP_UNSIGNED }, @@ -223,7 +223,7 @@ static void distnoise_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short ProcDef(distnoise) /* --- WOOD --- */ -static bNodeSocketTemplate wood_inputs[]= { +static bNodeSocketTemplate wood_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Turbulence"), 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f, PROP_UNSIGNED }, @@ -237,7 +237,7 @@ static void wood_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short threa ProcDef(wood) /* --- MUSGRAVE --- */ -static bNodeSocketTemplate musgrave_inputs[]= { +static bNodeSocketTemplate musgrave_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("H"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Lacunarity"), 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 6.0f, PROP_UNSIGNED }, @@ -258,7 +258,7 @@ static void musgrave_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short t ProcDef(musgrave) /* --- NOISE --- */ -static bNodeSocketTemplate noise_inputs[]= { +static bNodeSocketTemplate noise_inputs[] = { COMMON_INPUTS, { -1, 0, "" } }; @@ -266,7 +266,7 @@ ProcNoInputs(noise) ProcDef(noise) /* --- STUCCI --- */ -static bNodeSocketTemplate stucci_inputs[]= { +static bNodeSocketTemplate stucci_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Turbulence"), 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f, PROP_UNSIGNED }, diff --git a/source/blender/nodes/texture/nodes/node_texture_rotate.c b/source/blender/nodes/texture/nodes/node_texture_rotate.c index 8f50eaece4f..1b1d57044a3 100644 --- a/source/blender/nodes/texture/nodes/node_texture_rotate.c +++ b/source/blender/nodes/texture/nodes/node_texture_rotate.c @@ -35,14 +35,14 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Turns"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE }, { SOCK_VECTOR, 1, N_("Axis"), 0.0f, 0.0f, 1.0f, 0.0f, -1.0f, 1.0f, PROP_DIRECTION }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_scale.c b/source/blender/nodes/texture/nodes/node_texture_scale.c index 4bc283fc33c..56562724fb9 100644 --- a/source/blender/nodes/texture/nodes/node_texture_scale.c +++ b/source/blender/nodes/texture/nodes/node_texture_scale.c @@ -33,13 +33,13 @@ #include <math.h> #include "node_texture_util.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f }, { SOCK_VECTOR, 1, N_("Scale"), 1.0f, 1.0f, 1.0f, 0.0f, -10.0f, 10.0f, PROP_XYZ }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_texture.c b/source/blender/nodes/texture/nodes/node_texture_texture.c index 4832f19f2c7..cc7367a7632 100644 --- a/source/blender/nodes/texture/nodes/node_texture_texture.c +++ b/source/blender/nodes/texture/nodes/node_texture_texture.c @@ -35,13 +35,13 @@ #include "RE_shader_ext.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color1"), 1.0f, 1.0f, 1.0f, 1.0f }, { SOCK_RGBA, 1, N_("Color2"), 0.0f, 0.0f, 0.0f, 1.0f }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_translate.c b/source/blender/nodes/texture/nodes/node_texture_translate.c index bce60198a5d..a95cb00a47d 100644 --- a/source/blender/nodes/texture/nodes/node_texture_translate.c +++ b/source/blender/nodes/texture/nodes/node_texture_translate.c @@ -34,13 +34,13 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 1, N_("Offset"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_TRANSLATION }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_valToNor.c b/source/blender/nodes/texture/nodes/node_texture_valToNor.c index fe3ea908e26..bbfc1fa616b 100644 --- a/source/blender/nodes/texture/nodes/node_texture_valToNor.c +++ b/source/blender/nodes/texture/nodes/node_texture_valToNor.c @@ -33,13 +33,13 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_FLOAT, 1, N_("Val"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE }, { SOCK_FLOAT, 1, N_("Nabla"), 0.025f, 0.0f, 0.0f, 0.0f, 0.001f, 0.1f, PROP_UNSIGNED }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_VECTOR, 0, N_("Normal") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c index 515613509f6..78635453fc1 100644 --- a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c +++ b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c @@ -34,11 +34,11 @@ #include "NOD_texture.h" /* **************** VALTORGB ******************** */ -static bNodeSocketTemplate valtorgb_in[]= { +static bNodeSocketTemplate valtorgb_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { -1, 0, "" } }; -static bNodeSocketTemplate valtorgb_out[]= { +static bNodeSocketTemplate valtorgb_out[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; @@ -77,11 +77,11 @@ void register_node_type_tex_valtorgb(bNodeTreeType *ttype) } /* **************** RGBTOBW ******************** */ -static bNodeSocketTemplate rgbtobw_in[]= { +static bNodeSocketTemplate rgbtobw_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate rgbtobw_out[]= { +static bNodeSocketTemplate rgbtobw_out[] = { { SOCK_FLOAT, 0, N_("Val"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index 96cc84879c1..e32239b148d 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -164,11 +164,11 @@ bool KX_BlenderRenderTools::RayHit(KX_ClientObjectInfo* client, KX_RayCast* resu left = (dir.cross(resultnormal)).safe_normalized(); // for the up vector, we take the 'resultnormal' returned by the physics - double maat[16]={ - left[0], left[1], left[2], 0, - dir[0], dir[1], dir[2], 0, - resultnormal[0],resultnormal[1],resultnormal[2], 0, - 0, 0, 0, 1}; + double maat[16] = {left[0], left[1], left[2], 0, + dir[0], dir[1], dir[2], 0, + resultnormal[0], resultnormal[1], resultnormal[2], 0, + 0, 0, 0, 1}; + glTranslated(resultpoint[0],resultpoint[1],resultpoint[2]); //glMultMatrixd(oglmatrix); glMultMatrixd(maat); @@ -227,16 +227,17 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat left *= size[0]; dir *= size[1]; up *= size[2]; - double maat[16]={ - left[0], left[1],left[2], 0, - dir[0], dir[1],dir[2],0, - up[0],up[1],up[2],0, - 0,0,0,1}; - glTranslated(objpos[0],objpos[1],objpos[2]); - glMultMatrixd(maat); - - } else - { + + double maat[16] = {left[0], left[1], left[2], 0, + dir[0], dir[1], dir[2], 0, + up[0], up[1], up[2], 0, + 0, 0, 0, 1}; + + glTranslated(objpos[0],objpos[1],objpos[2]); + glMultMatrixd(maat); + + } + else { if (objectdrawmode & RAS_IPolyMaterial::SHADOW) { // shadow must be cast to the ground, physics system needed here! diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 4969eae67f2..0bd09146f3a 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -489,9 +489,9 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, // for some reason loc.setValue(pchan->loc) fails if (pchan) { - pchan->loc[0]= loc[0]; pchan->loc[1]= loc[1]; pchan->loc[2]= loc[2]; - pchan->size[0]= size[0]; pchan->size[1]= size[1]; pchan->size[2]= size[2]; - pchan->quat[0]= quat[3]; pchan->quat[1]= quat[0]; pchan->quat[2]= quat[1]; pchan->quat[3]= quat[2]; /* notice xyzw -> wxyz is intentional */ + pchan->loc[0] = loc[0]; pchan->loc[1] = loc[1]; pchan->loc[2] = loc[2]; + pchan->size[0] = size[0]; pchan->size[1] = size[1]; pchan->size[2] = size[2]; + pchan->quat[0] = quat[3]; pchan->quat[1] = quat[0]; pchan->quat[2] = quat[1]; pchan->quat[3] = quat[2]; /* notice xyzw -> wxyz is intentional */ } } @@ -554,13 +554,13 @@ PyAttributeDef BL_ActionActuator::Attributes[] = { PyObject *BL_ActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v); + BL_ActionActuator* self = static_cast<BL_ActionActuator*>(self_v); return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : ""); } int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v); + BL_ActionActuator* self = static_cast<BL_ActionActuator*>(self_v); if (!PyUnicode_Check(value)) { @@ -592,7 +592,7 @@ PyObject *BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA return NULL; #if 0 // XXX To be removed in a later version (first removed in 2.64) - BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v); + BL_ActionActuator* self = static_cast<BL_ActionActuator*>(self_v); PyObject *ret= PyList_New(0); PyObject *item; @@ -619,13 +619,13 @@ PyObject *BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA PyObject *BL_ActionActuator::pyattr_get_use_continue(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v); + BL_ActionActuator* self = static_cast<BL_ActionActuator*>(self_v); return PyBool_FromLong(self->m_flag & ACT_FLAG_CONTINUE); } int BL_ActionActuator::pyattr_set_use_continue(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v); + BL_ActionActuator* self = static_cast<BL_ActionActuator*>(self_v); if (PyObject_IsTrue(value)) self->m_flag |= ACT_FLAG_CONTINUE; @@ -637,13 +637,13 @@ int BL_ActionActuator::pyattr_set_use_continue(void *self_v, const KX_PYATTRIBUT PyObject *BL_ActionActuator::pyattr_get_frame(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v); + BL_ActionActuator* self = static_cast<BL_ActionActuator*>(self_v); return PyFloat_FromDouble(((KX_GameObject*)self->m_gameobj)->GetActionFrame(self->m_layer)); } int BL_ActionActuator::pyattr_set_frame(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v); + BL_ActionActuator* self = static_cast<BL_ActionActuator*>(self_v); ((KX_GameObject*)self->m_gameobj)->SetActionFrame(self->m_layer, PyFloat_AsDouble(value)); diff --git a/source/gameengine/Converter/BL_ArmatureChannel.cpp b/source/gameengine/Converter/BL_ArmatureChannel.cpp index 8f5547c337c..7cf895255ba 100644 --- a/source/gameengine/Converter/BL_ArmatureChannel.cpp +++ b/source/gameengine/Converter/BL_ArmatureChannel.cpp @@ -149,7 +149,7 @@ PyAttributeDef BL_ArmatureChannel::AttributesPtr[] = { PyObject *BL_ArmatureChannel::py_attr_getattr(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef) { - BL_ArmatureChannel* self= static_cast<BL_ArmatureChannel*>(self_v); + BL_ArmatureChannel* self = static_cast<BL_ArmatureChannel*>(self_v); bPoseChannel* channel = self->m_posechannel; int attr_order = attrdef-Attributes; @@ -177,7 +177,7 @@ PyObject *BL_ArmatureChannel::py_attr_getattr(void *self_v, const struct KX_PYAT int BL_ArmatureChannel::py_attr_setattr(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - BL_ArmatureChannel* self= static_cast<BL_ArmatureChannel*>(self_v); + BL_ArmatureChannel* self = static_cast<BL_ArmatureChannel*>(self_v); bPoseChannel* channel = self->m_posechannel; int attr_order = attrdef-Attributes; @@ -300,7 +300,7 @@ PyObject *BL_ArmatureChannel::py_attr_get_joint_rotation(void *self_v, const str int BL_ArmatureChannel::py_attr_set_joint_rotation(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - BL_ArmatureChannel* self= static_cast<BL_ArmatureChannel*>(self_v); + BL_ArmatureChannel* self = static_cast<BL_ArmatureChannel*>(self_v); bPoseChannel* pchan = self->m_posechannel; PyObject *item; float joints[3]; diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.cpp b/source/gameengine/Converter/BL_ArmatureConstraint.cpp index 169205d79e7..b8ad117a220 100644 --- a/source/gameengine/Converter/BL_ArmatureConstraint.cpp +++ b/source/gameengine/Converter/BL_ArmatureConstraint.cpp @@ -288,7 +288,7 @@ PyAttributeDef BL_ArmatureConstraint::Attributes[] = { PyObject *BL_ArmatureConstraint::py_attr_getattr(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef) { - BL_ArmatureConstraint* self= static_cast<BL_ArmatureConstraint*>(self_v); + BL_ArmatureConstraint* self = static_cast<BL_ArmatureConstraint*>(self_v); bConstraint* constraint = self->m_constraint; bKinematicConstraint* ikconstraint = (constraint && constraint->type == CONSTRAINT_TYPE_KINEMATIC) ? (bKinematicConstraint*)constraint->data : NULL; int attr_order = attrdef-Attributes; @@ -353,7 +353,7 @@ PyObject *BL_ArmatureConstraint::py_attr_getattr(void *self_v, const struct KX_P int BL_ArmatureConstraint::py_attr_setattr(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - BL_ArmatureConstraint* self= static_cast<BL_ArmatureConstraint*>(self_v); + BL_ArmatureConstraint* self = static_cast<BL_ArmatureConstraint*>(self_v); bConstraint* constraint = self->m_constraint; bKinematicConstraint* ikconstraint = (constraint && constraint->type == CONSTRAINT_TYPE_KINEMATIC) ? (bKinematicConstraint*)constraint->data : NULL; int attr_order = attrdef-Attributes; diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index e23fbd57d49..982988cc088 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -626,7 +626,7 @@ static bool ConvertMaterial( if (!material->cubemap[i]->cube[0]) BL_Texture::SplitEnvMap(material->cubemap[i]); - material->texname[i]= material->cubemap[i]->ima->id.name; + material->texname[i] = material->cubemap[i]->ima->id.name; material->mapping[i].mapping |= USEENV; } } @@ -777,7 +777,7 @@ static bool ConvertMaterial( const char *uvName = "", *uv2Name = ""; - uv2[0]= uv2[1]= uv2[2]= uv2[3]= MT_Point2(0.0f, 0.0f); + uv2[0] = uv2[1] = uv2[2] = uv2[3] = MT_Point2(0.0f, 0.0f); /* No material, what to do? let's see what is in the UV and set the material accordingly * light and visible is always on */ @@ -798,7 +798,7 @@ static bool ConvertMaterial( material->alphablend = GEMAT_SOLID; material->tile = 0; - uv[0]= uv[1]= uv[2]= uv[3]= MT_Point2(0.0f, 0.0f); + uv[0] = uv[1] = uv[2] = uv[3] = MT_Point2(0.0f, 0.0f); } if (validmat && validface) { @@ -1389,32 +1389,30 @@ static float my_boundbox_mesh(Mesh *me, float *loc, float *size) } if (me->totvert) { - loc[0]= (min[0]+max[0])/2.0f; - loc[1]= (min[1]+max[1])/2.0f; - loc[2]= (min[2]+max[2])/2.0f; + loc[0] = (min[0] + max[0]) / 2.0f; + loc[1] = (min[1] + max[1]) / 2.0f; + loc[2] = (min[2] + max[2]) / 2.0f; - size[0]= (max[0]-min[0])/2.0f; - size[1]= (max[1]-min[1])/2.0f; - size[2]= (max[2]-min[2])/2.0f; + size[0] = (max[0] - min[0]) / 2.0f; + size[1] = (max[1] - min[1]) / 2.0f; + size[2] = (max[2] - min[2]) / 2.0f; } else { - loc[0]= loc[1]= loc[2]= 0.0f; - size[0]= size[1]= size[2]= 0.0f; + loc[0] = loc[1] = loc[2] = 0.0f; + size[0] = size[1] = size[2] = 0.0f; } - bb->vec[0][0]=bb->vec[1][0]=bb->vec[2][0]=bb->vec[3][0]= loc[0]-size[0]; - bb->vec[4][0]=bb->vec[5][0]=bb->vec[6][0]=bb->vec[7][0]= loc[0]+size[0]; + bb->vec[0][0] = bb->vec[1][0] = bb->vec[2][0] = bb->vec[3][0] = loc[0]-size[0]; + bb->vec[4][0] = bb->vec[5][0] = bb->vec[6][0] = bb->vec[7][0] = loc[0]+size[0]; - bb->vec[0][1]=bb->vec[1][1]=bb->vec[4][1]=bb->vec[5][1]= loc[1]-size[1]; - bb->vec[2][1]=bb->vec[3][1]=bb->vec[6][1]=bb->vec[7][1]= loc[1]+size[1]; + bb->vec[0][1] = bb->vec[1][1] = bb->vec[4][1] = bb->vec[5][1] = loc[1]-size[1]; + bb->vec[2][1] = bb->vec[3][1] = bb->vec[6][1] = bb->vec[7][1] = loc[1]+size[1]; - bb->vec[0][2]=bb->vec[3][2]=bb->vec[4][2]=bb->vec[7][2]= loc[2]-size[2]; - bb->vec[1][2]=bb->vec[2][2]=bb->vec[5][2]=bb->vec[6][2]= loc[2]+size[2]; + bb->vec[0][2] = bb->vec[3][2] = bb->vec[4][2] = bb->vec[7][2] = loc[2]-size[2]; + bb->vec[1][2] = bb->vec[2][2] = bb->vec[5][2] = bb->vec[6][2] = loc[2]+size[2]; return sqrt(radius); } - - static void my_tex_space_mesh(Mesh *me) @@ -1437,12 +1435,12 @@ static void my_tex_space_mesh(Mesh *me) minmax_v3v3_v3(min, max, fp); } if (kb->totelem) { - loc[0]= (min[0]+max[0])/2.0f; loc[1]= (min[1]+max[1])/2.0f; loc[2]= (min[2]+max[2])/2.0f; - size[0]= (max[0]-min[0])/2.0f; size[1]= (max[1]-min[1])/2.0f; size[2]= (max[2]-min[2])/2.0f; + loc[0] = (min[0]+max[0])/2.0f; loc[1] = (min[1]+max[1])/2.0f; loc[2] = (min[2]+max[2])/2.0f; + size[0] = (max[0]-min[0])/2.0f; size[1] = (max[1]-min[1])/2.0f; size[2] = (max[2]-min[2])/2.0f; } else { - loc[0]= loc[1]= loc[2]= 0.0; - size[0]= size[1]= size[2]= 0.0; + loc[0] = loc[1] = loc[2] = 0.0; + size[0] = size[1] = size[2] = 0.0; } } @@ -1450,19 +1448,19 @@ static void my_tex_space_mesh(Mesh *me) copy_v3_v3(me->loc, loc); copy_v3_v3(me->size, size); - me->rot[0]= me->rot[1]= me->rot[2]= 0.0f; + me->rot[0] = me->rot[1] = me->rot[2] = 0.0f; if (me->size[0] == 0.0f) me->size[0] = 1.0f; - else if (me->size[0] > 0.0f && me->size[0]< 0.00001f) me->size[0]= 0.00001f; - else if (me->size[0] < 0.0f && me->size[0]> -0.00001f) me->size[0]= -0.00001f; + else if (me->size[0] > 0.0f && me->size[0]< 0.00001f) me->size[0] = 0.00001f; + else if (me->size[0] < 0.0f && me->size[0]> -0.00001f) me->size[0] = -0.00001f; - if (me->size[1] == 0.0f) me->size[1]= 1.0f; - else if (me->size[1] > 0.0f && me->size[1]< 0.00001f) me->size[1]= 0.00001f; - else if (me->size[1] < 0.0f && me->size[1]> -0.00001f) me->size[1]= -0.00001f; + if (me->size[1] == 0.0f) me->size[1] = 1.0f; + else if (me->size[1] > 0.0f && me->size[1]< 0.00001f) me->size[1] = 0.00001f; + else if (me->size[1] < 0.0f && me->size[1]> -0.00001f) me->size[1] = -0.00001f; - if (me->size[2] == 0.0f) me->size[2]= 1.0f; - else if (me->size[2] > 0.0f && me->size[2]< 0.00001f) me->size[2]= 0.00001f; - else if (me->size[2] < 0.0f && me->size[2]> -0.00001f) me->size[2]= -0.00001f; + if (me->size[2] == 0.0f) me->size[2] = 1.0f; + else if (me->size[2] > 0.0f && me->size[2]< 0.00001f) me->size[2] = 0.00001f; + else if (me->size[2] < 0.0f && me->size[2]> -0.00001f) me->size[2] = -0.00001f; } } @@ -1479,13 +1477,13 @@ static void my_get_local_bounds(Object *ob, DerivedMesh *dm, float *center, floa float min_r[3], max_r[3]; INIT_MINMAX(min_r, max_r); dm->getMinMax(dm, min_r, max_r); - size[0]= 0.5f*fabsf(max_r[0] - min_r[0]); - size[1]= 0.5f*fabsf(max_r[1] - min_r[1]); - size[2]= 0.5f*fabsf(max_r[2] - min_r[2]); + size[0] = 0.5f * fabsf(max_r[0] - min_r[0]); + size[1] = 0.5f * fabsf(max_r[1] - min_r[1]); + size[2] = 0.5f * fabsf(max_r[2] - min_r[2]); - center[0]= 0.5f*(max_r[0] + min_r[0]); - center[1]= 0.5f*(max_r[1] + min_r[1]); - center[2]= 0.5f*(max_r[2] + min_r[2]); + center[0] = 0.5f * (max_r[0] + min_r[0]); + center[1] = 0.5f * (max_r[1] + min_r[1]); + center[2] = 0.5f * (max_r[2] + min_r[2]); return; } else { @@ -1499,11 +1497,11 @@ static void my_get_local_bounds(Object *ob, DerivedMesh *dm, float *center, floa break; case OB_CURVE: case OB_SURF: - center[0]= center[1]= center[2]= 0.0; + center[0] = center[1] = center[2] = 0.0; size[0] = size[1]=size[2]=0.0; break; case OB_FONT: - center[0]= center[1]= center[2]= 0.0; + center[0] = center[1] = center[2] = 0.0; size[0] = size[1]=size[2]=1.0; break; case OB_MBALL: @@ -1513,15 +1511,15 @@ static void my_get_local_bounds(Object *ob, DerivedMesh *dm, float *center, floa if (bb==NULL) { - center[0]= center[1]= center[2]= 0.0; - size[0] = size[1]=size[2]=1.0; + center[0] = center[1] = center[2] = 0.0; + size[0] = size[1] = size[2] = 1.0; } else { size[0] = 0.5f * fabsf(bb->vec[0][0] - bb->vec[4][0]); size[1] = 0.5f * fabsf(bb->vec[0][1] - bb->vec[2][1]); size[2] = 0.5f * fabsf(bb->vec[0][2] - bb->vec[1][2]); - + center[0] = 0.5f * (bb->vec[0][0] + bb->vec[4][0]); center[1] = 0.5f * (bb->vec[0][1] + bb->vec[2][1]); center[2] = 0.5f * (bb->vec[0][2] + bb->vec[1][2]); diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp index 0d3c0d269fc..911ff245ab4 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.cpp +++ b/source/gameengine/Converter/BL_MeshDeformer.cpp @@ -154,27 +154,27 @@ void BL_MeshDeformer::RecalcNormals() v4 = &it.vertex[it.index[i+3]]; co4 = m_transverts[v4->getOrigIndex()]; - n1[0]= co1[0]-co3[0]; - n1[1]= co1[1]-co3[1]; - n1[2]= co1[2]-co3[2]; + n1[0] = co1[0] - co3[0]; + n1[1] = co1[1] - co3[1]; + n1[2] = co1[2] - co3[2]; - n2[0]= co2[0]-co4[0]; - n2[1]= co2[1]-co4[1]; - n2[2]= co2[2]-co4[2]; + n2[0] = co2[0] - co4[0]; + n2[1] = co2[1] - co4[1]; + n2[2] = co2[2] - co4[2]; } else { - n1[0]= co1[0]-co2[0]; - n2[0]= co2[0]-co3[0]; - n1[1]= co1[1]-co2[1]; + n1[0] = co1[0] - co2[0]; + n2[0] = co2[0] - co3[0]; + n1[1] = co1[1] - co2[1]; - n2[1]= co2[1]-co3[1]; - n1[2]= co1[2]-co2[2]; - n2[2]= co2[2]-co3[2]; + n2[1] = co2[1] - co3[1]; + n1[2] = co1[2] - co2[2]; + n2[2] = co2[2] - co3[2]; } - fnor[0]= n1[1]*n2[2] - n1[2]*n2[1]; - fnor[1]= n1[2]*n2[0] - n1[0]*n2[2]; - fnor[2]= n1[0]*n2[1] - n1[1]*n2[0]; + fnor[0] = n1[1] * n2[2] - n1[2] * n2[1]; + fnor[1] = n1[2] * n2[0] - n1[0] * n2[2]; + fnor[2] = n1[0] * n2[1] - n1[1] * n2[0]; normalize_v3(fnor); /* add to vertices for smooth normals */ diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 8325e80db78..d8b4f6aaf1c 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -528,13 +528,13 @@ PyAttributeDef BL_ShapeActionActuator::Attributes[] = { PyObject *BL_ShapeActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - BL_ShapeActionActuator* self= static_cast<BL_ShapeActionActuator*>(self_v); + BL_ShapeActionActuator* self = static_cast<BL_ShapeActionActuator*>(self_v); return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : ""); } int BL_ShapeActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - BL_ShapeActionActuator* self= static_cast<BL_ShapeActionActuator*>(self_v); + BL_ShapeActionActuator* self = static_cast<BL_ShapeActionActuator*>(self_v); /* exact copy of BL_ActionActuator's function from here down */ if (!PyUnicode_Check(value)) { diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index c027d8aec94..30a4209965e 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -818,13 +818,13 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber) if (icu_rz) icu_rz->ipo = IPO_LIN; } - if (icu_rx) eulerAnglesOld[0]= eval_icu( icu_rx, frameNumber - 1 ) / ((180 / 3.14159265f) / 10); - if (icu_ry) eulerAnglesOld[1]= eval_icu( icu_ry, frameNumber - 1 ) / ((180 / 3.14159265f) / 10); - if (icu_rz) eulerAnglesOld[2]= eval_icu( icu_rz, frameNumber - 1 ) / ((180 / 3.14159265f) / 10); + if (icu_rx) eulerAnglesOld[0] = eval_icu( icu_rx, frameNumber - 1 ) / ((180 / 3.14159265f) / 10); + if (icu_ry) eulerAnglesOld[1] = eval_icu( icu_ry, frameNumber - 1 ) / ((180 / 3.14159265f) / 10); + if (icu_rz) eulerAnglesOld[2] = eval_icu( icu_rz, frameNumber - 1 ) / ((180 / 3.14159265f) / 10); // orn.getValue((float *)tmat); // uses the wrong ordering, cant use this - for (int r=0;r<3;r++) - for (int c=0;c<3;c++) + for (int r = 0; r < 3; r++) + for (int c = 0; c < 3; c++) tmat[r][c] = orn[c][r]; // mat3_to_eul( eulerAngles,tmat); // better to use Mat3ToCompatibleEul @@ -1450,14 +1450,12 @@ RAS_MeshObject *KX_BlenderSceneConverter::ConvertMeshSpecial(KX_Scene* kx_scene, BLI_remlink(&m_maggie->mat, mat_new); BLI_addtail(&maggie->mat, mat_new); - mesh->mat[i]= mat_new; + mesh->mat[i] = mat_new; /* the same material may be used twice */ - for (int j=i+1; j<mesh->totcol; j++) - { - if (mesh->mat[j]==mat_old) - { - mesh->mat[j]= mat_new; + for (int j = i + 1; j < mesh->totcol; j++) { + if (mesh->mat[j] == mat_old) { + mesh->mat[j] = mat_new; mat_new->id.us++; mat_old->id.us--; } diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 43f84d273fd..8cff5a01c0e 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -468,9 +468,9 @@ static PyObject *listvalue_buffer_concat(PyObject *self, PyObject *other) static int listvalue_buffer_contains(PyObject *self_v, PyObject *value) { - CListValue *self= static_cast<CListValue *>(BGE_PROXY_REF(self_v)); + CListValue *self = static_cast<CListValue *>(BGE_PROXY_REF(self_v)); - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "val in CList, "BGE_PROXY_ERROR_MSG); return -1; } diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp index 48fa3257d20..b103c8c4050 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp @@ -51,11 +51,11 @@ SCA_Joystick::SCA_Joystick(short int index) m_istrig_button(0), m_istrig_hat(0) { - for (int i=0; i<JOYAXIS_MAX; i++) - m_axis_array[i]= 0; + for (int i=0; i < JOYAXIS_MAX; i++) + m_axis_array[i] = 0; - for (int i=0; i<JOYHAT_MAX; i++) - m_hat_array[i]= 0; + for (int i=0; i < JOYHAT_MAX; i++) + m_hat_array[i] = 0; #ifdef WITH_SDL m_private = new PrivateData(); @@ -127,7 +127,7 @@ void SCA_Joystick::ReleaseInstance() m_instance[i]->DestroyJoystickDevice(); delete m_instance[i]; } - m_instance[i]= NULL; + m_instance[i] = NULL; } // The video subsystem is required for joystick input to work. However, diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp index 21619d8c63f..f50137cfcf6 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp @@ -43,7 +43,7 @@ void SCA_Joystick::OnAxisMotion(SDL_Event* sdl_event) if (sdl_event->jaxis.axis >= JOYAXIS_MAX) return; - m_axis_array[sdl_event->jaxis.axis]= sdl_event->jaxis.value; + m_axis_array[sdl_event->jaxis.axis] = sdl_event->jaxis.value; m_istrig_axis = 1; } @@ -53,7 +53,7 @@ void SCA_Joystick::OnHatMotion(SDL_Event* sdl_event) if (sdl_event->jhat.hat >= JOYHAT_MAX) return; - m_hat_array[sdl_event->jhat.hat]= sdl_event->jhat.value; + m_hat_array[sdl_event->jhat.hat] = sdl_event->jhat.value; m_istrig_hat = 1; } diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index 6d76f122163..57f7dd64287 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -240,7 +240,7 @@ PyAttributeDef SCA_IController::Attributes[] = { PyObject *SCA_IController::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_IController* self= static_cast<SCA_IController*>(self_v); + SCA_IController* self = static_cast<SCA_IController*>(self_v); return PyLong_FromSsize_t(self->m_statemask); } diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index cfbdc1e750f..ab0e6c5edcb 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -233,7 +233,7 @@ int SCA_ILogicBrick::CheckProperty(void *self, const PyAttributeDef *attrdef) /*Attribute functions */ PyObject *SCA_ILogicBrick::pyattr_get_owner(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ILogicBrick* self= static_cast<SCA_ILogicBrick*>(self_v); + SCA_ILogicBrick* self = static_cast<SCA_ILogicBrick*>(self_v); CValue* parent = self->GetParent(); if (parent) diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 7cf0b18c3b5..bfb78abef04 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -382,7 +382,7 @@ PyAttributeDef SCA_ISensor::Attributes[] = { PyObject *SCA_ISensor::pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); int retval = 0; if (SCA_PythonController::m_sCurrentController) retval = SCA_PythonController::m_sCurrentController->IsTriggered(self); @@ -391,13 +391,13 @@ PyObject *SCA_ISensor::pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_D PyObject *SCA_ISensor::pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); return PyLong_FromSsize_t(self->GetState()); } PyObject *SCA_ISensor::pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); int status = 0; if (self->GetState()) { @@ -419,19 +419,19 @@ PyObject *SCA_ISensor::pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF PyObject *SCA_ISensor::pyattr_get_posTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); return PyLong_FromLong(self->GetPosTicks()); } PyObject *SCA_ISensor::pyattr_get_negTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); return PyLong_FromLong(self->GetNegTicks()); } int SCA_ISensor::pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); if (self->m_level) self->m_tap = false; return 0; @@ -439,7 +439,7 @@ int SCA_ISensor::pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attr int SCA_ISensor::pyattr_check_tap(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + SCA_ISensor* self = static_cast<SCA_ISensor*>(self_v); if (self->m_tap) self->m_level = false; return 0; diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index b4e461a9c2b..0c4dcae16f7 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -348,7 +348,7 @@ PyObject *SCA_JoystickSensor::PyGetButtonStatus( PyObject *args ) PyObject *SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); int axis_index= joy->GetNumberOfAxes(); @@ -363,7 +363,7 @@ PyObject *SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYAT PyObject *SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); if (self->m_joymode != KX_JOYSENSORMODE_AXIS_SINGLE) { @@ -376,7 +376,7 @@ PyObject *SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYAT PyObject *SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); int hat_index= joy->GetNumberOfHats(); @@ -391,7 +391,7 @@ PyObject *SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATT PyObject *SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyLong_FromSsize_t(joy->GetHat(self->m_hat-1)); @@ -399,28 +399,28 @@ PyObject *SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATT PyObject *SCA_JoystickSensor::pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyLong_FromSsize_t( joy ? joy->GetNumberOfAxes() : 0 ); } PyObject *SCA_JoystickSensor::pyattr_get_num_buttons(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyLong_FromSsize_t( joy ? joy->GetNumberOfButtons() : 0 ); } PyObject *SCA_JoystickSensor::pyattr_get_num_hats(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyLong_FromSsize_t( joy ? joy->GetNumberOfHats() : 0 ); } PyObject *SCA_JoystickSensor::pyattr_get_connected(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v); + SCA_JoystickSensor* self = static_cast<SCA_JoystickSensor*>(self_v); SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyBool_FromLong( joy ? joy->Connected() : 0 ); } diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 64bcae9f6d7..b3346270b61 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -497,7 +497,7 @@ PyAttributeDef SCA_KeyboardSensor::Attributes[] = { PyObject *SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_KeyboardSensor* self= static_cast<SCA_KeyboardSensor*>(self_v); + SCA_KeyboardSensor* self = static_cast<SCA_KeyboardSensor*>(self_v); SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)self->m_eventmgr)->GetInputDevice(); diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index f857d59b121..ece9d7b6c8f 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -484,10 +484,10 @@ PyObject *SCA_PythonController::PyDeActivate(PyObject *value) PyObject *SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - //SCA_PythonController* self= static_cast<SCA_PythonController*>(static_cast<SCA_IController*>(static_cast<SCA_ILogicBrick*>(static_cast<CValue*>(static_cast<PyObjectPlus*>(self_v))))); + //SCA_PythonController* self = static_cast<SCA_PythonController*>(static_cast<SCA_IController*>(static_cast<SCA_ILogicBrick*>(static_cast<CValue*>(static_cast<PyObjectPlus*>(self_v))))); // static_cast<void *>(dynamic_cast<Derived *>(obj)) - static_cast<void *>(obj) - SCA_PythonController* self= static_cast<SCA_PythonController*>(self_v); + SCA_PythonController* self = static_cast<SCA_PythonController*>(self_v); return PyUnicode_From_STR_String(self->m_scriptText); } @@ -495,7 +495,7 @@ PyObject *SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRI int SCA_PythonController::pyattr_set_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - SCA_PythonController* self= static_cast<SCA_PythonController*>(self_v); + SCA_PythonController* self = static_cast<SCA_PythonController*>(self_v); const char *scriptArg = _PyUnicode_AsString(value); diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 17784755421..7199ee6cf22 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -167,13 +167,13 @@ PyAttributeDef SCA_RandomSensor::Attributes[] = { PyObject *SCA_RandomSensor::pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_RandomSensor* self= static_cast<SCA_RandomSensor*>(self_v); + SCA_RandomSensor* self = static_cast<SCA_RandomSensor*>(self_v); return PyLong_FromSsize_t(self->m_basegenerator->GetSeed()); } int SCA_RandomSensor::pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - SCA_RandomSensor* self= static_cast<SCA_RandomSensor*>(self_v); + SCA_RandomSensor* self = static_cast<SCA_RandomSensor*>(self_v); if (!PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "sensor.seed = int: Random Sensor, expected an integer"); return PY_SET_ATTR_FAIL; diff --git a/source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.cpp b/source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.cpp index adf0bcd8e57..c4022d69153 100644 --- a/source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.cpp @@ -38,7 +38,8 @@ void GetRawLoadingAnimation(unsigned char **data, int *dataSize) { // create an array that will automatically be deleted when) // we're outta this scope - static unsigned char load_blend[]= { 66, 76, 69, 78, 68, 70, + static unsigned char load_blend[] = { + 66, 76, 69, 78, 68, 70, 73, 10, 0, 2, 21, 0, 0, 2, 22, 0, 0, 0, 0, 0, 0, 2, 30, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 25, 242, 2, 0, 2, 29, 253, 0, 0, 0, 4, 160, 249, 227, diff --git a/source/gameengine/GamePlayer/common/GPC_RawLogoArrays.cpp b/source/gameengine/GamePlayer/common/GPC_RawLogoArrays.cpp index 2471b528eac..2f58e9a692f 100644 --- a/source/gameengine/GamePlayer/common/GPC_RawLogoArrays.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RawLogoArrays.cpp @@ -38,7 +38,8 @@ void GetRawBlenderLogo(unsigned char **data, int *width, int *height) { // create an array that will automatically be deleted when) // we're outta this scope - static unsigned char logo_blender_raw[]= { 0, 0, 0, 0, 0, + static unsigned char logo_blender_raw[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1041,7 +1042,8 @@ void GetRawBlender3DLogo(unsigned char **data, int *width, int *height) { // create an array that will automatically be deleted when) // we're outta this scope - static unsigned char logo_blender3d_raw[]= {255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, + static unsigned char logo_blender3d_raw[] = { + 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 4bf81bf543e..dfc866526eb 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -173,11 +173,11 @@ bool GPC_RenderTools::RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, vo left = (dir.cross(resultnormal)).safe_normalized(); // for the up vector, we take the 'resultnormal' returned by the physics - double maat[16]={ - left[0], left[1], left[2], 0, - dir[0], dir[1], dir[2], 0, - resultnormal[0],resultnormal[1],resultnormal[2], 0, - 0, 0, 0, 1}; + double maat[16] = {left[0], left[1], left[2], 0, + dir[0], dir[1], dir[2], 0, + resultnormal[0], resultnormal[1], resultnormal[2], 0, + 0, 0, 0, 1}; + glTranslated(resultpoint[0],resultpoint[1],resultpoint[2]); //glMultMatrixd(oglmatrix); glMultMatrixd(maat); @@ -236,16 +236,16 @@ void GPC_RenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmatrix,in left *= size[0]; dir *= size[1]; up *= size[2]; - double maat[16]={ - left[0], left[1],left[2], 0, - dir[0], dir[1],dir[2],0, - up[0],up[1],up[2],0, - 0,0,0,1}; - glTranslated(objpos[0],objpos[1],objpos[2]); - glMultMatrixd(maat); - - } else - { + + double maat[16] = {left[0], left[1], left[2], 0, + dir[0], dir[1], dir[2], 0, + up[0], up[1], up[2], 0, + 0, 0, 0, 1}; + + glTranslated(objpos[0],objpos[1],objpos[2]); + glMultMatrixd(maat); + } + else { if (objectdrawmode & RAS_IPolyMaterial::SHADOW) { // shadow must be cast to the ground, physics system needed here! diff --git a/source/gameengine/Ketsji/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp index 122d692b599..b2dfefd9e0b 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.cpp +++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp @@ -143,9 +143,9 @@ void BL_BlenderShader::Update(const RAS_MeshSlot & ms, RAS_IRasterizer* rasty ) viewinv.getValue((float*)viewinvmat); if (ms.m_bObjectColor) - ms.m_RGBAcolor.getValue((float*)obcol); + ms.m_RGBAcolor.getValue((float *)obcol); else - obcol[0]= obcol[1]= obcol[2]= obcol[3]= 1.0f; + obcol[0] = obcol[1] = obcol[2] = obcol[3] = 1.0f; float auto_bump_scale = ms.m_pDerivedMesh!=0 ? ms.m_pDerivedMesh->auto_bump_scale : 1.0f; GPU_material_bind_uniforms(gpumat, obmat, viewmat, viewinvmat, obcol, auto_bump_scale); diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index 144ad61212d..fb8e7beb157 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -966,7 +966,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f, "setUniform2f(name, fx, fy)") Py_RETURN_NONE; } const char *uniform=""; - float array[2]={ 0,0 }; + float array[2] = {0, 0}; if (PyArg_ParseTuple(args, "sff:setUniform2f", &uniform, &array[0],&array[1] )) { int loc = GetUniformLocation(uniform); @@ -990,7 +990,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ") Py_RETURN_NONE; } const char *uniform=""; - float array[3]={0,0,0}; + float array[3] = {0, 0, 0}; if (PyArg_ParseTuple(args, "sfff:setUniform3f", &uniform, &array[0],&array[1],&array[2])) { int loc = GetUniformLocation(uniform); @@ -1015,7 +1015,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) " Py_RETURN_NONE; } const char *uniform=""; - float array[4]={0,0,0,0}; + float array[4] = {0, 0, 0, 0}; if (PyArg_ParseTuple(args, "sffff:setUniform4f", &uniform, &array[0],&array[1],&array[2], &array[3])) { int loc = GetUniformLocation(uniform); @@ -1063,7 +1063,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i, "setUniform2i(name, ix, iy)") Py_RETURN_NONE; } const char *uniform=""; - int array[2]={ 0,0 }; + int array[2] = {0, 0}; if (PyArg_ParseTuple(args, "sii:setUniform2i", &uniform, &array[0],&array[1] )) { int loc = GetUniformLocation(uniform); @@ -1088,7 +1088,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ") } const char *uniform=""; - int array[3]={0,0,0}; + int array[3] = {0, 0, 0}; if (PyArg_ParseTuple(args, "siii:setUniform3i", &uniform, &array[0],&array[1],&array[2])) { int loc = GetUniformLocation(uniform); @@ -1111,7 +1111,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) " Py_RETURN_NONE; } const char *uniform=""; - int array[4]={0,0,0, 0}; + int array[4] = {0, 0, 0, 0}; if (PyArg_ParseTuple(args, "siiii:setUniform4i", &uniform, &array[0],&array[1],&array[2], &array[3] )) { int loc = GetUniformLocation(uniform); diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp index d129fc88714..26523df8db3 100644 --- a/source/gameengine/Ketsji/BL_Texture.cpp +++ b/source/gameengine/Ketsji/BL_Texture.cpp @@ -670,7 +670,7 @@ void my_envmap_split_ima(EnvMap *env, ImBuf *ibuf) } else { for (part=0; part<6; part++) { - env->cube[part]= IMB_allocImBuf(dx, dx, 24, IB_rect); + env->cube[part] = IMB_allocImBuf(dx, dx, 24, IB_rect); } IMB_rectcpy(env->cube[0], ibuf, 0, 0, 0, 0, dx, dx); @@ -698,7 +698,7 @@ void my_free_envmapdata(EnvMap *env) ImBuf *ibuf= env->cube[part]; if (ibuf) { IMB_freeImBuf(ibuf); - env->cube[part]= NULL; + env->cube[part] = NULL; } } env->ok= 0; diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 2337e9569f3..da6fd822a6b 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -726,7 +726,7 @@ void KX_BlenderMaterial::setObjectMatrixData(int i, RAS_IRasterizer *ras) GLenum plane = GL_EYE_PLANE; // figure plane gen - float proj[4]= {0.f,0.f,0.f,0.f}; + float proj[4] = {0.f,0.f,0.f,0.f}; GetProjPlane(mMaterial, i, 0, proj); glTexGenfv(GL_S, plane, proj); @@ -837,26 +837,26 @@ PyTypeObject KX_BlenderMaterial::Type = { PyObject *KX_BlenderMaterial::pyattr_get_shader(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v); + KX_BlenderMaterial* self = static_cast<KX_BlenderMaterial*>(self_v); return self->PygetShader(NULL, NULL); } PyObject *KX_BlenderMaterial::pyattr_get_materialIndex(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v); + KX_BlenderMaterial* self = static_cast<KX_BlenderMaterial*>(self_v); return PyLong_FromSsize_t(self->GetMaterialIndex()); } PyObject *KX_BlenderMaterial::pyattr_get_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v); + KX_BlenderMaterial* self = static_cast<KX_BlenderMaterial*>(self_v); unsigned int* bfunc = self->getBlendFunc(); return Py_BuildValue("(ll)", (long int)bfunc[0], (long int)bfunc[1]); } int KX_BlenderMaterial::pyattr_set_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v); + KX_BlenderMaterial* self = static_cast<KX_BlenderMaterial*>(self_v); PyObject *obj = self->PysetBlending(value, NULL); if (obj) { diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 90912409af1..3cc51361788 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -714,13 +714,13 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, setOnTop, PyObject *KX_Camera::pyattr_get_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyBool_FromLong(self->m_camdata.m_perspective); } int KX_Camera::pyattr_set_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); int param = PyObject_IsTrue( value ); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.perspective = bool: KX_Camera, expected True/False or 0/1"); @@ -734,13 +734,13 @@ int KX_Camera::pyattr_set_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *at PyObject *KX_Camera::pyattr_get_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyFloat_FromDouble(self->m_camdata.m_lens); } int KX_Camera::pyattr_set_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); float param = PyFloat_AsDouble(value); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.lens = float: KX_Camera, expected a float greater then zero"); @@ -754,13 +754,13 @@ int KX_Camera::pyattr_set_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *KX_Camera::pyattr_get_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyFloat_FromDouble(self->m_camdata.m_scale); } int KX_Camera::pyattr_set_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); float param = PyFloat_AsDouble(value); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.ortho_scale = float: KX_Camera, expected a float greater then zero"); @@ -774,13 +774,13 @@ int KX_Camera::pyattr_set_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *at PyObject *KX_Camera::pyattr_get_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyFloat_FromDouble(self->m_camdata.m_clipstart); } int KX_Camera::pyattr_set_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); float param = PyFloat_AsDouble(value); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.near = float: KX_Camera, expected a float greater then zero"); @@ -794,13 +794,13 @@ int KX_Camera::pyattr_set_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *KX_Camera::pyattr_get_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyFloat_FromDouble(self->m_camdata.m_clipend); } int KX_Camera::pyattr_set_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); float param = PyFloat_AsDouble(value); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.far = float: KX_Camera, expected a float greater then zero"); @@ -815,13 +815,13 @@ int KX_Camera::pyattr_set_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, P PyObject *KX_Camera::pyattr_get_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyBool_FromLong(self->GetViewport()); } int KX_Camera::pyattr_set_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); int param = PyObject_IsTrue( value ); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.useViewport = bool: KX_Camera, expected True or False"); @@ -834,13 +834,13 @@ int KX_Camera::pyattr_set_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *a PyObject *KX_Camera::pyattr_get_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyObjectFrom(self->GetProjectionMatrix()); } int KX_Camera::pyattr_set_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); MT_Matrix4x4 mat; if (!PyMatTo(value, mat)) return PY_SET_ATTR_FAIL; @@ -851,19 +851,19 @@ int KX_Camera::pyattr_set_projection_matrix(void *self_v, const KX_PYATTRIBUTE_D PyObject *KX_Camera::pyattr_get_modelview_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyObjectFrom(self->GetModelviewMatrix()); } PyObject *KX_Camera::pyattr_get_camera_to_world(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyObjectFrom(self->GetCameraToWorld()); } PyObject *KX_Camera::pyattr_get_world_to_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Camera* self= static_cast<KX_Camera*>(self_v); + KX_Camera* self = static_cast<KX_Camera*>(self_v); return PyObjectFrom(self->GetWorldToCamera()); } diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index 9ca1ec59a0b..daa3e232423 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -143,9 +143,9 @@ static void Kx_VecUpMat3(float vec[3], float mat[][3], short axis) } if (axis==3) { cox= 0; coy= 1; coz= 2; /* Y op -Z tr */ - vec[0]= -vec[0]; - vec[1]= -vec[1]; - vec[2]= -vec[2]; + vec[0] = -vec[0]; + vec[1] = -vec[1]; + vec[2] = -vec[2]; } if (axis==4) { cox= 1; coy= 0; coz= 2; /* */ @@ -154,9 +154,9 @@ static void Kx_VecUpMat3(float vec[3], float mat[][3], short axis) cox= 2; coy= 1; coz= 0; /* Y up X tr */ } - mat[coz][0]= vec[0]; - mat[coz][1]= vec[1]; - mat[coz][2]= vec[2]; + mat[coz][0] = vec[0]; + mat[coz][1] = vec[1]; + mat[coz][2] = vec[2]; if (normalize_v3((float *)mat[coz]) == 0.f) { /* this is a very abnormal situation: the camera has reach the object center exactly * We will choose a completely arbitrary direction */ @@ -303,9 +303,9 @@ bool KX_CameraActuator::Update(double curtime, bool frame) /* CONSTRAINT 5: minimum / maximum afstand */ - rc[0]= (lookat[0]-from[0]); - rc[1]= (lookat[1]-from[1]); - rc[2]= (lookat[2]-from[2]); + rc[0] = (lookat[0]-from[0]); + rc[1] = (lookat[1]-from[1]); + rc[2] = (lookat[2]-from[2]); distsq = rc[0]*rc[0] + rc[1]*rc[1] + rc[2]*rc[2]; if (distsq > maxdistsq) { @@ -325,9 +325,9 @@ bool KX_CameraActuator::Update(double curtime, bool frame) /* CONSTRAINT 7: track to schaduw */ - rc[0]= (lookat[0]-from[0]); - rc[1]= (lookat[1]-from[1]); - rc[2]= (lookat[2]-from[2]); + rc[0] = (lookat[0]-from[0]); + rc[1] = (lookat[1]-from[1]); + rc[2] = (lookat[2]-from[2]); Kx_VecUpMat3(rc, mat, 3); /* y up Track -z */ @@ -337,9 +337,9 @@ bool KX_CameraActuator::Update(double curtime, bool frame) obj->NodeSetLocalPosition(from); - actormat[0][0]= mat[0][0]; actormat[0][1]= mat[1][0]; actormat[0][2]= mat[2][0]; - actormat[1][0]= mat[0][1]; actormat[1][1]= mat[1][1]; actormat[1][2]= mat[2][1]; - actormat[2][0]= mat[0][2]; actormat[2][1]= mat[1][2]; actormat[2][2]= mat[2][2]; + actormat[0][0] = mat[0][0]; actormat[0][1] = mat[1][0]; actormat[0][2] = mat[2][0]; + actormat[1][0] = mat[0][1]; actormat[1][1] = mat[1][1]; actormat[1][2] = mat[2][1]; + actormat[2][0] = mat[0][2]; actormat[2][1] = mat[1][2]; actormat[2][2] = mat[2][2]; obj->NodeSetLocalOrientation(actormat); return true; @@ -396,7 +396,7 @@ PyAttributeDef KX_CameraActuator::Attributes[] = { PyObject *KX_CameraActuator::pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_CameraActuator* self= static_cast<KX_CameraActuator*>(self_v); + KX_CameraActuator* self = static_cast<KX_CameraActuator*>(self_v); if (self->m_ob==NULL) Py_RETURN_NONE; else @@ -405,7 +405,7 @@ PyObject *KX_CameraActuator::pyattr_get_object(void *self_v, const KX_PYATTRIBUT int KX_CameraActuator::pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_CameraActuator* self= static_cast<KX_CameraActuator*>(self_v); + KX_CameraActuator* self = static_cast<KX_CameraActuator*>(self_v); KX_GameObject *gameobj; if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.object = value: KX_CameraActuator")) diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index 5727ed29e67..662db974ee8 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -119,7 +119,7 @@ PyAttributeDef KX_ConstraintWrapper::Attributes[] = { PyObject *KX_ConstraintWrapper::pyattr_get_constraintId(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_ConstraintWrapper* self= static_cast<KX_ConstraintWrapper*>(self_v); + KX_ConstraintWrapper* self = static_cast<KX_ConstraintWrapper*>(self_v); return self->PyGetConstraintId(); } diff --git a/source/gameengine/Ketsji/KX_FontObject.cpp b/source/gameengine/Ketsji/KX_FontObject.cpp index 9f6ef894f12..138124f9b1a 100644 --- a/source/gameengine/Ketsji/KX_FontObject.cpp +++ b/source/gameengine/Ketsji/KX_FontObject.cpp @@ -254,7 +254,7 @@ PyAttributeDef KX_FontObject::Attributes[] = { PyObject *KX_FontObject::pyattr_get_text(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_FontObject* self= static_cast<KX_FontObject*>(self_v); + KX_FontObject* self = static_cast<KX_FontObject*>(self_v); STR_String str = STR_String(); for (int i=0; i<self->m_text.size(); ++i) { @@ -267,7 +267,7 @@ PyObject *KX_FontObject::pyattr_get_text(void *self_v, const KX_PYATTRIBUTE_DEF int KX_FontObject::pyattr_set_text(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_FontObject* self= static_cast<KX_FontObject*>(self_v); + KX_FontObject* self = static_cast<KX_FontObject*>(self_v); if (!PyUnicode_Check(value)) return PY_SET_ATTR_FAIL; char* chars = _PyUnicode_AsString(value); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 6c581dae210..48a45c2d1c2 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1427,8 +1427,8 @@ static unsigned char mathutils_kxgameob_vector_cb_index= -1; /* index for our ca static int mathutils_kxgameob_generic_check(BaseMathObject *bmo) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; return 0; @@ -1436,8 +1436,8 @@ static int mathutils_kxgameob_generic_check(BaseMathObject *bmo) static int mathutils_kxgameob_vector_get(BaseMathObject *bmo, int subtype) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; #define PHYS_ERR(attr) PyErr_SetString(PyExc_AttributeError, "KX_GameObject." attr ", is missing a physics controller") @@ -1488,8 +1488,8 @@ static int mathutils_kxgameob_vector_get(BaseMathObject *bmo, int subtype) static int mathutils_kxgameob_vector_set(BaseMathObject *bmo, int subtype) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; switch (subtype) { @@ -1547,7 +1547,7 @@ static int mathutils_kxgameob_vector_set_index(BaseMathObject *bmo, int subtype, if (mathutils_kxgameob_vector_get(bmo, subtype) == -1) return -1; - bmo->data[index]= f; + bmo->data[index] = f; return mathutils_kxgameob_vector_set(bmo, subtype); } @@ -1567,8 +1567,8 @@ static unsigned char mathutils_kxgameob_matrix_cb_index= -1; /* index for our ca static int mathutils_kxgameob_matrix_get(BaseMathObject *bmo, int subtype) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; switch (subtype) { @@ -1586,8 +1586,8 @@ static int mathutils_kxgameob_matrix_get(BaseMathObject *bmo, int subtype) static int mathutils_kxgameob_matrix_set(BaseMathObject *bmo, int subtype) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; MT_Matrix3x3 mat3x3; @@ -1774,12 +1774,12 @@ PyObject *KX_GameObject::PyReinstancePhysicsMesh(PyObject *args) static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); const char *attr_str= _PyUnicode_AsString(item); CValue* resultattr; PyObject *pyconvert; - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "val = gameOb[key]: KX_GameObject, "BGE_PROXY_ERROR_MSG); return NULL; } @@ -1808,12 +1808,12 @@ static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); const char *attr_str= _PyUnicode_AsString(key); if (attr_str==NULL) PyErr_Clear(); - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "gameOb[key] = value: KX_GameObject, "BGE_PROXY_ERROR_MSG); return -1; } @@ -1896,9 +1896,9 @@ static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) static int Seq_Contains(PyObject *self_v, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "val in gameOb: KX_GameObject, "BGE_PROXY_ERROR_MSG); return -1; } @@ -1962,13 +1962,13 @@ PyTypeObject KX_GameObject::Type = { PyObject *KX_GameObject::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyUnicode_From_STR_String(self->GetName()); } PyObject *KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_GameObject* parent = self->GetParent(); if (parent) { parent->Release(); /* self->GetParent() AddRef's */ @@ -1979,7 +1979,7 @@ PyObject *KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DE PyObject *KX_GameObject::pyattr_get_group_children(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); CListValue* instances = self->GetInstanceObjects(); if (instances) { return instances->GetProxy(); @@ -2000,7 +2000,7 @@ PyObject* KX_GameObject::pyattr_get_scene(void *self_v, const KX_PYATTRIBUTE_DEF PyObject *KX_GameObject::pyattr_get_group_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_GameObject* pivot = self->GetDupliGroupObject(); if (pivot) { return pivot->GetProxy(); @@ -2010,7 +2010,7 @@ PyObject *KX_GameObject::pyattr_get_group_parent(void *self_v, const KX_PYATTRIB PyObject *KX_GameObject::pyattr_get_life(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); CValue *life = self->GetProperty("::timebomb"); if (life) @@ -2023,14 +2023,14 @@ PyObject *KX_GameObject::pyattr_get_life(void *self_v, const KX_PYATTRIBUTE_DEF PyObject *KX_GameObject::pyattr_get_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_IPhysicsController *spc = self->GetPhysicsController(); return PyFloat_FromDouble(spc ? spc->GetMass() : 0.0); } int KX_GameObject::pyattr_set_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_IPhysicsController *spc = self->GetPhysicsController(); MT_Scalar val = PyFloat_AsDouble(value); if (val < 0.0) { /* also accounts for non float */ @@ -2046,14 +2046,14 @@ int KX_GameObject::pyattr_set_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrd PyObject *KX_GameObject::pyattr_get_lin_vel_min(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_IPhysicsController *spc = self->GetPhysicsController(); return PyFloat_FromDouble(spc ? spc->GetLinVelocityMin() : 0.0f); } int KX_GameObject::pyattr_set_lin_vel_min(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_IPhysicsController *spc = self->GetPhysicsController(); MT_Scalar val = PyFloat_AsDouble(value); if (val < 0.0) { /* also accounts for non float */ @@ -2069,14 +2069,14 @@ int KX_GameObject::pyattr_set_lin_vel_min(void *self_v, const KX_PYATTRIBUTE_DEF PyObject *KX_GameObject::pyattr_get_lin_vel_max(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_IPhysicsController *spc = self->GetPhysicsController(); return PyFloat_FromDouble(spc ? spc->GetLinVelocityMax() : 0.0f); } int KX_GameObject::pyattr_set_lin_vel_max(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); KX_IPhysicsController *spc = self->GetPhysicsController(); MT_Scalar val = PyFloat_AsDouble(value); if (val < 0.0) { /* also accounts for non float */ @@ -2093,13 +2093,13 @@ int KX_GameObject::pyattr_set_lin_vel_max(void *self_v, const KX_PYATTRIBUTE_DEF PyObject *KX_GameObject::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyBool_FromLong(self->GetVisible()); } int KX_GameObject::pyattr_set_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); int param = PyObject_IsTrue( value ); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "gameOb.visible = bool: KX_GameObject, expected True or False"); @@ -2116,14 +2116,14 @@ PyObject *KX_GameObject::pyattr_get_worldPosition(void *self_v, const KX_PYATTRI #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_GLOBAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->NodeGetWorldPosition()); #endif } int KX_GameObject::pyattr_set_worldPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Point3 pos; if (!PyVecTo(value, pos)) return PY_SET_ATTR_FAIL; @@ -2138,14 +2138,14 @@ PyObject *KX_GameObject::pyattr_get_localPosition(void *self_v, const KX_PYATTRI #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_LOCAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->NodeGetLocalPosition()); #endif } int KX_GameObject::pyattr_set_localPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Point3 pos; if (!PyVecTo(value, pos)) return PY_SET_ATTR_FAIL; @@ -2160,7 +2160,7 @@ PyObject *KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIB #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_INERTIA_LOCAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); if (self->GetPhysicsController()) return PyObjectFrom(self->GetPhysicsController()->GetLocalInertia()); return Py_BuildValue("fff", 0.0f, 0.0f, 0.0f); @@ -2172,14 +2172,14 @@ PyObject *KX_GameObject::pyattr_get_worldOrientation(void *self_v, const KX_PYAT #ifdef USE_MATHUTILS return Matrix_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_GLOBAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->NodeGetWorldOrientation()); #endif } int KX_GameObject::pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); /* if value is not a sequence PyOrientationTo makes an error */ MT_Matrix3x3 rot; @@ -2197,14 +2197,14 @@ PyObject *KX_GameObject::pyattr_get_localOrientation(void *self_v, const KX_PYAT #ifdef USE_MATHUTILS return Matrix_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_LOCAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->NodeGetLocalOrientation()); #endif } int KX_GameObject::pyattr_set_localOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); /* if value is not a sequence PyOrientationTo makes an error */ MT_Matrix3x3 rot; @@ -2221,14 +2221,14 @@ PyObject *KX_GameObject::pyattr_get_worldScaling(void *self_v, const KX_PYATTRIB #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_GLOBAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->NodeGetWorldScaling()); #endif } int KX_GameObject::pyattr_set_worldScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector3 scale; if (!PyVecTo(value, scale)) return PY_SET_ATTR_FAIL; @@ -2243,14 +2243,14 @@ PyObject *KX_GameObject::pyattr_get_localScaling(void *self_v, const KX_PYATTRIB #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->NodeGetLocalScaling()); #endif } int KX_GameObject::pyattr_set_localScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector3 scale; if (!PyVecTo(value, scale)) return PY_SET_ATTR_FAIL; @@ -2345,14 +2345,14 @@ PyObject *KX_GameObject::pyattr_get_worldLinearVelocity(void *self_v, const KX_P #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_LINVEL_GLOBAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(GetLinearVelocity(false)); #endif } int KX_GameObject::pyattr_set_worldLinearVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector3 velocity; if (!PyVecTo(value, velocity)) return PY_SET_ATTR_FAIL; @@ -2367,14 +2367,14 @@ PyObject *KX_GameObject::pyattr_get_localLinearVelocity(void *self_v, const KX_P #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_LINVEL_LOCAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(GetLinearVelocity(true)); #endif } int KX_GameObject::pyattr_set_localLinearVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector3 velocity; if (!PyVecTo(value, velocity)) return PY_SET_ATTR_FAIL; @@ -2389,14 +2389,14 @@ PyObject *KX_GameObject::pyattr_get_worldAngularVelocity(void *self_v, const KX_ #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_ANGVEL_GLOBAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(GetAngularVelocity(false)); #endif } int KX_GameObject::pyattr_set_worldAngularVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector3 velocity; if (!PyVecTo(value, velocity)) return PY_SET_ATTR_FAIL; @@ -2411,14 +2411,14 @@ PyObject *KX_GameObject::pyattr_get_localAngularVelocity(void *self_v, const KX_ #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_ANGVEL_LOCAL); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(GetAngularVelocity(true)); #endif } int KX_GameObject::pyattr_set_localAngularVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector3 velocity; if (!PyVecTo(value, velocity)) return PY_SET_ATTR_FAIL; @@ -2431,7 +2431,7 @@ int KX_GameObject::pyattr_set_localAngularVelocity(void *self_v, const KX_PYATTR PyObject *KX_GameObject::pyattr_get_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); SG_Node* sg_parent; if (self->GetSGNode() && (sg_parent = self->GetSGNode()->GetSGParent()) != NULL && sg_parent->IsSlowParent()) { return PyFloat_FromDouble(static_cast<KX_SlowParentRelation *>(sg_parent->GetParentRelation())->GetTimeOffset()); @@ -2442,7 +2442,7 @@ PyObject *KX_GameObject::pyattr_get_timeOffset(void *self_v, const KX_PYATTRIBUT int KX_GameObject::pyattr_set_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); if (self->GetSGNode()) { MT_Scalar val = PyFloat_AsDouble(value); SG_Node *sg_parent= self->GetSGNode()->GetSGParent(); @@ -2458,7 +2458,7 @@ int KX_GameObject::pyattr_set_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF PyObject *KX_GameObject::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); int state = 0; state |= self->GetState(); return PyLong_FromSsize_t(state); @@ -2466,7 +2466,7 @@ PyObject *KX_GameObject::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF int KX_GameObject::pyattr_set_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); int state_i = PyLong_AsSsize_t(value); unsigned int state = 0; @@ -2486,7 +2486,7 @@ int KX_GameObject::pyattr_set_state(void *self_v, const KX_PYATTRIBUTE_DEF *attr PyObject *KX_GameObject::pyattr_get_meshes(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); PyObject *meshes= PyList_New(self->m_meshes.size()); int i; @@ -2504,14 +2504,14 @@ PyObject *KX_GameObject::pyattr_get_obcolor(void *self_v, const KX_PYATTRIBUTE_D #ifdef USE_MATHUTILS return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 4, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_OBJECT_COLOR); #else - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return PyObjectFrom(self->GetObjectColor()); #endif } int KX_GameObject::pyattr_set_obcolor(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); MT_Vector4 obcolor; if (!PyVecTo(value, obcolor)) return PY_SET_ATTR_FAIL; @@ -2539,19 +2539,19 @@ PyObject *KX_GameObject::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE PyObject *KX_GameObject::pyattr_get_children(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return self->GetChildren()->NewProxy(true); } PyObject *KX_GameObject::pyattr_get_children_recursive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); return self->GetChildrenRecursive()->NewProxy(true); } PyObject *KX_GameObject::pyattr_get_attrDict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast<KX_GameObject*>(self_v); + KX_GameObject* self = static_cast<KX_GameObject*>(self_v); if (self->m_attr_dict==NULL) self->m_attr_dict= PyDict_New(); diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index 5ea7a2e7394..1597d7f8809 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -455,13 +455,13 @@ PyAttributeDef KX_IpoActuator::Attributes[] = { PyObject *KX_IpoActuator::pyattr_get_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v); + KX_IpoActuator* self = static_cast<KX_IpoActuator*>(self_v); return PyFloat_FromDouble(self->m_startframe); } int KX_IpoActuator::pyattr_set_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v); + KX_IpoActuator* self = static_cast<KX_IpoActuator*>(self_v); float param = PyFloat_AsDouble(value); if (PyErr_Occurred()) { @@ -476,13 +476,13 @@ int KX_IpoActuator::pyattr_set_frame_start(void *self_v, const KX_PYATTRIBUTE_DE PyObject *KX_IpoActuator::pyattr_get_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v); + KX_IpoActuator* self = static_cast<KX_IpoActuator*>(self_v); return PyFloat_FromDouble(self->m_endframe); } int KX_IpoActuator::pyattr_set_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v); + KX_IpoActuator* self = static_cast<KX_IpoActuator*>(self_v); float param = PyFloat_AsDouble(value); if (PyErr_Occurred()) { diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 13074fca537..a4e90cb1e83 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -126,14 +126,14 @@ bool KX_LightObject::ApplyLight(KX_Scene *kxscene, int oblayer, int slot) vec[0] = worldmatrix(0,2); vec[1] = worldmatrix(1,2); vec[2] = worldmatrix(2,2); - //vec[0]= base->object->obmat[2][0]; - //vec[1]= base->object->obmat[2][1]; - //vec[2]= base->object->obmat[2][2]; - vec[3]= 0.0; + //vec[0] = base->object->obmat[2][0]; + //vec[1] = base->object->obmat[2][1]; + //vec[2] = base->object->obmat[2][2]; + vec[3] = 0.0; glLightfv((GLenum)(GL_LIGHT0+slot), GL_POSITION, vec); } else { - //vec[3]= 1.0; + //vec[3] = 1.0; glLightfv((GLenum)(GL_LIGHT0+slot), GL_POSITION, vec); glLightf((GLenum)(GL_LIGHT0+slot), GL_CONSTANT_ATTENUATION, 1.0); glLightf((GLenum)(GL_LIGHT0+slot), GL_LINEAR_ATTENUATION, m_lightobj.m_att1/m_lightobj.m_distance); @@ -145,9 +145,9 @@ bool KX_LightObject::ApplyLight(KX_Scene *kxscene, int oblayer, int slot) vec[0] = -worldmatrix(0,2); vec[1] = -worldmatrix(1,2); vec[2] = -worldmatrix(2,2); - //vec[0]= -base->object->obmat[2][0]; - //vec[1]= -base->object->obmat[2][1]; - //vec[2]= -base->object->obmat[2][2]; + //vec[0] = -base->object->obmat[2][0]; + //vec[1] = -base->object->obmat[2][1]; + //vec[2] = -base->object->obmat[2][2]; glLightfv((GLenum)(GL_LIGHT0+slot), GL_SPOT_DIRECTION, vec); glLightf((GLenum)(GL_LIGHT0+slot), GL_SPOT_CUTOFF, m_lightobj.m_spotsize / 2.0f); glLightf((GLenum)(GL_LIGHT0+slot), GL_SPOT_EXPONENT, 128.0f * m_lightobj.m_spotblend); @@ -161,10 +161,10 @@ bool KX_LightObject::ApplyLight(KX_Scene *kxscene, int oblayer, int slot) vec[0] = vec[1] = vec[2] = vec[3] = 0.0; } else { - vec[0]= m_lightobj.m_energy*m_lightobj.m_red; - vec[1]= m_lightobj.m_energy*m_lightobj.m_green; - vec[2]= m_lightobj.m_energy*m_lightobj.m_blue; - vec[3]= 1.0; + vec[0] = m_lightobj.m_energy*m_lightobj.m_red; + vec[1] = m_lightobj.m_energy*m_lightobj.m_green; + vec[2] = m_lightobj.m_energy*m_lightobj.m_blue; + vec[3] = 1.0; } glLightfv((GLenum)(GL_LIGHT0+slot), GL_DIFFUSE, vec); @@ -173,10 +173,10 @@ bool KX_LightObject::ApplyLight(KX_Scene *kxscene, int oblayer, int slot) vec[0] = vec[1] = vec[2] = vec[3] = 0.0; } else if (m_lightobj.m_nodiffuse) { - vec[0]= m_lightobj.m_energy*m_lightobj.m_red; - vec[1]= m_lightobj.m_energy*m_lightobj.m_green; - vec[2]= m_lightobj.m_energy*m_lightobj.m_blue; - vec[3]= 1.0; + vec[0] = m_lightobj.m_energy*m_lightobj.m_red; + vec[1] = m_lightobj.m_energy*m_lightobj.m_green; + vec[2] = m_lightobj.m_energy*m_lightobj.m_blue; + vec[3] = 1.0; } glLightfv((GLenum)(GL_LIGHT0+slot), GL_SPECULAR, vec); diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index b49c27fc6b8..87c366046ad 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -220,7 +220,7 @@ PyObject *KX_MeshProxy::PyGetPolygon(PyObject *args, PyObject *kwds) PyObject *KX_MeshProxy::pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MeshProxy* self= static_cast<KX_MeshProxy*>(self_v); + KX_MeshProxy* self = static_cast<KX_MeshProxy*>(self_v); int tot= self->m_meshobj->NumMaterials(); int i; diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index 0d25cd0ffc1..9368bc6458f 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -392,19 +392,19 @@ PyAttributeDef KX_MouseFocusSensor::Attributes[] = { /* Attributes */ PyObject *KX_MouseFocusSensor::pyattr_get_ray_source(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); return PyObjectFrom(self->RaySource()); } PyObject *KX_MouseFocusSensor::pyattr_get_ray_target(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); return PyObjectFrom(self->RayTarget()); } PyObject *KX_MouseFocusSensor::pyattr_get_ray_direction(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); MT_Vector3 dir = self->RayTarget() - self->RaySource(); if (MT_fuzzyZero(dir)) dir.setValue(0,0,0); else dir.normalize(); @@ -413,7 +413,7 @@ PyObject *KX_MouseFocusSensor::pyattr_get_ray_direction(void *self_v, const KX_P PyObject *KX_MouseFocusSensor::pyattr_get_hit_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); if (self->m_hitObject) return self->m_hitObject->GetProxy(); @@ -423,19 +423,19 @@ PyObject *KX_MouseFocusSensor::pyattr_get_hit_object(void *self_v, const KX_PYAT PyObject *KX_MouseFocusSensor::pyattr_get_hit_position(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); return PyObjectFrom(self->HitPosition()); } PyObject *KX_MouseFocusSensor::pyattr_get_hit_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); return PyObjectFrom(self->HitNormal()); } PyObject *KX_MouseFocusSensor::pyattr_get_hit_uv(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v); + KX_MouseFocusSensor* self = static_cast<KX_MouseFocusSensor*>(self_v); return PyObjectFrom(self->HitUV()); } diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp index b722c660d65..33656e9fd52 100644 --- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp +++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp @@ -258,10 +258,10 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts, raspoly = meshobj->GetPolygon(p); for (int v=0; v<raspoly->VertexCount()-2; v++) { - poly[0]= raspoly->GetVertex(0)->getOrigIndex(); + poly[0] = raspoly->GetVertex(0)->getOrigIndex(); for (size_t i=1; i<3; i++) { - poly[i]= raspoly->GetVertex(v+i)->getOrigIndex(); + poly[i] = raspoly->GetVertex(v+i)->getOrigIndex(); } poly += 6; } diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index c57cb7b55b7..9cebf9cfc82 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -389,8 +389,8 @@ static unsigned char mathutils_kxobactu_vector_cb_index = -1; /* index for our c static int mathutils_obactu_generic_check(BaseMathObject *bmo) { - KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_ObjectActuator* self = static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; return 0; @@ -398,8 +398,8 @@ static int mathutils_obactu_generic_check(BaseMathObject *bmo) static int mathutils_obactu_vector_get(BaseMathObject *bmo, int subtype) { - KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_ObjectActuator* self = static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; switch (subtype) { @@ -416,8 +416,8 @@ static int mathutils_obactu_vector_get(BaseMathObject *bmo, int subtype) static int mathutils_obactu_vector_set(BaseMathObject *bmo, int subtype) { - KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); - if (self==NULL) + KX_ObjectActuator* self = static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); + if (self == NULL) return -1; switch (subtype) { @@ -442,13 +442,13 @@ static int mathutils_obactu_vector_get_index(BaseMathObject *bmo, int subtype, i static int mathutils_obactu_vector_set_index(BaseMathObject *bmo, int subtype, int index) { - float f= bmo->data[index]; + float f = bmo->data[index]; /* lazy, avoid repeteing the case statement */ if (mathutils_obactu_vector_get(bmo, subtype) == -1) return -1; - bmo->data[index]= f; + bmo->data[index] = f; return mathutils_obactu_vector_set(bmo, subtype); } @@ -467,7 +467,7 @@ PyObject *KX_ObjectActuator::pyattr_get_linV(void *self_v, const KX_PYATTRIBUTE_ int KX_ObjectActuator::pyattr_set_linV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>(self_v); + KX_ObjectActuator* self = static_cast<KX_ObjectActuator*>(self_v); if (!PyVecTo(value, self->m_linear_velocity)) return PY_SET_ATTR_FAIL; @@ -483,7 +483,7 @@ PyObject *KX_ObjectActuator::pyattr_get_angV(void *self_v, const KX_PYATTRIBUTE_ int KX_ObjectActuator::pyattr_set_angV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>(self_v); + KX_ObjectActuator* self = static_cast<KX_ObjectActuator*>(self_v); if (!PyVecTo(value, self->m_angular_velocity)) return PY_SET_ATTR_FAIL; diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index 13b6bda4ebc..465e91ffb32 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -114,52 +114,52 @@ CValue* KX_PolyProxy::GetReplica() { return NULL;} PyObject *KX_PolyProxy::pyattr_get_material_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return self->PygetMaterialName(); } PyObject *KX_PolyProxy::pyattr_get_texture_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return self->PygetTextureName(); } PyObject *KX_PolyProxy::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return self->PygetMaterial(); } PyObject *KX_PolyProxy::pyattr_get_material_id(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return self->PygetMaterialIndex(); } PyObject *KX_PolyProxy::pyattr_get_v1(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 0)); } PyObject *KX_PolyProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 1)); } PyObject *KX_PolyProxy::pyattr_get_v3(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 2)); } PyObject *KX_PolyProxy::pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); if (3 < self->m_polygon->VertexCount()) { @@ -170,13 +170,13 @@ PyObject *KX_PolyProxy::pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *at PyObject *KX_PolyProxy::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return self->PyisVisible(); } PyObject *KX_PolyProxy::pyattr_get_collide(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v); + KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); return self->PyisCollider(); } diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 3b58a8abd83..36c94dc997b 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -357,26 +357,26 @@ KX_PYMETHODDEF_DOC(KX_PolygonMaterial, activate, "activate(rasty, cachingInfo)") PyObject *KX_PolygonMaterial::pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); return PyUnicode_From_STR_String(self->m_texturename); } PyObject *KX_PolygonMaterial::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); return PyUnicode_From_STR_String(self->m_materialname); } /* this does not seem useful */ PyObject *KX_PolygonMaterial::pyattr_get_tface(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); return PyCapsule_New(&self->m_tface, KX_POLYGONMATERIAL_CAPSULE_ID, NULL); } PyObject *KX_PolygonMaterial::pyattr_get_gl_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); int bindcode= 0; if (self->m_tface.tpage) bindcode= self->m_tface.tpage->bindcode; @@ -387,13 +387,13 @@ PyObject *KX_PolygonMaterial::pyattr_get_gl_texture(void *self_v, const KX_PYATT PyObject *KX_PolygonMaterial::pyattr_get_diffuse(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); return PyObjectFrom(self->m_diffuse); } int KX_PolygonMaterial::pyattr_set_diffuse(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); MT_Vector3 vec; if (!PyVecTo(value, vec)) @@ -405,13 +405,13 @@ int KX_PolygonMaterial::pyattr_set_diffuse(void *self_v, const KX_PYATTRIBUTE_DE PyObject *KX_PolygonMaterial::pyattr_get_specular(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); return PyObjectFrom(self->m_specular); } int KX_PolygonMaterial::pyattr_set_specular(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v); + KX_PolygonMaterial* self = static_cast<KX_PolygonMaterial*>(self_v); MT_Vector3 vec; if (!PyVecTo(value, vec)) diff --git a/source/gameengine/Ketsji/KX_PyMath.cpp b/source/gameengine/Ketsji/KX_PyMath.cpp index 85303b143bd..804e8de2ad1 100644 --- a/source/gameengine/Ketsji/KX_PyMath.cpp +++ b/source/gameengine/Ketsji/KX_PyMath.cpp @@ -86,11 +86,11 @@ bool PyQuatTo(PyObject *pyval, MT_Quaternion &qrot) return false; /* annoying!, Blender/Mathutils have the W axis first! */ - MT_Scalar w= qrot[0]; /* from python, this is actually the W */ - qrot[0]= qrot[1]; - qrot[1]= qrot[2]; - qrot[2]= qrot[3]; - qrot[3]= w; + MT_Scalar w = qrot[0]; /* from python, this is actually the W */ + qrot[0] = qrot[1]; + qrot[1] = qrot[2]; + qrot[2] = qrot[3]; + qrot[3] = w; return true; } diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 3bb657e2b87..2c147528bcb 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1844,7 +1844,7 @@ void removeImportMain(struct Main *maggie) } // Copied from bpy_interface.c -static struct _inittab bge_internal_modules[]= { +static struct _inittab bge_internal_modules[] = { {(char *)"mathutils", PyInit_mathutils}, {(char *)"bgl", BPyInit_bgl}, {(char *)"blf", BPyInit_blf}, diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index fb949fffa8a..04d67fc73e1 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -219,7 +219,7 @@ PyAttributeDef KX_RadarSensor::Attributes[] = { PyObject *KX_RadarSensor::pyattr_get_angle(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_RadarSensor* self= static_cast<KX_RadarSensor*>(self_v); + KX_RadarSensor* self = static_cast<KX_RadarSensor*>(self_v); // The original angle from the gui was converted, so we recalculate the value here to maintain // consistency between Python and the gui diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index f772fa5113a..96b4a21a36c 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -2043,11 +2043,11 @@ PyMethodDef KX_Scene::Methods[] = { }; static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) { - KX_Scene* self= static_cast<KX_Scene*>BGE_PROXY_REF(self_v); + KX_Scene* self = static_cast<KX_Scene*>BGE_PROXY_REF(self_v); const char *attr_str= _PyUnicode_AsString(item); PyObject *pyconvert; - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "val = scene[key]: KX_Scene, "BGE_PROXY_ERROR_MSG); return NULL; } @@ -2069,12 +2069,12 @@ static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) { - KX_Scene* self= static_cast<KX_Scene*>BGE_PROXY_REF(self_v); + KX_Scene* self = static_cast<KX_Scene*>BGE_PROXY_REF(self_v); const char *attr_str= _PyUnicode_AsString(key); if (attr_str==NULL) PyErr_Clear(); - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "scene[key] = value: KX_Scene, "BGE_PROXY_ERROR_MSG); return -1; } @@ -2116,9 +2116,9 @@ static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) static int Seq_Contains(PyObject *self_v, PyObject *value) { - KX_Scene* self= static_cast<KX_Scene*>BGE_PROXY_REF(self_v); + KX_Scene* self = static_cast<KX_Scene*>BGE_PROXY_REF(self_v); - if (self==NULL) { + if (self == NULL) { PyErr_SetString(PyExc_SystemError, "val in scene: KX_Scene, "BGE_PROXY_ERROR_MSG); return -1; } @@ -2130,45 +2130,45 @@ static int Seq_Contains(PyObject *self_v, PyObject *value) } PyMappingMethods KX_Scene::Mapping = { - (lenfunc)NULL , /*inquiry mp_length */ - (binaryfunc)Map_GetItem, /*binaryfunc mp_subscript */ - (objobjargproc)Map_SetItem, /*objobjargproc mp_ass_subscript */ + (lenfunc)NULL, /* inquiry mp_length */ + (binaryfunc)Map_GetItem, /* binaryfunc mp_subscript */ + (objobjargproc)Map_SetItem, /* objobjargproc mp_ass_subscript */ }; PySequenceMethods KX_Scene::Sequence = { - NULL, /* Cant set the len otherwise it can evaluate as false */ - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - NULL, /* sq_item */ - NULL, /* sq_slice */ - NULL, /* sq_ass_item */ - NULL, /* sq_ass_slice */ - (objobjproc)Seq_Contains, /* sq_contains */ - (binaryfunc) NULL, /* sq_inplace_concat */ - (ssizeargfunc) NULL, /* sq_inplace_repeat */ + NULL, /* Cant set the len otherwise it can evaluate as false */ + NULL, /* sq_concat */ + NULL, /* sq_repeat */ + NULL, /* sq_item */ + NULL, /* sq_slice */ + NULL, /* sq_ass_item */ + NULL, /* sq_ass_slice */ + (objobjproc)Seq_Contains, /* sq_contains */ + (binaryfunc) NULL, /* sq_inplace_concat */ + (ssizeargfunc) NULL, /* sq_inplace_repeat */ }; PyObject *KX_Scene::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); return PyUnicode_From_STR_String(self->GetName()); } PyObject *KX_Scene::pyattr_get_objects(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); return self->GetObjectList()->GetProxy(); } PyObject *KX_Scene::pyattr_get_objects_inactive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); return self->GetInactiveList()->GetProxy(); } PyObject *KX_Scene::pyattr_get_lights(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); return self->GetLightList()->GetProxy(); } @@ -2179,7 +2179,7 @@ PyObject *KX_Scene::pyattr_get_cameras(void *self_v, const KX_PYATTRIBUTE_DEF *a * however this is the same with "scene.objects + []", when you make a copy by adding lists. */ - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); CListValue* clist = new CListValue(); /* return self->GetCameras()->GetProxy(); */ @@ -2195,7 +2195,7 @@ PyObject *KX_Scene::pyattr_get_cameras(void *self_v, const KX_PYATTRIBUTE_DEF *a PyObject *KX_Scene::pyattr_get_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); KX_Camera* cam= self->GetActiveCamera(); if (cam) return self->GetActiveCamera()->GetProxy(); @@ -2206,7 +2206,7 @@ PyObject *KX_Scene::pyattr_get_active_camera(void *self_v, const KX_PYATTRIBUTE_ int KX_Scene::pyattr_set_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_Scene* self= static_cast<KX_Scene*>(self_v); + KX_Scene* self = static_cast<KX_Scene*>(self_v); KX_Camera *camOb; if (!ConvertPythonToCamera(value, &camOb, false, "scene.active_camera = value: KX_Scene")) diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 885ac70061e..36e0bf692f1 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -333,7 +333,7 @@ PyAttributeDef KX_TouchSensor::Attributes[] = { PyObject *KX_TouchSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_TouchSensor* self= static_cast<KX_TouchSensor*>(self_v); + KX_TouchSensor* self = static_cast<KX_TouchSensor*>(self_v); if (self->m_hitObject) return self->m_hitObject->GetProxy(); @@ -343,7 +343,7 @@ PyObject *KX_TouchSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBU PyObject *KX_TouchSensor::pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_TouchSensor* self= static_cast<KX_TouchSensor*>(self_v); + KX_TouchSensor* self = static_cast<KX_TouchSensor*>(self_v); return self->m_colliders->GetProxy(); } diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index 461563d4512..dabb79b357d 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -103,85 +103,85 @@ PyAttributeDef KX_VertexProxy::Attributes[] = { PyObject *KX_VertexProxy::pyattr_get_x(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getXYZ()[0]); } PyObject *KX_VertexProxy::pyattr_get_y(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getXYZ()[1]); } PyObject *KX_VertexProxy::pyattr_get_z(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getXYZ()[2]); } PyObject *KX_VertexProxy::pyattr_get_r(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getRGBA()[0]/255.0); } PyObject *KX_VertexProxy::pyattr_get_g(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getRGBA()[1]/255.0); } PyObject *KX_VertexProxy::pyattr_get_b(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getRGBA()[2]/255.0); } PyObject *KX_VertexProxy::pyattr_get_a(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getRGBA()[3]/255.0); } PyObject *KX_VertexProxy::pyattr_get_u(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getUV1()[0]); } PyObject *KX_VertexProxy::pyattr_get_v(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getUV1()[1]); } PyObject *KX_VertexProxy::pyattr_get_u2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getUV2()[0]); } PyObject *KX_VertexProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyFloat_FromDouble(self->m_vertex->getUV2()[1]); } PyObject *KX_VertexProxy::pyattr_get_XYZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyObjectFrom(MT_Vector3(self->m_vertex->getXYZ())); } PyObject *KX_VertexProxy::pyattr_get_UV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyObjectFrom(MT_Point2(self->m_vertex->getUV1())); } PyObject *KX_VertexProxy::pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); const unsigned char *colp = self->m_vertex->getRGBA(); MT_Vector4 color(colp[0], colp[1], colp[2], colp[3]); color /= 255.0; @@ -190,13 +190,13 @@ PyObject *KX_VertexProxy::pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DE PyObject *KX_VertexProxy::pyattr_get_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); return PyObjectFrom(MT_Vector3(self->m_vertex->getNormal())); } int KX_VertexProxy::pyattr_set_x(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -211,7 +211,7 @@ int KX_VertexProxy::pyattr_set_x(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_y(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -226,7 +226,7 @@ int KX_VertexProxy::pyattr_set_y(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_z(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -241,7 +241,7 @@ int KX_VertexProxy::pyattr_set_z(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_u(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -256,7 +256,7 @@ int KX_VertexProxy::pyattr_set_u(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_v(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -271,7 +271,7 @@ int KX_VertexProxy::pyattr_set_v(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_u2(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -286,7 +286,7 @@ int KX_VertexProxy::pyattr_set_u2(void *self_v, const struct KX_PYATTRIBUTE_DEF int KX_VertexProxy::pyattr_set_v2(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -301,7 +301,7 @@ int KX_VertexProxy::pyattr_set_v2(void *self_v, const struct KX_PYATTRIBUTE_DEF int KX_VertexProxy::pyattr_set_r(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -318,7 +318,7 @@ int KX_VertexProxy::pyattr_set_r(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_g(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -335,7 +335,7 @@ int KX_VertexProxy::pyattr_set_g(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_b(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -352,7 +352,7 @@ int KX_VertexProxy::pyattr_set_b(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_a(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PyFloat_Check(value)) { float val = PyFloat_AsDouble(value); @@ -369,7 +369,7 @@ int KX_VertexProxy::pyattr_set_a(void *self_v, const struct KX_PYATTRIBUTE_DEF * int KX_VertexProxy::pyattr_set_XYZ(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PySequence_Check(value)) { MT_Point3 vec; @@ -385,7 +385,7 @@ int KX_VertexProxy::pyattr_set_XYZ(void *self_v, const struct KX_PYATTRIBUTE_DEF int KX_VertexProxy::pyattr_set_UV(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PySequence_Check(value)) { MT_Point2 vec; @@ -401,7 +401,7 @@ int KX_VertexProxy::pyattr_set_UV(void *self_v, const struct KX_PYATTRIBUTE_DEF int KX_VertexProxy::pyattr_set_color(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PySequence_Check(value)) { MT_Vector4 vec; @@ -417,7 +417,7 @@ int KX_VertexProxy::pyattr_set_color(void *self_v, const struct KX_PYATTRIBUTE_D int KX_VertexProxy::pyattr_set_normal(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { - KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v); + KX_VertexProxy* self = static_cast<KX_VertexProxy*>(self_v); if (PySequence_Check(value)) { MT_Vector3 vec; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 29a9b6481e9..568c11a0be4 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -1520,10 +1520,10 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, // only add polygons that have the collision flag set if (poly->IsCollider()) { - if (vert_tag_array[mf->v1]==false) {vert_tag_array[mf->v1]= true;tot_bt_verts++;} - if (vert_tag_array[mf->v2]==false) {vert_tag_array[mf->v2]= true;tot_bt_verts++;} - if (vert_tag_array[mf->v3]==false) {vert_tag_array[mf->v3]= true;tot_bt_verts++;} - if (mf->v4 && vert_tag_array[mf->v4]==false) {vert_tag_array[mf->v4]= true;tot_bt_verts++;} + if (vert_tag_array[mf->v1] == false) {vert_tag_array[mf->v1] = true; tot_bt_verts++;} + if (vert_tag_array[mf->v2] == false) {vert_tag_array[mf->v2] = true; tot_bt_verts++;} + if (vert_tag_array[mf->v3] == false) {vert_tag_array[mf->v3] = true; tot_bt_verts++;} + if (mf->v4 && vert_tag_array[mf->v4] == false) {vert_tag_array[mf->v4] = true; tot_bt_verts++;} } } @@ -1542,7 +1542,7 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, if (vert_tag_array[mf->v1]==true) { const float* vtx = mvert[mf->v1].co; - vert_tag_array[mf->v1]= false; + vert_tag_array[mf->v1] = false; *bt++ = vtx[0]; *bt++ = vtx[1]; *bt++ = vtx[2]; @@ -1550,7 +1550,7 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, if (vert_tag_array[mf->v2]==true) { const float* vtx = mvert[mf->v2].co; - vert_tag_array[mf->v2]= false; + vert_tag_array[mf->v2] = false; *bt++ = vtx[0]; *bt++ = vtx[1]; *bt++ = vtx[2]; @@ -1558,7 +1558,7 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, if (vert_tag_array[mf->v3]==true) { const float* vtx = mvert[mf->v3].co; - vert_tag_array[mf->v3]= false; + vert_tag_array[mf->v3] = false; *bt++ = vtx[0]; *bt++ = vtx[1]; *bt++ = vtx[2]; @@ -1566,7 +1566,7 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, if (mf->v4 && vert_tag_array[mf->v4]==true) { const float* vtx = mvert[mf->v4].co; - vert_tag_array[mf->v4]= false; + vert_tag_array[mf->v4] = false; *bt++ = vtx[0]; *bt++ = vtx[1]; *bt++ = vtx[2]; @@ -1588,13 +1588,13 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, if (poly->IsCollider()) { if (vert_tag_array[mf->v1]==false) - {vert_tag_array[mf->v1]= true;vert_remap_array[mf->v1]= tot_bt_verts;tot_bt_verts++;} + {vert_tag_array[mf->v1] = true;vert_remap_array[mf->v1] = tot_bt_verts;tot_bt_verts++;} if (vert_tag_array[mf->v2]==false) - {vert_tag_array[mf->v2]= true;vert_remap_array[mf->v2]= tot_bt_verts;tot_bt_verts++;} + {vert_tag_array[mf->v2] = true;vert_remap_array[mf->v2] = tot_bt_verts;tot_bt_verts++;} if (vert_tag_array[mf->v3]==false) - {vert_tag_array[mf->v3]= true;vert_remap_array[mf->v3]= tot_bt_verts;tot_bt_verts++;} + {vert_tag_array[mf->v3] = true;vert_remap_array[mf->v3] = tot_bt_verts;tot_bt_verts++;} if (mf->v4 && vert_tag_array[mf->v4]==false) - {vert_tag_array[mf->v4]= true;vert_remap_array[mf->v4]= tot_bt_verts;tot_bt_verts++;} + {vert_tag_array[mf->v4] = true;vert_remap_array[mf->v4] = tot_bt_verts;tot_bt_verts++;} tot_bt_tris += (mf->v4 ? 2:1); /* a quad or a tri */ } } @@ -1629,9 +1629,9 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, MVert *v3= &mvert[mf->v3]; // the face indices - tri_pt[0]= vert_remap_array[mf->v1]; - tri_pt[1]= vert_remap_array[mf->v2]; - tri_pt[2]= vert_remap_array[mf->v3]; + tri_pt[0] = vert_remap_array[mf->v1]; + tri_pt[1] = vert_remap_array[mf->v2]; + tri_pt[2] = vert_remap_array[mf->v3]; tri_pt= tri_pt+3; if (tf) { @@ -1650,19 +1650,19 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, // the vertex location if (vert_tag_array[mf->v1]==true) { /* *** v1 *** */ - vert_tag_array[mf->v1]= false; + vert_tag_array[mf->v1] = false; *bt++ = v1->co[0]; *bt++ = v1->co[1]; *bt++ = v1->co[2]; } if (vert_tag_array[mf->v2]==true) { /* *** v2 *** */ - vert_tag_array[mf->v2]= false; + vert_tag_array[mf->v2] = false; *bt++ = v2->co[0]; *bt++ = v2->co[1]; *bt++ = v2->co[2]; } if (vert_tag_array[mf->v3]==true) { /* *** v3 *** */ - vert_tag_array[mf->v3]= false; + vert_tag_array[mf->v3] = false; *bt++ = v3->co[0]; *bt++ = v3->co[1]; *bt++ = v3->co[2]; @@ -1672,9 +1672,9 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, { MVert *v4= &mvert[mf->v4]; - tri_pt[0]= vert_remap_array[mf->v1]; - tri_pt[1]= vert_remap_array[mf->v3]; - tri_pt[2]= vert_remap_array[mf->v4]; + tri_pt[0] = vert_remap_array[mf->v1]; + tri_pt[1] = vert_remap_array[mf->v3]; + tri_pt[2] = vert_remap_array[mf->v4]; tri_pt= tri_pt+3; if (tf) { @@ -1692,8 +1692,8 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, poly_index_pt++; // the vertex location - if (vert_tag_array[mf->v4]==true) { /* *** v4 *** */ - vert_tag_array[mf->v4]= false; + if (vert_tag_array[mf->v4] == true) { /* *** v4 *** */ + vert_tag_array[mf->v4] = false; *bt++ = v4->co[0]; *bt++ = v4->co[1]; *bt++ = v4->co[2]; @@ -1832,8 +1832,8 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA if (vert_tag_array[v_orig]==false) { - vert_tag_array[v_orig]= true; - vert_remap_array[v_orig]= tot_bt_verts; + vert_tag_array[v_orig] = true; + vert_remap_array[v_orig] = tot_bt_verts; tot_bt_verts++; } } @@ -1880,7 +1880,7 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA *bt++ = mv->co[1]; *bt++ = mv->co[2]; - vert_tag_array[v_orig]= false; + vert_tag_array[v_orig] = false; } *tri_pt++ = vert_remap_array[v_orig]; uv_pt->uv[0] = tf->uv[*fv_pt][0]; @@ -1941,7 +1941,7 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA /* transverts are only used for deformed RAS_Meshes, the RAS_TexVert data * is too hard to get at, see below for details */ - float (*transverts)[3]= NULL; + float (*transverts)[3] = NULL; int transverts_tot= 0; /* with deformed meshes - should always be greater then the max orginal index, or we get crashes */ if (deformer) { @@ -1971,8 +1971,8 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA v_orig= poly->GetVertex(i)->getOrigIndex(); if (vert_tag_array[v_orig]==false) { - vert_tag_array[v_orig]= true; - vert_remap_array[v_orig]= tot_bt_verts; + vert_tag_array[v_orig] = true; + vert_remap_array[v_orig] = tot_bt_verts; tot_bt_verts++; } } @@ -2025,14 +2025,14 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA *bt++ = xyz[2]; } - vert_tag_array[v_orig]= false; + vert_tag_array[v_orig] = false; } *tri_pt++ = vert_remap_array[v_orig]; } } - m_polygonIndexArray[p]= p; /* dumb counting */ + m_polygonIndexArray[p] = p; /* dumb counting */ } } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 6ba03606bf2..e43ddb303e9 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -1517,8 +1517,8 @@ struct OcclusionBuffer return(true); } } - } else if (width == 1) - { + } + else if (width == 1) { // Degenerated in at least 2 vertical lines // The algorithm below doesn't work when face has a single pixel width // We cannot use general formulas because the plane is degenerated. @@ -1529,16 +1529,16 @@ struct OcclusionBuffer if (y[0] > y[1]) { ytmp=y[1];y[1]=y[0];y[0]=ytmp;ztmp=z[1];z[1]=z[0];z[0]=ztmp; } if (y[0] > y[2]) { ytmp=y[2];y[2]=y[0];y[0]=ytmp;ztmp=z[2];z[2]=z[0];z[0]=ztmp; } if (y[1] > y[2]) { ytmp=y[2];y[2]=y[1];y[1]=ytmp;ztmp=z[2];z[2]=z[1];z[1]=ztmp; } - int dy[]={ y[0]-y[1], - y[1]-y[2], - y[2]-y[0]}; + int dy[] = {y[0] - y[1], + y[1] - y[2], + y[2] - y[0]}; btScalar dzy[3]; - dzy[0] = (dy[0]) ? (z[0]-z[1])/dy[0] : btScalar(0.f); - dzy[1] = (dy[1]) ? (z[1]-z[2])/dy[1] : btScalar(0.f); - dzy[2] = (dy[2]) ? (z[2]-z[0])/dy[2] : btScalar(0.f); - btScalar v[3] = { dzy[0]*(miy-y[0])+z[0], - dzy[1]*(miy-y[1])+z[1], - dzy[2]*(miy-y[2])+z[2] }; + dzy[0] = (dy[0]) ? (z[0] - z[1]) / dy[0] : btScalar(0.f); + dzy[1] = (dy[1]) ? (z[1] - z[2]) / dy[1] : btScalar(0.f); + dzy[2] = (dy[2]) ? (z[2] - z[0]) / dy[2] : btScalar(0.f); + btScalar v[3] = {dzy[0] * (miy - y[0]) + z[0], + dzy[1] * (miy - y[1]) + z[1], + dzy[2] * (miy - y[2]) + z[2]}; dy[0] = y[1]-y[0]; dy[1] = y[0]-y[1]; dy[2] = y[2]-y[0]; @@ -1566,16 +1566,16 @@ struct OcclusionBuffer if (x[0] > x[1]) { xtmp=x[1];x[1]=x[0];x[0]=xtmp;ztmp=z[1];z[1]=z[0];z[0]=ztmp; } if (x[0] > x[2]) { xtmp=x[2];x[2]=x[0];x[0]=xtmp;ztmp=z[2];z[2]=z[0];z[0]=ztmp; } if (x[1] > x[2]) { xtmp=x[2];x[2]=x[1];x[1]=xtmp;ztmp=z[2];z[2]=z[1];z[1]=ztmp; } - int dx[]={ x[0]-x[1], - x[1]-x[2], - x[2]-x[0]}; + int dx[] = {x[0] - x[1], + x[1] - x[2], + x[2] - x[0]}; btScalar dzx[3]; dzx[0] = (dx[0]) ? (z[0]-z[1])/dx[0] : btScalar(0.f); dzx[1] = (dx[1]) ? (z[1]-z[2])/dx[1] : btScalar(0.f); dzx[2] = (dx[2]) ? (z[2]-z[0])/dx[2] : btScalar(0.f); - btScalar v[3] = { dzx[0]*(mix-x[0])+z[0], - dzx[1]*(mix-x[1])+z[1], - dzx[2]*(mix-x[2])+z[2] }; + btScalar v[3] = {dzx[0] * (mix - x[0]) + z[0], + dzx[1] * (mix - x[1]) + z[1], + dzx[2] * (mix - x[2]) + z[2]}; dx[0] = x[1]-x[0]; dx[1] = x[0]-x[1]; dx[2] = x[2]-x[0]; @@ -1592,24 +1592,24 @@ struct OcclusionBuffer v[0] += dzx[0]; v[1] += dzx[1]; v[2] += dzx[2]; dx[0]--; dx[1]++, dx[2]--; } - } else - { + } + else { // general case - const int dx[]={ y[0]-y[1], - y[1]-y[2], - y[2]-y[0]}; - const int dy[]={ x[1]-x[0]-dx[0]*width, - x[2]-x[1]-dx[1]*width, - x[0]-x[2]-dx[2]*width}; - const int a=x[2]*y[0]+x[0]*y[1]-x[2]*y[1]-x[0]*y[2]+x[1]*y[2]-x[1]*y[0]; - const btScalar ia=1/(btScalar)a; - const btScalar dzx=ia*(y[2]*(z[1]-z[0])+y[1]*(z[0]-z[2])+y[0]*(z[2]-z[1])); - const btScalar dzy=ia*(x[2]*(z[0]-z[1])+x[0]*(z[1]-z[2])+x[1]*(z[2]-z[0]))-(dzx*width); - int c[]={ miy*x[1]+mix*y[0]-x[1]*y[0]-mix*y[1]+x[0]*y[1]-miy*x[0], - miy*x[2]+mix*y[1]-x[2]*y[1]-mix*y[2]+x[1]*y[2]-miy*x[1], - miy*x[0]+mix*y[2]-x[0]*y[2]-mix*y[0]+x[2]*y[0]-miy*x[2]}; - btScalar v=ia*((z[2]*c[0])+(z[0]*c[1])+(z[1]*c[2])); - btScalar* scan=&m_buffer[miy*m_sizes[0]]; + const int dx[] = {y[0] - y[1], + y[1] - y[2], + y[2] - y[0]}; + const int dy[] = {x[1] - x[0] - dx[0] * width, + x[2] - x[1] - dx[1] * width, + x[0] - x[2] - dx[2] * width}; + const int a = x[2] * y[0] + x[0] * y[1] - x[2] * y[1] - x[0] * y[2] + x[1] * y[2] - x[1] * y[0]; + const btScalar ia = 1 / (btScalar)a; + const btScalar dzx = ia*(y[2]*(z[1]-z[0])+y[1]*(z[0]-z[2])+y[0]*(z[2]-z[1])); + const btScalar dzy = ia*(x[2]*(z[0]-z[1])+x[0]*(z[1]-z[2])+x[1]*(z[2]-z[0]))-(dzx*width); + int c[] = {miy*x[1]+mix*y[0]-x[1]*y[0]-mix*y[1]+x[0]*y[1]-miy*x[0], + miy*x[2]+mix*y[1]-x[2]*y[1]-mix*y[2]+x[1]*y[2]-miy*x[1], + miy*x[0]+mix*y[2]-x[0]*y[2]-mix*y[0]+x[2]*y[0]-miy*x[2]}; + btScalar v = ia*((z[2]*c[0])+(z[0]*c[1])+(z[1]*c[2])); + btScalar *scan = &m_buffer[miy*m_sizes[0]]; for (int iy=miy;iy<mxy;++iy) { for (int ix=mix;ix<mxx;++ix) @@ -1696,18 +1696,18 @@ struct OcclusionBuffer // the box is clipped, it's probably a large box, don't waste our time to check if ((x[i][2]+x[i][3])<=0) return(true); } - static const int d[]={ 1,0,3,2, - 4,5,6,7, - 4,7,3,0, - 6,5,1,2, - 7,6,2,3, - 5,4,0,1}; + static const int d[] = {1,0,3,2, + 4,5,6,7, + 4,7,3,0, + 6,5,1,2, + 7,6,2,3, + 5,4,0,1}; for (unsigned int i=0;i<(sizeof(d)/sizeof(d[0]));) { - const btVector4 p[]={ x[d[i++]], - x[d[i++]], - x[d[i++]], - x[d[i++]]}; + const btVector4 p[] = {x[d[i++]], + x[d[i++]], + x[d[i++]], + x[d[i++]]}; if (clipDraw<4,QueryOCL>(p,1.f,0.f)) return(true); } @@ -1966,8 +1966,8 @@ void CcdPhysicsEnvironment::setConstraintParam(int constraintId,int param,float btGeneric6DofConstraint* genCons = (btGeneric6DofConstraint*)typedConstraint; int transMotorIndex = param-6; btTranslationalLimitMotor* transMotor = genCons->getTranslationalLimitMotor(); - transMotor->m_targetVelocity[transMotorIndex]= value0; - transMotor->m_maxMotorForce[transMotorIndex]=value1; + transMotor->m_targetVelocity[transMotorIndex] = value0; + transMotor->m_maxMotorForce[transMotorIndex] = value1; transMotor->m_enableMotor[transMotorIndex] = (value1>0.f); break; } diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index 480cc742ec8..9fb47117f1d 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -393,7 +393,7 @@ bool RAS_MeshSlot::Join(RAS_MeshSlot *target, MT_Scalar distance) target->m_joinedSlots.push_back(this); MT_Matrix4x4 ntransform = m_joinInvTransform.transposed(); - ntransform[0][3]= ntransform[1][3]= ntransform[2][3]= 0.0f; + ntransform[0][3] = ntransform[1][3] = ntransform[2][3] = 0.0f; for (begin(mit); !end(mit); next(mit)) for (i=mit.startvertex; i<mit.endvertex; i++) @@ -471,7 +471,7 @@ bool RAS_MeshSlot::Split(bool force) } MT_Matrix4x4 ntransform = m_joinInvTransform.inverse().transposed(); - ntransform[0][3]= ntransform[1][3]= ntransform[2][3]= 0.0f; + ntransform[0][3] = ntransform[1][3] = ntransform[2][3] = 0.0f; for (begin(mit); !end(mit); next(mit)) for (i=mit.startvertex; i<mit.endvertex; i++) diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index 21d2e6d5a7b..2ccb9453b3d 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -608,7 +608,7 @@ void RAS_MeshObject::CheckWeightCache(Object* obj) weights= (float*)MEM_mallocN(totvert*sizeof(float), "weights"); for (i=0; i < totvert; i++, dv++) { - weights[i]= defvert_find_weight(dv, defindex); + weights[i] = defvert_find_weight(dv, defindex); } kb->weights = weights; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 9d87f0df047..dc96e972217 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -239,10 +239,10 @@ void RAS_OpenGLRasterizer::DisplayFog() glFogf(GL_FOG_DENSITY, 0.1f); glFogf(GL_FOG_START, m_fogstart); glFogf(GL_FOG_END, m_fogstart + m_fogdist); - params[0]= m_fogr; - params[1]= m_fogg; - params[2]= m_fogb; - params[3]= 0.0; + params[0] = m_fogr; + params[1] = m_fogg; + params[2] = m_fogb; + params[3] = 0.0; glFogfv(GL_FOG_COLOR, params); glEnable(GL_FOG); } diff --git a/source/gameengine/Rasterizer/RAS_Polygon.cpp b/source/gameengine/Rasterizer/RAS_Polygon.cpp index f454d1c0204..74544a80efa 100644 --- a/source/gameengine/Rasterizer/RAS_Polygon.cpp +++ b/source/gameengine/Rasterizer/RAS_Polygon.cpp @@ -40,7 +40,7 @@ RAS_Polygon::RAS_Polygon(RAS_MaterialBucket* bucket, RAS_DisplayArray *darray, i { m_bucket = bucket; m_darray = darray; - m_offset[0]= m_offset[1]= m_offset[2]= m_offset[3]= 0; + m_offset[0] = m_offset[1] = m_offset[2] = m_offset[3] = 0; m_numvert = numvert; // m_edgecode = 255; diff --git a/source/gameengine/Rasterizer/RAS_TexVert.cpp b/source/gameengine/Rasterizer/RAS_TexVert.cpp index f74aa24232b..b60fae73e2a 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.cpp +++ b/source/gameengine/Rasterizer/RAS_TexVert.cpp @@ -77,7 +77,7 @@ void RAS_TexVert::SetXYZ(const MT_Point3& xyz) void RAS_TexVert::SetXYZ(const float *xyz) { - m_localxyz[0]= xyz[0]; m_localxyz[1]= xyz[1]; m_localxyz[2]= xyz[2]; + m_localxyz[0] = xyz[0]; m_localxyz[1] = xyz[1]; m_localxyz[2] = xyz[2]; } void RAS_TexVert::SetUV(const MT_Point2& uv) diff --git a/source/gameengine/Rasterizer/RAS_texmatrix.cpp b/source/gameengine/Rasterizer/RAS_texmatrix.cpp index 4399265c380..d335a38171f 100644 --- a/source/gameengine/Rasterizer/RAS_texmatrix.cpp +++ b/source/gameengine/Rasterizer/RAS_texmatrix.cpp @@ -93,10 +93,10 @@ int main() MT_Point2 puv0={0,0}; MT_Point3 pxyz0 (0,0,128); - MT_Scalar puv1[2]={1,0}; + MT_Scalar puv1[2] = {1,0}; MT_Point3 pxyz1(128,0,128); - MT_Scalar puv2[2]={1,1}; + MT_Scalar puv2[2] = {1,1}; MT_Point3 pxyz2(128,0,0); RAS_TexVert p0(pxyz0,puv0); diff --git a/source/tests/rna_array.py b/source/tests/rna_array.py index 06b4735cc0d..a2241dff108 100644 --- a/source/tests/rna_array.py +++ b/source/tests/rna_array.py @@ -98,14 +98,14 @@ class TestArray(unittest.TestCase): for arr, rand_func in zip((test.farr, test.iarr, test.barr), (rand_float, rand_int, rand_bool)): for i in range(len(arr)): val= rand_func() - arr[i]= val + arr[i] = val self.assertEqual(arr[i], val) # float prop should accept also int for i in range(len(test.farr)): val= rand_int() - test.farr[i]= val + test.farr[i] = val self.assertEqual(test.farr[i], float(val)) # @@ -115,7 +115,7 @@ class TestArray(unittest.TestCase): arr[4] = 1.0 def assign_bad_type(arr): - arr[1]= "123" + arr[1] = "123" for arr in [test.farr, test.iarr, test.barr]: self.assertRaises(IndexError, assign_bad_index, arr) @@ -183,7 +183,7 @@ class TestMArray(unittest.TestCase): rval= make_random_2d_array((4, 5), func) for i in range(3): - getattr(test, arr)[i]= rval + getattr(test, arr)[i] = rval self.assertEqual(prop_to_list(getattr(test, arr)[i]), rval) # arr[i][j] = x @@ -194,13 +194,13 @@ class TestMArray(unittest.TestCase): for i in range(3): for j in range(4): - arr[i][j]= rval + arr[i][j] = rval self.assertEqual(prop_to_list(arr[i][j]), rval) def test_assign_item_fail(self): def assign_wrong_size(arr, i, rval): - getattr(test, arr)[i]= rval + getattr(test, arr)[i] = rval # assign wrong size at level 2 for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)): |