diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_scene.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/collision.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 17 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 16 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 8 |
9 files changed, 39 insertions, 38 deletions
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 4b3d3723ab5..f75e4020cb9 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -51,8 +51,8 @@ struct Text; #define SCE_COPY_LINK_DATA 2 #define SCE_COPY_FULL 3 -#define SETLOOPER(s, b) sce= s, b= _setlooper_base_step(&sce, NULL); b; b= _setlooper_base_step(&sce, b) -struct Base *_setlooper_base_step(struct Scene **sce, struct Base *base); +#define SETLOOPER(_sce_basis, _sce_iter, _base) _sce_iter= _sce_basis, _base= _setlooper_base_step(&_sce_iter, NULL); _base; _base= _setlooper_base_step(&_sce_iter, _base) +struct Base *_setlooper_base_step(struct Scene **sce_iter, struct Base *base); void free_avicodecdata(struct AviCodecData *acd); void free_qtcodecdata(struct QuicktimeCodecData *acd); diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index d39e550192b..b2d587151b1 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -1358,9 +1358,9 @@ Object **get_collisionobjects(Scene *scene, Object *self, Group *group, unsigned add_collision_object(&objs, &numobj, &maxobj, go->ob, self, 0); } else { - Scene *sce; /* for SETLOOPER macro */ + Scene *sce_iter; /* add objects in same layer in scene */ - for(SETLOOPER(scene, base)) { + for(SETLOOPER(scene, sce_iter, base)) { if(base->lay & self->lay) add_collision_object(&objs, &numobj, &maxobj, base->object, self, 0); @@ -1417,11 +1417,11 @@ ListBase *get_collider_cache(Scene *scene, Object *self, Group *group) add_collider_cache_object(&objs, go->ob, self, 0); } else { - Scene *sce; /* for SETLOOPER macro */ + Scene *sce_iter; Base *base; /* add objects in same layer in scene */ - for(SETLOOPER(scene, base)) { + for(SETLOOPER(scene, sce_iter, base)) { if(!self || (base->lay & self->lay)) add_collider_cache_object(&objs, base->object, self, 0); diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 2ac3946cb98..1904e63c2ba 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -2139,10 +2139,10 @@ void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const s Object *ob; Group *group; GroupObject *go; - Scene *sce; + Scene *sce_iter; /* set ob flags where animated systems are */ - for(SETLOOPER(scene, base)) { + for(SETLOOPER(scene, sce_iter, base)) { ob= base->object; if(do_time) { @@ -2167,12 +2167,12 @@ void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const s } } - for(sce= scene; sce; sce= sce->set) - DAG_scene_flush_update(bmain, sce, lay, 1); + for(sce_iter= scene; sce_iter; sce_iter= sce_iter->set) + DAG_scene_flush_update(bmain, sce_iter, lay, 1); if(do_time) { /* test: set time flag, to disable baked systems to update */ - for(SETLOOPER(scene, base)) { + for(SETLOOPER(scene, sce_iter, base)) { ob= base->object; if(ob->recalc) ob->recalc |= OB_RECALC_TIME; @@ -2240,7 +2240,7 @@ void DAG_ids_flush_update(Main *bmain, int time) void DAG_on_load_update(Main *bmain, const short do_time) { - Scene *scene, *sce; + Scene *scene; Base *base; Object *ob; Group *group; @@ -2251,15 +2251,16 @@ void DAG_on_load_update(Main *bmain, const short do_time) dag_current_scene_layers(bmain, &scene, &lay); if(scene && scene->theDag) { + Scene *sce_iter; /* derivedmeshes and displists are not saved to file so need to be remade, tag them so they get remade in the scene update loop, note armature poses or object matrices are preserved and do not require updates, so we skip those */ dag_scene_flush_layers(scene, lay); - for(SETLOOPER(scene, base)) { + for(SETLOOPER(scene, sce_iter, base)) { ob= base->object; - node= (sce->theDag)? dag_get_node(sce->theDag, ob): NULL; + node= (sce_iter->theDag)? dag_get_node(sce_iter->theDag, ob): NULL; oblay= (node)? node->lay: ob->lay; if(oblay & lay) { diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index c43f53cc4af..d131a3c3592 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -2464,7 +2464,7 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) { Main *bmain = baker->main; Scene *scene = baker->scene; - Scene *sce; /* SETLOOPER macro only */ + Scene *sce_iter; /* SETLOOPER macro only */ Base *base; ListBase pidlist; PTCacheID *pid = baker->pid; @@ -2535,7 +2535,7 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) cache->flag &= ~PTCACHE_BAKED; } } - else for(SETLOOPER(scene, base)) { + 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); @@ -2624,7 +2624,7 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) BKE_ptcache_write_cache(pid, 0); } } - else for(SETLOOPER(scene, base)) { + 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) { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 58b7f95f9c8..7a8c4efb51a 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1077,20 +1077,20 @@ float get_render_aosss_error(RenderData *r, float error) } /* helper function for the SETLOOPER macro */ -Base *_setlooper_base_step(Scene **sce, Base *base) +Base *_setlooper_base_step(Scene **sce_iter, Base *base) { if(base && base->next) { /* common case, step to the next */ return base->next; } - else if(base==NULL && (*sce)->base.first) { + else if(base==NULL && (*sce_iter)->base.first) { /* first time looping, return the scenes first base */ - return (Base *)(*sce)->base.first; + return (Base *)(*sce_iter)->base.first; } else { /* reached the end, get the next base in the set */ - while((*sce= (*sce)->set)) { - base= (Base *)(*sce)->base.first; + while((*sce_iter= (*sce_iter)->set)) { + base= (Base *)(*sce_iter)->base.first; if(base) { return base; } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 80993b45f72..6bf87e1964b 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1726,7 +1726,6 @@ void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *)) { RegionView3D *rv3d= ar->regiondata; Base *base; - Scene *sce; short zbuf= v3d->zbuf; short flag= v3d->flag; float glalphaclip= U.glalphaclip; @@ -1759,7 +1758,8 @@ void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *)) /* draw set first */ if(scene->set) { - for(SETLOOPER(scene->set, base)) { + Scene *sce_iter; + for(SETLOOPER(scene->set, sce_iter, base)) { if(v3d->lay & base->lay) { if (func == NULL || func(base)) { draw_object(scene, ar, v3d, base, 0); @@ -1881,14 +1881,14 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d) { ListBase shadows; View3DShadow *shadow; - Scene *sce; + Scene *sce_iter; Base *base; Object *ob; shadows.first= shadows.last= NULL; /* update lamp transform and gather shadow lamps */ - for(SETLOOPER(scene, base)) { + for(SETLOOPER(scene, sce_iter, base)) { ob= base->object; if(ob->type == OB_LAMP) @@ -2036,7 +2036,6 @@ static void view3d_main_area_setup_view(Scene *scene, View3D *v3d, ARegion *ar, void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx, int winy, float viewmat[][4], float winmat[][4]) { - Scene *sce; Base *base; float backcol[3]; int bwinx, bwiny; @@ -2091,7 +2090,8 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx, /* draw set first */ if(scene->set) { - for(SETLOOPER(scene->set, base)) { + Scene *sce_iter; + for(SETLOOPER(scene->set, sce_iter, base)) { if(v3d->lay & base->lay) { UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); draw_object(scene, ar, v3d, base, DRAW_CONSTCOLOR|DRAW_SCENESET); @@ -2295,7 +2295,6 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) Scene *scene= CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); - Scene *sce; Base *base; Object *ob; float backcol[3]; @@ -2389,7 +2388,8 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) /* draw set first */ if(scene->set) { - for(SETLOOPER(scene->set, base)) { + Scene *sce_iter; + for(SETLOOPER(scene->set, sce_iter, base)) { if(v3d->lay & base->lay) { diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 592cf809a4f..b9da22b36a7 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -756,10 +756,10 @@ static void material_lights(GPUShadeInput *shi, GPUShadeResult *shr) { Base *base; Object *ob; - Scene *sce; + Scene *sce_iter; GPULamp *lamp; - for(SETLOOPER(shi->gpumat->scene, base)) { + for(SETLOOPER(shi->gpumat->scene, sce_iter, base)) { ob= base->object; if(ob->type==OB_LAMP) { diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 02b05cb7073..48de2930bd0 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -874,10 +874,10 @@ static void object_simplify_update(Object *ob) static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Scene *sce; + Scene *sce_iter; Base *base; - for(SETLOOPER(scene, base)) + for(SETLOOPER(scene, sce_iter, base)) object_simplify_update(base->object); DAG_ids_flush_update(bmain, 0); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 53f418966e2..b851728653a 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4679,7 +4679,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp Object *ob; Group *group; ObjectInstanceRen *obi; - Scene *sce; + Scene *sce_iter; float mat[4][4]; int lay, vectorlay, redoimat= 0; @@ -4688,7 +4688,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp * NULL is just for init */ set_dupli_tex_mat(NULL, NULL, NULL); - for(SETLOOPER(re->scene, base)) { + for(SETLOOPER(re->scene, sce_iter, base)) { ob= base->object; /* imat objects has to be done here, since displace can have texture using Object map-input */ mul_m4_m4m4(mat, ob->obmat, re->viewmat); @@ -4698,7 +4698,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp ob->transflag &= ~OB_RENDER_DUPLI; } - for(SETLOOPER(re->scene, base)) { + for(SETLOOPER(re->scene, sce_iter, base)) { ob= base->object; /* in the prev/next pass for making speed vectors, avoid creating @@ -4836,7 +4836,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp /* imat objects has to be done again, since groups can mess it up */ if(redoimat) { - for(SETLOOPER(re->scene, base)) { + for(SETLOOPER(re->scene, sce_iter, base)) { ob= base->object; mul_m4_m4m4(mat, ob->obmat, re->viewmat); invert_m4_m4(ob->imat, mat); |