Skip to content

Commit

Permalink
Merge pull request #87831 from Riteo/bitfield-xor
Browse files Browse the repository at this point in the history
Core: Implement a XOR operator for BitField
  • Loading branch information
akien-mga committed Mar 26, 2024
2 parents 198d0b6 + 7739940 commit 9335b83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/variant/type_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ class BitField {
_FORCE_INLINE_ constexpr BitField(T p_value) { value = (int64_t)p_value; }
_FORCE_INLINE_ operator int64_t() const { return value; }
_FORCE_INLINE_ operator Variant() const { return value; }
_FORCE_INLINE_ BitField<T> operator^(const BitField<T> &p_b) const { return BitField<T>(value ^ p_b.value); }
};

#define TEMPL_MAKE_BITFIELD_TYPE_INFO(m_enum, m_impl) \
Expand Down
2 changes: 1 addition & 1 deletion platform/linuxbsd/wayland/wayland_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ void WaylandThread::_wl_pointer_on_frame(void *data, struct wl_pointer *wl_point
}

if (old_pd.pressed_button_mask != pd.pressed_button_mask) {
BitField<MouseButtonMask> pressed_mask_delta = BitField<MouseButtonMask>((uint32_t)old_pd.pressed_button_mask ^ (uint32_t)pd.pressed_button_mask);
BitField<MouseButtonMask> pressed_mask_delta = old_pd.pressed_button_mask ^ pd.pressed_button_mask;

const MouseButton buttons_to_test[] = {
MouseButton::LEFT,
Expand Down

0 comments on commit 9335b83

Please sign in to comment.