Add NO_DEPTH_SORT ItemKey flag

This commit is contained in:
Ryan Huffman 2015-05-29 08:52:37 -07:00
parent 874f722504
commit b2c503af0e

View file

@ -41,6 +41,7 @@ public:
INVISIBLE, // Visible or not? could be just here to cast shadow
SHADOW_CASTER, // Item cast shadows
PICKABLE, // Item can be picked/selected
NO_DEPTH_SORT, // Item should not be depth sorted
NUM_FLAGS, // Not a valid flag
};
@ -68,6 +69,7 @@ public:
Builder& withInvisible() { _flags.set(INVISIBLE); return (*this); }
Builder& withShadowCaster() { _flags.set(SHADOW_CASTER); return (*this); }
Builder& withPickable() { _flags.set(PICKABLE); return (*this); }
Builder& withNoDepthSort() { _flags.set(NO_DEPTH_SORT); return (*this); }
// Convenient standard keys that we will keep on using all over the place
static ItemKey opaqueShape() { return Builder().withTypeShape().build(); }
@ -87,11 +89,14 @@ public:
bool isDeformed() const { return _flags[DEFORMED]; }
bool isVisible() const { return !_flags[INVISIBLE]; }
bool isUnvisible() const { return _flags[INVISIBLE]; }
bool isInvisible() const { return _flags[INVISIBLE]; }
bool isShadowCaster() const { return _flags[SHADOW_CASTER]; }
bool isPickable() const { return _flags[PICKABLE]; }
bool isDepthSort() const { return !_flags[NO_DEPTH_SORT]; }
bool isNoDepthSort() const { return _flags[NO_DEPTH_SORT]; }
};
inline QDebug operator<<(QDebug debug, const ItemKey& itemKey) {
@ -141,6 +146,9 @@ public:
Builder& withPickable() { _value.set(ItemKey::PICKABLE); _mask.set(ItemKey::PICKABLE); return (*this); }
Builder& withDepthSort() { _value.reset(ItemKey::NO_DEPTH_SORT); _mask.set(ItemKey::NO_DEPTH_SORT); return (*this); }
Builder& withNotDepthSort() { _value.set(ItemKey::NO_DEPTH_SORT); _mask.set(ItemKey::NO_DEPTH_SORT); return (*this); }
// Convenient standard keys that we will keep on using all over the place
static ItemFilter opaqueShape() { return Builder().withTypeShape().withOpaque().build(); }
static ItemFilter transparentShape() { return Builder().withTypeShape().withTransparent().build(); }