diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-03-05 11:53:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-03-05 11:53:16 +0300 |
commit | c2d600159830fb827809ef6e806ff37f8b9836ea (patch) | |
tree | da7eda8b0ebf8b2ccc844903e8eea226a05343c0 /source/blender/editors/space_view3d/view3d_draw.c | |
parent | 1935a276b615bff77842a975228c09555baadf25 (diff) |
minor change to dupli draw looping, no functional changes.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index af84e974a0e..7fd46e7864d 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1492,26 +1492,18 @@ int dupli_ob_sort(void *arg1, void *arg2) #endif -static int draw_dupli_objects_step(DupliObject **dob_prev, DupliObject **dob, DupliObject **dob_next) +static DupliObject *dupli_step(DupliObject *dob) { - (*dob_prev) = (*dob); - (*dob) = (*dob_next); - - if((*dob_next)) { - (*dob_next) = (*dob_next)->next; - while((*dob_next) && (*dob_next)->no_draw) { - (*dob_next)= (*dob_next)->next; - } - } - - return (*dob) != NULL; + while(dob && dob->no_draw) + dob= dob->next; + return dob; } static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int color) { RegionView3D *rv3d= ar->regiondata; ListBase *lb; - DupliObject *dob_prev= NULL, *dob= NULL, *dob_next= NULL; + DupliObject *dob_prev= NULL, *dob, *dob_next; Base tbase; BoundBox bb, *bb_tmp; /* use a copy because draw_object, calls clear_mesh_caches */ GLuint displist=0; @@ -1523,13 +1515,11 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas tbase.flag= OB_FROMDUPLI|base->flag; lb= object_duplilist(scene, base->object); // BLI_sortlist(lb, dupli_ob_sort); // might be nice to have if we have a dupli list with mixed objects. - - dob_next= lb->first; - while(dob_next && dob_next->no_draw) { - dob_next= dob_next->next; - } - while(draw_dupli_objects_step(&dob_prev, &dob, &dob_next)) { + dob=dupli_step(lb->first); + if(dob) dob_next= dupli_step(dob->next); + + for( ; dob ; dob_prev= dob, dob= dob_next, dob_next= dob_next ? dupli_step(dob_next->next) : NULL) { tbase.object= dob->ob; /* extra service: draw the duplicator in drawtype of parent */ |