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/editors
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/editors')
-rw-r--r--source/blender/editors/armature/meshlaplacian.c20
-rw-r--r--source/blender/editors/physics/particle_edit.c6
-rw-r--r--source/blender/editors/render/render_internal.c6
-rw-r--r--source/blender/editors/screen/screen_ops.c2
-rw-r--r--source/blender/editors/space_info/info_ops.c16
-rw-r--r--source/blender/editors/space_node/node_edit.c2
6 files changed, 26 insertions, 26 deletions
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 720413650fa..67773d358d0 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -182,16 +182,16 @@ static void laplacian_triangle_area(LaplacianSystem *sys, int i1, int i2, int i3
t2= cotan_weight(v2, v3, v1);
t3= cotan_weight(v3, v1, v2);
- if(RAD2DEG(angle_v3v3v3(v2, v1, v3)) > 90) obtuse= 1;
- else if(RAD2DEG(angle_v3v3v3(v1, v2, v3)) > 90) obtuse= 2;
- else if(RAD2DEG(angle_v3v3v3(v1, v3, v2)) > 90) obtuse= 3;
+ if(RAD2DEGF(angle_v3v3v3(v2, v1, v3)) > 90) obtuse= 1;
+ else if(RAD2DEGF(angle_v3v3v3(v1, v2, v3)) > 90) obtuse= 2;
+ else if(RAD2DEGF(angle_v3v3v3(v1, v3, v2)) > 90) obtuse= 3;
if (obtuse > 0) {
area= area_tri_v3(v1, v2, v3);
- varea[i1] += (obtuse == 1)? area: area*0.5;
- varea[i2] += (obtuse == 2)? area: area*0.5;
- varea[i3] += (obtuse == 3)? area: area*0.5;
+ varea[i1] += (obtuse == 1)? area: area*0.5f;
+ varea[i2] += (obtuse == 2)? area: area*0.5f;
+ varea[i3] += (obtuse == 3)? area: area*0.5f;
}
else {
len1= len_v3v3(v2, v3);
@@ -492,7 +492,7 @@ static int heat_ray_source_visible(LaplacianSystem *sys, int vertex, int source)
sub_v3_v3v3(data.vec, end, data.start);
madd_v3_v3v3fl(data.start, data.start, data.vec, 1e-5);
- mul_v3_fl(data.vec, 1.0f - 2e-5);
+ mul_v3_fl(data.vec, 1.0f - 2e-5f);
/* pass normalized vec + distance to bvh */
hit.index = -1;
@@ -1041,9 +1041,9 @@ void rigid_deform_end(int cancel)
#define MESHDEFORM_TAG_INTERIOR 2
#define MESHDEFORM_TAG_EXTERIOR 3
-#define MESHDEFORM_LEN_THRESHOLD 1e-6
+#define MESHDEFORM_LEN_THRESHOLD 1e-6f
-#define MESHDEFORM_MIN_INFLUENCE 0.0005
+#define MESHDEFORM_MIN_INFLUENCE 0.0005f
static int MESHDEFORM_OFFSET[7][3] =
{{0,0,0}, {1,0,0}, {-1,0,0}, {0,1,0}, {0,-1,0}, {0,0,1}, {0,0,-1}};
@@ -1146,7 +1146,7 @@ static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
isectco[1]= (1.0f - u - v)*vert0[1] + u*vert1[1] + v*vert2[1];
isectco[2]= (1.0f - u - v)*vert0[2] + u*vert1[2] + v*vert2[2];
- uvw[0]= 1.0 - u - v;
+ uvw[0]= 1.0f - u - v;
uvw[1]= u;
uvw[2]= v;
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 697f016f2d4..3f2fcaab94a 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -430,7 +430,7 @@ static int key_test_depth(PEData *data, float co[3])
}
#endif
- if((float)uz - 0.00001 > depth)
+ if((float)uz - 0.00001f > depth)
return 0;
else
return 1;
@@ -3246,7 +3246,7 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, floa
if(isect_line_tri_v3(co1, co2, v1, v2, v3, &cur_d, cur_uv)){
if(cur_d<*min_d){
*min_d=cur_d;
- min_w[0]= 1.0 - cur_uv[0] - cur_uv[1];
+ min_w[0]= 1.0f - cur_uv[0] - cur_uv[1];
min_w[1]= cur_uv[0];
min_w[2]= cur_uv[1];
min_w[3]= 0.0f;
@@ -3260,7 +3260,7 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, floa
if(isect_line_tri_v3(co1, co2, v1, v3, v4, &cur_d, cur_uv)){
if(cur_d<*min_d){
*min_d=cur_d;
- min_w[0]= 1.0 - cur_uv[0] - cur_uv[1];
+ min_w[0]= 1.0f - cur_uv[0] - cur_uv[1];
min_w[1]= 0.0f;
min_w[2]= cur_uv[0];
min_w[3]= cur_uv[1];
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index 956618eb1bb..39def19aa17 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -147,12 +147,12 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat
float *rf= rectf;
float srgb[3];
char *rc= rectc;
- const float dither = ibuf->dither / 255.0;
+ const float dither = ibuf->dither / 255.0f;
/* XXX temp. because crop offset */
if( rectc >= (char *)(ibuf->rect)) {
for(x1= 0; x1<xmax; x1++, rf += 4, rc+=4) {
- const float d = (BLI_frand()-0.5)*dither;
+ const float d = (BLI_frand()-0.5f)*dither;
srgb[0]= d + linearrgb_to_srgb(rf[0]);
srgb[1]= d + linearrgb_to_srgb(rf[1]);
srgb[2]= d + linearrgb_to_srgb(rf[2]);
@@ -176,7 +176,7 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat
/* XXX temp. because crop offset */
if( rectc >= (char *)(ibuf->rect)) {
for(x1= 0; x1<xmax; x1++, rf += 4, rc+=4) {
- const float d = (BLI_frand()-0.5)*dither;
+ const float d = (BLI_frand()-0.5f)*dither;
rgb[0] = d + rf[0];
rgb[1] = d + rf[1];
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index d07cc61e680..289296fd817 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -2766,7 +2766,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e
else sync= (scene->flag & SCE_FRAME_DROP);
if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE) && finite(time = sound_sync_scene(scene)))
- scene->r.cfra = time * FPS + 0.5;
+ scene->r.cfra = (double)time * FPS + 0.5;
else
{
if (sync) {
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index 701b0fc1de7..d58fb7b11f0 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -322,11 +322,11 @@ void FILE_OT_find_missing_files(wmOperatorType *ot)
* inactive regions, so use this for now. --matt
*/
-#define INFO_TIMEOUT 5.0
-#define INFO_COLOR_TIMEOUT 3.0
-#define ERROR_TIMEOUT 10.0
-#define ERROR_COLOR_TIMEOUT 6.0
-#define COLLAPSE_TIMEOUT 0.25
+#define INFO_TIMEOUT 5.0f
+#define INFO_COLOR_TIMEOUT 3.0f
+#define ERROR_TIMEOUT 10.0f
+#define ERROR_COLOR_TIMEOUT 6.0f
+#define COLLAPSE_TIMEOUT 0.25f
static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
wmWindowManager *wm= CTX_wm_manager(C);
@@ -353,7 +353,7 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm
color_timeout = (report->type & RPT_ERROR_ALL)?ERROR_COLOR_TIMEOUT:INFO_COLOR_TIMEOUT;
/* clear the report display after timeout */
- if (reports->reporttimer->duration > timeout) {
+ if ((float)reports->reporttimer->duration > timeout) {
WM_event_remove_timer(wm, NULL, reports->reporttimer);
reports->reporttimer = NULL;
@@ -381,8 +381,8 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm
rti->widthfac=1.0;
}
- progress = reports->reporttimer->duration / timeout;
- color_progress = reports->reporttimer->duration / color_timeout;
+ progress = (float)reports->reporttimer->duration / timeout;
+ color_progress = (float)reports->reporttimer->duration / color_timeout;
/* save us from too many draws */
if(color_progress <= 1.0f) {
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index f37c62de473..3877e7abf5e 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -1175,7 +1175,7 @@ static void sample_apply(bContext *C, wmOperator *op, wmEvent *event)
fx = (bufx > 0.0f ? ((float)mx - 0.5f*ar->winx - snode->xof) / bufx + 0.5f : 0.0f);
fy = (bufy > 0.0f ? ((float)my - 0.5f*ar->winy - snode->yof) / bufy + 0.5f : 0.0f);
- if(fx>=0.0 && fy>=0.0 && fx<1.0 && fy<1.0) {
+ if(fx>=0.0f && fy>=0.0f && fx<1.0f && fy<1.0f) {
float *fp;
char *cp;
int x= (int)(fx*ibuf->x), y= (int)(fy*ibuf->y);