From cf8c679a23b21d6c6f29cba6a54eaa2eed88bf92 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 12 Feb 2020 14:24:06 -0300 Subject: ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits. --- core/object.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/object.h') diff --git a/core/object.h b/core/object.h index 865c155764..312fe07a17 100644 --- a/core/object.h +++ b/core/object.h @@ -34,6 +34,7 @@ #include "core/hash_map.h" #include "core/list.h" #include "core/map.h" +#include "core/object_id.h" #include "core/os/rw_lock.h" #include "core/set.h" #include "core/variant.h" @@ -89,6 +90,7 @@ enum PropertyHint { PROPERTY_HINT_OBJECT_TOO_BIG, ///< object is too big to send PROPERTY_HINT_NODE_PATH_VALID_TYPES, PROPERTY_HINT_SAVE_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,". This opens a save dialog + PROPERTY_HINT_INT_IS_OBJECTID, PROPERTY_HINT_MAX, // When updating PropertyHint, also sync the hardcoded list in VisualScriptEditorVariableEdit }; @@ -397,7 +399,6 @@ public: \ private: class ScriptInstance; -typedef uint64_t ObjectID; class Object { public: @@ -452,7 +453,7 @@ private: _id(p_id), method(p_method) { } - Target() { _id = 0; } + Target() { _id = ObjectID(); } }; struct Slot { @@ -775,7 +776,7 @@ class ObjectDB { static HashMap instances; static HashMap instance_checks; - static ObjectID instance_counter; + static uint64_t instance_counter; friend class Object; friend void unregister_core_types(); -- cgit v1.2.3