diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-02-24 00:00:42 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-02-24 00:00:42 +0300 |
commit | 7c830b75f160db4de8c415dcf1c0b3bf554a4821 (patch) | |
tree | 4892c025ae6bffdb20fb81213ba57f538a4b2e53 /source/blender/blenlib | |
parent | e25318ebefb4dd34443430ab0b7408d3a6118b3d (diff) | |
parent | 334da0fa57195af65c2877ee2882714efe5431f9 (diff) |
merging trunk 17520:19093
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_arithb.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/arithb.c | 11 | ||||
-rw-r--r-- | source/blender/blenlib/intern/bpath.c | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/graph.c | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 10 |
5 files changed, 20 insertions, 12 deletions
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 1d4b5cf16b2..6a2db92d25f 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -241,6 +241,7 @@ int VecLen(int *v1, int *v2); float VecLenf(float *v1, float *v2); float VecLength(float *v); void VecMulf(float *v1, float f); +void VecNegf(float *v1); int VecLenCompare(float *v1, float *v2, float limit); int VecCompare(float *v1, float *v2, float limit); diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 783acb9cc97..5f94df6f5eb 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2183,6 +2183,13 @@ void VecMulf(float *v1, float f) v1[2]*= f; } +void VecNegf(float *v1) +{ + v1[0] = -v1[0]; + v1[1] = -v1[1]; + v1[2] = -v1[2]; +} + void VecOrthoBasisf(float *v, float *v1, float *v2) { float f = sqrt(v[0]*v[0] + v[1]*v[1]); @@ -3945,7 +3952,7 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f Normalize(nor); /* flip normal */ - if(Inpf(nor,vel)>0.0f) VecMulf(nor,-1.0f); + if(Inpf(nor,vel)>0.0f) VecNegf(nor); a=Inpf(p1,nor)-Inpf(v0,nor); nordotv=Inpf(nor,vel); @@ -4677,7 +4684,7 @@ void tangent_from_uv(float *uv1, float *uv2, float *uv3, float *co1, float *co2, /* check flip */ if ((ct[0]*n[0] + ct[1]*n[1] + ct[2]*n[2]) < 0.0f) - VecMulf(tang, -1.0f); + VecNegf(tang); } /* used for zoom values*/ diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index e23c2658399..ac0c4bf4efd 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -339,9 +339,9 @@ void BLI_bpathIterator_step( struct BPathIterator *bpi) { bSound *snd = (bSound *)bpi->data; bpi->lib = snd->id.lib ? snd->id.lib->filename : NULL; - bpi->path = snd->sample->name; + bpi->path = snd->name; bpi->name = snd->id.name+2; - bpi->len = sizeof(snd->sample->name); + bpi->len = sizeof(snd->name); /* we are done, advancing to the next item, this type worked fine */ break; diff --git a/source/blender/blenlib/intern/graph.c b/source/blender/blenlib/intern/graph.c index ca82fcac844..52277063a8f 100644 --- a/source/blender/blenlib/intern/graph.c +++ b/source/blender/blenlib/intern/graph.c @@ -807,15 +807,15 @@ static void testAxialSymmetry(BGraph *graph, BNode* root_node, BNode* node1, BNo if (abs(nor[0]) > abs(nor[1]) && abs(nor[0]) > abs(nor[2]) && nor[0] < 0) { - VecMulf(nor, -1); + VecNegf(nor); } else if (abs(nor[1]) > abs(nor[0]) && abs(nor[1]) > abs(nor[2]) && nor[1] < 0) { - VecMulf(nor, -1); + VecNegf(nor); } else if (abs(nor[2]) > abs(nor[1]) && abs(nor[2]) > abs(nor[0]) && nor[2] < 0) { - VecMulf(nor, -1); + VecNegf(nor); } /* mirror node2 along axis */ diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index ca7a376d3a2..8ba03ad1343 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -47,9 +47,9 @@ #include <time.h> #include <sys/stat.h> -#if defined (__sun__) || defined (__sun) +#if defined (__sun__) || defined (__sun) || defined (__sgi) #include <sys/statvfs.h> /* Other modern unix os's should probably use this also */ -#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sgi) || defined(__sparc) || defined(__sparc__)) +#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__)) #include <sys/statfs.h> #endif @@ -179,7 +179,7 @@ double BLI_diskfree(char *dir) return (double) (freec*bytesps*sectorspc); #else -#if defined (__sun__) || defined (__sun) +#if defined (__sun__) || defined (__sun) || defined (__sgi) struct statvfs disk; #else struct statfs disk; @@ -204,9 +204,9 @@ double BLI_diskfree(char *dir) return -1; #endif -#if defined (__sun__) || defined (__sun) +#if defined (__sun__) || defined (__sun) || defined (__sgi) if (statvfs(name, &disk)) return(-1); -#elif !defined(__FreeBSD__) && !defined(linux) && (defined (__sgi) || defined(__sparc) || defined(__sparc__)) +#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__)) /* WARNING - This may not be supported by geeneric unix os's - Campbell */ if (statfs(name, &disk, sizeof(struct statfs), 0)) return(-1); #endif |