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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-04-20 19:54:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-04-20 20:02:21 +0400
commit55d75f5020ebdbaeb9cab1c7be565c83ba722bc2 (patch)
tree0798082991ace83f32f4d6c77b24629badf67ac4 /source/blender/render
parent1a1bc281e64624d1a6b798f8dd84dda134f0f45a (diff)
Code cleanup: correct abs use
also minor cleanup to rotation code
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/render_texture.c20
-rw-r--r--source/blender/render/intern/source/rendercore.c6
-rw-r--r--source/blender/render/intern/source/shadbuf.c2
-rw-r--r--source/blender/render/intern/source/sunsky.c4
4 files changed, 16 insertions, 16 deletions
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index 3ed216518de..adc824fcd6f 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -643,10 +643,10 @@ static float voronoiTex(Tex *tex, const float texvec[3], TexResult *texres)
{
int rv = TEX_INT;
float da[4], pa[12]; /* distance and point coordinate arrays of 4 nearest neighbors */
- float aw1 = fabs(tex->vn_w1);
- float aw2 = fabs(tex->vn_w2);
- float aw3 = fabs(tex->vn_w3);
- float aw4 = fabs(tex->vn_w4);
+ float aw1 = fabsf(tex->vn_w1);
+ float aw2 = fabsf(tex->vn_w2);
+ float aw3 = fabsf(tex->vn_w3);
+ float aw4 = fabsf(tex->vn_w4);
float sc = (aw1 + aw2 + aw3 + aw4);
if (sc!=0.f) sc = tex->ns_outscale/sc;
@@ -751,9 +751,9 @@ static int cubemap_glob(const float n[3], float x, float y, float z, float *adr1
}
mul_mat3_m4_v3(R.viewinv, nor);
- x1= fabs(nor[0]);
- y1= fabs(nor[1]);
- z1= fabs(nor[2]);
+ x1 = fabsf(nor[0]);
+ y1 = fabsf(nor[1]);
+ z1 = fabsf(nor[2]);
if (z1>=x1 && z1>=y1) {
*adr1 = (x + 1.0f) / 2.0f;
@@ -844,9 +844,9 @@ static int cubemap_ob(Object *ob, const float n[3], float x, float y, float z, f
copy_v3_v3(nor, n);
if (ob) mul_mat3_m4_v3(ob->imat, nor);
- x1= fabs(nor[0]);
- y1= fabs(nor[1]);
- z1= fabs(nor[2]);
+ x1 = fabsf(nor[0]);
+ y1 = fabsf(nor[1]);
+ z1 = fabsf(nor[2]);
if (z1>=x1 && z1>=y1) {
*adr1 = (x + 1.0f) / 2.0f;
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 63fcafe2cc0..3b71fd40c94 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -1910,9 +1910,9 @@ static void renderflare(RenderResult *rr, float *rectf, HaloRen *har)
for (b=1; b<har->flarec; b++) {
- fla.r= fabs(rc[0]);
- fla.g= fabs(rc[1]);
- fla.b= fabs(rc[2]);
+ fla.r = fabsf(rc[0]);
+ fla.g = fabsf(rc[1]);
+ fla.b = fabsf(rc[2]);
fla.alfa= ma->flareboost*fabsf(alfa*visifac*rc[3]);
fla.hard= 20.0f + fabsf(70.0f*rc[7]);
fla.tex= 0;
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index f534acd838d..194397bb19c 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -2120,7 +2120,7 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v
/* clip We can test for -1.0/1.0 because of the properties of the
* coordinate transformations. */
- fac= fabs(hoco[3]);
+ fac = fabsf(hoco[3]);
if (hoco[0]<-fac || hoco[0]>fac)
return 0;
if (hoco[1]<-fac || hoco[1]>fac)
diff --git a/source/blender/render/intern/source/sunsky.c b/source/blender/render/intern/source/sunsky.c
index e812b99287c..45dbe3f190d 100644
--- a/source/blender/render/intern/source/sunsky.c
+++ b/source/blender/render/intern/source/sunsky.c
@@ -109,8 +109,8 @@ static float AngleBetween(float thetav, float phiv, float theta, float phi)
* */
static void DirectionToThetaPhi(float *toSun, float *theta, float *phi)
{
- *theta = acos(toSun[2]);
- if (fabs(*theta) < 1e-5)
+ *theta = acosf(toSun[2]);
+ if (fabsf(*theta) < 1e-5f)
*phi = 0;
else
*phi = atan2(toSun[1], toSun[0]);