diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-28 21:08:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-28 21:08:33 +0400 |
commit | 9b9c4184c88c49ff96f3f23cbfbd00f6811d7301 (patch) | |
tree | 4c5aaf763f28710d07b3ec364088a98de8ae9794 /source/blender/nodes/intern/TEX_nodes | |
parent | faf07c3e2b6cb180d1580b4160ff6534b4754b76 (diff) |
misc nodes & editors: floats were being implicitly promoted to doubles, adjust to use floats.
+ minor update to demo_mode
Diffstat (limited to 'source/blender/nodes/intern/TEX_nodes')
4 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c index b2da0d60570..305d7094f57 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c @@ -53,9 +53,9 @@ static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack ** float sz = tex_input_value(in[2], p, thread); /* 0.00001 because of unit sized stuff */ - int xi = (int)fabs(floor(0.00001 + x / sz)); - int yi = (int)fabs(floor(0.00001 + y / sz)); - int zi = (int)fabs(floor(0.00001 + z / sz)); + int xi = (int)fabs(floor(0.00001f + x / sz)); + int yi = (int)fabs(floor(0.00001f + y / sz)); + int zi = (int)fabs(floor(0.00001f + z / sz)); if( (xi % 2 == yi % 2) == (zi % 2) ) { tex_input_rgba(out, in[0], p, thread); diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c b/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c index 52e88cbc2d9..70c5d25e1eb 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c @@ -54,11 +54,11 @@ static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float hue, float sat rgb_to_hsv(in[0], in[1], in[2], hsv, hsv+1, hsv+2); hsv[0]+= (hue - 0.5f); - if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0; + if(hsv[0]>1.0f) hsv[0]-=1.0f; else if(hsv[0]<0.0f) hsv[0]+= 1.0f; hsv[1]*= sat; - if(hsv[1]>1.0) hsv[1]= 1.0; else if(hsv[1]<0.0) hsv[1]= 0.0; + if(hsv[1]>1.0f) hsv[1]= 1.0f; else if(hsv[1]<0.0f) hsv[1]= 0.0f; hsv[2]*= val; - if(hsv[2]>1.0) hsv[2]= 1.0; else if(hsv[2]<0.0) hsv[2]= 0.0; + if(hsv[2]>1.0f) hsv[2]= 1.0f; else if(hsv[2]<0.0f) hsv[2]= 0.0f; hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); out[0]= mfac*in[0] + fac*col[0]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_math.c b/source/blender/nodes/intern/TEX_nodes/TEX_math.c index a84573f1d09..1652ba10e48 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_math.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_math.c @@ -116,8 +116,8 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor out[0]= pow(in0, in1); } else { float y_mod_1 = fmod(in1, 1); - if (y_mod_1 > 0.999 || y_mod_1 < 0.001) { - *out = pow(in0, floor(in1 + 0.5)); + if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) { + *out = pow(in0, floor(in1 + 0.5f)); } else { *out = 0.0; } diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c index c31fc25bea2..8f7793ddaaf 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c @@ -53,8 +53,8 @@ static void rotate(float new_co[3], float a, float ax[3], float co[3]) float perp[3]; float cp[3]; - float cos_a = cos(a * 2 * M_PI); - float sin_a = sin(a * 2 * M_PI); + float cos_a = cos(a * (float)(2*M_PI)); + float sin_a = sin(a * (float)(2*M_PI)); // x' = xcosa + n(n.x)(1-cosa) + (x*n)sina |