summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/config/engine.cpp5
-rw-r--r--core/core_bind.cpp4
-rw-r--r--core/core_bind.h4
-rw-r--r--core/core_constants.cpp4
-rw-r--r--core/crypto/aes_context.cpp1
-rw-r--r--core/crypto/aes_context.h2
-rw-r--r--core/crypto/crypto_core.h8
-rw-r--r--core/crypto/hashing_context.h2
-rw-r--r--core/debugger/debugger_marshalls.cpp2
-rw-r--r--core/debugger/debugger_marshalls.h2
-rw-r--r--core/io/file_access_encrypted.h4
-rw-r--r--core/io/file_access_memory.h4
-rw-r--r--core/io/image.cpp12
-rw-r--r--core/io/image.h4
-rw-r--r--core/io/packed_data_container.h2
-rw-r--r--core/io/pck_packer.h8
-rw-r--r--core/math/a_star.h16
-rw-r--r--core/math/expression.h22
-rw-r--r--core/math/quick_hull.h10
-rw-r--r--core/os/dir_access.h1
-rw-r--r--core/os/file_access.cpp4
-rw-r--r--core/templates/hash_map.h2
-rw-r--r--core/templates/list.h6
-rw-r--r--core/templates/safe_refcount.h2
-rw-r--r--core/templates/set.h2
-rw-r--r--core/templates/thread_work_pool.h4
-rw-r--r--core/variant/array.cpp2
-rw-r--r--core/variant/callable.h6
-rw-r--r--core/variant/variant.h2
-rw-r--r--core/variant/variant_internal.h233
30 files changed, 306 insertions, 74 deletions
diff --git a/core/config/engine.cpp b/core/config/engine.cpp
index 8e2ab094b0..26f8cdf840 100644
--- a/core/config/engine.cpp
+++ b/core/config/engine.cpp
@@ -224,8 +224,9 @@ Engine::Singleton::Singleton(const StringName &p_name, Object *p_ptr) :
name(p_name),
ptr(p_ptr) {
#ifdef DEBUG_ENABLED
- if (Object::cast_to<Reference>(p_ptr)) {
- ERR_PRINT("A class intended to be used as a singleton must *not* inherit from Reference.");
+ Reference *ref = Object::cast_to<Reference>(p_ptr);
+ if (ref && !ref->is_referenced()) {
+ WARN_PRINT("You must use Ref<> to ensure the lifetime of a Reference object intended to be used as a singleton.");
}
#endif
}
diff --git a/core/core_bind.cpp b/core/core_bind.cpp
index f3bdea1eec..259d899d39 100644
--- a/core/core_bind.cpp
+++ b/core/core_bind.cpp
@@ -542,9 +542,9 @@ void _OS::dump_memory_to_file(const String &p_file) {
struct _OSCoreBindImg {
String path;
Size2 size;
- int fmt;
+ int fmt = 0;
ObjectID id;
- int vram;
+ int vram = 0;
bool operator<(const _OSCoreBindImg &p_img) const { return vram == p_img.vram ? id < p_img.id : vram > p_img.vram; }
};
diff --git a/core/core_bind.h b/core/core_bind.h
index 4a642c47ce..f3a77a4fa6 100644
--- a/core/core_bind.h
+++ b/core/core_bind.h
@@ -492,8 +492,8 @@ public:
virtual ~_Directory();
private:
- bool _list_skip_navigational;
- bool _list_skip_hidden;
+ bool _list_skip_navigational = false;
+ bool _list_skip_hidden = false;
};
class _Marshalls : public Object {
diff --git a/core/core_constants.cpp b/core/core_constants.cpp
index 64bfff1c58..57ea10c074 100644
--- a/core/core_constants.cpp
+++ b/core/core_constants.cpp
@@ -38,10 +38,10 @@
struct _CoreConstant {
#ifdef DEBUG_METHODS_ENABLED
StringName enum_name;
- bool ignore_value_in_docs;
+ bool ignore_value_in_docs = false;
#endif
const char *name;
- int value;
+ int value = 0;
_CoreConstant() {}
diff --git a/core/crypto/aes_context.cpp b/core/crypto/aes_context.cpp
index 8ef1f4f1d4..608f3c912c 100644
--- a/core/crypto/aes_context.cpp
+++ b/core/crypto/aes_context.cpp
@@ -112,5 +112,4 @@ void AESContext::_bind_methods() {
}
AESContext::AESContext() {
- mode = MODE_MAX;
}
diff --git a/core/crypto/aes_context.h b/core/crypto/aes_context.h
index c23c504a72..557bde1f04 100644
--- a/core/crypto/aes_context.h
+++ b/core/crypto/aes_context.h
@@ -47,7 +47,7 @@ public:
};
private:
- Mode mode;
+ Mode mode = MODE_MAX;
CryptoCore::AESContext ctx;
PackedByteArray iv;
diff --git a/core/crypto/crypto_core.h b/core/crypto/crypto_core.h
index 57ba469f8d..c2ec6febe3 100644
--- a/core/crypto/crypto_core.h
+++ b/core/crypto/crypto_core.h
@@ -37,7 +37,7 @@ class CryptoCore {
public:
class MD5Context {
private:
- void *ctx; // To include, or not to include...
+ void *ctx = nullptr; // To include, or not to include...
public:
MD5Context();
@@ -50,7 +50,7 @@ public:
class SHA1Context {
private:
- void *ctx; // To include, or not to include...
+ void *ctx = nullptr; // To include, or not to include...
public:
SHA1Context();
@@ -63,7 +63,7 @@ public:
class SHA256Context {
private:
- void *ctx; // To include, or not to include...
+ void *ctx = nullptr; // To include, or not to include...
public:
SHA256Context();
@@ -76,7 +76,7 @@ public:
class AESContext {
private:
- void *ctx; // To include, or not to include...
+ void *ctx = nullptr; // To include, or not to include...
public:
AESContext();
diff --git a/core/crypto/hashing_context.h b/core/crypto/hashing_context.h
index 40d075afa9..7cd55ba267 100644
--- a/core/crypto/hashing_context.h
+++ b/core/crypto/hashing_context.h
@@ -45,7 +45,7 @@ public:
private:
void *ctx = nullptr;
- HashType type;
+ HashType type = HASH_MD5;
protected:
static void _bind_methods();
diff --git a/core/debugger/debugger_marshalls.cpp b/core/debugger/debugger_marshalls.cpp
index 3f949b0ae1..03de832b5e 100644
--- a/core/debugger/debugger_marshalls.cpp
+++ b/core/debugger/debugger_marshalls.cpp
@@ -171,7 +171,7 @@ bool DebuggerMarshalls::ServersProfilerFrame::deserialize(const Array &p_arr) {
}
servers.push_back(si);
}
- CHECK_SIZE(p_arr, idx + 3, "ServersProfilerFrame");
+ CHECK_SIZE(p_arr, idx + 1, "ServersProfilerFrame");
int func_size = p_arr[idx];
idx += 1;
CHECK_SIZE(p_arr, idx + func_size, "ServersProfilerFrame");
diff --git a/core/debugger/debugger_marshalls.h b/core/debugger/debugger_marshalls.h
index f5a1a891bf..0c13790d60 100644
--- a/core/debugger/debugger_marshalls.h
+++ b/core/debugger/debugger_marshalls.h
@@ -148,7 +148,7 @@ struct DebuggerMarshalls {
// Visual Profiler
struct VisualProfilerFrame {
- uint64_t frame_number;
+ uint64_t frame_number = 0;
Vector<RS::FrameProfileArea> areas;
Array serialize();
diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h
index fddc6842f3..c760933038 100644
--- a/core/io/file_access_encrypted.h
+++ b/core/io/file_access_encrypted.h
@@ -47,8 +47,8 @@ private:
Vector<uint8_t> key;
bool writing = false;
FileAccess *file = nullptr;
- size_t base;
- size_t length;
+ size_t base = 0;
+ size_t length = 0;
Vector<uint8_t> data;
mutable int pos = 0;
mutable bool eofed = false;
diff --git a/core/io/file_access_memory.h b/core/io/file_access_memory.h
index 1a9bd3fbbb..47012b4e83 100644
--- a/core/io/file_access_memory.h
+++ b/core/io/file_access_memory.h
@@ -35,8 +35,8 @@
class FileAccessMemory : public FileAccess {
uint8_t *data = nullptr;
- int length;
- mutable int pos;
+ int length = 0;
+ mutable int pos = 0;
static FileAccess *create();
diff --git a/core/io/image.cpp b/core/io/image.cpp
index f3c87a0f2d..6dde25af32 100644
--- a/core/io/image.cpp
+++ b/core/io/image.cpp
@@ -2766,8 +2766,8 @@ Dictionary Image::_get_data() const {
return d;
}
-Color Image::get_pixelv(const Point2 &p_src) const {
- return get_pixel(p_src.x, p_src.y);
+Color Image::get_pixelv(const Point2i &p_point) const {
+ return get_pixel(p_point.x, p_point.y);
}
Color Image::_get_color_at_ofs(const uint8_t *ptr, uint32_t ofs) const {
@@ -2976,8 +2976,8 @@ Color Image::get_pixel(int p_x, int p_y) const {
return _get_color_at_ofs(data.ptr(), ofs);
}
-void Image::set_pixelv(const Point2 &p_dst, const Color &p_color) {
- set_pixel(p_dst.x, p_dst.y, p_color);
+void Image::set_pixelv(const Point2i &p_point, const Color &p_color) {
+ set_pixel(p_point.x, p_point.y, p_color);
}
void Image::set_pixel(int p_x, int p_y, const Color &p_color) {
@@ -3132,9 +3132,9 @@ void Image::_bind_methods() {
ClassDB::bind_method(D_METHOD("_set_data", "data"), &Image::_set_data);
ClassDB::bind_method(D_METHOD("_get_data"), &Image::_get_data);
- ClassDB::bind_method(D_METHOD("get_pixelv", "src"), &Image::get_pixelv);
+ ClassDB::bind_method(D_METHOD("get_pixelv", "point"), &Image::get_pixelv);
ClassDB::bind_method(D_METHOD("get_pixel", "x", "y"), &Image::get_pixel);
- ClassDB::bind_method(D_METHOD("set_pixelv", "dst", "color"), &Image::set_pixelv);
+ ClassDB::bind_method(D_METHOD("set_pixelv", "point", "color"), &Image::set_pixelv);
ClassDB::bind_method(D_METHOD("set_pixel", "x", "y", "color"), &Image::set_pixel);
ClassDB::bind_method(D_METHOD("load_png_from_buffer", "buffer"), &Image::load_png_from_buffer);
diff --git a/core/io/image.h b/core/io/image.h
index c5ec74f02f..c4c84589e5 100644
--- a/core/io/image.h
+++ b/core/io/image.h
@@ -387,9 +387,9 @@ public:
UsedChannels detect_used_channels(CompressSource p_source = COMPRESS_SOURCE_GENERIC);
void optimize_channels();
- Color get_pixelv(const Point2 &p_src) const;
+ Color get_pixelv(const Point2i &p_point) const;
Color get_pixel(int p_x, int p_y) const;
- void set_pixelv(const Point2 &p_dst, const Color &p_color);
+ void set_pixelv(const Point2i &p_point, const Color &p_color);
void set_pixel(int p_x, int p_y, const Color &p_color);
void set_as_black();
diff --git a/core/io/packed_data_container.h b/core/io/packed_data_container.h
index b784abcd16..3899c14bb4 100644
--- a/core/io/packed_data_container.h
+++ b/core/io/packed_data_container.h
@@ -84,7 +84,7 @@ class PackedDataContainerRef : public Reference {
GDCLASS(PackedDataContainerRef, Reference);
friend class PackedDataContainer;
- uint32_t offset;
+ uint32_t offset = 0;
Ref<PackedDataContainer> from;
protected:
diff --git a/core/io/pck_packer.h b/core/io/pck_packer.h
index c1026c2499..56be1b52df 100644
--- a/core/io/pck_packer.h
+++ b/core/io/pck_packer.h
@@ -39,7 +39,7 @@ class PCKPacker : public Reference {
GDCLASS(PCKPacker, Reference);
FileAccess *file = nullptr;
- int alignment;
+ int alignment = 0;
uint64_t ofs = 0;
Vector<uint8_t> key;
@@ -50,9 +50,9 @@ class PCKPacker : public Reference {
struct File {
String path;
String src_path;
- uint64_t ofs;
- uint64_t size;
- bool encrypted;
+ uint64_t ofs = 0;
+ uint64_t size = 0;
+ bool encrypted = false;
Vector<uint8_t> md5;
};
Vector<File> files;
diff --git a/core/math/a_star.h b/core/math/a_star.h
index a6fa771b30..7cfa73f2c2 100644
--- a/core/math/a_star.h
+++ b/core/math/a_star.h
@@ -47,20 +47,20 @@ class AStar : public Reference {
struct Point {
Point() {}
- int id;
+ int id = 0;
Vector3 pos;
- real_t weight_scale;
- bool enabled;
+ real_t weight_scale = 0;
+ bool enabled = false;
OAHashMap<int, Point *> neighbours = 4u;
OAHashMap<int, Point *> unlinked_neighbours = 4u;
// Used for pathfinding.
- Point *prev_point;
- real_t g_score;
- real_t f_score;
- uint64_t open_pass;
- uint64_t closed_pass;
+ Point *prev_point = nullptr;
+ real_t g_score = 0;
+ real_t f_score = 0;
+ uint64_t open_pass = 0;
+ uint64_t closed_pass = 0;
};
struct SortPoints {
diff --git a/core/math/expression.h b/core/math/expression.h
index d9cedb8c2c..6b34bc6ae8 100644
--- a/core/math/expression.h
+++ b/core/math/expression.h
@@ -133,7 +133,7 @@ private:
ENode *next = nullptr;
- Type type;
+ Type type = TYPE_INPUT;
ENode() {}
virtual ~ENode() {
@@ -144,7 +144,7 @@ private:
};
struct ExpressionNode {
- bool is_op;
+ bool is_op = false;
union {
Variant::Operator op;
ENode *node;
@@ -154,23 +154,23 @@ private:
ENode *_parse_expression();
struct InputNode : public ENode {
- int index;
+ int index = 0;
InputNode() {
type = TYPE_INPUT;
}
};
struct ConstantNode : public ENode {
- Variant value;
+ Variant value = Variant::NIL;
ConstantNode() {
type = TYPE_CONSTANT;
}
};
struct OperatorNode : public ENode {
- Variant::Operator op;
+ Variant::Operator op = Variant::Operator::OP_ADD;
- ENode *nodes[2];
+ ENode *nodes[2] = { nullptr, nullptr };
OperatorNode() {
type = TYPE_OPERATOR;
@@ -184,8 +184,8 @@ private:
};
struct IndexNode : public ENode {
- ENode *base;
- ENode *index;
+ ENode *base = nullptr;
+ ENode *index = nullptr;
IndexNode() {
type = TYPE_INDEX;
@@ -193,7 +193,7 @@ private:
};
struct NamedIndexNode : public ENode {
- ENode *base;
+ ENode *base = nullptr;
StringName name;
NamedIndexNode() {
@@ -202,7 +202,7 @@ private:
};
struct ConstructorNode : public ENode {
- Variant::Type data_type;
+ Variant::Type data_type = Variant::Type::NIL;
Vector<ENode *> arguments;
ConstructorNode() {
@@ -211,7 +211,7 @@ private:
};
struct CallNode : public ENode {
- ENode *base;
+ ENode *base = nullptr;
StringName method;
Vector<ENode *> arguments;
diff --git a/core/math/quick_hull.h b/core/math/quick_hull.h
index 80f32e191b..024325c4fc 100644
--- a/core/math/quick_hull.h
+++ b/core/math/quick_hull.h
@@ -41,7 +41,7 @@ public:
struct Edge {
union {
uint32_t vertices[2];
- uint64_t id;
+ uint64_t id = 0;
};
bool operator<(const Edge &p_edge) const {
@@ -60,7 +60,7 @@ public:
struct Face {
Plane plane;
- uint32_t vertices[3];
+ uint32_t vertices[3] = { 0 };
Vector<int> points_over;
bool operator<(const Face &p_face) const {
@@ -70,11 +70,13 @@ public:
private:
struct FaceConnect {
- List<Face>::Element *left, *right = nullptr;
+ List<Face>::Element *left = nullptr;
+ List<Face>::Element *right = nullptr;
FaceConnect() {}
};
struct RetFaceConnect {
- List<Geometry3D::MeshData::Face>::Element *left, *right = nullptr;
+ List<Geometry3D::MeshData::Face>::Element *left = nullptr;
+ List<Geometry3D::MeshData::Face>::Element *right = nullptr;
RetFaceConnect() {}
};
diff --git a/core/os/dir_access.h b/core/os/dir_access.h
index 0f4fa9b250..17f84d3c52 100644
--- a/core/os/dir_access.h
+++ b/core/os/dir_access.h
@@ -57,7 +57,6 @@ protected:
String _get_root_string() const;
String fix_path(String p_path) const;
- bool next_is_dir;
template <class T>
static DirAccess *_create_builtin() {
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp
index fd3c6f8806..b962f61e1f 100644
--- a/core/os/file_access.cpp
+++ b/core/os/file_access.cpp
@@ -254,8 +254,8 @@ class CharBuffer {
Vector<char> vector;
char stack_buffer[256];
- char *buffer;
- int capacity;
+ char *buffer = nullptr;
+ int capacity = 0;
int written = 0;
bool grow() {
diff --git a/core/templates/hash_map.h b/core/templates/hash_map.h
index f6b889015a..e1ba381595 100644
--- a/core/templates/hash_map.h
+++ b/core/templates/hash_map.h
@@ -73,7 +73,7 @@ public:
private:
friend class HashMap;
- uint32_t hash;
+ uint32_t hash = 0;
Element *next = nullptr;
Element() {}
Pair pair;
diff --git a/core/templates/list.h b/core/templates/list.h
index d745066e4c..8e14aaa90d 100644
--- a/core/templates/list.h
+++ b/core/templates/list.h
@@ -137,9 +137,9 @@ public:
private:
struct _Data {
- Element *first;
- Element *last;
- int size_cache;
+ Element *first = nullptr;
+ Element *last = nullptr;
+ int size_cache = 0;
bool erase(const Element *p_I) {
ERR_FAIL_COND_V(!p_I, false);
diff --git a/core/templates/safe_refcount.h b/core/templates/safe_refcount.h
index dc4e62354a..6b08b876f8 100644
--- a/core/templates/safe_refcount.h
+++ b/core/templates/safe_refcount.h
@@ -165,7 +165,7 @@ uint64_t atomic_exchange_if_greater(volatile uint64_t *pw, volatile uint64_t val
#endif
struct SafeRefCount {
- uint32_t count;
+ uint32_t count = 0;
public:
// destroy() is called when weak_count_ drops to zero.
diff --git a/core/templates/set.h b/core/templates/set.h
index 1bc0a3f41e..d0ac71a710 100644
--- a/core/templates/set.h
+++ b/core/templates/set.h
@@ -80,7 +80,7 @@ public:
private:
struct _Data {
Element *_root = nullptr;
- Element *_nil;
+ Element *_nil = nullptr;
int size_cache = 0;
_FORCE_INLINE_ _Data() {
diff --git a/core/templates/thread_work_pool.h b/core/templates/thread_work_pool.h
index 661060aa3f..e083cdcb24 100644
--- a/core/templates/thread_work_pool.h
+++ b/core/templates/thread_work_pool.h
@@ -41,8 +41,8 @@ class ThreadWorkPool {
std::atomic<uint32_t> index;
struct BaseWork {
- std::atomic<uint32_t> *index;
- uint32_t max_elements;
+ std::atomic<uint32_t> *index = nullptr;
+ uint32_t max_elements = 0;
virtual void work() = 0;
virtual ~BaseWork() = default;
};
diff --git a/core/variant/array.cpp b/core/variant/array.cpp
index 79bc01b89c..5043868b1d 100644
--- a/core/variant/array.cpp
+++ b/core/variant/array.cpp
@@ -371,7 +371,7 @@ void Array::sort() {
}
struct _ArrayVariantSortCustom {
- Object *obj;
+ Object *obj = nullptr;
StringName func;
_FORCE_INLINE_ bool operator()(const Variant &p_l, const Variant &p_r) const {
diff --git a/core/variant/callable.h b/core/variant/callable.h
index 40621fbde3..9334ae3581 100644
--- a/core/variant/callable.h
+++ b/core/variant/callable.h
@@ -62,9 +62,9 @@ public:
CALL_ERROR_TOO_FEW_ARGUMENTS, // expected is number of arguments
CALL_ERROR_INSTANCE_IS_NULL,
};
- Error error;
- int argument;
- int expected;
+ Error error = Error::CALL_OK;
+ int argument = 0;
+ int expected = 0;
};
void call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, CallError &r_call_error) const;
diff --git a/core/variant/variant.h b/core/variant/variant.h
index 093daf0c6f..26280948be 100644
--- a/core/variant/variant.h
+++ b/core/variant/variant.h
@@ -128,7 +128,7 @@ private:
struct ObjData {
ObjectID id;
- Object *obj;
+ Object *obj = nullptr;
};
/* array helpers */
diff --git a/core/variant/variant_internal.h b/core/variant/variant_internal.h
index 3c3be44ef7..bf7e46eed7 100644
--- a/core/variant/variant_internal.h
+++ b/core/variant/variant_internal.h
@@ -38,7 +38,82 @@
class VariantInternal {
public:
// Set type.
- _FORCE_INLINE_ static void initialize(Variant *v, Variant::Type p_type) { v->type = p_type; }
+ _FORCE_INLINE_ static void initialize(Variant *v, Variant::Type p_type) {
+ v->clear();
+ v->type = p_type;
+
+ switch (p_type) {
+ case Variant::AABB:
+ init_aabb(v);
+ break;
+ case Variant::TRANSFORM2D:
+ init_transform2d(v);
+ break;
+ case Variant::TRANSFORM:
+ init_transform(v);
+ break;
+ case Variant::STRING:
+ init_string(v);
+ break;
+ case Variant::STRING_NAME:
+ init_string_name(v);
+ break;
+ case Variant::NODE_PATH:
+ init_node_path(v);
+ break;
+ case Variant::CALLABLE:
+ init_callable(v);
+ break;
+ case Variant::SIGNAL:
+ init_signal(v);
+ break;
+ case Variant::DICTIONARY:
+ init_dictionary(v);
+ break;
+ case Variant::ARRAY:
+ init_array(v);
+ break;
+ case Variant::PACKED_BYTE_ARRAY:
+ init_byte_array(v);
+ break;
+ case Variant::PACKED_INT32_ARRAY:
+ init_int32_array(v);
+ break;
+ case Variant::PACKED_INT64_ARRAY:
+ init_int64_array(v);
+ break;
+ case Variant::PACKED_FLOAT32_ARRAY:
+ init_float32_array(v);
+ break;
+ case Variant::PACKED_FLOAT64_ARRAY:
+ init_float64_array(v);
+ break;
+ case Variant::PACKED_STRING_ARRAY:
+ init_string_array(v);
+ break;
+ case Variant::PACKED_VECTOR2_ARRAY:
+ init_vector2_array(v);
+ break;
+ case Variant::PACKED_VECTOR3_ARRAY:
+ init_vector3_array(v);
+ break;
+ case Variant::PACKED_COLOR_ARRAY:
+ init_color_array(v);
+ break;
+ default:
+ break;
+ }
+ }
+
+ _FORCE_INLINE_ static void set_object(Variant *v, Object *obj) {
+ if (obj) {
+ v->_get_obj().obj = obj;
+ v->_get_obj().id = obj->get_instance_id();
+ } else {
+ v->_get_obj().obj = nullptr;
+ v->_get_obj().id = ObjectID();
+ }
+ }
// Atomic types.
_FORCE_INLINE_ static bool *get_bool(Variant *v) { return &v->_data._bool; }
@@ -216,6 +291,162 @@ public:
v->_get_obj().obj = nullptr;
v->_get_obj().id = ObjectID();
}
+
+ _FORCE_INLINE_ static void *get_opaque_pointer(Variant *v) {
+ switch (v->type) {
+ case Variant::NIL:
+ return nullptr;
+ case Variant::BOOL:
+ return get_bool(v);
+ case Variant::INT:
+ return get_int(v);
+ case Variant::FLOAT:
+ return get_float(v);
+ case Variant::STRING:
+ return get_string(v);
+ case Variant::VECTOR2:
+ return get_vector2(v);
+ case Variant::VECTOR2I:
+ return get_vector2i(v);
+ case Variant::VECTOR3:
+ return get_vector3(v);
+ case Variant::VECTOR3I:
+ return get_vector3i(v);
+ case Variant::RECT2:
+ return get_rect2(v);
+ case Variant::RECT2I:
+ return get_rect2i(v);
+ case Variant::TRANSFORM:
+ return get_transform(v);
+ case Variant::TRANSFORM2D:
+ return get_transform2d(v);
+ case Variant::QUAT:
+ return get_quat(v);
+ case Variant::PLANE:
+ return get_plane(v);
+ case Variant::BASIS:
+ return get_basis(v);
+ case Variant::AABB:
+ return get_aabb(v);
+ case Variant::COLOR:
+ return get_color(v);
+ case Variant::STRING_NAME:
+ return get_string_name(v);
+ case Variant::NODE_PATH:
+ return get_node_path(v);
+ case Variant::RID:
+ return get_rid(v);
+ case Variant::CALLABLE:
+ return get_callable(v);
+ case Variant::SIGNAL:
+ return get_signal(v);
+ case Variant::DICTIONARY:
+ return get_dictionary(v);
+ case Variant::ARRAY:
+ return get_array(v);
+ case Variant::PACKED_BYTE_ARRAY:
+ return get_byte_array(v);
+ case Variant::PACKED_INT32_ARRAY:
+ return get_int32_array(v);
+ case Variant::PACKED_INT64_ARRAY:
+ return get_int64_array(v);
+ case Variant::PACKED_FLOAT32_ARRAY:
+ return get_float32_array(v);
+ case Variant::PACKED_FLOAT64_ARRAY:
+ return get_float64_array(v);
+ case Variant::PACKED_STRING_ARRAY:
+ return get_string_array(v);
+ case Variant::PACKED_VECTOR2_ARRAY:
+ return get_vector2_array(v);
+ case Variant::PACKED_VECTOR3_ARRAY:
+ return get_vector3_array(v);
+ case Variant::PACKED_COLOR_ARRAY:
+ return get_color_array(v);
+ case Variant::OBJECT:
+ return v->_get_obj().obj;
+ case Variant::VARIANT_MAX:
+ ERR_FAIL_V(nullptr);
+ }
+ ERR_FAIL_V(nullptr);
+ }
+
+ _FORCE_INLINE_ static const void *get_opaque_pointer(const Variant *v) {
+ switch (v->type) {
+ case Variant::NIL:
+ return nullptr;
+ case Variant::BOOL:
+ return get_bool(v);
+ case Variant::INT:
+ return get_int(v);
+ case Variant::FLOAT:
+ return get_float(v);
+ case Variant::STRING:
+ return get_string(v);
+ case Variant::VECTOR2:
+ return get_vector2(v);
+ case Variant::VECTOR2I:
+ return get_vector2i(v);
+ case Variant::VECTOR3:
+ return get_vector3(v);
+ case Variant::VECTOR3I:
+ return get_vector3i(v);
+ case Variant::RECT2:
+ return get_rect2(v);
+ case Variant::RECT2I:
+ return get_rect2i(v);
+ case Variant::TRANSFORM:
+ return get_transform(v);
+ case Variant::TRANSFORM2D:
+ return get_transform2d(v);
+ case Variant::QUAT:
+ return get_quat(v);
+ case Variant::PLANE:
+ return get_plane(v);
+ case Variant::BASIS:
+ return get_basis(v);
+ case Variant::AABB:
+ return get_aabb(v);
+ case Variant::COLOR:
+ return get_color(v);
+ case Variant::STRING_NAME:
+ return get_string_name(v);
+ case Variant::NODE_PATH:
+ return get_node_path(v);
+ case Variant::RID:
+ return get_rid(v);
+ case Variant::CALLABLE:
+ return get_callable(v);
+ case Variant::SIGNAL:
+ return get_signal(v);
+ case Variant::DICTIONARY:
+ return get_dictionary(v);
+ case Variant::ARRAY:
+ return get_array(v);
+ case Variant::PACKED_BYTE_ARRAY:
+ return get_byte_array(v);
+ case Variant::PACKED_INT32_ARRAY:
+ return get_int32_array(v);
+ case Variant::PACKED_INT64_ARRAY:
+ return get_int64_array(v);
+ case Variant::PACKED_FLOAT32_ARRAY:
+ return get_float32_array(v);
+ case Variant::PACKED_FLOAT64_ARRAY:
+ return get_float64_array(v);
+ case Variant::PACKED_STRING_ARRAY:
+ return get_string_array(v);
+ case Variant::PACKED_VECTOR2_ARRAY:
+ return get_vector2_array(v);
+ case Variant::PACKED_VECTOR3_ARRAY:
+ return get_vector3_array(v);
+ case Variant::PACKED_COLOR_ARRAY:
+ return get_color_array(v);
+ case Variant::OBJECT:
+ return v->_get_obj().obj;
+ case Variant::VARIANT_MAX:
+ ERR_FAIL_V(nullptr);
+ }
+ ERR_FAIL_V(nullptr);
+ }
};
template <class T>