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
path: root/intern
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2013-05-18 15:04:29 +0400
committerThomas Dinges <blender@dingto.org>2013-05-18 15:04:29 +0400
commit75e36650e35d556fa9959ac0c9e1831a070fb2ef (patch)
treeabaebe762b1589d2570cb25a63deca8541e7bc72 /intern
parentf314ff02bda2ad959b6dc374d090047d270cd885 (diff)
Code cleanup / Cycles:
* Simplify shaperadius() function a bit to avoid castings. * Style cleanup 1.f -> 1.0f, to follow rest of Cycles code.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/blender_curves.cpp5
-rw-r--r--intern/cycles/kernel/kernel_path.h2
-rw-r--r--intern/cycles/render/nodes.cpp2
-rw-r--r--intern/cycles/util/util_transform.h2
4 files changed, 6 insertions, 5 deletions
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index df00c8fd92e..56d78fb5c26 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -115,11 +115,12 @@ void curveinterp_v3_v3v3v3v3(float3 *p, float3 *v1, float3 *v2, float3 *v3, floa
float shaperadius(float shape, float root, float tip, float time)
{
float radius = 1.0f - time;
+
if(shape != 0.0f) {
if(shape < 0.0f)
- radius = (float)pow(1.0f - time, 1.f + shape);
+ radius = powf(radius, 1.0f + shape);
else
- radius = (float)pow(1.0f - time, 1.f / (1.f - shape));
+ radius = powf(radius, 1.0f / (1.0f - shape));
}
return (radius * (root - tip)) + tip;
}
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h
index b5a179d0b20..040f50273be 100644
--- a/intern/cycles/kernel/kernel_path.h
+++ b/intern/cycles/kernel/kernel_path.h
@@ -1141,7 +1141,7 @@ __device void kernel_path_trace(KernelGlobals *kg,
#endif
}
else
- L = make_float4(0.f, 0.f, 0.f, 0.f);
+ L = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
/* accumulate result in output buffer */
kernel_write_pass_float4(buffer, sample, L);
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index d7ac379739d..7435616ffc0 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -382,7 +382,7 @@ static float2 sky_spherical_coordinates(float3 dir)
static float sky_perez_function(float lam[6], float theta, float gamma)
{
- return (1.f + lam[0]*expf(lam[1]/cosf(theta))) * (1.f + lam[2]*expf(lam[3]*gamma) + lam[4]*cosf(gamma)*cosf(gamma));
+ return (1.0f + lam[0]*expf(lam[1]/cosf(theta))) * (1.0f + lam[2]*expf(lam[3]*gamma) + lam[4]*cosf(gamma)*cosf(gamma));
}
static void sky_texture_precompute(KernelSunSky *ksunsky, float3 dir, float turbidity)
diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h
index 33761827dd7..66801e90b56 100644
--- a/intern/cycles/util/util_transform.h
+++ b/intern/cycles/util/util_transform.h
@@ -195,7 +195,7 @@ __device_inline Transform transform_rotate(float angle, float3 axis)
{
float s = sinf(angle);
float c = cosf(angle);
- float t = 1.f - c;
+ float t = 1.0f - c;
axis = normalize(axis);