diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-12-22 07:57:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-12-22 08:41:01 +0300 |
commit | a9c881f6a3c15a636f398e9340d8daab290513f7 (patch) | |
tree | bf177be1ab98d9d1108b24bc366564034917d60a /source/blender/bmesh/intern/bmesh_operator_api_inline.h | |
parent | ee2b583a059777162ce68eaa705481c210805513 (diff) |
BMesh: store stackdepth as an index
Avoids -1 all over.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_operator_api_inline.h')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operator_api_inline.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operator_api_inline.h b/source/blender/bmesh/intern/bmesh_operator_api_inline.h index 4f995e08b9c..95c4f710c38 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api_inline.h +++ b/source/blender/bmesh/intern/bmesh_operator_api_inline.h @@ -41,38 +41,38 @@ ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2) BLI_INLINE short _bmo_elem_flag_test(BMesh *bm, BMFlagLayer *oflags, const short oflag) { - return oflags[bm->stackdepth - 1].f & oflag; + return oflags[bm->toolflag_index].f & oflag; } ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2) BLI_INLINE bool _bmo_elem_flag_test_bool(BMesh *bm, BMFlagLayer *oflags, const short oflag) { - return (oflags[bm->stackdepth - 1].f & oflag) != 0; + return (oflags[bm->toolflag_index].f & oflag) != 0; } ATTR_NONNULL(1, 2) BLI_INLINE void _bmo_elem_flag_enable(BMesh *bm, BMFlagLayer *oflags, const short oflag) { - oflags[bm->stackdepth - 1].f |= oflag; + oflags[bm->toolflag_index].f |= oflag; } ATTR_NONNULL(1, 2) BLI_INLINE void _bmo_elem_flag_disable(BMesh *bm, BMFlagLayer *oflags, const short oflag) { - oflags[bm->stackdepth - 1].f &= (short)~oflag; + oflags[bm->toolflag_index].f &= (short)~oflag; } ATTR_NONNULL(1, 2) BLI_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, const short oflag, int val) { - if (val) oflags[bm->stackdepth - 1].f |= oflag; - else oflags[bm->stackdepth - 1].f &= (short)~oflag; + if (val) oflags[bm->toolflag_index].f |= oflag; + else oflags[bm->toolflag_index].f &= (short)~oflag; } ATTR_NONNULL(1, 2) BLI_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const short oflag) { - oflags[bm->stackdepth - 1].f ^= oflag; + oflags[bm->toolflag_index].f ^= oflag; } ATTR_NONNULL(1, 2) |