Style cleanup: displist module
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 7 May 2012 06:58:03 +0000 (06:58 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 7 May 2012 06:58:03 +0000 (06:58 +0000)
24 files changed:
source/blender/blenkernel/BKE_displist.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/collada/MeshImporter.cpp
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_relations.c
source/blender/editors/space_info/info_stats.c
source/blender/editors/space_view3d/drawobject.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/modifiers/intern/MOD_array.c
source/blender/python/mathutils/mathutils_geometry.c
source/blender/render/intern/source/convertblender.c

index c5684e839039fb930214ca842c802be35e4f47b4..cb8ddbf0b00d75333539bcaf5cc7e873ba3f4f37 100644 (file)
@@ -78,29 +78,28 @@ typedef struct DispList {
        unsigned int *bevelSplitFlag;
 } DispList;
 
-extern void copy_displist(struct ListBase *lbn, struct ListBase *lb);
-extern void free_disp_elem(DispList *dl);
-extern DispList *find_displist_create(struct ListBase *lb, int type);
-extern DispList *find_displist(struct ListBase *lb, int type);
-extern void addnormalsDispList(struct ListBase *lb);
-extern void count_displist(struct ListBase *lb, int *totvert, int *totface);
-extern void freedisplist(struct ListBase *lb);
-extern int displist_has_faces(struct ListBase *lb);
-
-extern void makeDispListSurf(struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct DerivedMesh **derivedFinal, int forRender, int forOrco);
-extern void makeDispListCurveTypes(struct Scene *scene, struct Object *ob, int forOrco);
-extern void makeDispListCurveTypes_forRender(struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct DerivedMesh **derivedFinal, int forOrco);
-extern void makeDispListCurveTypes_forOrco(struct Scene *scene, struct Object *ob, struct ListBase *dispbase);
-extern void makeDispListMBall(struct Scene *scene, struct Object *ob);
-extern void makeDispListMBall_forRender(struct Scene *scene, struct Object *ob, struct ListBase *dispbase);
-
-int surfindex_displist(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4);
-void filldisplist(struct ListBase *dispbase, struct ListBase *to, int flipnormal);
-
-float calc_taper(struct Scene *scene, struct Object *taperobj, int cur, int tot);
+void BKE_displist_copy(struct ListBase *lbn, struct ListBase *lb);
+void BKE_displist_elem_free(DispList *dl);
+DispList *BKE_displist_find_or_create(struct ListBase *lb, int type);
+DispList *BKE_displist_find(struct ListBase *lb, int type);
+void BKE_displist_normals_add(struct ListBase *lb);
+void BKE_displist_count(struct ListBase *lb, int *totvert, int *totface);
+void BKE_displist_free(struct ListBase *lb);
+int BKE_displist_has_faces(struct ListBase *lb);
+
+void BKE_displist_make_surf(struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct DerivedMesh **derivedFinal, int forRender, int forOrco);
+void BKE_displist_make_curveTypes(struct Scene *scene, struct Object *ob, int forOrco);
+void BKE_displist_make_curveTypes_forRender(struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct DerivedMesh **derivedFinal, int forOrco);
+void BKE_displist_make_curveTypes_forOrco(struct Scene *scene, struct Object *ob, struct ListBase *dispbase);
+void BKE_displist_make_mball(struct Scene *scene, struct Object *ob);
+void BKE_displist_make_mball_forRender(struct Scene *scene, struct Object *ob, struct ListBase *dispbase);
+
+int BKE_displist_surfindex_get(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4);
+void BKE_displist_fill(struct ListBase *dispbase, struct ListBase *to, int flipnormal);
+
+float BKE_displist_calc_taper(struct Scene *scene, struct Object *taperobj, int cur, int tot);
 
 /* add Orco layer to the displist object which has got derived mesh and return orco */
-float *makeOrcoDispList(struct Scene *scene, struct Object *ob, struct DerivedMesh *derivedFinal, int forRender);
+float *BKE_displist_make_orco(struct Scene *scene, struct Object *ob, struct DerivedMesh *derivedFinal, int forRender);
 
 #endif
-
index 2024a5ce09165d19732271d4a7dd6885fa200a07..a814ca81beb0c3474db8c2d87adbaa42192c824b 100644 (file)
@@ -2097,7 +2097,7 @@ static void clear_mesh_caches(Object *ob)
                me->bb = NULL;
        }
 
-       freedisplist(&ob->disp);
+       BKE_displist_free(&ob->disp);
 
        if (ob->derivedFinal) {
                ob->derivedFinal->needsFree = 1;
index 1f4259c6d86a6f4df8304c391d1945bf13e595c4..09b295aabf1a52bdbcb759f77c18ced1c80d9427 100644 (file)
@@ -1818,7 +1818,7 @@ static void splineik_init_tree_from_pchan(Scene *scene, Object *UNUSED(ob), bPos
 
                /* only happens on reload file, but violates depsgraph still... fix! */
                if ((cu->path == NULL) || (cu->path->data == NULL))
-                       makeDispListCurveTypes(scene, ikData->tar, 0);
+                       BKE_displist_make_curveTypes(scene, ikData->tar, 0);
        }
 
        /* find the root bone and the chain of bones from the root to the tip
index eed5ec490122dad279231a151a8e4837565381ac..868da0fda94b55ed163527c46b7c2f936ce7a30a 100644 (file)
@@ -516,7 +516,7 @@ static void contarget_get_lattice_mat(Object *ob, const char *substring, float m
 {
        Lattice *lt = (Lattice *)ob->data;
        
-       DispList *dl = find_displist(&ob->disp, DL_VERTS);
+       DispList *dl = BKE_displist_find(&ob->disp, DL_VERTS);
        float *co = dl ? dl->verts : NULL;
        BPoint *bp = lt->def;
        
@@ -1234,7 +1234,7 @@ static void followpath_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstra
                
                /* only happens on reload file, but violates depsgraph still... fix! */
                if (cu->path == NULL || cu->path->data == NULL)
-                       makeDispListCurveTypes(cob->scene, ct->tar, 0);
+                       BKE_displist_make_curveTypes(cob->scene, ct->tar, 0);
                
                if (cu->path && cu->path->data) {
                        float quat[4];
@@ -2007,7 +2007,7 @@ static void pycon_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstraintTa
                        
                        /* this check is to make sure curve objects get updated on file load correctly.*/
                        if (cu->path == NULL || cu->path->data == NULL) /* only happens on reload file, but violates depsgraph still... fix! */
-                               makeDispListCurveTypes(cob->scene, ct->tar, 0);                         
+                               BKE_displist_make_curveTypes(cob->scene, ct->tar, 0);                           
                }
                
                /* firstly calculate the matrix the normal way, then let the py-function override
@@ -3090,7 +3090,7 @@ static void clampto_get_tarmat(bConstraint *UNUSED(con), bConstraintOb *cob, bCo
                
                /* only happens on reload file, but violates depsgraph still... fix! */
                if (cu->path == NULL || cu->path->data == NULL)
-                       makeDispListCurveTypes(cob->scene, ct->tar, 0);
+                       BKE_displist_make_curveTypes(cob->scene, ct->tar, 0);
        }
        
        /* technically, this isn't really needed for evaluation, but we don't know what else
@@ -3720,7 +3720,7 @@ static void splineik_get_tarmat(bConstraint *UNUSED(con), bConstraintOb *cob, bC
                
                /* only happens on reload file, but violates depsgraph still... fix! */
                if (cu->path == NULL || cu->path->data == NULL)
