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/render/render_update.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/render/render_update.c')
-rw-r--r-- | source/blender/editors/render/render_update.c | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index 4483d7d8ba1..72b29c56811 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -77,7 +77,7 @@ void ED_render_scene_update(Main *bmain, Scene *scene, int updated) /* don't do this render engine update if we're updating the scene from * other threads doing e.g. rendering or baking jobs */ - if(!BLI_thread_is_main()) + if (!BLI_thread_is_main()) return; C= CTX_create(); @@ -86,22 +86,22 @@ void ED_render_scene_update(Main *bmain, Scene *scene, int updated) CTX_wm_manager_set(C, bmain->wm.first); - for(sc=bmain->screen.first; sc; sc=sc->id.next) { - for(sa=sc->areabase.first; sa; sa=sa->next) { - if(sa->spacetype != SPACE_VIEW3D) + for (sc=bmain->screen.first; sc; sc=sc->id.next) { + for (sa=sc->areabase.first; sa; sa=sa->next) { + if (sa->spacetype != SPACE_VIEW3D) continue; - for(ar=sa->regionbase.first; ar; ar=ar->next) { + for (ar=sa->regionbase.first; ar; ar=ar->next) { RegionView3D *rv3d; RenderEngine *engine; - if(ar->regiontype != RGN_TYPE_WINDOW) + if (ar->regiontype != RGN_TYPE_WINDOW) continue; rv3d= ar->regiondata; engine= rv3d->render_engine; - if(engine && (updated || (engine->flag & RE_ENGINE_DO_UPDATE))) { + if (engine && (updated || (engine->flag & RE_ENGINE_DO_UPDATE))) { CTX_wm_screen_set(C, sc); CTX_wm_area_set(C, sa); CTX_wm_region_set(C, ar); @@ -123,20 +123,20 @@ void ED_render_engine_changed(Main *bmain) ScrArea *sa; ARegion *ar; - for(sc=bmain->screen.first; sc; sc=sc->id.next) { - for(sa=sc->areabase.first; sa; sa=sa->next) { - if(sa->spacetype != SPACE_VIEW3D) + for (sc=bmain->screen.first; sc; sc=sc->id.next) { + for (sa=sc->areabase.first; sa; sa=sa->next) { + if (sa->spacetype != SPACE_VIEW3D) continue; - for(ar=sa->regionbase.first; ar; ar=ar->next) { + for (ar=sa->regionbase.first; ar; ar=ar->next) { RegionView3D *rv3d; - if(ar->regiontype != RGN_TYPE_WINDOW) + if (ar->regiontype != RGN_TYPE_WINDOW) continue; rv3d= ar->regiondata; - if(rv3d->render_engine) { + if (rv3d->render_engine) { RE_engine_free(rv3d->render_engine); rv3d->render_engine= NULL; } @@ -154,11 +154,11 @@ static int mtex_use_tex(MTex **mtex, int tot, Tex *tex) { int a; - if(!mtex) + if (!mtex) return 0; - for(a=0; a<tot; a++) - if(mtex[a] && mtex[a]->tex == tex) + for (a=0; a<tot; a++) + if (mtex[a] && mtex[a]->tex == tex) return 1; return 0; @@ -168,17 +168,17 @@ static int nodes_use_tex(bNodeTree *ntree, Tex *tex) { bNode *node; - for(node=ntree->nodes.first; node; node= node->next) { - if(node->id) { - if(node->id == (ID*)tex) { + for (node=ntree->nodes.first; node; node= node->next) { + if (node->id) { + if (node->id == (ID*)tex) { return 1; } - else if(GS(node->id->name) == ID_MA) { - if(mtex_use_tex(((Material*)node->id)->mtex, MAX_MTEX, tex)) + else if (GS(node->id->name) == ID_MA) { + if (mtex_use_tex(((Material*)node->id)->mtex, MAX_MTEX, tex)) return 1; } - else if(node->type==NODE_GROUP) { - if(nodes_use_tex((bNodeTree *)node->id, tex)) + else if (node->type==NODE_GROUP) { + if (nodes_use_tex((bNodeTree *)node->id, tex)) return 1; } } @@ -191,13 +191,13 @@ static int nodes_use_material(bNodeTree *ntree, Material *ma) { bNode *node; - for(node=ntree->nodes.first; node; node= node->next) { - if(node->id) { - if(node->id == (ID*)ma) { + for (node=ntree->nodes.first; node; node= node->next) { + if (node->id) { + if (node->id == (ID*)ma) { return 1; } - else if(node->type==NODE_GROUP) { - if(nodes_use_material((bNodeTree *)node->id, ma)) + else if (node->type==NODE_GROUP) { + if (nodes_use_material((bNodeTree *)node->id, ma)) return 1; } } @@ -214,17 +214,17 @@ static void material_changed(Main *bmain, Material *ma) BKE_icon_changed(BKE_icon_getid(&ma->id)); /* glsl */ - if(ma->gpumaterial.first) + if (ma->gpumaterial.first) GPU_material_free(ma); /* find node materials using this */ - for(parent=bmain->mat.first; parent; parent=parent->id.next) { - if(parent->use_nodes && parent->nodetree && nodes_use_material(parent->nodetree, ma)); + for (parent=bmain->mat.first; parent; parent=parent->id.next) { + if (parent->use_nodes && parent->nodetree && nodes_use_material(parent->nodetree, ma)); else continue; BKE_icon_changed(BKE_icon_getid(&parent->id)); - if(parent->gpumaterial.first) + if (parent->gpumaterial.first) GPU_material_free(parent); } } @@ -241,40 +241,40 @@ static void texture_changed(Main *bmain, Tex *tex) BKE_icon_changed(BKE_icon_getid(&tex->id)); /* find materials */ - for(ma=bmain->mat.first; ma; ma=ma->id.next) { - if(mtex_use_tex(ma->mtex, MAX_MTEX, tex)); - else if(ma->use_nodes && ma->nodetree && nodes_use_tex(ma->nodetree, tex)); + for (ma=bmain->mat.first; ma; ma=ma->id.next) { + if (mtex_use_tex(ma->mtex, MAX_MTEX, tex)); + else if (ma->use_nodes && ma->nodetree && nodes_use_tex(ma->nodetree, tex)); else continue; BKE_icon_changed(BKE_icon_getid(&ma->id)); - if(ma->gpumaterial.first) + if (ma->gpumaterial.first) GPU_material_free(ma); } /* find lamps */ - for(la=bmain->lamp.first; la; la=la->id.next) { - if(mtex_use_tex(la->mtex, MAX_MTEX, tex)); - else if(la->nodetree && nodes_use_tex(la->nodetree, tex)); + for (la=bmain->lamp.first; la; la=la->id.next) { + if (mtex_use_tex(la->mtex, MAX_MTEX, tex)); + else if (la->nodetree && nodes_use_tex(la->nodetree, tex)); else continue; BKE_icon_changed(BKE_icon_getid(&la->id)); } /* find worlds */ - for(wo=bmain->world.first; wo; wo=wo->id.next) { - if(mtex_use_tex(wo->mtex, MAX_MTEX, tex)); - else if(wo->nodetree && nodes_use_tex(wo->nodetree, tex)); + for (wo=bmain->world.first; wo; wo=wo->id.next) { + if (mtex_use_tex(wo->mtex, MAX_MTEX, tex)); + else if (wo->nodetree && nodes_use_tex(wo->nodetree, tex)); else continue; BKE_icon_changed(BKE_icon_getid(&wo->id)); } /* find compositing nodes */ - for(scene=bmain->scene.first; scene; scene=scene->id.next) { - if(scene->use_nodes && scene->nodetree) { - for(node=scene->nodetree->nodes.first; node; node=node->next) { - if(node->id == &tex->id) + for (scene=bmain->scene.first; scene; scene=scene->id.next) { + if (scene->use_nodes && scene->nodetree) { + for (node=scene->nodetree->nodes.first; node; node=node->next) { + if (node->id == &tex->id) ED_node_changed_update(&scene->id, node); } } @@ -290,12 +290,12 @@ static void lamp_changed(Main *bmain, Lamp *la) BKE_icon_changed(BKE_icon_getid(&la->id)); /* glsl */ - for(ob=bmain->object.first; ob; ob=ob->id.next) - if(ob->data == la && ob->gpulamp.first) + for (ob=bmain->object.first; ob; ob=ob->id.next) + if (ob->data == la && ob->gpulamp.first) GPU_lamp_free(ob); - for(ma=bmain->mat.first; ma; ma=ma->id.next) - if(ma->gpumaterial.first) + for (ma=bmain->mat.first; ma; ma=ma->id.next) + if (ma->gpumaterial.first) GPU_material_free(ma); } @@ -307,8 +307,8 @@ static void world_changed(Main *bmain, World *wo) BKE_icon_changed(BKE_icon_getid(&wo->id)); /* glsl */ - for(ma=bmain->mat.first; ma; ma=ma->id.next) - if(ma->gpumaterial.first) + for (ma=bmain->mat.first; ma; ma=ma->id.next) + if (ma->gpumaterial.first) GPU_material_free(ma); } @@ -320,8 +320,8 @@ static void image_changed(Main *bmain, Image *ima) BKE_icon_changed(BKE_icon_getid(&ima->id)); /* textures */ - for(tex=bmain->tex.first; tex; tex=tex->id.next) - if(tex->ima == ima) + for (tex=bmain->tex.first; tex; tex=tex->id.next) + if (tex->ima == ima) texture_changed(bmain, tex); } @@ -331,12 +331,12 @@ static void scene_changed(Main *bmain, Scene *UNUSED(scene)) Material *ma; /* glsl */ - for(ob=bmain->object.first; ob; ob=ob->id.next) - if(ob->gpulamp.first) + for (ob=bmain->object.first; ob; ob=ob->id.next) + if (ob->gpulamp.first) GPU_lamp_free(ob); - for(ma=bmain->mat.first; ma; ma=ma->id.next) - if(ma->gpumaterial.first) + for (ma=bmain->mat.first; ma; ma=ma->id.next) + if (ma->gpumaterial.first) GPU_material_free(ma); } |