summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2020-03-14 19:20:17 +0100
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2020-03-17 16:30:04 +0100
commit6a85cdf640d735b1ca8216b4c6e16fb949f4d183 (patch)
treeafc06540f53d6d2f7ede36fc8383330dee149262 /core
parent0159787864e7ecce60a4d3142f5c82e024710f89 (diff)
Fix C# bindings after recent breaking changes
Implementation for new Variant types Callable, Signal, StringName. Added support for PackedInt64Array and PackedFloat64Array. Add generation of signal members as events, as well as support for user created signals as events. NOTE: As of now, raising such events will not emit the signal. As such, one must use `EmitSignal` instead of raising the event directly. Removed old ThreadLocal fallback class. It's safe to use thread_local now since it's supported on all minimum versions of compilers we support.
Diffstat (limited to 'core')
-rw-r--r--core/callable.cpp6
-rw-r--r--core/callable.h1
-rw-r--r--core/type_info.h2
3 files changed, 8 insertions, 1 deletions
diff --git a/core/callable.cpp b/core/callable.cpp
index 4a5ae3a248..2bb9ab167b 100644
--- a/core/callable.cpp
+++ b/core/callable.cpp
@@ -78,6 +78,12 @@ StringName Callable::get_method() const {
return method;
}
+CallableCustom *Callable::get_custom() const {
+ ERR_FAIL_COND_V_MSG(!is_custom(), NULL,
+ vformat("Can't get custom on non-CallableCustom \"%s\".", operator String()));
+ return custom;
+}
+
uint32_t Callable::hash() const {
if (is_custom()) {
return custom->hash();
diff --git a/core/callable.h b/core/callable.h
index cecf2264a3..7fa024dccd 100644
--- a/core/callable.h
+++ b/core/callable.h
@@ -84,6 +84,7 @@ public:
Object *get_object() const;
ObjectID get_object_id() const;
StringName get_method() const;
+ CallableCustom *get_custom() const;
uint32_t hash() const;
diff --git a/core/type_info.h b/core/type_info.h
index 618419a323..3b08ff3cae 100644
--- a/core/type_info.h
+++ b/core/type_info.h
@@ -174,7 +174,7 @@ MAKE_TYPE_INFO(IP_Address, Variant::STRING)
template <>
struct GetTypeInfo<ObjectID> {
static const Variant::Type VARIANT_TYPE = Variant::INT;
- static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE;
+ static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_INT_IS_UINT64;
static inline PropertyInfo get_class_info() {
return PropertyInfo(Variant::INT, String(), PROPERTY_HINT_INT_IS_OBJECTID);
}