From 094c9799f9926ae37515a1fe0380403ce3298a77 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 11 Nov 2011 12:00:08 +0000 Subject: quiet -Wdouble-promotion warnings --- source/blender/gpu/intern/gpu_draw.c | 4 ++-- source/blender/gpu/intern/gpu_material.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index d08d7cf2ead..3981e9fac02 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -775,7 +775,7 @@ int GPU_update_image_time(Image *ima, double time) if (ima->lastupdate<0) ima->lastupdate = 0; - if (ima->lastupdate>time) + if (ima->lastupdate > (float)time) ima->lastupdate=(float)time; if(ima->tpageflag & IMA_TWINANIM) { @@ -783,7 +783,7 @@ int GPU_update_image_time(Image *ima, double time) /* check: is the bindcode not in the array? Then free. (still to do) */ - diff = (float)(time-ima->lastupdate); + diff = (float)((float)time - ima->lastupdate); inc = (int)(diff*(float)ima->animspeed); ima->lastupdate+=((float)inc/(float)ima->animspeed); diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 02ba2eba9e9..397c0e32c69 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1337,8 +1337,8 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr) if(world) { /* exposure correction */ if(world->exp!=0.0f || world->range!=1.0f) { - linfac= 1.0 + pow((2.0*world->exp + 0.5), -10); - logfac= log((linfac-1.0f)/linfac)/world->range; + linfac= 1.0f + powf((2.0f*world->exp + 0.5f), -10); + logfac= logf((linfac-1.0f)/linfac)/world->range; GPU_link(mat, "set_value", GPU_uniform(&linfac), &ulinfac); GPU_link(mat, "set_value", GPU_uniform(&logfac), &ulogfac); @@ -1518,7 +1518,7 @@ static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *l if(lamp->mode & LA_HALO) if(lamp->spotsi > 170.0f) lamp->spotsi = 170.0f; - lamp->spotsi= cos(M_PI*lamp->spotsi/360.0); + lamp->spotsi= cosf((float)M_PI*lamp->spotsi/360.0f); lamp->spotbl= (1.0f - lamp->spotsi)*la->spotblend; lamp->k= la->k; @@ -1539,7 +1539,7 @@ static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *l /* makeshadowbuf */ angle= saacos(lamp->spotsi); - temp= 0.5f*lamp->size*cos(angle)/sin(angle); + temp= 0.5f*lamp->size*cosf(angle)/sinf(angle); pixsize= (lamp->d)/temp; wsize= pixsize*0.5f*lamp->size; -- cgit v1.2.3