-                       makeDispListCurveTypes(cob->scene, ct->tar, 0);
+                       BKE_displist_make_curveTypes(cob->scene, ct->tar, 0);
        }
        
        /* technically, this isn't really needed for evaluation, but we don't know what else
index 190d9f654f6eaa240ba55db9967470f85b4d0033..45dbf96fd60fcba1208c3b8578ba5d53098c072e 100644 (file)
@@ -136,7 +136,7 @@ void BKE_curve_free(Curve *cu)
 {
        BKE_nurbList_free(&cu->nurb);
        BLI_freelistN(&cu->bev);
-       freedisplist(&cu->disp);
+       BKE_displist_free(&cu->disp);
        BKE_curve_editfont_free(cu);
 
        BKE_curve_editNurb_free(cu);
@@ -1234,7 +1234,7 @@ float *BKE_curve_make_orco(Scene *scene, Object *ob)
        float *fp, *coord_array;
        ListBase disp = {NULL, NULL};
 
-       makeDispListCurveTypes_forOrco(scene, ob, &disp);
+       BKE_displist_make_curveTypes_forOrco(scene, ob, &disp);
 
        numVerts = 0;
        for (dl = disp.first; dl; dl = dl->next) {
@@ -1306,7 +1306,7 @@ float *BKE_curve_make_orco(Scene *scene, Object *ob)
                }
        }
 
-       freedisplist(&disp);
+       BKE_displist_free(&disp);
 
        return coord_array;
 }
@@ -1337,13 +1337,13 @@ void BKE_curve_bevel_make(Scene *scene, Object *ob, ListBase *disp, int forRende
                        facy = cu->bevobj->size[1];
 
                        if (forRender) {
-                               makeDispListCurveTypes_forRender(scene, cu->bevobj, &bevdisp, NULL, 0);
+                               BKE_displist_make_curveTypes_forRender(scene, cu->bevobj, &bevdisp, NULL, 0);
                                dl = bevdisp.first;
                        }
                        else {
                                dl = cu->bevobj->disp.first;
                                if (dl == NULL) {
-                                       makeDispListCurveTypes(scene, cu->bevobj, 0);
+                                       BKE_displist_make_curveTypes(scene, cu->bevobj, 0);
                                        dl = cu->bevobj->disp.first;
                                }
                        }
@@ -1370,7 +1370,7 @@ void BKE_curve_bevel_make(Scene *scene, Object *ob, ListBase *disp, int forRende
                                dl = dl->next;
                        }
 
-                       freedisplist(&bevdisp);
+                       BKE_displist_free(&bevdisp);
                }
        }
        else if (cu->ext1 == 0.0f && cu->ext2 == 0.0f) {
index f43a133c339ddee217a813f7b43f1015c8701122..8b4d699006d0ef03c6ec416b7dc5baf854bf3892 100644 (file)
@@ -64,7 +64,7 @@
 
 static void boundbox_displist(Object *ob);
 
-void free_disp_elem(DispList *dl)
+void BKE_displist_elem_free(DispList *dl)
 {
        if (dl) {
                if (dl->verts) MEM_freeN(dl->verts);
@@ -77,25 +77,26 @@ void free_disp_elem(DispList *dl)
        }
 }
 
-void freedisplist(ListBase *lb)
+void BKE_displist_free(ListBase *lb)
 {
        DispList *dl;
 
        dl = lb->first;
        while (dl) {
                BLI_remlink(lb, dl);
-               free_disp_elem(dl);
+               BKE_displist_elem_free(dl);
                dl = lb->first;
        }
 }
 
-DispList *find_displist_create(ListBase *lb, int type)
+DispList *BKE_displist_find_or_create(ListBase *lb, int type)
 {
        DispList *dl;
-       
+
        dl = lb->first;
        while (dl) {
-               if (dl->type == type) return dl;
+               if (dl->type == type)
+                       return dl;
                dl = dl->next;
        }
 
@@ -106,39 +107,41 @@ DispList *find_displist_create(ListBase *lb, int type)
        return dl;
 }
 
-DispList *find_displist(ListBase *lb, int type)
+DispList *BKE_displist_find(ListBase *lb, int type)
 {
        DispList *dl;
-       
+
        dl = lb->first;
        while (dl) {
-               if (dl->type == type) return dl;
+               if (dl->type == type)
+                       return dl;
                dl = dl->next;
        }
 
        return NULL;
 }
 
-int displist_has_faces(ListBase *lb)
+int BKE_displist_has_faces(ListBase *lb)
 {
        DispList *dl;
+
        for (dl = lb->first; dl; dl = dl->next) {
                if (ELEM3(dl->type, DL_INDEX3, DL_INDEX4, DL_SURF)) {
-                       return 1;
+                       return TRUE;
                }
        }
-       return 0;
+
+       return FALSE;
 }
 
-void copy_displist(ListBase *lbn, ListBase *lb)
+void BKE_displist_copy(ListBase *lbn, ListBase *lb)
 {
        DispList *dln, *dl;
-       
-       freedisplist(lbn);
-       
+
+       BKE_displist_free(lbn);
+
        dl = lb->first;
        while (dl) {
-               
                dln = MEM_dupallocN(dl);
                BLI_addtail(lbn, dln);
                dln->verts = MEM_dupallocN(dl->verts);
@@ -154,7 +157,7 @@ void copy_displist(ListBase *lbn, ListBase *lb)
        }
 }
 
-void addnormalsDispList(ListBase *lb)
+void BKE_displist_normals_add(ListBase *lb)
 {
        DispList *dl = NULL;
        float *vdata, *ndata, nor[3];
@@ -162,29 +165,31 @@ void addnormalsDispList(ListBase *lb)
        float *n1, *n2, *n3, *n4;
        int a, b, p1, p2, p3, p4;
 
-
        dl = lb->first;
-       
+
        while (dl) {
                if (dl->type == DL_INDEX3) {
                        if (dl->nors == NULL) {
                                dl->nors = MEM_callocN(sizeof(float) * 3, "dlnors");
-                               if (dl->verts[2] < 0.0f) dl->nors[2] = -1.0f;
-                               else dl->nors[2] = 1.0f;
+
+                               if (dl->verts[2] < 0.0f)
+                                       dl->nors[2] = -1.0f;
+                               else
+                                       dl->nors[2] = 1.0f;
                        }
                }
                else if (dl->type == DL_SURF) {
                        if (dl->nors == NULL) {
                                dl->nors = MEM_callocN(sizeof(float) * 3 * dl->nr * dl->parts, "dlnors");
-                               
+
                                vdata = dl->verts;
                                ndata = dl->nors;
-                               
+
                                for (a = 0; a < dl->parts; a++) {
-                                       
-                                       if (surfindex_displist(dl, a, &b, &p1, &p2, &p3, &p4) == 0)
+
+                                       if (BKE_displist_surfindex_get(dl, a, &b, &p1, &p2, &p3, &p4) == 0)
                                                break;
-       
+
                                        v1 = vdata + 3 * p1;
                                        n1 = ndata + 3 * p1;
                                        v2 = vdata + 3 * p2;
@@ -193,16 +198,15 @@ void addnormalsDispList(ListBase *lb)
                                        n3 = ndata + 3 * p3;
                                        v4 = vdata + 3 * p4;
                                        n4 = ndata + 3 * p4;
-                                       
+
                                        for (; b < dl->nr; b++) {
-       
                                                normal_quad_v3(nor, v1, v3, v4, v2);
-       
+
                                                add_v3_v3(n1, nor);
                                                add_v3_v3(n2, nor);
                                                add_v3_v3(n3, nor);
                                                add_v3_v3(n4, nor);
-       
+
                                                v2 = v1; v1 += 3;
                                                v4 = v3; v3 += 3;
                                                n2 = n1; n1 += 3;
@@ -221,13 +225,12 @@ void addnormalsDispList(ListBase *lb)
        }
 }
 
-void count_displist(ListBase *lb, int *totvert, int *totface)
+void BKE_displist_count(ListBase *lb, int *totvert, int *totface)
 {
        DispList *dl;
-       
+
        dl = lb->first;
        while (dl) {
-               
                switch (dl->type) {
                        case DL_SURF:
                                *totvert += dl->nr * dl->parts;
@@ -241,18 +244,19 @@ void count_displist(ListBase *lb, int *totvert, int *totface)
                        case DL_POLY:
                        case DL_SEGM:
                                *totvert += dl->nr * dl->parts;
+                               break;
                }
-               
+
                dl = dl->next;
        }
 }
 
-int surfindex_displist(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4)
+int BKE_displist_surfindex_get(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4)
 {
        if ((dl->flag & DL_CYCL_V) == 0 && a == (dl->parts) - 1) {
                return 0;
        }
-       
+
        if (dl->flag & DL_CYCL_U) {
                (*p1) = dl->nr * a;
                (*p2) = (*p1) + dl->nr - 1;
@@ -267,12 +271,12 @@ int surfindex_displist(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, i
                (*p3) = (*p1) + dl->nr;
                (*b) = 1;
        }
-       
-       if ( (dl->flag & DL_CYCL_V) && a == dl->parts - 1) {
+
+       if ((dl->flag & DL_CYCL_V) && a == dl->parts - 1) {
                (*p3) -= dl->nr * dl->parts;
                (*p4) -= dl->nr * dl->parts;
        }
-       
+
        return 1;
 }
 
@@ -286,19 +290,17 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
        BPoint *bp;
        float *data;
        int a, len, resolu;
-       
+
        nu = nubase->first;
        while (nu) {
                if (nu->hide == 0) {
-                       
                        if (forRender && cu->resolu_ren != 0)
                                resolu = cu->resolu_ren;
                        else
                                resolu = nu->resolu;
-                       
+
                        if (!BKE_nurb_check_valid_u(nu)) ;
                        else if (nu->type == CU_BEZIER) {
-                               
                                /* count */
                                len = 0;
                                a = nu->pntsu - 1;
@@ -307,17 +309,21 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
                                prevbezt = nu->bezt;
                                bezt = prevbezt + 1;
                                while (a--) {
-                                       if (a == 0 && (nu->flagu & CU_NURB_CYCLIC)) bezt = nu->bezt;
-                                       
-                                       if (prevbezt->h2 == HD_VECT && bezt->h1 == HD_VECT) len++;
-                                       else len += resolu;
-                                       
-                                       if (a == 0 && (nu->flagu & CU_NURB_CYCLIC) == 0) len++;
-                                       
+                                       if (a == 0 && (nu->flagu & CU_NURB_CYCLIC))
+                                               bezt = nu->bezt;
+
+                                       if (prevbezt->h2 == HD_VECT && bezt->h1 == HD_VECT)
+                                               len++;
+                                       else
+                                               len += resolu;
+
+                                       if (a == 0 && (nu->flagu & CU_NURB_CYCLIC) == 0)
+                                               len++;
+
                                        prevbezt = bezt;
                                        bezt++;
                                }
