diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-01-30 17:42:12 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-01-30 17:42:12 +0400 |
commit | 452a52575cbc33551017d940ba86dda7a2c8c30b (patch) | |
tree | 741538f4ed22dff243600017940958507fda3f98 /intern/cycles/render/image.h | |
parent | 54223ed05b7e2840865b5e46ed6d43573ff2b4ae (diff) |
Cycles material preview: fix for generated/packed/movie files
Issue was caused by cycles trying to find builtin images in a main
database and in case of preview render images are not in database,
they're just referenced by shader node tree.
Now builtin images in cycles have got void* pointer to store data
needed to load builtin images.
In case ob blender session, this pointer will store pointer from
PointerRNA for image datablock and used later to construct Image
class based on this pointer.
This also saves database lookup for final render which is nice :)
Reviewed by Brecht.
Diffstat (limited to 'intern/cycles/render/image.h')
-rw-r--r-- | intern/cycles/render/image.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h index e39ac14b60f..464b87ff530 100644 --- a/intern/cycles/render/image.h +++ b/intern/cycles/render/image.h @@ -51,9 +51,9 @@ public: ImageManager(); ~ImageManager(); - int add_image(const string& filename, bool is_builtin, bool animated, bool& is_float); - void remove_image(const string& filename, bool is_builtin); - bool is_float_image(const string& filename, bool is_builtin); + int add_image(const string& filename, void *builtin_data, bool animated, bool& is_float); + void remove_image(const string& filename, void *builtin_data); + bool is_float_image(const string& filename, void *builtin_data); void device_update(Device *device, DeviceScene *dscene, Progress& progress); void device_free(Device *device, DeviceScene *dscene); @@ -65,9 +65,9 @@ public: bool need_update; - boost::function<void(const string &filename, bool &is_float, int &width, int &height, int &channels)> builtin_image_info_cb; - boost::function<bool(const string &filename, unsigned char *pixels)> builtin_image_pixels_cb; - boost::function<bool(const string &filename, float *pixels)> builtin_image_float_pixels_cb; + boost::function<void(const string &filename, void *data, bool &is_float, int &width, int &height, int &channels)> builtin_image_info_cb; + boost::function<bool(const string &filename, void *data, unsigned char *pixels)> builtin_image_pixels_cb; + boost::function<bool(const string &filename, void *data, float *pixels)> builtin_image_float_pixels_cb; private: int tex_num_images; int tex_num_float_images; @@ -77,7 +77,7 @@ private: struct Image { string filename; - bool is_builtin; + void *builtin_data; bool need_load; bool animated; |