diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-26 03:12:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-26 03:12:42 +0400 |
commit | 4457e85442eea30bc6166e15da040188e77b5be7 (patch) | |
tree | 7cf14bbdf42fa1c02beae745642f46e76961860f /source/blender/blenkernel/intern/pointcache.c | |
parent | 6faeac9fe2867aca9c111e4f86f74912c115eddd (diff) |
style cleanup: dont use 'else for' for extended blocks of code (quite confusing)
Diffstat (limited to 'source/blender/blenkernel/intern/pointcache.c')
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 94 |
1 files changed, 50 insertions, 44 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 63135ea8641..e3b2e190f03 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -2839,40 +2839,44 @@ void BKE_ptcache_bake(PTCacheBaker* baker) cache->flag &= ~PTCACHE_BAKED; } } - else for (SETLOOPER(scene, sce_iter, base)) { - /* cache/bake everything in the scene */ - BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR); - - for (pid=pidlist.first; pid; pid=pid->next) { - cache = pid->cache; - if ((cache->flag & PTCACHE_BAKED)==0) { - if (pid->type==PTCACHE_TYPE_PARTICLES) { - ParticleSystem *psys = (ParticleSystem*)pid->calldata; - /* skip hair & keyed particles */ - if (psys->part->type == PART_HAIR || psys->part->phystype == PART_PHYS_KEYED) - continue; - - psys_get_pointcache_start_end(scene, pid->calldata, &cache->startframe, &cache->endframe); - } + else { + for (SETLOOPER(scene, sce_iter, base)) { + /* cache/bake everything in the scene */ + BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR); + + for (pid=pidlist.first; pid; pid=pid->next) { + cache = pid->cache; + if ((cache->flag & PTCACHE_BAKED)==0) { + if (pid->type==PTCACHE_TYPE_PARTICLES) { + ParticleSystem *psys = (ParticleSystem*)pid->calldata; + /* skip hair & keyed particles */ + if (psys->part->type == PART_HAIR || psys->part->phystype == PART_PHYS_KEYED) + continue; + + psys_get_pointcache_start_end(scene, pid->calldata, &cache->startframe, &cache->endframe); + } - if ((cache->flag & PTCACHE_REDO_NEEDED || (cache->flag & PTCACHE_SIMULATION_VALID)==0) - && ((cache->flag & PTCACHE_QUICK_CACHE)==0 || render || bake)) - BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); + if ((cache->flag & PTCACHE_REDO_NEEDED || (cache->flag & PTCACHE_SIMULATION_VALID)==0) && + ((cache->flag & PTCACHE_QUICK_CACHE)==0 || render || bake)) + { + BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); + } - startframe = MIN2(startframe, cache->startframe); + startframe = MIN2(startframe, cache->startframe); - if (bake || render) { - cache->flag |= PTCACHE_BAKING; + if (bake || render) { + cache->flag |= PTCACHE_BAKING; - if (bake) - thread_data.endframe = MAX2(thread_data.endframe, cache->endframe); - } + if (bake) + thread_data.endframe = MAX2(thread_data.endframe, cache->endframe); + } - cache->flag &= ~PTCACHE_BAKED; + cache->flag &= ~PTCACHE_BAKED; + } } + BLI_freelistN(&pidlist); } - BLI_freelistN(&pidlist); } CFRA = startframe; @@ -2928,30 +2932,32 @@ void BKE_ptcache_bake(PTCacheBaker* baker) BKE_ptcache_write(pid, 0); } } - else for (SETLOOPER(scene, sce_iter, base)) { - BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR); + else { + for (SETLOOPER(scene, sce_iter, base)) { + BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR); - for (pid=pidlist.first; pid; pid=pid->next) { - /* skip hair particles */ - if (pid->type==PTCACHE_TYPE_PARTICLES && ((ParticleSystem*)pid->calldata)->part->type == PART_HAIR) - continue; - - cache = pid->cache; + for (pid=pidlist.first; pid; pid=pid->next) { + /* skip hair particles */ + if (pid->type==PTCACHE_TYPE_PARTICLES && ((ParticleSystem*)pid->calldata)->part->type == PART_HAIR) + continue; - if (thread_data.step > 1) - cache->flag &= ~(PTCACHE_BAKING|PTCACHE_OUTDATED); - else - cache->flag &= ~(PTCACHE_BAKING|PTCACHE_REDO_NEEDED); + cache = pid->cache; - cache->flag |= PTCACHE_SIMULATION_VALID; + if (thread_data.step > 1) + cache->flag &= ~(PTCACHE_BAKING|PTCACHE_OUTDATED); + else + cache->flag &= ~(PTCACHE_BAKING|PTCACHE_REDO_NEEDED); - if (bake) { - cache->flag |= PTCACHE_BAKED; - if (cache->flag & PTCACHE_DISK_CACHE) - BKE_ptcache_write(pid, 0); + cache->flag |= PTCACHE_SIMULATION_VALID; + + if (bake) { + cache->flag |= PTCACHE_BAKED; + if (cache->flag & PTCACHE_DISK_CACHE) + BKE_ptcache_write(pid, 0); + } } + BLI_freelistN(&pidlist); } - BLI_freelistN(&pidlist); } scene->r.framelen = frameleno; |