remove bm_get_cd_float, use CustomData_bmesh_get instead, this function only casts...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 12 Feb 2012 18:49:56 +0000 (18:49 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 12 Feb 2012 18:49:56 +0000 (18:49 +0000)
source/blender/editors/include/ED_mesh.h
source/blender/editors/mesh/bmesh_tools.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_buttons.c

index b3d86b66b626bb5ebee7dd2f8ef8c970e677857b..50fbf6fbb152057120eacb1143388b68071c493e 100644 (file)
@@ -97,8 +97,6 @@ struct ToolSettings;
 #define B_FRACTAL              0x2000
 #define B_SPHERE               0x4000
 
-float *bm_get_cd_float(struct CustomData *cdata, void *data, int type);
-
 intptr_t    mesh_octree_table(struct Object *ob, struct BMEditMesh *em, float *co, char mode);
 int         mesh_mirrtopo_table(struct Object *ob, char mode);
 
index 75bc3c46a6fe31cb787bf9973c2c495715e1355f..345c4176c93a1eeb620718a8c0924dbd1c2ef36a 100644 (file)
@@ -1296,13 +1296,6 @@ void MESH_OT_flip_normals(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
-float *bm_get_cd_float(CustomData *cdata, void *data, int type)
-{
-       float *f = CustomData_bmesh_get(cdata, data, type);
-
-       return f;
-}
-
 static const EnumPropertyItem direction_items[] = {
        {DIRECTION_CW, "CW", 0, "Clockwise", ""},
        {DIRECTION_CCW, "CCW", 0, "Counter Clockwise", ""},
index b985f441f48ebce985757b6b5b45f9c1fdd024ee..cf5192e0e7bb4f61dad71d5a04c664dd7e6378cf 100644 (file)
@@ -2531,7 +2531,7 @@ static int draw_dm_creases__setDrawOptions(void *userData, int index)
 {
        BMEditMesh *em = userData;
        BMEdge *eed = EDBM_get_edge_for_index(userData, index);
-       float *crease = eed ? bm_get_cd_float(&em->bm->edata, eed->head.data, CD_CREASE) : NULL;
+       float *crease = eed ? (float *)CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_CREASE) : NULL;
        
        if (!crease)
                return 0;
@@ -2554,7 +2554,7 @@ static int draw_dm_bweights__setDrawOptions(void *userData, int index)
 {
        BMEditMesh *em = userData;
        BMEdge *eed = EDBM_get_edge_for_index(userData, index);
-       float *bweight = bm_get_cd_float(&em->bm->edata, eed->head.data, CD_BWEIGHT);
+       float *bweight = (float *)CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_BWEIGHT);
 
        if (!bweight)
                return 0;
@@ -2570,7 +2570,7 @@ static void draw_dm_bweights__mapFunc(void *userData, int index, float *co, floa
 {
        BMEditMesh *em = userData;
        BMVert *eve = EDBM_get_vert_for_index(userData, index);
-       float *bweight = bm_get_cd_float(&em->bm->vdata, eve->head.data, CD_BWEIGHT);
+       float *bweight = (float *)CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_BWEIGHT);
        
        if (!bweight)
                return;
index 045bbdcd0129358d4b49676baa90c4c3f63e5e30..44bc96cdb8942f7d4f692713d32a567391ab1a0a 100644 (file)
@@ -173,10 +173,10 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                                float *f;
 
                                totedge++;
-                               f = bm_get_cd_float(&bm->edata, eed->head.data, CD_CREASE);
+                               f = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE);
                                median[3]+= f ? *f : 0.0f;
 
-                               f = bm_get_cd_float(&bm->edata, eed->head.data, CD_BWEIGHT);
+                               f = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT);
                                median[6]+= f ? *f : 0.0f;
                        }
                }
@@ -436,7 +436,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
 
                                        BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                                                if(BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
-                                                       float *crease = bm_get_cd_float(&em->bm->edata, eed->head.data, CD_CREASE);
+                                                       float *crease = (float *)CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_CREASE);
                                                        if (!crease) break;
                                                        
                                                        *crease= fixed_crease;
@@ -458,7 +458,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                                                
                                                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                                                        if(BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
-                                                               float *crease = bm_get_cd_float(&em->bm->edata, eed->head.data, CD_CREASE);
+                                                               float *crease = (float *)CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_CREASE);
                                                                
                                                                if (!crease) break;
                                                                
@@ -473,7 +473,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
 
                                                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                                                        if(BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
-                                                               float *crease = bm_get_cd_float(&em->bm->edata, eed->head.data, CD_CREASE);
+                                                               float *crease = (float *)CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_CREASE);
                                                                if (!crease) break;
 
                                                                *crease = 1.0f - ((1.0f - *crease) * sca);
@@ -493,7 +493,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
 
                                        BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                                                if(BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
-                                                       float *bweight = bm_get_cd_float(&em->bm->edata, eed->head.data, CD_BWEIGHT);
+                                                       float *bweight = (float *)CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_BWEIGHT);
                                                        if(!bweight) break;
                                                        
                                                        *bweight = fixed_bweight;
@@ -515,7 +515,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                                                
                                                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                                                        if(BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
-                                                               float *bweight = bm_get_cd_float(&em->bm->edata, eed->head.data, CD_BWEIGHT);
+                                                               float *bweight = (float *)CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_BWEIGHT);
                                                                if(!bweight) break;
                                                                
                                                                *bweight *= sca;
@@ -529,7 +529,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
 
                                                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                                                        if(BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
-                                                               float *bweight = bm_get_cd_float(&em->bm->edata, eed->head.data, CD_BWEIGHT);
+                                                               float *bweight = (float *)CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_BWEIGHT);
                                                                if(!bweight) break;
 
                                                                *bweight = 1.0f - ((1.0f - *bweight) * sca);