From 7b2e1486875b59f6c74b073deb4cae7279cf0139 Mon Sep 17 00:00:00 2001 From: HolonProduction Date: Mon, 6 Oct 2025 22:01:22 +0200 Subject: [PATCH] Bitpack more `Object` booleans --- core/object/object.cpp | 4 ++-- core/object/object.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/object/object.cpp b/core/object/object.cpp index c43397325f9..83b823be9d7 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -252,7 +252,7 @@ Object::Connection::Connection(const Variant &p_variant) { } bool Object::_predelete() { - _predelete_ok = 1; + _predelete_ok = true; notification(NOTIFICATION_PREDELETE, true); if (!_predelete_ok) { return false; @@ -2349,7 +2349,7 @@ Object::~Object() { ObjectDB::remove_instance(this); _instance_id = ObjectID(); } - _predelete_ok = 2; + _predelete_ok = true; if (_instance_bindings != nullptr) { for (uint32_t i = 0; i < _instance_binding_count; i++) { diff --git a/core/object/object.h b/core/object/object.h index c2cbad425ac..4e790717c94 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -651,7 +651,6 @@ private: #ifdef DEBUG_ENABLED SafeRefCount _lock_index; #endif // DEBUG_ENABLED - int _predelete_ok = 0; ObjectID _instance_id; bool _predelete(); void _initialize(); @@ -662,6 +661,12 @@ private: bool _block_signals : 1; bool _can_translate : 1; bool _emitting : 1; + bool _predelete_ok : 1; + +public: + bool _is_queued_for_deletion : 1; // Set to true by SceneTree::queue_delete(). + +private: #ifdef TOOLS_ENABLED bool _edited : 1; uint32_t _edited_version = 0; @@ -996,7 +1001,6 @@ public: String tr(const StringName &p_message, const StringName &p_context = "") const; String tr_n(const StringName &p_message, const StringName &p_message_plural, int p_n, const StringName &p_context = "") const; - bool _is_queued_for_deletion = false; // Set to true by SceneTree::queue_delete(). bool is_queued_for_deletion() const; _FORCE_INLINE_ void set_message_translation(bool p_enable) { _can_translate = p_enable; }