diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-13 21:59:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-13 21:59:58 +0400 |
commit | c48c62a8314c51608e7b34ac0df474ce3fca0b02 (patch) | |
tree | 9d7e11b5fd56937d98d02bc5f1e19ba15380950f /source/blender/blenkernel/intern | |
parent | 800e2283aa986c5cc57e833ef80569cf26d0de2f (diff) |
Code Cleanup: replace checks for ima->source with BKE_image_is_animated
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 14 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/packedFile.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/texture.c | 4 |
3 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index c0362e3aaf3..3ccc95635a3 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1010,7 +1010,7 @@ void BKE_image_all_free_anim_ibufs(int cfra) Image *ima; for (ima = G.main->image.first; ima; ima = ima->id.next) - if (ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) + if (BKE_image_is_animated(ima)) BKE_image_free_anim_ibufs(ima, cfra); } @@ -2254,7 +2254,7 @@ static void image_tag_frame_recalc(Image *ima, ImageUser *iuser, void *customdat { Image *changed_image = customdata; - if (ima == changed_image && ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) { + if (ima == changed_image && BKE_image_is_animated(ima)) { iuser->flag |= IMA_NEED_FRAME_RECALC; } } @@ -3552,6 +3552,16 @@ int BKE_image_sequence_guess_offset(Image *image) return atoi(num); } +/** + * Checks the image buffer changes (not keyframed values) + * + * to see if we need to call #BKE_image_user_check_frame_calc + */ +bool BKE_image_is_animated(Image *image) +{ + return ELEM(image->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE); +} + bool BKE_image_is_dirty(Image *image) { bool is_dirty = false; diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 5c2789a2c1c..b120ec0d1f1 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -245,7 +245,7 @@ void packAll(Main *bmain, ReportList *reports) ima->packedfile = newPackedFile(reports, ima->name, ID_BLEND_PATH(bmain, &ima->id)); tot ++; } - else if (ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { + else if (BKE_image_is_animated(ima)) { BKE_reportf(reports, RPT_WARNING, "Image '%s' skipped, movies and image sequences not supported", ima->id.name + 2); } diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index ccbccac85cf..542069d9b87 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -1422,9 +1422,7 @@ void BKE_free_oceantex(struct OceanTex *ot) /* ------------------------------------------------------------------------- */ bool BKE_texture_dependsOnTime(const struct Tex *texture) { - if (texture->ima && - ELEM(texture->ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) - { + if (texture->ima && BKE_image_is_animated(texture->ima)) { return 1; } else if (texture->adt) { |