-                               
+
                                dl = MEM_callocN(sizeof(DispList), "makeDispListbez");
                                /* len+1 because of 'forward_diff_bezier' function */
                                dl->verts = MEM_callocN((len + 1) * 3 * sizeof(float), "dlverts");
@@ -337,13 +343,14 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
                                        dl->type = DL_SEGM;
                                        a = nu->pntsu - 1;
                                }
-                               
+
                                prevbezt = nu->bezt;
                                bezt = prevbezt + 1;
-                               
+
                                while (a--) {
-                                       if (a == 0 && dl->type == DL_POLY) bezt = nu->bezt;
-                                       
+                                       if (a == 0 && dl->type == DL_POLY)
+                                               bezt = nu->bezt;
+
                                        if (prevbezt->h2 == HD_VECT && bezt->h1 == HD_VECT) {
                                                copy_v3_v3(data, prevbezt->vec[1]);
                                                data += 3;
@@ -357,32 +364,33 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
                                                                                      bezt->vec[1][j],
                                                                                      data + j, resolu, 3 * sizeof(float));
                                                }
-                                               
+
                                                data += 3 * resolu;
                                        }
-                                       
+
                                        if (a == 0 && dl->type == DL_SEGM) {
                                                copy_v3_v3(data, bezt->vec[1]);
                                        }
-                                       
+
                                        prevbezt = bezt;
                                        bezt++;
                                }
                        }
                        else if (nu->type == CU_NURBS) {
                                len = (resolu * SEGMENTSU(nu));
-                               
+
                                dl = MEM_callocN(sizeof(DispList), "makeDispListsurf");
                                dl->verts = MEM_callocN(len * 3 * sizeof(float), "dlverts");
                                BLI_addtail(dispbase, dl);
                                dl->parts = 1;
-                               
+
                                dl->nr = len;
                                dl->col = nu->mat_nr;
                                dl->charidx = nu->charidx;
 
                                data = dl->verts;
-                               if (nu->flagu & CU_NURB_CYCLIC) dl->type = DL_POLY;
+                               if (nu->flagu & CU_NURB_CYCLIC)
+                                       dl->type = DL_POLY;
                                else dl->type = DL_SEGM;
                                BKE_nurb_makeCurve(nu, data, NULL, NULL, NULL, resolu, 3 * sizeof(float));
                        }
@@ -399,7 +407,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
                                data = dl->verts;
                                if (nu->flagu & CU_NURB_CYCLIC) dl->type = DL_POLY;
                                else dl->type = DL_SEGM;
-                               
+
                                a = len;
                                bp = nu->bp;
                                while (a--) {
@@ -414,7 +422,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
 }
 
 
-void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
+void BKE_displist_fill(ListBase *dispbase, ListBase *to, int flipnormal)
 {
        ScanFillContext sf_ctx;
        ScanFillVert *eve, *v1, *vlast;
@@ -423,36 +431,39 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
        float *f1;
        int colnr = 0, charidx = 0, cont = 1, tot, a, *index, nextcol = 0;
        intptr_t totvert;
-       
-       if (dispbase == NULL) return;
-       if (dispbase->first == NULL) return;
+
+       if (dispbase == NULL)
+               return;
+       if (dispbase->first == NULL)
+               return;
 
        while (cont) {
                cont = 0;
                totvert = 0;
                nextcol = 0;
-               
+
                BLI_scanfill_begin(&sf_ctx);
-               
+
                dl = dispbase->first;
                while (dl) {
-       
                        if (dl->type == DL_POLY) {
-                               if (charidx < dl->charidx) cont = 1;
+                               if (charidx < dl->charidx)
+                                       cont = 1;
                                else if (charidx == dl->charidx) { /* character with needed index */
                                        if (colnr == dl->col) {
                                                /* make editverts and edges */
                                                f1 = dl->verts;
                                                a = dl->nr;
                                                eve = v1 = NULL;
-                                               
+
                                                while (a--) {
                                                        vlast = eve;
 
                                                        eve = BLI_scanfill_vert_add(&sf_ctx, f1);
                                                        totvert++;
 
-                                                       if (vlast == NULL) v1 = eve;
+                                                       if (vlast == NULL)
+                                                               v1 = eve;
                                                        else {
                                                                BLI_scanfill_edge_add(&sf_ctx, vlast, eve);
                                                        }
@@ -472,7 +483,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
                        }
                        dl = dl->next;
                }
-               
+
                if (totvert && (tot = BLI_scanfill_calc(&sf_ctx, FALSE))) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) {
                        if (tot) {
                                dlnew = MEM_callocN(sizeof(DispList), "filldisplist");
@@ -483,7 +494,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
 
                                dlnew->index = MEM_mallocN(tot * 3 * sizeof(int), "dlindex");
                                dlnew->verts = MEM_mallocN(totvert * 3 * sizeof(float), "dlverts");
-                               
+
                                /* vert data */
                                f1 = dlnew->verts;
                                totvert = 0;
@@ -491,14 +502,14 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
                                while (eve) {
                                        copy_v3_v3(f1, eve->co);
                                        f1 += 3;
-       
+
                                        /* index number */
                                        eve->tmp.l = totvert;
                                        totvert++;
-                                       
+
                                        eve = eve->next;
                                }
-                               
+
                                /* index data */
                                efa = sf_ctx.fillfacebase.first;
                                index = dlnew->index;
@@ -509,14 +520,13 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
 
                                        if (flipnormal)
                                                SWAP(int, index[0], index[2]);
-                                       
+
                                        index += 3;
                                        efa = efa->next;
                                }
                        }
 
                        BLI_addhead(to, dlnew);
-                       
                }
                BLI_scanfill_end(&sf_ctx);
 
@@ -530,9 +540,8 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
                        colnr = 0;
                }
        }
-       
+
        /* do not free polys, needed for wireframe display */
-       
 }
 
 static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
@@ -541,14 +550,14 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
        DispList *dl, *dlnew;
        float *fp, *fp1;
        int a, dpoly;
-       
+
        front.first = front.last = back.first = back.last = NULL;
