From 2b815df3c19499f9fcf1575cfce1477876030e81 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 8 Jan 2023 00:55:54 +0100 Subject: Use BitField<> in core type masks * All core types masks are now correctly marked as bitfields. * The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks. * Most bitmask operations replaced by functions in BitField<> * Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is. * Documentation and API dump updated to reflect bitfields in core types. --- scene/main/viewport.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scene/main/viewport.h') diff --git a/scene/main/viewport.h b/scene/main/viewport.h index ca6f3163df..9f182682d7 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -259,7 +259,7 @@ private: bool control = false; bool shift = false; bool meta = false; - MouseButton mouse_mask = MouseButton::NONE; + BitField mouse_mask; } physics_last_mouse_state; @@ -358,7 +358,7 @@ private: Control *mouse_focus = nullptr; Control *last_mouse_focus = nullptr; Control *mouse_click_grabber = nullptr; - MouseButton mouse_focus_mask = MouseButton::NONE; + BitField mouse_focus_mask; Control *key_focus = nullptr; Control *mouse_over = nullptr; Control *drag_mouse_over = nullptr; -- cgit v1.2.3