diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-16 04:51:36 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-16 04:51:36 +0400 |
commit | ed33320e3f149f4106ed70b82d019113970c991e (patch) | |
tree | 49aaa5a8f7e53e7065fb758c86c73eddc20d3b9f /source/blender/editors/mesh | |
parent | eb22b5248229494bcab091e68cf7a354fe0cc0e3 (diff) |
Code cleanup: simplify standard GHash creation.
Added four new functions as shortcuts to creating GHashes that use the
standard ptr/str/int/pair hash and compare functions.
GHash *BLI_ghash_ptr_new(const char *info);
GHash *BLI_ghash_str_new(const char *info);
GHash *BLI_ghash_int_new(const char *info);
GHash *BLI_ghash_pair_new(const char *info);
Replaced almost all occurrences of BLI_ghash_new() with one of the
above functions.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 6 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index d49b77c7005..a9ec893adb7 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -2829,9 +2829,9 @@ static int knifetool_init(bContext *C, wmOperator *op, int UNUSED(do_cut)) kcd->kverts = BLI_mempool_create(sizeof(KnifeVert), 1, 512, BLI_MEMPOOL_ALLOW_ITER); kcd->kedges = BLI_mempool_create(sizeof(KnifeEdge), 1, 512, BLI_MEMPOOL_ALLOW_ITER); - kcd->origedgemap = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "knife origedgemap"); - kcd->origvertmap = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "knife origvertmap"); - kcd->kedgefacemap = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "knife origvertmap"); + kcd->origedgemap = BLI_ghash_ptr_new("knife origedgemap"); + kcd->origvertmap = BLI_ghash_ptr_new("knife origvertmap"); + kcd->kedgefacemap = BLI_ghash_ptr_new("knife origvertmap"); /* cut all the way through the mesh if use_occlude_geometry button not pushed */ kcd->cut_through = !RNA_boolean_get(op->ptr, "use_occlude_geometry"); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 9be71218da0..7f746ed9ef5 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -2700,7 +2700,7 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op) } /* the floating point coordinates of verts in screen space will be stored in a hash table according to the vertices pointer */ - gh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "knife cut exec"); + gh = BLI_ghash_ptr_new("knife cut exec"); for (bv = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); bv; bv = BM_iter_step(&iter)) { scr = MEM_mallocN(sizeof(float) * 2, "Vertex Screen Coordinates"); copy_v3_v3(co, bv->co); |