diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-20 07:29:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-20 07:29:12 +0400 |
commit | e8667421ed4a72ceec9c73b4599e4f7f9b06b346 (patch) | |
tree | d21f1216c6de3dc17aec0079737909477165cb39 /source/blender/bmesh/intern/bmesh_operator_api.h | |
parent | 050e220a98fde3d077c974d19416babb08147360 (diff) |
bmesh operator api edits, add macros and NULL the buffer if BMO_slot_buffer_alloc()'s len is zero.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_operator_api.h')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operator_api.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h index fbce08ed896..a44900cd4f5 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api.h +++ b/source/blender/bmesh/intern/bmesh_operator_api.h @@ -126,23 +126,31 @@ typedef struct BMOpSlot { float f; void *p; float vec[3]; - void *buf; + void **buf; GHash *ghash; } data; } BMOpSlot; +/* mainly for use outside bmesh internal code */ +#define BMO_SLOT_AS_BOOL(slot) ((slot)->data.i) +#define BMO_SLOT_AS_INT(slot) ((slot)->data.i) +#define BMO_SLOT_AS_FLOAT(slot) ((slot)->data.f) +#define BMO_SLOT_AS_VECTOR(slot) ((slot)->data.vec) +#define BMO_SLOT_AS_MATRIX(slot ) ((float (*)[4])((slot)->data.p)) +#define BMO_SLOT_AS_BUFFER(slot ) ((slot)->data.buf) +#define BMO_SLOT_AS_GHASH(slot ) ((slot)->data.ghash) + /* way more than probably needed, compiler complains if limit hit */ #define BMO_OP_MAX_SLOTS 16 typedef struct BMOperator { - int type; - int slot_type; - int type_flag; - int flag; /* runtime options */ struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]; struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]; void (*exec)(BMesh *bm, struct BMOperator *op); struct MemArena *arena; + int type; + int type_flag; + int flag; /* runtime options */ } BMOperator; enum { |