diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-05-08 01:28:21 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2016-06-08 22:45:40 +0300 |
commit | ba7685ae7e2d038e3e18fc718119304c187d1996 (patch) | |
tree | bbaa81d696ceb1a8d76853d68636cac308d12e37 /intern/cycles/blender | |
parent | 779555913e193b756ad027aa9f0ed60db0b8b712 (diff) |
Code refactor: nodify Cycles camera and fix some mistakes in XML node read.
Differential Revision: https://developer.blender.org/D2016
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/blender_camera.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/blender/blender_util.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/intern/cycles/blender/blender_camera.cpp b/intern/cycles/blender/blender_camera.cpp index 3a0fee23c0d..f02fc553908 100644 --- a/intern/cycles/blender/blender_camera.cpp +++ b/intern/cycles/blender/blender_camera.cpp @@ -37,7 +37,7 @@ struct BlenderCamera { float lens; float shuttertime; Camera::MotionPosition motion_position; - float shutter_curve[RAMP_TABLE_SIZE]; + array<float> shutter_curve; Camera::RollingShutterType rolling_shutter_type; float rolling_shutter_duration; @@ -460,7 +460,7 @@ static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int cam->rolling_shutter_type = bcam->rolling_shutter_type; cam->rolling_shutter_duration = bcam->rolling_shutter_duration; - memcpy(cam->shutter_curve, bcam->shutter_curve, sizeof(cam->shutter_curve)); + cam->shutter_curve = bcam->shutter_curve; /* border */ cam->border = bcam->border; diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index e23d8bf4e2d..2510cebcdc0 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -98,11 +98,12 @@ static inline void curvemapping_minmax(/*const*/ BL::CurveMapping& cumap, } static inline void curvemapping_to_array(BL::CurveMapping& cumap, - float *data, + array<float>& data, int size) { cumap.update(); BL::CurveMap curve = cumap.curves[0]; + data.resize(size); for(int i = 0; i < size; i++) { float t = (float)i/(float)(size-1); data[i] = curve.evaluate(t); |