diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-09 11:06:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-09 11:06:06 +0400 |
commit | d5953568c8b3ce1980c4cd872251042c72ac07e9 (patch) | |
tree | eec6f202ec31fb274f918ca5e88006f5fa57e982 /source | |
parent | f5bb4635c6d023775689450c453cb76f917f2ee3 (diff) |
use 'const float[3]' for derived mesh callback args.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_DerivedMesh.h | 21 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/cdderivedmesh.c | 21 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/editderivedmesh.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 15 | ||||
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 3 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_bvh.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 30 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_snap.c | 3 | ||||
-rw-r--r-- | source/blender/editors/util/crazyspace.c | 3 |
12 files changed, 72 insertions, 55 deletions
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index abdb1d8cc8b..3a28af97166 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -262,29 +262,28 @@ struct DerivedMesh { * coordinate and normal. For historical reasons the normal can be * passed as a float or short array, only one should be non-NULL. */ - void (*foreachMappedVert)( - DerivedMesh *dm, - void (*func)(void *userData, int index, float *co, - float *no_f, short *no_s), - void *userData); + void (*foreachMappedVert)(DerivedMesh *dm, + void (*func)(void *userData, int index, const float co[3], + const float no_f[3], const short no_s[3]), + void *userData); /* Iterate over each mapped edge in the derived mesh, calling the * given function with the original edge and the mapped edge's new * coordinates. */ void (*foreachMappedEdge)(DerivedMesh *dm, - void (*func)(void *userData, int index, - float *v0co, float *v1co), - void *userData); + void (*func)(void *userData, int index, + const float v0co[3], const float v1co[3]), + void *userData); /* Iterate over each mapped face in the derived mesh, calling the * given function with the original face and the mapped face's (or * faces') center and normal. */ void (*foreachMappedFaceCenter)(DerivedMesh *dm, - void (*func)(void *userData, int index, - float *cent, float *no), - void *userData); + void (*func)(void *userData, int index, + const float cent[3], const float no[3]), + void *userData); /* Iterate over all vertex points, calling DO_MINMAX with given args. * diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 05f5bca03e4..59059589f0f 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2306,7 +2306,8 @@ DerivedMesh *editbmesh_get_derived_base(Object *obedit, BMEditMesh *em) /* ********* For those who don't grasp derived stuff! (ton) :) *************** */ -static void make_vertexcosnos__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) +static void make_vertexcosnos__mapFunc(void *userData, int index, const float co[3], + const float no_f[3], const short no_s[3]) { float *vec = userData; diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 19c4a654f9c..55b3a3f3e42 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -840,7 +840,8 @@ typedef struct vertexDupliData { /* ------------- */ -static void vertex_dupli__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) +static void vertex_dupli__mapFunc(void *userData, int index, const float co[3], + const float no_f[3], const short no_s[3]) { DupliObject *dob; vertexDupliData *vdd= userData; diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 03f2851531c..7a39cf1b916 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -1418,10 +1418,9 @@ static void cdDM_drawMappedEdges(DerivedMesh *dm, DMSetDrawOptions setDrawOption } static void cdDM_foreachMappedVert( - DerivedMesh *dm, - void (*func)(void *userData, int index, float *co, - float *no_f, short *no_s), - void *userData) + DerivedMesh *dm, + void (*func)(void *userData, int index, const float co[3], const float no_f[3], const short no_s[3]), + void *userData) { MVert *mv = CDDM_get_verts(dm); int i, orig, *index = DM_get_vert_data_layer(dm, CD_ORIGINDEX); @@ -1438,10 +1437,9 @@ static void cdDM_foreachMappedVert( } static void cdDM_foreachMappedEdge( - DerivedMesh *dm, - void (*func)(void *userData, int index, - float *v0co, float *v1co), - void *userData) + DerivedMesh *dm, + void (*func)(void *userData, int index, const float v0co[3], const float v1co[3]), + void *userData) { CDDerivedMesh *cddm = (CDDerivedMesh*) dm; MVert *mv = cddm->mvert; @@ -1460,10 +1458,9 @@ static void cdDM_foreachMappedEdge( } static void cdDM_foreachMappedFaceCenter( - DerivedMesh *dm, - void (*func)(void *userData, int index, - float *cent, float *no), - void *userData) + DerivedMesh *dm, + void (*func)(void *userData, int index, const float cent[3], const float no[3]), + void *userData) { CDDerivedMesh *cddm = (CDDerivedMesh*)dm; MVert *mv = cddm->mvert; diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index 04ad8276365..abc74983d2b 100644 --- a/source/blender/blenkernel/intern/editderivedmesh.c +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -351,9 +351,9 @@ static void emDM_recalcTessellation(DerivedMesh *UNUSED(dm)) } static void emDM_foreachMappedVert( - DerivedMesh *dm, - void (*func)(void *userData, int index, float *co, float *no_f, short *no_s), - void *userData) + DerivedMesh *dm, + void (*func)(void *userData, int index, const float co[3], const float no_f[3], const short no_s[3]), + void *userData) { EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm; BMVert *eve; @@ -371,9 +371,9 @@ static void emDM_foreachMappedVert( } } static void emDM_foreachMappedEdge( - DerivedMesh *dm, - void (*func)(void *userData, int index, float *v0co, float *v1co), - void *userData) + DerivedMesh *dm, + void (*func)(void *userData, int index, const float v0co[3], const float v1co[3]), + void *userData) { EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm; BMEdge *eed; @@ -551,9 +551,9 @@ static void emDM__calcFaceCent(BMesh *bm, BMFace *efa, float cent[3], float (*ve } static void emDM_foreachMappedFaceCenter( - DerivedMesh *dm, - void (*func)(void *userData, int index, float *co, float *no), - void *userData) + DerivedMesh *dm, + void (*func)(void *userData, int index, const float co[3], const float no[3]), + void *userData) { EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm; float (*polyNos)[3] = NULL; diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index c34161db0eb..a3737b3f79e 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1391,7 +1391,10 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3]) MEM_freeN(faceMap2); } -static void ccgDM_foreachMappedVert(DerivedMesh *dm, void (*func)(void *userData, int index, float *co, float *no_f, short *no_s), void *userData) +static void ccgDM_foreachMappedVert( + DerivedMesh *dm, + void (*func)(void *userData, int index, const float co[3], const float no_f[3], const short no_s[3]), + void *userData) { CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm; CCGVertIterator *vi = ccgSubSurf_getVertIterator(ccgdm->ss); @@ -1408,7 +1411,10 @@ static void ccgDM_foreachMappedVert(DerivedMesh *dm, void (*func)(void *userData ccgVertIterator_free(vi); } -static void ccgDM_foreachMappedEdge(DerivedMesh *dm, void (*func)(void *userData, int index, float *v0co, float *v1co), void *userData) +static void ccgDM_foreachMappedEdge( + DerivedMesh *dm, + void (*func)(void *userData, int index, const float v0co[3], const float v1co[3]), + void *userData) { CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm; CCGSubSurf *ss = ccgdm->ss; @@ -2382,7 +2388,10 @@ static void ccgDM_drawMappedEdgesInterp(DerivedMesh *dm, ccgEdgeIterator_free(ei); } -static void ccgDM_foreachMappedFaceCenter(DerivedMesh *dm, void (*func)(void *userData, int index, float *co, float *no), void *userData) +static void ccgDM_foreachMappedFaceCenter( + DerivedMesh *dm, + void (*func)(void *userData, int index, const float co[3], const float no[3]), + void *userData) { CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm; CCGSubSurf *ss = ccgdm->ss; diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index a09722f78b6..cc3d0c6e184 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -4508,7 +4508,8 @@ static int dgroup_skinnable_cb(Object *ob, Bone *bone, void *datap) return 0; } -static void add_vgroups__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) +static void add_vgroups__mapFunc(void *userData, int index, const float co[3], + const float UNUSED(no_f[3]), const short UNUSED(no_s[3])) { /* DerivedMesh mapFunc for getting final coords in weight paint mode */ diff --git a/source/blender/editors/mesh/editmesh_bvh.c b/source/blender/editors/mesh/editmesh_bvh.c index 37c4897cede..f9c673010f3 100644 --- a/source/blender/editors/mesh/editmesh_bvh.c +++ b/source/blender/editors/mesh/editmesh_bvh.c @@ -69,8 +69,8 @@ typedef struct BMBVHTree { Scene *scene; } BMBVHTree; -static void cage_mapped_verts_callback(void *userData, int index, float *co, - float *UNUSED(no_f), short *UNUSED(no_s)) +static void cage_mapped_verts_callback(void *userData, int index, const float co[3], + const float UNUSED(no_f[3]), const short UNUSED(no_s[3])) { void **data = userData; BMEditMesh *em = data[0]; diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index a7754b37f22..bba1e870b1f 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -2676,7 +2676,8 @@ static void knifetool_exit(bContext *UNUSED(C), wmOperator *op) op->customdata = NULL; } -static void cage_mapped_verts_callback(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) +static void cage_mapped_verts_callback(void *userData, int index, const float co[3], + const float UNUSED(no_f[3]), const short UNUSED(no_s[3])) { void **data = userData; BMEditMesh *em = data[0]; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 31f7cf322bc..177a5d3d850 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2026,7 +2026,8 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob) * if not, ED_view3d_init_mats_rv3d() can be used for selection tools * but would not give correct results with dupli's for eg. which don't * use the object matrix in the usual way */ -static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) +static void mesh_foreachScreenVert__mapFunc(void *userData, int index, const float co[3], + const float UNUSED(no_f[3]), const short UNUSED(no_s[3])) { foreachScreenVert_userData *data = userData; BMVert *eve = EDBM_vert_at_index(data->vc.em, index); @@ -2072,7 +2073,8 @@ void mesh_foreachScreenVert( } /* draw callback */ -static void drawSelectedVertices__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) +static void drawSelectedVertices__mapFunc(void *userData, int index, const float co[3], + const float UNUSED(no_f[3]), const short UNUSED(no_s[3])) { MVert *mv = &((MVert *)userData)[index]; @@ -2105,7 +2107,7 @@ static int is_co_in_region(ARegion *ar, const short co[2]) (co[1] >= 0) && (co[1] < ar->winy)); } -static void mesh_foreachScreenEdge__mapFunc(void *userData, int index, float *v0co, float *v1co) +static void mesh_foreachScreenEdge__mapFunc(void *userData, int index, const float v0co[3], const float v1co[3]) { foreachScreenEdge_userData *data = userData; BMEdge *eed = EDBM_edge_at_index(data->vc.em, index); @@ -2162,7 +2164,7 @@ void mesh_foreachScreenEdge( dm->release(dm); } -static void mesh_foreachScreenFace__mapFunc(void *userData, int index, float *cent, float *UNUSED(no)) +static void mesh_foreachScreenFace__mapFunc(void *userData, int index, const float cent[3], const float UNUSED(no[3])) { foreachScreenFace_userData *data = userData; BMFace *efa = EDBM_face_at_index(data->vc.em, index); @@ -2266,7 +2268,7 @@ void nurbs_foreachScreenVert( * logic!!! */ -static void draw_dm_face_normals__mapFunc(void *userData, int index, float *cent, float *no) +static void draw_dm_face_normals__mapFunc(void *userData, int index, const float cent[3], const float no[3]) { drawDMNormal_userData *data = userData; BMFace *efa = EDBM_face_at_index(data->em, index); @@ -2290,7 +2292,7 @@ static void draw_dm_face_normals(BMEditMesh *em, Scene *scene, DerivedMesh *dm) glEnd(); } -static void draw_dm_face_centers__mapFunc(void *userData, int index, float *cent, float *UNUSED(no)) +static void draw_dm_face_centers__mapFunc(void *userData, int index, const float cent[3], const float UNUSED(no[3])) { BMFace *efa = EDBM_face_at_index(((void **)userData)[0], index); int sel = *(((int **)userData)[1]); @@ -2308,7 +2310,7 @@ static void draw_dm_face_centers(BMEditMesh *em, DerivedMesh *dm, int sel) bglEnd(); } -static void draw_dm_vert_normals__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) +static void draw_dm_vert_normals__mapFunc(void *userData, int index, const float co[3], const float no_f[3], const short no_s[3]) { drawDMNormal_userData *data = userData; BMVert *eve = EDBM_vert_at_index(data->em, index); @@ -2341,7 +2343,8 @@ static void draw_dm_vert_normals(BMEditMesh *em, Scene *scene, DerivedMesh *dm) } /* Draw verts with color set based on selection */ -static void draw_dm_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) +static void draw_dm_verts__mapFunc(void *userData, int index, const float co[3], + const float UNUSED(no_f[3]), const short UNUSED(no_s[3])) { drawDMVerts_userData *data = userData; BMVert *eve = EDBM_vert_at_index(data->em, index); @@ -2616,7 +2619,8 @@ static DMDrawOption draw_dm_bweights__setDrawOptions(void *userData, int index) return DM_DRAW_OPTION_SKIP; } } -static void draw_dm_bweights__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) +static void draw_dm_bweights__mapFunc(void *userData, int index, const float co[3], + const float UNUSED(no_f[3]), const short UNUSED(no_s[3])) { BMEditMesh *em = userData; BMVert *eve = EDBM_vert_at_index(userData, index); @@ -7145,7 +7149,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) /* ***************** BACKBUF SEL (BBS) ********* */ -static void bbs_obmode_mesh_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) +static void bbs_obmode_mesh_verts__mapFunc(void *userData, int index, const float co[3], + const float UNUSED(no_f[3]), const short UNUSED(no_s[3])) { bbsObmodeMeshVerts_userData *data = userData; MVert *mv = &data->mvert[index]; @@ -7171,7 +7176,8 @@ static void bbs_obmode_mesh_verts(Object *ob, DerivedMesh *dm, int offset) glPointSize(1.0); } -static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) +static void bbs_mesh_verts__mapFunc(void *userData, int index, const float co[3], + const float UNUSED(no_f[3]), const short UNUSED(no_s[3])) { void **ptrs = userData; int offset = (intptr_t) ptrs[0]; @@ -7228,7 +7234,7 @@ static DMDrawOption bbs_mesh_solid__setSolidDrawOptions(void *userData, int inde } } -static void bbs_mesh_solid__drawCenter(void *userData, int index, float *cent, float *UNUSED(no)) +static void bbs_mesh_solid__drawCenter(void *userData, int index, const float cent[3], const float UNUSED(no[3])) { BMFace *efa = EDBM_face_at_index(((void **)userData)[0], index); diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index ac94accf991..faf765fdaef 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -193,7 +193,8 @@ static void special_transvert_update(Object *obedit) } } -static void set_mapped_co(void *vuserdata, int index, float *co, float *UNUSED(no), short *UNUSED(no_s)) +static void set_mapped_co(void *vuserdata, int index, const float co[3], + const float UNUSED(no[3]), const short UNUSED(no_s[3])) { void **userdata = vuserdata; BMEditMesh *em = userdata[0]; diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index d63ad7f58e6..504d296bda8 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -72,7 +72,8 @@ static void set_crazy_vertex_quat(float *quat, float *v1, float *v2, float *v3, } #undef TAN_MAKE_VEC -static void make_vertexcos__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) +static void make_vertexcos__mapFunc(void *userData, int index, const float co[3], + const float UNUSED(no_f[3]), const short UNUSED(no_s[3])) { MappedUserData *mappedData = (MappedUserData *)userData; float *vec = mappedData->vertexcos; |