From ebaf1306b8167ea28be61980305a53b3c54cc4dc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 20 Nov 2012 13:29:27 +0000 Subject: bmesh operator api: avoid per vert/edge/face string lookups in BMO_slot_map_* functions --- used in array modifier, subdivide, remove doubles and other tools. --- source/blender/bmesh/intern/bmesh_operator_api.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/bmesh/intern/bmesh_operator_api.h') diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h index a44900cd4f5..1bff79ba799 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api.h +++ b/source/blender/bmesh/intern/bmesh_operator_api.h @@ -140,6 +140,10 @@ typedef struct BMOpSlot { #define BMO_SLOT_AS_BUFFER(slot ) ((slot)->data.buf) #define BMO_SLOT_AS_GHASH(slot ) ((slot)->data.ghash) +#define BMO_ASSERT_SLOT_IN_OP(slot, op) \ + BLI_assert(((slot >= (op)->slots_in) && (slot < &(op)->slots_in[BMO_OP_MAX_SLOTS])) || \ + ((slot >= (op)->slots_out) && (slot < &(op)->slots_out[BMO_OP_MAX_SLOTS]))) + /* way more than probably needed, compiler complains if limit hit */ #define BMO_OP_MAX_SLOTS 16 @@ -385,8 +389,8 @@ void BMO_slot_buffer_from_disabled_hflag(BMesh *bm, BMOperator *op, int BMO_slot_buffer_count(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name); int BMO_slot_map_count(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name); -void BMO_slot_map_insert(BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, - void *element, void *data, int len); +void BMO_slot_map_insert(BMOperator *op, BMOpSlot *slot, + const void *element, void *data, int len); /* Counts the number of edges with tool flag toolflag around */ -- cgit v1.2.3