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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/jitter.c')
-rw-r--r--source/blender/blenlib/intern/jitter.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/blenlib/intern/jitter.c b/source/blender/blenlib/intern/jitter.c
index 52733b092d3..fbdf698cc87 100644
--- a/source/blender/blenlib/intern/jitter.c
+++ b/source/blender/blenlib/intern/jitter.c
@@ -55,9 +55,9 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
vecx = jit1[j] - x - 1.0f;
vecy = jit1[j+1] - y - 1.0f;
for (k = 3; k>0 ; k--) {
- if( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
+ if ( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
len= sqrt(vecx*vecx + vecy*vecy);
- if(len>0 && len<rad1) {
+ if (len>0 && len<rad1) {
len= len/rad1;
dvecx += vecx/len;
dvecy += vecy/len;
@@ -65,9 +65,9 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
}
vecx += 1.0f;
- if( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
+ if ( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
len= sqrt(vecx*vecx + vecy*vecy);
- if(len>0 && len<rad1) {
+ if (len>0 && len<rad1) {
len= len/rad1;
dvecx += vecx/len;
dvecy += vecy/len;
@@ -75,9 +75,9 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
}
vecx += 1.0f;
- if( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
+ if ( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
len= sqrt(vecx*vecx + vecy*vecy);
- if(len>0 && len<rad1) {
+ if (len>0 && len<rad1) {
len= len/rad1;
dvecx += vecx/len;
dvecy += vecy/len;
@@ -113,17 +113,17 @@ void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2)
vecx = jit1[j] - x - 1.0f;
vecy = jit1[j+1] - y - 1.0f;
- if( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
+ if ( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
vecx += 1.0f;
- if( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
+ if ( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
vecx += 1.0f;
- if( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
+ if ( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
- if( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
+ if ( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
vecy += 1.0f;
- if( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
+ if ( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
vecy += 1.0f;
- if( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
+ if ( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
}
}
@@ -144,7 +144,7 @@ void BLI_initjit(float *jitarr, int num)
float *jit2, x, rad1, rad2, rad3;
int i;
- if(num==0) return;
+ if (num==0) return;
jit2= MEM_mallocN(12 + 2*sizeof(float)*num, "initjit");
rad1= 1.0f/sqrtf((float)num);
@@ -153,7 +153,7 @@ void BLI_initjit(float *jitarr, int num)
BLI_srand(31415926 + num);
x= 0;
- for(i=0; i<2*num; i+=2) {
+ for (i=0; i<2*num; i+=2) {
jitarr[i]= x+ rad1*(float)(0.5-BLI_drand());
jitarr[i+1]= ((float)i/2)/num +rad1*(float)(0.5-BLI_drand());
x+= rad3;
@@ -169,7 +169,7 @@ void BLI_initjit(float *jitarr, int num)
MEM_freeN(jit2);
/* finally, move jittertab to be centered around (0,0) */
- for(i=0; i<2*num; i+=2) {
+ for (i=0; i<2*num; i+=2) {
jitarr[i] -= 0.5f;
jitarr[i+1] -= 0.5f;
}