diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-17 11:31:57 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-17 11:31:57 +0300 |
commit | 9d2292ef7e39756d249797a6b972076f096f2750 (patch) | |
tree | b25fc88001a820ca64c2a05edd14bc902042122a /source/blender/editors | |
parent | c42e38299434b44ee9fd30c250a615915de58d01 (diff) |
misc maintenance changes
- metaball tessellation functuion was calculating density when it didn't need to.
- image drawing was using a float as a loop counter, in extreme cases this could cause an infinite loop.
- remove/comment unused vars.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 17 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner.c | 6 |
2 files changed, 13 insertions, 10 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index e2d58b1df5f..22ca549637e 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -473,13 +473,18 @@ static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Scene *scene, static void draw_image_buffer_repeated(SpaceImage *sima, ARegion *ar, Scene *scene, Image *ima, ImBuf *ibuf, float zoomx, float zoomy) { - float x, y; - double time_current; - - time_current = PIL_check_seconds_timer(); + const double time_current= PIL_check_seconds_timer(); + + const int xmax= ceil(ar->v2d.cur.xmax); + const int ymax= ceil(ar->v2d.cur.ymax); + const int xmin= floor(ar->v2d.cur.xmin); + const int ymin= floor(ar->v2d.cur.ymin); + + int x; - for(x=floor(ar->v2d.cur.xmin); x<ar->v2d.cur.xmax; x += 1.0f) { - for(y=floor(ar->v2d.cur.ymin); y<ar->v2d.cur.ymax; y += 1.0f) { + for(x=xmin; x<xmax; x++) { + int y; + for(y=ymin; y<ymax; y++) { if(ima && (ima->tpageflag & IMA_TILES)) draw_image_buffer_tiled(sima, ar, scene, ima, ibuf, x, y, zoomx, zoomy); else diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 1d10708547b..49e477ca109 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1409,7 +1409,6 @@ static void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops) for(group= mainvar->group.first; group; group= group->id.next) { if(group->gobject.first) { te= outliner_add_element(soops, &soops->tree, group, NULL, 0, 0); - tselem= TREESTORE(te); for(go= group->gobject.first; go; go= go->next) { ten= outliner_add_element(soops, &te->subtree, go->ob, te, 0, 0); @@ -2022,13 +2021,13 @@ static int tree_element_active_material(bContext *C, Scene *scene, SpaceOops *so static int tree_element_active_texture(bContext *C, Scene *scene, SpaceOops *soops, TreeElement *te, int set) { TreeElement *tep; - TreeStoreElem *tselem, *tselemp; + TreeStoreElem /* *tselem,*/ *tselemp; Object *ob=OBACT; SpaceButs *sbuts=NULL; if(ob==NULL) return 0; // no active object - tselem= TREESTORE(te); + /*tselem= TREESTORE(te);*/ /*UNUSED*/ /* find buttons area (note, this is undefined really still, needs recode in blender) */ /* XXX removed finding sbuts */ @@ -4551,7 +4550,6 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Spa if(level<1 || (tselem->type==0 && te->idcode==ID_OB)) { /* active blocks get white circle */ - active= 0; if(tselem->type==0) { if(te->idcode==ID_OB) active= (OBACT==(Object *)tselem->id); else if(scene->obedit && scene->obedit->data==tselem->id) active= 1; // XXX use context? |