From 8b4127abda9a0069fa7833cfd12c1f79d1516fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 9 May 2018 15:15:06 +0200 Subject: Expanded BMALLOC_TEMPLATE_FROM_ME to accept two meshes --- source/blender/bmesh/intern/bmesh_mesh.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'source/blender/bmesh/intern') 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 *), \ -- cgit v1.2.3