diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 10:38:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 10:38:07 +0400 |
commit | ab4a2aaf4a4b2b4e416aa1f113b30362cbe0dec3 (patch) | |
tree | 81af4c18519181490074508dbe9a8d515eab634f /source/blender/editors/physics/physics_pointcache.c | |
parent | 5a90ea77bc1333efe4e1e54984a080550ed3f707 (diff) |
style cleanup: follow style guide for formatting of if/for/while loops, and else if's
Diffstat (limited to 'source/blender/editors/physics/physics_pointcache.c')
-rw-r--r-- | source/blender/editors/physics/physics_pointcache.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index 9501dee30db..6573647aaee 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -67,7 +67,7 @@ static int ptcache_bake_all_poll(bContext *C) { Scene *scene= CTX_data_scene(C); - if(!scene) + if (!scene) return 0; return 1; @@ -114,7 +114,8 @@ static int ptcache_bake_all_exec(bContext *C, wmOperator *op) baker.progressbar = (void (*)(void *, int))WM_timecursor; baker.progressend = (void (*)(void *))WM_cursor_restore; baker.progresscontext = win; - } else { + } + else { baker.progressbar = bake_console_progress; baker.progressend = bake_console_progress_end; baker.progresscontext = NULL; @@ -134,10 +135,10 @@ static int ptcache_free_bake_all_exec(bContext *C, wmOperator *UNUSED(op)) PTCacheID *pid; ListBase pidlist; - for(base=scene->base.first; base; base= base->next) { + for (base=scene->base.first; base; base= base->next) { BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR); - for(pid=pidlist.first; pid; pid=pid->next) { + for (pid=pidlist.first; pid; pid=pid->next) { pid->cache->flag &= ~PTCACHE_BAKED; } @@ -194,8 +195,8 @@ static int ptcache_bake_exec(bContext *C, wmOperator *op) BKE_ptcache_ids_from_object(&pidlist, ob, scene, MAX_DUPLI_RECUR); - for(pid=pidlist.first; pid; pid=pid->next) { - if(pid->cache == cache) + for (pid=pidlist.first; pid; pid=pid->next) { + if (pid->cache == cache) break; } @@ -216,7 +217,8 @@ static int ptcache_bake_exec(bContext *C, wmOperator *op) baker.progressbar = (void (*)(void *, int))WM_timecursor; baker.progressend = (void (*)(void *))WM_cursor_restore; baker.progresscontext = win; - } else { + } + else { printf("\n"); /* empty first line before console reports */ baker.progressbar = bake_console_progress; baker.progressend = bake_console_progress_end; @@ -238,8 +240,8 @@ static int ptcache_free_bake_exec(bContext *C, wmOperator *UNUSED(op)) PointCache *cache= ptr.data; Object *ob= ptr.id.data; - if(cache->edit) { - if(!cache->edit->edited || 1) {// XXX okee("Lose changes done in particle mode?")) { + if (cache->edit) { + if (!cache->edit->edited || 1) {// XXX okee("Lose changes done in particle mode?")) { PE_free_ptcache_edit(cache->edit); cache->edit = NULL; cache->flag &= ~PTCACHE_BAKED; @@ -320,8 +322,8 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *UNUSED(op)) BKE_ptcache_ids_from_object(&pidlist, ob, scene, MAX_DUPLI_RECUR); - for(pid=pidlist.first; pid; pid=pid->next) { - if(pid->cache == cache) { + for (pid=pidlist.first; pid; pid=pid->next) { + if (pid->cache == cache) { PointCache *cache = BKE_ptcache_add(pid->ptcaches); cache->step = pid->default_step; *(pid->cache_ptr) = cache; @@ -347,9 +349,9 @@ static int ptcache_remove_exec(bContext *C, wmOperator *UNUSED(op)) BKE_ptcache_ids_from_object(&pidlist, ob, scene, MAX_DUPLI_RECUR); - for(pid=pidlist.first; pid; pid=pid->next) { - if(pid->cache == cache) { - if(pid->ptcaches->first == pid->ptcaches->last) + for (pid=pidlist.first; pid; pid=pid->next) { + if (pid->cache == cache) { + if (pid->ptcaches->first == pid->ptcaches->last) continue; /* don't delete last cache */ BLI_remlink(pid->ptcaches, pid->cache); |