diff options
author | Daniel Dunbar <daniel@zuster.org> | 2005-07-16 00:56:55 +0400 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2005-07-16 00:56:55 +0400 |
commit | 8d2176bfeb863429cc5d689d8da14e76e8ce8135 (patch) | |
tree | 92f179b73aea6ee5ab0e1574aac7cc9208efe89a /source/blender/blenkernel | |
parent | 10d865df2523f9ca10b76ee301444c444d330bb5 (diff) |
- removed makeDispList, set_displist_onlyzero
- appropriate callers of makeDispList replaced with depgraph calls
- unappropriate places just killed... small chance this gives some
errors in corner cases if dep graph isn't notified (example, font
family displists) but these can be tracked down as they show up.
- still a large number of callers of makeDispListCurveTypes, but
makeDispListMesh has just a few.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_displist.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 11 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 56 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/font.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 9 |
5 files changed, 17 insertions, 69 deletions
diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h index 9a718eec5b9..d75a8a65f0a 100644 --- a/source/blender/blenkernel/BKE_displist.h +++ b/source/blender/blenkernel/BKE_displist.h @@ -141,12 +141,9 @@ extern void curve_to_filledpoly(struct Curve *cu, struct ListBase *nurb, struct extern void freedisplist(struct ListBase *lb); extern int displist_has_faces(struct ListBase *lb); extern float calc_taper(struct Object *taperobj, int cur, int tot); -extern void makeDispList(struct Object *ob); -extern void mesh_changed(struct Object *meshOb); extern void makeDispListMesh(struct Object *ob); extern void makeDispListCurveTypes(struct Object *ob); extern void makeDispListMBall(struct Object *ob); -extern void set_displist_onlyzero(int val); extern void shadeDispList(struct Object *ob); void freefastshade(void); void boundbox_displist(struct Object *ob); diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 6f2ddc8c783..236d21bd710 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -846,15 +846,6 @@ static void build_mesh_data(Object *ob, int inEditMode) { Mesh *me = ob->data; - /* Inside edit mode mesh modifiers aren't calculated */ - if(ob->disp.first==NULL && !inEditMode) { - if ( (ob->parent && (ob->partype==PARSKEL || ob->parent->type==OB_LATTICE)) || - ob->hooks.first || - (ob->softflag & OB_SB_ENABLE) || - (ob->effect.first && ((Effect*) ob->effect.first)->type==EFF_WAVE)) - makeDispListMesh(ob); - } - if ((me->flag&ME_SUBSURF) && me->subdiv) { if(inEditMode && !G.editMesh->derived) { makeDispListMesh(ob); @@ -894,7 +885,7 @@ DerivedMesh *mesh_get_derived_render(Object *ob, int *needsFree) *needsFree = 0; // Don't reuse cache in editmode, we need to guarantee - // order of result and the incremental syncing messes + // index order of result and the incremental syncing messes // with this (could be fixed). - zr if(!(G.obedit && me==G.obedit->data)) { return me->derived; diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 49f1736caf9..874bec746f1 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1549,13 +1549,6 @@ void curve_to_filledpoly(Curve *cu, ListBase *nurb, ListBase *dispbase) } -static int dl_onlyzero= 0; - -void set_displist_onlyzero(int val) -{ - dl_onlyzero= val; -} - /* taper rules: - only 1 curve - first point left, last point right @@ -1604,44 +1597,23 @@ float calc_taper(Object *taperobj, int cur, int tot) return 1.0; } -void mesh_changed(Object *meshOb) +void makeDispListMesh(Object *ob) { - Mesh *me = meshOb->data; + Mesh *me; + + if(!ob || (ob->flag&OB_FROMDUPLI) || ob->type!=OB_MESH) return; + me= ob->data; + /* also serves as signal to remake texspace */ if (me->bb) { MEM_freeN(me->bb); me->bb = NULL; } - freedisplist(&meshOb->disp); - freedisplist(&me->disp); - - if (me->derived) { - me->derived->release(me->derived); - me->derived = NULL; - } - - /* This should really be delayed, but there is no simple way - * to signal to rebuild the derived mesh (we can't null it - * because it is used for incremental). Just need to add a - * flag at some point. - zr - */ - if (G.obedit && meshOb->data==G.obedit->data && mesh_uses_displist(me)) { - G.editMesh->derived= subsurf_make_derived_from_editmesh(G.editMesh, me->subdiv, me->subsurftype, G.editMesh->derived); - } -} - -void makeDispListMesh(Object *ob) -{ - Mesh *me; - - if(!ob || (ob->flag&OB_FROMDUPLI) || ob->type!=OB_MESH) return; - freedisplist(&(ob->disp)); - - me= ob->data; freedisplist(&me->disp); + if (me->derived) { me->derived->release(me->derived); me->derived= NULL; @@ -1700,7 +1672,6 @@ void makeDispListCurveTypes(Object *ob) draw= ob->dt; cu= ob->data; dispbase= &(cu->disp); - if(dl_onlyzero && dispbase->first) return; freedisplist(dispbase); if(ob==G.obedit) nu= editNurb.first; @@ -1792,7 +1763,6 @@ void makeDispListCurveTypes(Object *ob) draw= ob->dt; cu= ob->data; dispbase= &(cu->disp); - if(dl_onlyzero && dispbase->first) return; freedisplist(dispbase); BLI_freelistN(&(cu->bev)); @@ -1936,18 +1906,6 @@ void makeDispListCurveTypes(Object *ob) boundbox_displist(ob); } -void makeDispList(Object *ob) -{ - if (ob->type==OB_MESH) { - makeDispListMesh(ob); - } else if (ob->type==OB_MBALL) { - makeDispListMBall(ob); - } else { - makeDispListCurveTypes(ob); - } -} - - /*******************************/ /***** OUTLINE *****/ /*******************************/ diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 7d59fb541e0..6855b826f7c 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -805,14 +805,13 @@ void font_duplilist(Object *par) yof= cu->yof; ct= chartransdata; - set_displist_onlyzero(1); for(a=0; a<slen; a++, ct++) { ob= find_family_object(obar, cu->family, cu->str[a]); if(ob) { - - makeDispList(ob); + /* not clear if this free line here is still needed */ + freedisplist(&ob->disp); vec[0]= fsize*(ct->xof - xof); vec[1]= fsize*(ct->yof - yof); @@ -836,6 +835,6 @@ void font_duplilist(Object *par) } } - set_displist_onlyzero(0); + MEM_freeN(chartransdata); } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 647a5bca76c..b46aa5ab67c 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1777,10 +1777,13 @@ void object_handle_update(Object *ob) // printf("recalcdata %s\n", ob->id.name+2); /* includes all keys and modifiers */ if(ob->type==OB_MESH) { - mesh_changed(ob); + makeDispListMesh(ob); } - else if(ob->type && ob->type<OB_LAMP) { - makeDispList(ob); + else if(ob->type==OB_MBALL) { + makeDispListMBall(ob); + } + else if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { + makeDispListCurveTypes(ob); } else if(ob->type==OB_ARMATURE) { /* this actually only happens for reading old files... */ |