diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index c4d11b8a325..d9664e7370d 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -33,8 +33,6 @@ #include "core/io/resource_loader.h" #include "core/object/ref_counted.h" #include "core/object/script_language.h" -#include "core/os/keyboard.h" -#include "core/string/print_string.h" #include #include @@ -69,10 +67,31 @@ ObjectID EncodedObjectAsID::get_object_id() const { // For `Variant::ARRAY`. // Occupies bits 16 and 17. #define HEADER_DATA_FIELD_TYPED_ARRAY_MASK (0b11 << 16) -#define HEADER_DATA_FIELD_TYPED_ARRAY_NONE (0b00 << 16) -#define HEADER_DATA_FIELD_TYPED_ARRAY_BUILTIN (0b01 << 16) -#define HEADER_DATA_FIELD_TYPED_ARRAY_CLASS_NAME (0b10 << 16) -#define HEADER_DATA_FIELD_TYPED_ARRAY_SCRIPT (0b11 << 16) +#define HEADER_DATA_FIELD_TYPED_ARRAY_SHIFT 16 + +// For `Variant::DICTIONARY`. +// Occupies bits 16 and 17. +#define HEADER_DATA_FIELD_TYPED_DICTIONARY_KEY_MASK (0b11 << 16) +#define HEADER_DATA_FIELD_TYPED_DICTIONARY_KEY_SHIFT 16 +// Occupies bits 18 and 19. +#define HEADER_DATA_FIELD_TYPED_DICTIONARY_VALUE_MASK (0b11 << 18) +#define HEADER_DATA_FIELD_TYPED_DICTIONARY_VALUE_SHIFT 18 + +enum ContainerTypeKind { + CONTAINER_TYPE_KIND_NONE = 0b00, + CONTAINER_TYPE_KIND_BUILTIN = 0b01, + CONTAINER_TYPE_KIND_CLASS_NAME = 0b10, + CONTAINER_TYPE_KIND_SCRIPT = 0b11, +}; + +struct ContainerType { + Variant::Type builtin_type = Variant::NIL; + StringName class_name; + Ref