Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-09-24 07:31:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-09-24 07:31:00 +0400
commit5342d57a5eb8f45549bcca81db611ac75188b060 (patch)
tree049a354eee6407512a44e5694a127155858bcd85 /source/blender/bmesh/intern/bmesh_mesh.h
parent464e9b8777134ef18d78d4605ec50d030c9a0df8 (diff)
allocate bmesh data from known sizes where possible (was still using defaults in places),
add macros for initializing BMAllocTemplate's, also add assert on invalid use of bmesh_sfme()
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_mesh.h')
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh.h b/source/blender/bmesh/intern/bmesh_mesh.h
index efcd80b374b..583b1589290 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.h
+++ b/source/blender/bmesh/intern/bmesh_mesh.h
@@ -60,6 +60,13 @@ typedef struct BMAllocTemplate {
extern const BMAllocTemplate bm_mesh_allocsize_default;
extern const BMAllocTemplate bm_mesh_chunksize_default;
+#define BMALLOC_TEMPLATE_FROM_BM(bm) { (CHECK_TYPE_INLINE(bm, BMesh *), \
+ (bm)->totvert), (bm)->totedge, (bm)->totloop, (bm)->totface}
+#define BMALLOC_TEMPLATE_FROM_ME(me) { (CHECK_TYPE_INLINE(me, Mesh *), \
+ (me)->totvert), (me)->totedge, (me)->totloop, (me)->totpoly}
+#define BMALLOC_TEMPLATE_FROM_DM(dm) { (CHECK_TYPE_INLINE(dm, DerivedMesh *), \
+ (dm)->getNumVerts(dm)), (dm)->getNumEdges(dm), (dm)->getNumLoops(dm), (dm)->getNumPolys(dm)}
+
enum {
BM_MESH_CREATE_USE_TOOLFLAGS = (1 << 0)
};