diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-08-08 15:15:32 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-08-08 15:15:32 +0400 |
commit | 1cdc39f49b2b93c57718c7ee1b1b8bb1fcdacf79 (patch) | |
tree | c3ac8b42053efe1fe108ce725cbd5ad54815c019 /source/blender/blenkernel/intern/seqcache.c | |
parent | 098cbdac62c007c708a21ffa73204abfdca00853 (diff) |
Code cleanup: mark functions as static, ifdef 0 some unused functions
Diffstat (limited to 'source/blender/blenkernel/intern/seqcache.c')
-rw-r--r-- | source/blender/blenkernel/intern/seqcache.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/seqcache.c b/source/blender/blenkernel/intern/seqcache.c index 0d91dcb7faa..6eb4c6734e4 100644 --- a/source/blender/blenkernel/intern/seqcache.c +++ b/source/blender/blenkernel/intern/seqcache.c @@ -47,6 +47,73 @@ typedef struct SeqCacheKey { static struct MovieCache *moviecache = NULL; +static int seq_cmp_render_data(const SeqRenderData *a, const SeqRenderData *b) +{ + if (a->preview_render_size < b->preview_render_size) { + return -1; + } + if (a->preview_render_size > b->preview_render_size) { + return 1; + } + + if (a->rectx < b->rectx) { + return -1; + } + if (a->rectx > b->rectx) { + return 1; + } + + if (a->recty < b->recty) { + return -1; + } + if (a->recty > b->recty) { + return 1; + } + + if (a->bmain < b->bmain) { + return -1; + } + if (a->bmain > b->bmain) { + return 1; + } + + if (a->scene < b->scene) { + return -1; + } + if (a->scene > b->scene) { + return 1; + } + + if (a->motion_blur_shutter < b->motion_blur_shutter) { + return -1; + } + if (a->motion_blur_shutter > b->motion_blur_shutter) { + return 1; + } + + if (a->motion_blur_samples < b->motion_blur_samples) { + return -1; + } + if (a->motion_blur_samples > b->motion_blur_samples) { + return 1; + } + + return 0; +} + +static unsigned int seq_hash_render_data(const SeqRenderData *a) +{ + unsigned int rval = a->rectx + a->recty; + + rval ^= a->preview_render_size; + rval ^= ((intptr_t) a->bmain) << 6; + rval ^= ((intptr_t) a->scene) << 6; + rval ^= (int)(a->motion_blur_shutter * 100.0f) << 10; + rval ^= a->motion_blur_samples << 24; + + return rval; +} + static unsigned int seqcache_hashhash(const void *key_) { const SeqCacheKey *key = (SeqCacheKey *) key_; |