-       
+
        dl = dispbase->first;
        while (dl) {
                if (dl->type == DL_SURF) {
-                       if ( (dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U) == 0) {
-                               if ( (cu->flag & CU_BACK) && (dl->flag & DL_BACK_CURVE) ) {
+                       if ((dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U) == 0) {
+                               if ( (cu->flag & CU_BACK) && (dl->flag & DL_BACK_CURVE)) {
                                        dlnew = MEM_callocN(sizeof(DispList), "filldisp");
                                        BLI_addtail(&front, dlnew);
                                        dlnew->verts = fp1 = MEM_mallocN(sizeof(float) * 3 * dl->parts, "filldisp1");
@@ -557,10 +566,10 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
                                        dlnew->type = DL_POLY;
                                        dlnew->col = dl->col;
                                        dlnew->charidx = dl->charidx;
-                                       
+
                                        fp = dl->verts;
                                        dpoly = 3 * dl->nr;
-                                       
+
                                        a = dl->parts;
                                        while (a--) {
                                                copy_v3_v3(fp1, fp);
@@ -568,7 +577,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
                                                fp += dpoly;
                                        }
                                }
-                               if ( (cu->flag & CU_FRONT) && (dl->flag & DL_FRONT_CURVE) ) {
+                               if ((cu->flag & CU_FRONT) && (dl->flag & DL_FRONT_CURVE)) {
                                        dlnew = MEM_callocN(sizeof(DispList), "filldisp");
                                        BLI_addtail(&back, dlnew);
                                        dlnew->verts = fp1 = MEM_mallocN(sizeof(float) * 3 * dl->parts, "filldisp1");
@@ -577,10 +586,10 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
                                        dlnew->type = DL_POLY;
                                        dlnew->col = dl->col;
                                        dlnew->charidx = dl->charidx;
-                                       
+
                                        fp = dl->verts + 3 * (dl->nr - 1);
                                        dpoly = 3 * dl->nr;
-                                       
+
                                        a = dl->parts;
                                        while (a--) {
                                                copy_v3_v3(fp1, fp);
@@ -593,25 +602,25 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
                dl = dl->next;
        }
 
-       filldisplist(&front, dispbase, 1);
-       filldisplist(&back, dispbase, 0);
-       
-       freedisplist(&front);
-       freedisplist(&back);
+       BKE_displist_fill(&front, dispbase, 1);
+       BKE_displist_fill(&back, dispbase, 0);
+
+       BKE_displist_free(&front);
+       BKE_displist_free(&back);
 
-       filldisplist(dispbase, dispbase, 0);
-       
+       BKE_displist_fill(dispbase, dispbase, 0);
 }
 
 static void curve_to_filledpoly(Curve *cu, ListBase *UNUSED(nurb), ListBase *dispbase)
 {
-       if (cu->flag & CU_3D) return;
+       if (cu->flag & CU_3D)
+               return;
 
        if (dispbase->first && ((DispList *) dispbase->first)->type == DL_SURF) {
                bevels_to_filledpoly(cu, dispbase);
        }
        else {
-               filldisplist(dispbase, dispbase, 0);
+               BKE_displist_fill(dispbase, dispbase, 0);
        }
 }
 
@@ -620,30 +629,30 @@ static void curve_to_filledpoly(Curve *cu, ListBase *UNUSED(nurb), ListBase *dis
  * - first point left, last point right
  * - based on subdivided points in original curve, not on points in taper curve (still)
  */
-float calc_taper(Scene *scene, Object *taperobj, int cur, int tot)
+float BKE_displist_calc_taper(Scene *scene, Object *taperobj, int cur, int tot)
 {
        DispList *dl;
-       
-       if (taperobj == NULL || taperobj->type != OB_CURVE) return 1.0;
-       
+
+       if (taperobj == NULL || taperobj->type != OB_CURVE)
+               return 1.0;
+
        dl = taperobj->disp.first;
        if (dl == NULL) {
-               makeDispListCurveTypes(scene, taperobj, 0);
+               BKE_displist_make_curveTypes(scene, taperobj, 0);
                dl = taperobj->disp.first;
        }
        if (dl) {
                float fac = ((float)cur) / (float)(tot - 1);
                float minx, dx, *fp;
                int a;
-               
+
                /* horizontal size */
                minx = dl->verts[0];
                dx = dl->verts[3 * (dl->nr - 1)] - minx;
                if (dx > 0.0f) {
-               
                        fp = dl->verts;
                        for (a = 0; a < dl->nr; a++, fp += 3) {
-                               if ( (fp[0] - minx) / dx >= fac) {
+                               if ((fp[0] - minx) / dx >= fac) {
                                        /* interpolate with prev */
                                        if (a > 0) {
                                                float fac1 = (fp[-3] - minx) / dx;
@@ -657,19 +666,22 @@ float calc_taper(Scene *scene, Object *taperobj, int cur, int tot)
                        return fp[-2];  // last y coord
                }
        }
-       
+
        return 1.0;
 }
 
-void makeDispListMBall(Scene *scene, Object *ob)
+void BKE_displist_make_mball(Scene *scene, Object *ob)
 {
-       if (!ob || ob->type != OB_MBALL) return;
+       if (!ob || ob->type != OB_MBALL)
+               return;
 
-       // XXX: mball stuff uses plenty of global variables
-       //      while this is unchanged updating during render is unsafe
-       if (G.rendering) return;
+       /* XXX: mball stuff uses plenty of global variables
+        *      while this is unchanged updating during render is unsafe
+        */
+       if (G.rendering)
+               return;
 
-       freedisplist(&(ob->disp));
+       BKE_displist_free(&(ob->disp));
 
        if (ob->type == OB_MBALL) {
                if (ob == BKE_mball_basis_find(scene, ob)) {
@@ -679,15 +691,15 @@ void makeDispListMBall(Scene *scene, Object *ob)
                        object_deform_mball(ob, &ob->disp);
                }
        }
-       
+
        boundbox_displist(ob);
 }
 
-void makeDispListMBall_forRender(Scene *scene, Object *ob, ListBase *dispbase)
+void BKE_displist_make_mball_forRender(Scene *scene, Object *ob, ListBase *dispbase)
 {
        BKE_mball_polygonize(scene, ob, dispbase);
        BKE_mball_texspace_calc(ob);
-       
+
        object_deform_mball(ob, dispbase);
 }
 
@@ -697,24 +709,30 @@ static ModifierData *curve_get_tessellate_point(Scene *scene, Object *ob, int fo
        ModifierData *pretessellatePoint;
        int required_mode;
 
-       if (forRender) required_mode = eModifierMode_Render;
-       else required_mode = eModifierMode_Realtime;
+       if (forRender)
+               required_mode = eModifierMode_Render;
+       else
+               required_mode = eModifierMode_Realtime;
 
-       if (editmode) required_mode |= eModifierMode_Editmode;
+       if (editmode)
+               required_mode |= eModifierMode_Editmode;
 
        pretessellatePoint = NULL;
        for (; md; md = md->next) {
                ModifierTypeInfo *mti = modifierType_getInfo(md->type);
 
-               if (!modifier_isEnabled(scene, md, required_mode)) continue;
-               if (mti->type == eModifierTypeType_Constructive) return pretessellatePoint;
+               if (!modifier_isEnabled(scene, md, required_mode))
+                       continue;
+               if (mti->type == eModifierTypeType_Constructive)
+                       return pretessellatePoint;
 
                if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
                        pretessellatePoint = md;
 
                        /* this modifiers are moving point of tessellation automatically
                         * (some of them even can't be applied on tessellated curve), set flag
-                        * for incformation button in modifier's header */
+                        * for incformation button in modifier's header
+                        */
                        md->mode |= eModifierMode_ApplyOnSpline;
                }
                else if (md->mode & eModifierMode_ApplyOnSpline) {
@@ -738,12 +756,15 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, fl
        float *keyVerts = NULL;
        int required_mode;
 
-       if (forRender) required_mode = eModifierMode_Render;
-       else required_mode = eModifierMode_Realtime;
+       if (forRender)
+               required_mode = eModifierMode_Render;
+       else
+               required_mode = eModifierMode_Realtime;
 
        pretessellatePoint = curve_get_tessellate_point(scene, ob, forRender, editmode);
-       
-       if (editmode) required_mode |= eModifierMode_Editmode;
+
+       if (editmode)
+               required_mode |= eModifierMode_Editmode;
 
        if (cu->editnurb == NULL) {
                keyVerts = do_ob_key(scene, ob);
@@ -758,16 +779,19 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, fl
                        numVerts = BKE_nurbList_verts_count_without_handles(nurb);
                }
        }
-       
+
        if (pretessellatePoint) {
                for (; md; md = md->next) {
                        ModifierTypeInfo *mti = modifierType_getInfo(md->type);
 
                        md->scene = scene;
-                       
-                       if ((md->mode & required_mode) != required_mode) continue;
-                       if (mti->isDisabled && mti->isDisabled(md, forRender)) continue;
-                       if (mti->type != eModifierTypeType_OnlyDeform) continue;
+
+                       if ((md->mode & required_mode) != required_mode)
+                               continue;
+                       if (mti->isDisabled && mti->isDisabled(md, forRender))
+                               continue;
+                       if (mti->type != eModifierTypeType_OnlyDeform)
+                               continue;
 
                        if (!deformedVerts) {
                                deformedVerts = BKE_curve_vertexCos_get(cu, nurb, &numVerts);
@@ -828,8 +852,8 @@ static void displist_apply_allverts(ListBase *dispbase, float (*allverts)[3])
        }
 }
 
-static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispbase,
-                                      DerivedMesh **derivedFinal, int forRender, float (*originalVerts)[3], float (*deformedVerts)[3])
+static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispbase, DerivedMesh **derivedFinal,
+                                      int forRender, float (*originalVerts)[3], float (*deformedVerts)[3])
 {
        ModifierData *md = modifiers_getVirtualModifierList(ob);
        ModifierData *pretessellatePoint;
@@ -841,12 +865,15 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
        float (*vertCos)[3] = NULL;
        int useCache = !forRender;
 
-       if (forRender) required_mode = eModifierMode_Render;
-       else required_mode = eModifierMode_Realtime;
+       if (forRender)
+               required_mode = eModifierMode_Render;
+       else
+               required_mode = eModifierMode_Realtime;
 
        pretessellatePoint = curve_get_tessellate_point(scene, ob, forRender, editmode);
-       
-       if (editmode) required_mode |= eModifierMode_Editmode;
+
+       if (editmode)
+               required_mode |= eModifierMode_Editmode;
 
        if (pretessellatePoint) {
                md = pretessellatePoint->next;
@@ -861,8 +888,10 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
 
                md->scene = scene;
 
-               if ((md->mode & required_mode) != required_mode) continue;
-               if (mti->isDisabled && mti->isDisabled(md, forRender)) continue;
+               if ((md->mode & required_mode) != required_mode)
+                       continue;
+               if (mti->isDisabled && mti->isDisabled(md, forRender))
+                       continue;
 
                if (mti->type == eModifierTypeType_OnlyDeform ||
                    (mti->type == eModifierTypeType_DeformOrConstruct && !dm)) {
@@ -885,9 +914,10 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
                }
                else {
                        if (!derivedFinal) {
-                               /* makeDisplistCurveTypes could be used for beveling, where derived mesh */
-                               /* is totally unnecessary, so we could stop modifiers applying */
-                               /* when we found constructive modifier but derived mesh is unwanted result */
+                               /* makeDisplistCurveTypes could be used for beveling, where derived mesh
+                                * is totally unnecessary, so we could stop modifiers applying
+                                * when we found constructive modifier but derived mesh is unwanted result
+                                */
                                break;
                        }
 
@@ -951,7 +981,8 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
        }
 
        if (derivedFinal) {
-               if (dm) DM_ensure_tessface(dm);  /* needed for drawing */
+               if (dm)
+                       DM_ensure_tessface(dm);  /* needed for drawing */
                (*derivedFinal) = dm;
        }
 
@@ -966,30 +997,28 @@ static void displist_surf_indices(DispList *dl)
 {
        int a, b, p1, p2, p3, p4;
        int *index;
-       
+
        dl->totindex = 0;
-       
+
        index = dl->index = MEM_mallocN(4 * sizeof(int) * (dl->parts + 1) * (dl->nr + 1), "index array nurbs");
-       
+
        for (a = 0; a < dl->parts; a++) {
-               
-               if (surfindex_displist(dl, a, &b, &p1, &p2, &p3, &p4) == 0)
+
+               if (BKE_displist_surfindex_get(dl, a, &b, &p1, &p2, &p3, &p4) == 0)
                        break;
-               
+
                for (; b < dl->nr; b++, index += 4) {
                        index[0] = p1;
                        index[1] = p2;
                        index[2] = p4;
                        index[3] = p3;
-                       
+
                        dl->totindex++;
-                       
+
                        p2 = p1; p1++;
                        p4 = p3; p3++;
-
                }
        }
-       
 }
 
 static DerivedMesh *create_orco_dm(Scene *scene, Object *ob)
@@ -998,10 +1027,10 @@ static DerivedMesh *create_orco_dm(Scene *scene, Object *ob)
        ListBase disp = {NULL, NULL};
 
        /* OrcoDM should be created from underformed disp lists */
-       makeDispListCurveTypes_forOrco(scene, ob, &disp);
+       BKE_displist_make_curveTypes_forOrco(scene, ob, &disp);
        dm = CDDM_from_curve_customDB(ob, &disp);
 
-       freedisplist(&disp);
+       BKE_displist_free(&disp);
 
        return dm;
 }
@@ -1043,8 +1072,9 @@ static void add_orco_dm(Scene *scene, Object *ob, DerivedMesh *dm, DerivedMesh *
 
 static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFinal, int forRender)
 {
-       /* this function represents logic of mesh's orcodm calculation */
-       /* for displist-based objects */
+       /* this function represents logic of mesh's orcodm calculation
+        * for displist-based objects
+        */
 
        ModifierData *md = modifiers_getVirtualModifierList(ob);
        ModifierData *pretessellatePoint;
@@ -1053,12 +1083,15 @@ static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFina
        int editmode = (!forRender && cu->editnurb);
        DerivedMesh *ndm, *orcodm = NULL;
 
-       if (forRender) required_mode = eModifierMode_Render;
-       else required_mode = eModifierMode_Realtime;
+       if (forRender)
+               required_mode = eModifierMode_Render;
+       else
+               required_mode = eModifierMode_Realtime;
 
        pretessellatePoint = curve_get_tessellate_point(scene, ob, forRender, editmode);
 
-       if (editmode) required_mode |= eModifierMode_Editmode;
+       if (editmode)
+               required_mode |= eModifierMode_Editmode;
 
        if (pretessellatePoint) {
                md = pretessellatePoint->next;
@@ -1069,9 +1102,12 @@ static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFina
 
                md->scene = scene;
 
-               if ((md->mode & required_mode) != required_mode) continue;
-               if (mti->isDisabled && mti->isDisabled(md, forRender)) continue;
-               if (mti->type != eModifierTypeType_Constructive) continue;
+               if ((md->mode & required_mode) != required_mode)
+                       continue;
+               if (mti->isDisabled && mti->isDisabled(md, forRender))
+                       continue;
+               if (mti->type != eModifierTypeType_Constructive)
+                       continue;
 
                if (!orcodm)
                        orcodm = create_orco_dm(scene, ob);
@@ -1094,8 +1130,8 @@ static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFina
                orcodm->release(orcodm);
 }
 
-void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
-                      DerivedMesh **derivedFinal, int forRender, int forOrco)
+void BKE_displist_make_surf(Scene *scene, Object *ob, ListBase *dispbase,
+                            DerivedMesh **derivedFinal, int forRender, int forOrco)
 {
        ListBase *nubase;
        Nurb *nu;
@@ -1120,8 +1156,10 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
                        int resolu = nu->resolu, resolv = nu->resolv;
 
                        if (forRender) {
-                               if (cu->resolu_ren) resolu = cu->resolu_ren;
-                               if (cu->resolv_ren) resolv = cu->resolv_ren;
+                               if (cu->resolu_ren)
+                                       resolu = cu->resolu_ren;
+                               if (cu->resolv_ren)
+                                       resolv = cu->resolv_ren;
                        }
 
                        if (nu->pntsv == 1) {
@@ -1148,7 +1186,7 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
                        }
                        else {
                                len = (nu->pntsu * resolu) * (nu->pntsv * resolv);
-                               
+
                                dl = MEM_callocN(sizeof(DispList), "makeDispListsurf");
                                dl->verts = MEM_callocN(len * 3 * sizeof(float), "dlverts");
                                BLI_addtail(dispbase, dl);
@@ -1169,7 +1207,7 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
                                if (nu->flagu & CU_NURB_CYCLIC) dl->flag |= DL_CYCL_V;
 
                                BKE_nurb_makeFaces(nu, data, 0, resolu, resolv);
-                               
+
                                /* gl array drawing: using indices */
                                displist_surf_indices(dl);
                        }
@@ -1179,15 +1217,16 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
        /* make copy of 'undeformed" displist for texture space calculation
         * actually, it's not totally undeformed -- pre-tessellation modifiers are
         * already applied, thats how it worked for years, so keep for compatibility (sergey) */
-       copy_displist(&cu->disp, dispbase);
+       BKE_displist_copy(&cu->disp, dispbase);
 
        if (!forRender) {
                BKE_curve_texspace_calc(cu);
        }
 
-       if (!forOrco)
+       if (!forOrco) {
                curve_calc_modifiers_post(scene, ob, dispbase, derivedFinal,
                                          forRender, originalVerts, deformedVerts);
+       }
 }
 
 static void rotateBevelPiece(Curve *cu, BevPoint *bevp, DispList *dlb, float widfac, float fac, float **data_r)
@@ -1255,7 +1294,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
        if (!ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) return;
 
        if (ob->type == OB_SURF) {
-               makeDispListSurf(scene, ob, dispbase, derivedFinal, forRender, forOrco);
+               BKE_displist_make_surf(scene, ob, dispbase, derivedFinal, forRender, forOrco);
        }
        else if (ELEM(ob->type, OB_CURVE, OB_FONT)) {
                ListBase dlbev;
@@ -1271,9 +1310,11 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                if (cu->path) free_path(cu->path);
                cu->path = NULL;
 
-               if (ob->type == OB_FONT) BKE_vfont_to_curve(G.main, scene, ob, 0);
+               if (ob->type == OB_FONT)
+                       BKE_vfont_to_curve(G.main, scene, ob, 0);
 
-               if (!forOrco) curve_calc_modifiers_pre(scene, ob, forRender, &originalVerts, &deformedVerts, &numVerts);
+               if (!forOrco)
+                       curve_calc_modifiers_pre(scene, ob, forRender, &originalVerts, &deformedVerts, &numVerts);
 
                BKE_curve_bevelList_make(ob);
 
@@ -1355,9 +1396,9 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                                                        dl = MEM_callocN(sizeof(DispList), "makeDispListbev1");
                                                        dl->verts = data = MEM_callocN(3 * sizeof(float) * dlb->nr * steps, "dlverts");
                                                        BLI_addtail(dispbase, dl);
-       
+
                                                        dl->type = DL_SURF;
-                                                       
+
                                                        dl->flag = dlb->flag & (DL_FRONT_CURVE | DL_BACK_CURVE);
                                                        if (dlb->type == DL_POLY) dl->flag |= DL_CYCL_U;
                                                        if (bl->poly >= 0) dl->flag |= DL_CYCL_V;
@@ -1372,7 +1413,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                                                        dl->rt = nu->flag & ~CU_2D;
 
                                                        dl->bevelSplitFlag = MEM_callocN(sizeof(*dl->col2) * ((steps + 0x1F) >> 5), "bevelSplitFlag");
-       
+
                                                        /* for each point of poly make a bevel piece */
                                                        bevp = (BevPoint *)(bl + 1) + start;
                                                        for (i = start, a = 0; a < steps; i++, bevp++, a++) {
@@ -1384,13 +1425,13 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                                                                                fac = bevp->radius;
                                                                }
                                                                else {
-                                                                       fac = calc_taper(scene, cu->taperobj, i, bl->nr);
+                                                                       fac = BKE_displist_calc_taper(scene, cu->taperobj, i, bl->nr);
                                                                }
 
                                                                if (bevp->split_tag) {
                                                                        dl->bevelSplitFlag[a >> 5] |= 1 << (a & 0x1F);
                                                                }
-       
+
                                                                /* rotate bevel piece and write in data */
                                                                rotateBevelPiece(cu, bevp, dlb, widfac, fac, &data);
 
@@ -1415,7 +1456,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                                                                }
 
                                                                if (cu->bevobj && (cu->flag & CU_FILL_CAPS)) {
-                                                                       if (a == 1) 
+                                                                       if (a == 1)
                                                                                fillBevelCap(nu, dlb, cur_data - 3 * dlb->nr, &bottom_capbase);
                                                                        if (a == steps - 1)
                                                                                fillBevelCap(nu, dlb, cur_data, &top_capbase);
@@ -1427,34 +1468,36 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                                                }
 
                                                if (bottom_capbase.first) {
-                                                       filldisplist(&bottom_capbase, dispbase, 1);
-                                                       filldisplist(&top_capbase, dispbase, 0);
-                                                       freedisplist(&bottom_capbase);
-                                                       freedisplist(&top_capbase);
+                                                       BKE_displist_fill(&bottom_capbase, dispbase, 1);
+                                                       BKE_displist_fill(&top_capbase, dispbase, 0);
+                                                       BKE_displist_free(&bottom_capbase);
+                                                       BKE_displist_free(&top_capbase);
                                                }
                                        }
                                }
 
                        }
-                       freedisplist(&dlbev);
+                       BKE_displist_free(&dlbev);
                }
 
                if (!(cu->flag & CU_DEFORM_FILL)) {
                        curve_to_filledpoly(cu, nubase, dispbase);
                }
 
-               if ((cu->flag & CU_PATH) && !forOrco) calc_curvepath(ob);
+               if ((cu->flag & CU_PATH) && !forOrco)
+                       calc_curvepath(ob);
 
                /* make copy of 'undeformed" displist for texture space calculation
                 * actually, it's not totally undeformed -- pre-tessellation modifiers are
                 * already applied, thats how it worked for years, so keep for compatibility (sergey) */
-               copy_displist(&cu->disp, dispbase);
+               BKE_displist_copy(&cu->disp, dispbase);
 
                if (!forRender) {
                        BKE_curve_texspace_calc(cu);
                }
 
-               if (!forOrco) curve_calc_modifiers_post(scene, ob, dispbase, derivedFinal, forRender, originalVerts, deformedVerts);
+               if (!forOrco)
+                       curve_calc_modifiers_post(scene, ob, dispbase, derivedFinal, forRender, originalVerts, deformedVerts);
 
                if (cu->flag & CU_DEFORM_FILL && !ob->derivedFinal) {
                        curve_to_filledpoly(cu, nubase, dispbase);
@@ -1462,7 +1505,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
        }
 }
 
-void makeDispListCurveTypes(Scene *scene, Object *ob, int forOrco)
+void BKE_displist_make_curveTypes(Scene *scene, Object *ob, int forOrco)
 {
        Curve *cu = ob->data;
        ListBase *dispbase;
@@ -1470,14 +1513,15 @@ void makeDispListCurveTypes(Scene *scene, Object *ob, int forOrco)
        /* The same check for duplis as in do_makeDispListCurveTypes.
         * Happens when curve used for constraint/bevel was converted to mesh.
         * check there is still needed for render displist and orco displists. */
-       if (!ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) return;
+       if (!ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT))
+               return;
 
-       freedisplist(&(ob->disp));
+       BKE_displist_free(&(ob->disp));
        dispbase = &(ob->disp);
-       freedisplist(dispbase);
+       BKE_displist_free(dispbase);
 
        /* free displist used for textspace */
-       freedisplist(&cu->disp);
+       BKE_displist_free(&cu->disp);
 
        do_makeDispListCurveTypes(scene, ob, dispbase, &ob->derivedFinal, 0, forOrco);
 
@@ -1495,19 +1539,19 @@ void makeDispListCurveTypes(Scene *scene, Object *ob, int forOrco)
        }
 }
 
-void makeDispListCurveTypes_forRender(Scene *scene, Object *ob, ListBase *dispbase,
+void BKE_displist_make_curveTypes_forRender(Scene *scene, Object *ob, ListBase *dispbase,
                                       DerivedMesh **derivedFinal, int forOrco)
 {
        do_makeDispListCurveTypes(scene, ob, dispbase, derivedFinal, 1, forOrco);
 }
 
-void makeDispListCurveTypes_forOrco(struct Scene *scene, struct Object *ob, struct ListBase *dispbase)
+void BKE_displist_make_curveTypes_forOrco(struct Scene *scene, struct Object *ob, struct ListBase *dispbase)
 {
        do_makeDispListCurveTypes(scene, ob, dispbase, NULL, 1, 1);
 }
 
 /* add Orco layer to the displist object which has got derived mesh and return orco */
-float *makeOrcoDispList(Scene *scene, Object *ob, DerivedMesh *derivedFinal, int forRender)
+float *BKE_displist_make_orco(Scene *scene, Object *ob, DerivedMesh *derivedFinal, int forRender)
 {
        float *orco;
 
@@ -1535,7 +1579,7 @@ static void boundbox_displist(Object *ob)
        DispList *dl;
        float *vert;
        int a, tot = 0;
-       
+
        INIT_MINMAX(min, max);
 
        if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
@@ -1544,13 +1588,13 @@ static void boundbox_displist(Object *ob)
 
                if (cu->bb == NULL) cu->bb = MEM_callocN(sizeof(BoundBox), "boundbox");
                bb = cu->bb;
-               
+
                dl = ob->disp.first;
 
                while (dl) {
                        if (dl->type == DL_INDEX3) tot = dl->nr;
                        else tot = dl->nr * dl->parts;
-                       
+
                        vert = dl->verts;
                        for (a = 0; a < tot; a++, vert += 3) {
                                doit = 1;
@@ -1559,17 +1603,16 @@ static void boundbox_displist(Object *ob)
 
                        dl = dl->next;
                }
-               
+
                if (!doit) {
                        /* there's no geometry in displist, use zero-sized boundbox */
                        zero_v3(min);
                        zero_v3(max);
                }
-               
+
        }
-       
+
        if (bb) {
                BKE_boundbox_init_from_minmax(bb, min, max);
        }
 }
-
index 4024deee1e82e25c3430ff5bed328ffba23857cd..1d109d5f61674dc11c39e8e7d54f9e6803e5b1a6 100644 (file)
@@ -181,7 +181,7 @@ static void precalculate_effector(EffectorCache *eff)
                Curve *cu= eff->ob->data;
                if (cu->flag & CU_PATH) {
                        if (cu->path==NULL || cu->path->data==NULL)
-                               makeDispListCurveTypes(eff->scene, eff->ob, 0);
+                               BKE_displist_make_curveTypes(eff->scene, eff->ob, 0);
 
                        if (cu->path && cu->path->data) {
                                where_on_path(eff->ob, 0.0, eff->guide_loc, eff->guide_dir, NULL, &eff->guide_radius, NULL);
index 0ec0c16073b12fd642d2bb63a7d1bdf03026e15c..fda078f5c42f77dc744ccf8f7d7f543165ffae80 100644 (file)
@@ -846,7 +846,7 @@ makebreak:
                
                cucu->flag |= (CU_PATH + CU_FOLLOW);
                
-               if (cucu->path == NULL) makeDispListCurveTypes(scene, cu->textoncurve, 0);
+               if (cucu->path == NULL) BKE_displist_make_curveTypes(scene, cu->textoncurve, 0);
                if (cucu->path) {
                        float distfac, imat[4][4], imat3[3][3], cmat[3][3];
                        float minx, maxx, miny, maxy;
index 4076031fa1819f6fd787235120558cdc59404601..8ac8acf6edf37749d301cfb5fecc57f6b905e5a6 100644 (file)
@@ -149,7 +149,7 @@ void BKE_lattice_resize(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
                lt->typeu = lt->typev = lt->typew = KEY_LINEAR;
 
                /* prevent using deformed locations */
-               freedisplist(&ltOb->disp);
+               BKE_displist_free(&ltOb->disp);
 
                copy_m4_m4(mat, ltOb->obmat);
                unit_m4(ltOb->obmat);
@@ -294,7 +294,7 @@ void init_latt_deform(Object *oblatt, Object *ob)
        /* we make an array with all differences */
        Lattice *lt = oblatt->data;
        BPoint *bp;
-       DispList *dl = find_displist(&oblatt->disp, DL_VERTS);
+       DispList *dl = BKE_displist_find(&oblatt->disp, DL_VERTS);
        float *co = dl ? dl->verts : NULL;
        float *fp, imat[4][4];
        float fu, fv, fw;
@@ -541,7 +541,7 @@ static int calc_curve_deform(Scene *scene, Object *par, float co[3],
 
        /* to be sure, mostly after file load */
        if (cu->path == NULL) {
-               makeDispListCurveTypes(scene, par, 0);
+               BKE_displist_make_curveTypes(scene, par, 0);
                if (cu->path == NULL) return 0;  // happens on append...
        }
        
@@ -963,7 +963,7 @@ void BKE_lattice_modifiers_calc(Scene *scene, Object *ob)
        float (*vertexCos)[3] = NULL;
        int numVerts, editmode = (lt->editlatt != NULL);
 
-       freedisplist(&ob->disp);
+       BKE_displist_free(&ob->disp);
 
        for (; md; md = md->next) {
                ModifierTypeInfo *mti = modifierType_getInfo(md->type);
index 7507442a4d5bcc14ca8da9f306b03e7d141284cb..0eeb16be6993a2f5bdd35d6b9b423e2ab8b2964a 100644 (file)
@@ -1172,7 +1172,7 @@ int object_remove_material_slot(Object *ob)
        /* check indices from mesh */
        if (ELEM4(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) {
                data_delete_material_index_id((ID *)ob->data, actcol - 1);
-               freedisplist(&ob->disp);
+               BKE_displist_free(&ob->disp);
        }
 
        return TRUE;
index 5da54b497be2b2f24d45bb1e8c1dd0aff031c7aa..8075aaa21d3a75e355066e583a67595561c3fff5 100644 (file)
@@ -196,7 +196,7 @@ void BKE_mball_free(MetaBall *mb)
        if (mb->mat) MEM_freeN(mb->mat);
        if (mb->bb) MEM_freeN(mb->bb);
        BLI_freelistN(&mb->elems);
-       if (mb->disp.first) freedisplist(&mb->disp);
+       if (mb->disp.first) BKE_displist_free(&mb->disp);
 }
 
 MetaBall *BKE_mball_add(const char *name)
index 282ce5cf3490139741806511982a009d05c82ba3..e43c09996988d893b637eceb08afc13d38c163c4 100644 (file)
@@ -242,7 +242,7 @@ void BKE_object_free_display(Object *ob)
                ob->derivedFinal = NULL;
        }
        
-       freedisplist(&ob->disp);
+       BKE_displist_free(&ob->disp);
 }
 
 void free_sculptsession_deformMats(SculptSession *ss)
@@ -1638,7 +1638,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4])
        
        cu = par->data;
        if (cu->path == NULL || cu->path->data == NULL) /* only happens on reload file, but violates depsgraph still... fix! */
-               makeDispListCurveTypes(scene, par, 0);
+               BKE_displist_make_curveTypes(scene, par, 0);
        if (cu->path == NULL) return;
        
        /* catch exceptions: feature for nla stride editing */
@@ -1846,7 +1846,7 @@ static void give_parvert(Object *par, int nr, float vec[3])
        else if (par->type == OB_LATTICE) {
                Lattice *latt = par->data;
                BPoint *bp;
-               DispList *dl = find_displist(&par->disp, DL_VERTS);
+               DispList *dl = BKE_displist_find(&par->disp, DL_VERTS);
                float *co = dl ? dl->verts : NULL;
                
                if (latt->editlatt) latt = latt->editlatt->latt;
@@ -2593,13 +2593,13 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
                                        break;
 
                                case OB_MBALL:
-                                       makeDispListMBall(scene, ob);
+                                       BKE_displist_make_mball(scene, ob);
                                        break;
 
                                case OB_CURVE:
                                case OB_SURF:
                                case OB_FONT:
-                                       makeDispListCurveTypes(scene, ob, 0);
+                                       BKE_displist_make_curveTypes(scene, ob, 0);
                                        break;
                                
                                case OB_LATTICE:
index a254e892289c092d24b95dfd95d1691dfa1a1620..8676a3e75a025fd3c18926fc1c2536689e390290 100644 (file)
@@ -2188,7 +2188,7 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
 
                        /* curve taper */
                        if (cu->taperobj)
-                               mul_v3_fl(vec_to_point, calc_taper(eff->scene, cu->taperobj, (int)(data->strength * guidetime * 100.0f), 100));
+                               mul_v3_fl(vec_to_point, BKE_displist_calc_taper(eff->scene, cu->taperobj, (int)(data->strength * guidetime * 100.0f), 100));
 
                        else { /* curve size*/
                                if (cu->flag & CU_PATH_RADIUS) {
index 9ce0ce6c3a2751227b0e250218bbea9dcdbc9240..73d1f42b34007ada423e13e2245510ecf2fc817d 100644 (file)
@@ -346,7 +346,7 @@ int MeshImporter::triangulate_poly(unsigned int *indices, int totvert, MVert *ve
                vert += 3;
        }
        
-       filldisplist(&dispbase, &dispbase, 0);
+       BKE_displist_fill(&dispbase, &dispbase, 0);
 
        int tottri = 0;
        dl= (DispList*)dispbase.first;
@@ -368,7 +368,7 @@ int MeshImporter::triangulate_poly(unsigned int *indices, int totvert, MVert *ve
                }
        }
 
-       freedisplist(&dispbase);
+       BKE_displist_free(&dispbase);
 
        return tottri;
 }
index d38ec6436b9b99ef032ebc7fcd6a565d6e6e4a2b..2d403d03fb2a1899905c521101a21ea9f1987414 100644 (file)
@@ -150,7 +150,7 @@ static void draw_triangulated(int mcords[][2], short tot)
        }
        
        /* do the fill */
-       filldisplist(&lb, &lb, 0);
+       BKE_displist_fill(&lb, &lb, 0);
 
        /* do the draw */
        dl = lb.first;  /* filldisplist adds in head of list */
@@ -170,7 +170,7 @@ static void draw_triangulated(int mcords[][2], short tot)
                glEnd();
        }
        
-       freedisplist(&lb);
+       BKE_displist_free(&lb);
 }
 
 
index 5a2370eb518684a69be58f68667680fccbfbd4c6..466338a736f61ddd73186da6670fcaebd7c0fd9e 100644 (file)
@@ -1239,7 +1239,7 @@ static EnumPropertyItem convert_target_items[] = {
 static void curvetomesh(Scene *scene, Object *ob) 
 {
        if (ob->disp.first == NULL)
-               makeDispListCurveTypes(scene, ob, 0);  /* force creation */
+               BKE_displist_make_curveTypes(scene, ob, 0);  /* force creation */
 
        BKE_mesh_from_nurbs(ob); /* also does users */
 
@@ -1405,7 +1405,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                        cu = newob->data;
 
                        if (!newob->disp.first)
-                               makeDispListCurveTypes(scene, newob, 0);
+                               BKE_displist_make_curveTypes(scene, newob, 0);
 
                        newob->type = OB_CURVE;
                        cu->type = OB_CURVE;
@@ -1446,7 +1446,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                                curvetomesh(scene, newob);
 
                                /* meshes doesn't use displist */
-                               freedisplist(&newob->disp);
+                               BKE_displist_free(&newob->disp);
                        }
                }
                else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
@@ -1467,7 +1467,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                                        newob = ob;
 
                                        /* meshes doesn't use displist */
-                                       freedisplist(&newob->disp);
+                                       BKE_displist_free(&newob->disp);
                                }
 
                                curvetomesh(scene, newob);
@@ -1487,7 +1487,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                        }
 
                        if (!baseob->disp.first) {
-                               makeDispListMBall(scene, baseob);
+                               BKE_displist_make_mball(scene, baseob);
                        }
 
                        if (!(baseob->flag & OB_DONE)) {
index f6bf9ba2f15f580b16bb6fcb6a47296e45f0feeb..17f4ea73d6d4179d531d178944c6faaa2a12029b 100644 (file)
@@ -1372,10 +1372,10 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op)
                        BKE_lattice_modifiers_calc(scene, ob);
                }
                else if (ob->type == OB_MBALL) {
-                       makeDispListMBall(scene, ob);
+                       BKE_displist_make_mball(scene, ob);
                }
                else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
-                       makeDispListCurveTypes(scene, ob, 0);
+                       BKE_displist_make_curveTypes(scene, ob, 0);
                }
 
                mmd->bindfunc = NULL;
index 9d4f63262780a27ee26c9311011da5bab62ab6f5..b3e16c8d4ebd7a3c86d8c1a46086245e08196398 100644 (file)
@@ -533,7 +533,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
                        
                        if ((cu->flag & CU_PATH) == 0) {
                                cu->flag |= CU_PATH | CU_FOLLOW;
-                               makeDispListCurveTypes(scene, par, 0);  /* force creation of path data */
+                               BKE_displist_make_curveTypes(scene, par, 0);  /* force creation of path data */
                        }
                        else cu->flag |= CU_FOLLOW;
                        
index 0cc212f9c3401647bf06a0d4562d6548c99fb988..7870e64228aa6e292a3f4e626f2b35b4b24294ba 100644 (file)
@@ -107,7 +107,7 @@ static void stats_object(Object *ob, int sel, int totob, SceneStats *stats)
                        stats->totcurve += totob;
 
                        if (ob->disp.first)
-                               count_displist(&ob->disp, &tot, &totf);
+                               BKE_displist_count(&ob->disp, &tot, &totf);
 
                        tot *= totob;
                        totf *= totob;
@@ -124,7 +124,7 @@ static void stats_object(Object *ob, int sel, int totob, SceneStats *stats)
                case OB_MBALL: {
                        int tot = 0, totf = 0;
 
-                       count_displist(&ob->disp, &tot, &totf);
+                       BKE_displist_count(&ob->disp, &tot, &totf);
 
                        tot *= totob;
                        totf *= totob;
index 466e9886f19e4910a1db6a2c7be7c1583d71fd8e..f93d4bea94dfb51682c5d7284825e4f044c6a590 100644 (file)
@@ -1924,7 +1924,7 @@ void lattice_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, BPo
        Object *obedit = vc->obedit;
        Lattice *lt = obedit->data;
        BPoint *bp = lt->editlatt->latt->def;
-       DispList *dl = find_displist(&obedit->disp, DL_VERTS);
+       DispList *dl = BKE_displist_find(&obedit->disp, DL_VERTS);
        float *co = dl ? dl->verts : NULL;
        int i, N = lt->editlatt->latt->pntsu * lt->editlatt->latt->pntsv * lt->editlatt->latt->pntsw;
        short s[2] = {IS_CLIPPED, 0};
@@ -1972,7 +1972,7 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob)
        /* now we default make displist, this will modifiers work for non animated case */
        if (ob->disp.first == NULL)
                BKE_lattice_modifiers_calc(scene, ob);
-       dl = find_displist(&ob->disp, DL_VERTS);
+       dl = BKE_displist_find(&ob->disp, DL_VERTS);
        
        if (is_edit) {
                lt = lt->editlatt->latt;
@@ -3917,10 +3917,10 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
                                dl = lb->first;
                                if (dl == NULL) return 1;
 
-                               if (dl->nors == NULL) addnormalsDispList(lb);
+                               if (dl->nors == NULL) BKE_displist_normals_add(lb);
                                index3_nors_incr = 0;
 
-                               if (displist_has_faces(lb) == 0) {
+                               if (BKE_displist_has_faces(lb) == 0) {
                                        if (!render_only) {
                                                draw_index_wire = 0;
                                                drawDispListwire(lb);
@@ -3948,7 +3948,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
                                index3_nors_incr = 1;
                        }
                        else {
-                               if (!render_only || (render_only && displist_has_faces(lb))) {
+                               if (!render_only || (render_only && BKE_displist_has_faces(lb))) {
                                        draw_index_wire = 0;
                                        retval = drawDispListwire(lb);
                                        draw_index_wire = 1;
@@ -3963,7 +3963,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
                                dl = lb->first;
                                if (dl == NULL) return 1;
 
-                               if (dl->nors == NULL) addnormalsDispList(lb);
+                               if (dl->nors == NULL) BKE_displist_normals_add(lb);
 
                                if (draw_glsl_material(scene, ob, v3d, dt)) {
                                        GPU_begin_object_materials(v3d, rv3d, scene, ob, 1, NULL);
@@ -3984,7 +3984,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
 
                        if (BKE_mball_is_basis(ob)) {
                                lb = &ob->disp;
-                               if (lb->first == NULL) makeDispListMBall(scene, ob);
+                               if (lb->first == NULL) BKE_displist_make_mball(scene, ob);
                                if (lb->first == NULL) return 1;
 
                                if (solid) {
@@ -6162,7 +6162,7 @@ static void draw_bounding_volume(Scene *scene, Object *ob, char type)
                if (BKE_mball_is_basis(ob)) {
                        bb = ob->bb;
                        if (bb == NULL) {
-                               makeDispListMBall(scene, ob);
+                               BKE_displist_make_mball(scene, ob);
                                bb = ob->bb;
                        }
                }
@@ -6235,7 +6235,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
                        hasfaces = dm->getNumTessFaces(dm);
                }
                else {
-                       hasfaces = displist_has_faces(&ob->disp);
+                       hasfaces = BKE_displist_has_faces(&ob->disp);
                }
 
                if (hasfaces && ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
@@ -6574,7 +6574,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
        /* bad exception, solve this! otherwise outline shows too late */
        if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
                /* still needed for curves hidden in other layers. depgraph doesnt handle that yet */
-               if (ob->disp.first == NULL) makeDispListCurveTypes(scene, ob, 0);
+               if (ob->disp.first == NULL) BKE_displist_make_curveTypes(scene, ob, 0);
        }
        
        /* draw outline for selected objects, mesh does itself */
index f58471797e47500a5e3302bbbc854540b4c98cb6..7ed0304ebb40649a98f7efae3dd41c8cb01625a1 100644 (file)
@@ -105,7 +105,7 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
                copycu->editnurb = tmpcu->editnurb;
 
                /* get updated display list, and convert to a mesh */
-               makeDispListCurveTypes(sce, tmpobj, 0);
+               BKE_displist_make_curveTypes(sce, tmpobj, 0);
 
                copycu->editfont = NULL;
                copycu->editnurb = NULL;
@@ -135,9 +135,9 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
                        
                if (render) {
                        ListBase disp = {NULL, NULL};
-                       makeDispListMBall_forRender(sce, ob, &disp);
+                       BKE_displist_make_mball_forRender(sce, ob, &disp);
                        BKE_mesh_from_metaball(&disp, tmpmesh);
-                       freedisplist(&disp);
+                       BKE_displist_free(&disp);
                }
                else
                        BKE_mesh_from_metaball(&ob->disp, tmpmesh);
index 482f330275bdf7c2d345cafd2f884ad59ca6f15e..fa4c90a4eb4ca016e99f505e6977065a7be09480 100644 (file)
@@ -360,7 +360,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
                                
                        if (!cu->path) {
                                cu->flag |= CU_PATH; // needed for path & bevlist
-                               makeDispListCurveTypes(scene, amd->curve_ob, 0);
+                               BKE_displist_make_curveTypes(scene, amd->curve_ob, 0);
                        }
                        if (cu->path)
                                length = scale * cu->path->totdist;
index 9e9b96a885b29e19a6e79b021ca205753e07d1b8..c6bfeff16512de0831955b58e531eaa1a52f9bfe 100644 (file)
@@ -1055,7 +1055,7 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject
        for (i = 0; i < len_polylines; i++) {
                polyLine = PySequence_GetItem(polyLineSeq, i);
                if (!PySequence_Check(polyLine)) {
-                       freedisplist(&dispbase);
+                       BKE_displist_free(&dispbase);
                        Py_XDECREF(polyLine); /* may be null so use Py_XDECREF*/
                        PyErr_SetString(PyExc_TypeError,
                                        "One or more of the polylines is not a sequence of mathutils.Vector's");
@@ -1109,7 +1109,7 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject
        }
 
        if (ls_error) {
-               freedisplist(&dispbase); /* possible some dl was allocated */
+               BKE_displist_free(&dispbase); /* possible some dl was allocated */
                PyErr_SetString(PyExc_TypeError,
                                "A point in one of the polylines "
                                "is not a mathutils.Vector type");
@@ -1117,7 +1117,7 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject
        }
        else if (totpoints) {
                /* now make the list to return */
-               filldisplist(&dispbase, &dispbase, 0);
+               BKE_displist_fill(&dispbase, &dispbase, 0);
 
                /* The faces are stored in a new DisplayList
                 * thats added to the head of the listbase */
@@ -1125,7 +1125,7 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject
 
                tri_list = PyList_New(dl->parts);
                if (!tri_list) {
-                       freedisplist(&dispbase);
+                       BKE_displist_free(&dispbase);
                        PyErr_SetString(PyExc_RuntimeError,
                                        "failed to make a new list");
                        return NULL;
@@ -1138,11 +1138,11 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject
                        dl_face += 3;
                        index++;
                }
-               freedisplist(&dispbase);
+               BKE_displist_free(&dispbase);
        }
        else {
                /* no points, do this so scripts don't barf */
-               freedisplist(&dispbase); /* possible some dl was allocated */
+               BKE_displist_free(&dispbase); /* possible some dl was allocated */
                tri_list = PyList_New(0);
        }
 
index c1d607600049c31c60a4313ac68a2e21e17cde6f..1fd10f83389dfe95761870dff8c4f82b3f79c054 100644 (file)
@@ -2452,7 +2452,7 @@ static void init_render_mball(Render *re, ObjectRen *obr)
                need_orco= 1;
        }
 
-       makeDispListMBall_forRender(re->scene, ob, &dispbase);
+       BKE_displist_make_mball_forRender(re->scene, ob, &dispbase);
        dl= dispbase.first;
        if (dl==0) return;
 
@@ -2526,7 +2526,7 @@ static void init_render_mball(Render *re, ObjectRen *obr)
        }
 
        /* enforce display lists remade */
-       freedisplist(&dispbase);
+       BKE_displist_free(&dispbase);
 }
 
 /* ------------------------------------------------------------------------- */
@@ -2828,11 +2828,11 @@ static void init_render_surf(Render *re, ObjectRen *obr, int timeoffset)
 
        if (ob->parent && (ob->parent->type==OB_LATTICE)) need_orco= 1;
 
-       makeDispListSurf(re->scene, ob, &displist, &dm, 1, 0);
+       BKE_displist_make_surf(re->scene, ob, &displist, &dm, 1, 0);
 
        if (dm) {
                if (need_orco) {
-                       orco= makeOrcoDispList(re->scene, ob, dm, 1);
+                       orco= BKE_displist_make_orco(re->scene, ob, dm, 1);
                        if (orco) {
                                set_object_orco(re, ob, orco);
                        }
@@ -2854,7 +2854,7 @@ static void init_render_surf(Render *re, ObjectRen *obr, int timeoffset)
                }
        }
 
-       freedisplist(&displist);
+       BKE_displist_free(&displist);
 
        MEM_freeN(matar);
 }
@@ -2878,7 +2878,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
        if (ob->type==OB_FONT && cu->str==NULL) return;
        else if (ob->type==OB_CURVE && cu->nurb.first==NULL) return;
 
-       makeDispListCurveTypes_forRender(re->scene, ob, &disp, &dm, 0);
+       BKE_displist_make_curveTypes_forRender(re->scene, ob, &disp, &dm, 0);
        dl= disp.first;
        if (dl==NULL) return;
        
@@ -2898,7 +2898,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
 
        if (dm) {
                if (need_orco) {
-                       orco= makeOrcoDispList(re->scene, ob, dm, 1);
+                       orco= BKE_displist_make_orco(re->scene, ob, dm, 1);
                        if (orco) {
                                set_object_orco(re, ob, orco);
                        }
@@ -3005,7 +3005,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
 
                                                for (a=0; a<dl->parts; a++) {
 
-                                                       if (surfindex_displist(dl, a, &b, &p1, &p2, &p3, &p4)==0)
+                                                       if (BKE_displist_surfindex_get(dl, a, &b, &p1, &p2, &p3, &p4)==0)
                                                                break;
 
                                                        p1+= startvert;
@@ -3062,7 +3062,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
                }
        }
 
-       freedisplist(&disp);
+       BKE_displist_free(&disp);
 
        MEM_freeN(matar);
 }