1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Bitpack more Object booleans

This commit is contained in:
HolonProduction
2025-10-06 22:01:22 +02:00
parent ef5cd99604
commit 7b2e148687
2 changed files with 8 additions and 4 deletions

View File

@@ -252,7 +252,7 @@ Object::Connection::Connection(const Variant &p_variant) {
} }
bool Object::_predelete() { bool Object::_predelete() {
_predelete_ok = 1; _predelete_ok = true;
notification(NOTIFICATION_PREDELETE, true); notification(NOTIFICATION_PREDELETE, true);
if (!_predelete_ok) { if (!_predelete_ok) {
return false; return false;
@@ -2349,7 +2349,7 @@ Object::~Object() {
ObjectDB::remove_instance(this); ObjectDB::remove_instance(this);
_instance_id = ObjectID(); _instance_id = ObjectID();
} }
_predelete_ok = 2; _predelete_ok = true;
if (_instance_bindings != nullptr) { if (_instance_bindings != nullptr) {
for (uint32_t i = 0; i < _instance_binding_count; i++) { for (uint32_t i = 0; i < _instance_binding_count; i++) {

View File

@@ -651,7 +651,6 @@ private:
#ifdef DEBUG_ENABLED #ifdef DEBUG_ENABLED
SafeRefCount _lock_index; SafeRefCount _lock_index;
#endif // DEBUG_ENABLED #endif // DEBUG_ENABLED
int _predelete_ok = 0;
ObjectID _instance_id; ObjectID _instance_id;
bool _predelete(); bool _predelete();
void _initialize(); void _initialize();
@@ -662,6 +661,12 @@ private:
bool _block_signals : 1; bool _block_signals : 1;
bool _can_translate : 1; bool _can_translate : 1;
bool _emitting : 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 #ifdef TOOLS_ENABLED
bool _edited : 1; bool _edited : 1;
uint32_t _edited_version = 0; uint32_t _edited_version = 0;
@@ -996,7 +1001,6 @@ public:
String tr(const StringName &p_message, const StringName &p_context = "") const; 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; 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; bool is_queued_for_deletion() const;
_FORCE_INLINE_ void set_message_translation(bool p_enable) { _can_translate = p_enable; } _FORCE_INLINE_ void set_message_translation(bool p_enable) { _can_translate = p_enable; }