diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-21 22:23:45 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-21 22:23:45 +0400 |
commit | a1407ff34215e5a72de2988e06c54379a1843c14 (patch) | |
tree | 8ad3d63a087733b7c50910602ae079b388b5f89b /source/blender/blenlib/intern/arithb.c | |
parent | e4b79972776f9873fde045f4b93537309fba1817 (diff) |
2.5:
* Windows fixes for texture filter & bump patches, thanks
Jean-Michel Soler for noting.
* Added sqrtf/sinf/fabsf/... fallback #ifdefs in BLI_arithb.h,
those should be safe to use now. Replacing the double for the
float version throughout the code can be done once, but would
need proper testing.
Diffstat (limited to 'source/blender/blenlib/intern/arithb.c')
-rw-r--r-- | source/blender/blenlib/intern/arithb.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index f7313c8b37a..ce381a3ee7c 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -92,6 +92,26 @@ float sasqrt(float fac) return (float)sqrt(fac); } +float saacosf(float fac) +{ + if(fac<= -1.0f) return (float)M_PI; + else if(fac>=1.0f) return 0.0f; + else return (float)acosf(fac); +} + +float saasinf(float fac) +{ + if(fac<= -1.0f) return (float)-M_PI/2.0f; + else if(fac>=1.0f) return (float)M_PI/2.0f; + else return (float)asinf(fac); +} + +float sasqrtf(float fac) +{ + if(fac<=0.0) return 0.0; + return (float)sqrtf(fac); +} + float Normalize(float *n) { float d; |