diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-19 07:07:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-19 07:07:58 +0400 |
commit | 9b07c98bb40ac93774b7cfc9723bd28c95ec409d (patch) | |
tree | 90ad7172ac43826ceecea77bffdbfe4e2343454b /intern | |
parent | 5ad61e9642a8f0d26c7e5c85477747f4f387bfc3 (diff) |
code cleanup: minor style change & quiet warning, also add assert for BM_vert_splice() to check for invalid use.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/osl/nodes/node_rgb_ramp.osl | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/intern/cycles/kernel/osl/nodes/node_rgb_ramp.osl b/intern/cycles/kernel/osl/nodes/node_rgb_ramp.osl index afce1127305..a128ebbd1cf 100644 --- a/intern/cycles/kernel/osl/nodes/node_rgb_ramp.osl +++ b/intern/cycles/kernel/osl/nodes/node_rgb_ramp.osl @@ -20,25 +20,24 @@ #include "oslutil.h" shader node_rgb_ramp( - color ramp_color[RAMP_TABLE_SIZE] = {0.0}, - float ramp_alpha[RAMP_TABLE_SIZE] = {0.0}, + color ramp_color[RAMP_TABLE_SIZE] = {0.0}, + float ramp_alpha[RAMP_TABLE_SIZE] = {0.0}, - float Fac = 0.0, - output color Color = color(0.0, 0.0, 0.0), - output float Alpha = 1.0 - ) + float Fac = 0.0, + output color Color = color(0.0, 0.0, 0.0), + output float Alpha = 1.0) { - float f = clamp(Fac, 0.0, 1.0) * (RAMP_TABLE_SIZE - 1); + float f = clamp(Fac, 0.0, 1.0) * (RAMP_TABLE_SIZE - 1); - int i = (int)f; - float t = f - (float)i; + int i = (int)f; + float t = f - (float)i; - Color = ramp_color[i]; - Alpha = ramp_alpha[i]; + Color = ramp_color[i]; + Alpha = ramp_alpha[i]; - if (t > 0.0) { - Color = (1.0 - t) * Color + t * ramp_color[i + 1]; - Alpha = (1.0 - t) * Alpha + t * ramp_alpha[i + 1]; - } + if (t > 0.0) { + Color = (1.0 - t) * Color + t * ramp_color[i + 1]; + Alpha = (1.0 - t) * Alpha + t * ramp_alpha[i + 1]; + } } |