diff options
| author | Juan Linietsky <juan@godotengine.org> | 2020-02-12 14:24:06 -0300 |
|---|---|---|
| committer | Juan Linietsky <juan@godotengine.org> | 2020-02-12 14:24:54 -0300 |
| commit | cf8c679a23b21d6c6f29cba6a54eaa2eed88bf92 (patch) | |
| tree | 52aca947b395362b2addec4843915b15947c32ca /core/object.h | |
| parent | 4aa31a2851e3dd5b67193194f899850239b2669d (diff) | |
| download | redot-engine-cf8c679a23b21d6c6f29cba6a54eaa2eed88bf92.tar.gz | |
ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits.
Diffstat (limited to 'core/object.h')
| -rw-r--r-- | core/object.h | 7 |
1 files changed, 4 insertions, 3 deletions
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<ObjectID, Object *> instances; static HashMap<Object *, ObjectID, ObjectPtrHash> instance_checks; - static ObjectID instance_counter; + static uint64_t instance_counter; friend class Object; friend void unregister_core_types(); |
