diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-05-03 01:22:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-05-03 01:31:46 +0400 |
commit | 8d16869d833ea2a2bd548c8f7b767dae582c78f2 (patch) | |
tree | 8b4dac3292c5cb5c1c37211150633e6968814bc9 /intern/cycles/blender | |
parent | 43d5e54a799b6823bca31bde17606c591b81d8be (diff) |
Code cleanup: Add -Werror=float-conversion to Cycles
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/blender_camera.cpp | 16 | ||||
-rw-r--r-- | intern/cycles/blender/blender_util.h | 6 |
2 files changed, 11 insertions, 11 deletions
diff --git a/intern/cycles/blender/blender_camera.cpp b/intern/cycles/blender/blender_camera.cpp index 6bbd4106a96..1a85561c6d5 100644 --- a/intern/cycles/blender/blender_camera.cpp +++ b/intern/cycles/blender/blender_camera.cpp @@ -212,8 +212,8 @@ static void blender_camera_viewplane(BlenderCamera *bcam, int width, int height, BoundBox2D *viewplane, float *aspectratio, float *sensor_size) { /* dimensions */ - float xratio = width*bcam->pixelaspect.x; - float yratio = height*bcam->pixelaspect.y; + float xratio = (float)width*bcam->pixelaspect.x; + float yratio = (float)height*bcam->pixelaspect.y; /* compute x/y aspect and ratio */ float xaspect, yaspect; @@ -288,8 +288,8 @@ static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int /* panorama sensor */ if (bcam->type == CAMERA_PANORAMA && bcam->panorama_type == PANORAMA_FISHEYE_EQUISOLID) { - float fit_xratio = bcam->full_width*bcam->pixelaspect.x; - float fit_yratio = bcam->full_height*bcam->pixelaspect.y; + float fit_xratio = (float)bcam->full_width*bcam->pixelaspect.x; + float fit_yratio = (float)bcam->full_height*bcam->pixelaspect.y; bool horizontal_fit; float sensor_size; @@ -565,10 +565,10 @@ BufferParams BlenderSync::get_buffer_params(BL::RenderSettings b_render, BL::Sce if(use_border) { /* border render */ - params.full_x = cam->border.left*width; - params.full_y = cam->border.bottom*height; - params.width = (int)(cam->border.right*width) - params.full_x; - params.height = (int)(cam->border.top*height) - params.full_y; + params.full_x = (int)(cam->border.left * (float)width); + params.full_y = (int)(cam->border.bottom * (float)height); + params.width = (int)(cam->border.right * (float)width) - params.full_x; + params.height = (int)(cam->border.top * (float)height) - params.full_y; /* survive in case border goes out of view or becomes too small */ params.width = max(params.width, 1); diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index 2c83ee6c2b5..35e417d8069 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -57,7 +57,7 @@ static inline void colorramp_to_array(BL::ColorRamp ramp, float4 *data, int size for(int i = 0; i < size; i++) { float color[4]; - ramp.evaluate(i/(float)(size-1), color); + ramp.evaluate((float)i/(float)(size-1), color); data[i] = make_float4(color[0], color[1], color[2], color[3]); } } @@ -74,7 +74,7 @@ static inline void curvemapping_color_to_array(BL::CurveMapping cumap, float4 *d BL::CurveMap mapI = cumap.curves[3]; for(int i = 0; i < size; i++) { - float t = i/(float)(size-1); + float t = (float)i/(float)(size-1); data[i][0] = mapR.evaluate(mapI.evaluate(t)); data[i][1] = mapG.evaluate(mapI.evaluate(t)); @@ -83,7 +83,7 @@ static inline void curvemapping_color_to_array(BL::CurveMapping cumap, float4 *d } else { for(int i = 0; i < size; i++) { - float t = i/(float)(size-1); + float t = (float)i/(float)(size-1); data[i][0] = mapR.evaluate(t); data[i][1] = mapG.evaluate(t); |