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:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-05-09 16:15:06 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-05-09 16:44:49 +0300
commit8b4127abda9a0069fa7833cfd12c1f79d1516fc8 (patch)
treec1fd7ee3127465252191da1b6643575ce4ce230a /source/blender/bmesh/intern/bmesh_mesh.h
parent03fc491048f9efef67033a91d5a37ee0d9d7ec79 (diff)
Expanded BMALLOC_TEMPLATE_FROM_ME to accept two meshes
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_mesh.h')
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh.h b/source/blender/bmesh/intern/bmesh_mesh.h
index 3ebe6535a8b..b4443c748ce 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.h
+++ b/source/blender/bmesh/intern/bmesh_mesh.h
@@ -111,8 +111,23 @@ 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 _VA_BMALLOC_TEMPLATE_FROM_ME_1(me) { \
+ (CHECK_TYPE_INLINE(me, Mesh *), \
+ (me)->totvert), \
+ (me)->totedge, \
+ (me)->totloop, \
+ (me)->totpoly, \
+}
+#define _VA_BMALLOC_TEMPLATE_FROM_ME_2(me_a, me_b) { \
+ (CHECK_TYPE_INLINE(me_a, Mesh *), \
+ CHECK_TYPE_INLINE(me_b, Mesh *), \
+ (me_a)->totvert + (me_b)->totvert), \
+ (me_a)->totedge + (me_b)->totedge, \
+ (me_a)->totloop + (me_b)->totloop, \
+ (me_a)->totpoly + (me_b)->totpoly, \
+}
+#define BMALLOC_TEMPLATE_FROM_ME(...) VA_NARGS_CALL_OVERLOAD(_VA_BMALLOC_TEMPLATE_FROM_ME_, __VA_ARGS__)
#define _VA_BMALLOC_TEMPLATE_FROM_DM_1(dm) { \
(CHECK_TYPE_INLINE(dm, DerivedMesh *), \