diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-02 07:13:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-02 07:13:51 +0400 |
commit | 54310b8086e5820049f73f66fde8c92041fdb61a (patch) | |
tree | d609ba2de71e27ae8af41742930fecbf418c2fcd /source/blender/bmesh/intern/bmesh_operator_api.h | |
parent | d59b4752e432aa1188fe9082a99d3aa6f6d59ab1 (diff) |
bmesh: internal api change, remove BMOElemMapping, its not needed since the values can be stored in the ghash directly.
saves 24 bytes per element (per vertex/edge/face on a 64bit system), for bmesh operators.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_operator_api.h')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operator_api.h | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h index 24bfcd70d75..3bfb05221ba 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api.h +++ b/source/blender/bmesh/intern/bmesh_operator_api.h @@ -398,7 +398,7 @@ int BMO_slot_buffer_count(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot 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, - const void *element, const void *data, const int len); + const void *element, const void *data); /* flags all elements in a mapping. note that the mapping must only have * bmesh elements in it.*/ @@ -452,7 +452,7 @@ typedef struct BMOIter { BMOpSlot *slot; int cur; //for arrays GHashIterator giter; - void *val; + void **val; char restrictmask; /* bitwise '&' with BMHeader.htype */ } BMOIter; @@ -463,15 +463,12 @@ void *BMO_iter_new(BMOIter *iter, const char restrictmask); void *BMO_iter_step(BMOIter *iter); -/* returns a pointer to the key value when iterating over mappings. - * remember for pointer maps this will be a pointer to a pointer.*/ -void *BMO_iter_map_value(BMOIter *iter); +void **BMO_iter_map_value_p(BMOIter *iter); +void *BMO_iter_map_value_ptr(BMOIter *iter); -/* use this for pointer mappings */ -void *BMO_iter_map_value_p(BMOIter *iter); - -/* use this for float mappings */ -float BMO_iter_map_value_f(BMOIter *iter); +float BMO_iter_map_value_float(BMOIter *iter); +int BMO_iter_map_value_int(BMOIter *iter); +bool BMO_iter_map_value_bool(BMOIter *iter); #define BMO_ITER(ele, iter, slot_args, slot_name, restrict_flag) \ for (ele = BMO_iter_new(iter, slot_args, slot_name, restrict_flag); ele; ele = BMO_iter_step(iter)) @@ -479,16 +476,6 @@ float BMO_iter_map_value_f(BMOIter *iter); /******************* Inlined Functions********************/ typedef void (*opexec)(BMesh *bm, BMOperator *op); -/* mappings map elements to data, which - * follows the mapping struct in memory. */ -typedef struct BMOElemMapping { - BMHeader *element; - int len; -} BMOElemMapping; - -/* pointer after BMOElemMapping */ -#define BMO_OP_SLOT_MAPPING_DATA(var) (void *)(((BMOElemMapping *)var) + 1) - extern const int BMO_OPSLOT_TYPEINFO[BMO_OP_SLOT_TOTAL_TYPES]; int BMO_opcode_from_opname(const char *opname); |