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>2011-03-28 21:08:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-03-28 21:08:33 +0400
commit9b9c4184c88c49ff96f3f23cbfbd00f6811d7301 (patch)
tree4c5aaf763f28710d07b3ec364088a98de8ae9794 /source/blender/nodes/intern
parentfaf07c3e2b6cb180d1580b4160ff6534b4754b76 (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')
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c4
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_invert.c2
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_checker.c6
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c6
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_math.c4
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_rotate.c4
6 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c b/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c
index dd09b4e1b70..91fd995dbbe 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c
@@ -52,12 +52,12 @@ static bNodeSocketType sh_node_hue_sat_out[]= {
/* note: it would be possible to use CMP version for both nodes */
static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float *hue, float *sat, float *val, float *in, float *fac)
{
- if(*fac!=0.0f && (*hue!=0.5f || *sat!=1.0 || *val!=1.0)) {
+ if(*fac!=0.0f && (*hue!=0.5f || *sat!=1.0f || *val!=1.0f)) {
float col[3], hsv[3], mfac= 1.0f - *fac;
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;
hsv[2]*= *val;
hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_invert.c b/source/blender/nodes/intern/SHD_nodes/SHD_invert.c
index 888d1514146..f8d6e54859e 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_invert.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_invert.c
@@ -59,7 +59,7 @@ bNodeStack **out)
/* if fac, blend result against original input */
if (in[0]->vec[0] < 1.0f) {
- facm = 1.0 - in[0]->vec[0];
+ facm = 1.0f - in[0]->vec[0];
col[0] = in[0]->vec[0]*col[0] + (facm*in[1]->vec[0]);
col[1] = in[0]->vec[0]*col[1] + (facm*in[1]->vec[1]);
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