summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/extension/native_extension.cpp7
-rw-r--r--core/math/audio_frame.h2
-rw-r--r--core/object/object.cpp35
-rw-r--r--core/object/object.h3
4 files changed, 46 insertions, 1 deletions
diff --git a/core/extension/native_extension.cpp b/core/extension/native_extension.cpp
index ac9d2ca8a6..ebdfa20725 100644
--- a/core/extension/native_extension.cpp
+++ b/core/extension/native_extension.cpp
@@ -281,6 +281,7 @@ void NativeExtension::_get_library_path(const GDNativeExtensionClassLibraryPtr p
Error NativeExtension::open_library(const String &p_path, const String &p_entry_symbol) {
Error err = OS::get_singleton()->open_dynamic_library(p_path, library, true, &library_path);
if (err != OK) {
+ ERR_PRINT("GDExtension dynamic library not found: " + p_path);
return err;
}
@@ -289,6 +290,7 @@ Error NativeExtension::open_library(const String &p_path, const String &p_entry_
err = OS::get_singleton()->get_dynamic_library_symbol_handle(library, p_entry_symbol, entry_funcptr, false);
if (err != OK) {
+ ERR_PRINT("GDExtension entry point '" + p_entry_symbol + "' not found in library " + p_path);
OS::get_singleton()->close_dynamic_library(library);
return err;
}
@@ -299,6 +301,7 @@ Error NativeExtension::open_library(const String &p_path, const String &p_entry_
level_initialized = -1;
return OK;
} else {
+ ERR_PRINT("GDExtension initialization function '" + p_entry_symbol + "' returned an error.");
return FAILED;
}
}
@@ -387,6 +390,7 @@ Ref<Resource> NativeExtensionResourceLoader::load(const String &p_path, const St
}
if (err != OK) {
+ ERR_PRINT("Error loading GDExtension config file: " + p_path);
return Ref<Resource>();
}
@@ -394,6 +398,7 @@ Ref<Resource> NativeExtensionResourceLoader::load(const String &p_path, const St
if (r_error) {
*r_error = ERR_INVALID_DATA;
}
+ ERR_PRINT("GDExtension config file must contain 'configuration.entry_symbol' key: " + p_path);
return Ref<Resource>();
}
@@ -426,6 +431,7 @@ Ref<Resource> NativeExtensionResourceLoader::load(const String &p_path, const St
if (r_error) {
*r_error = ERR_FILE_NOT_FOUND;
}
+ ERR_PRINT("No GDExtension library found for current architecture; in config file " + p_path);
return Ref<Resource>();
}
@@ -443,6 +449,7 @@ Ref<Resource> NativeExtensionResourceLoader::load(const String &p_path, const St
}
if (err != OK) {
+ // Errors already logged in open_library()
return Ref<Resource>();
}
diff --git a/core/math/audio_frame.h b/core/math/audio_frame.h
index 8b244e9fe4..b3d63c0094 100644
--- a/core/math/audio_frame.h
+++ b/core/math/audio_frame.h
@@ -52,7 +52,7 @@ static const float AUDIO_MIN_PEAK_DB = -200.0f; // linear2db(AUDIO_PEAK_OFFSET)
struct AudioFrame {
//left and right samples
- float l, r;
+ float l = 0.f, r = 0.f;
_ALWAYS_INLINE_ const float &operator[](int idx) const { return idx == 0 ? l : r; }
_ALWAYS_INLINE_ float &operator[](int idx) { return idx == 0 ? l : r; }
diff --git a/core/object/object.cpp b/core/object/object.cpp
index 9dec417b11..96469db8c6 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -209,6 +209,17 @@ MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const
arguments.push_back(p_param5);
}
+MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5, const PropertyInfo &p_param6) :
+ name(p_name),
+ flags(METHOD_FLAG_NORMAL) {
+ arguments.push_back(p_param1);
+ arguments.push_back(p_param2);
+ arguments.push_back(p_param3);
+ arguments.push_back(p_param4);
+ arguments.push_back(p_param5);
+ arguments.push_back(p_param6);
+}
+
MethodInfo::MethodInfo(Variant::Type ret) :
flags(METHOD_FLAG_NORMAL) {
return_val.type = ret;
@@ -265,6 +276,18 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyIn
arguments.push_back(p_param5);
}
+MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5, const PropertyInfo &p_param6) :
+ name(p_name),
+ flags(METHOD_FLAG_NORMAL) {
+ return_val.type = ret;
+ arguments.push_back(p_param1);
+ arguments.push_back(p_param2);
+ arguments.push_back(p_param3);
+ arguments.push_back(p_param4);
+ arguments.push_back(p_param5);
+ arguments.push_back(p_param6);
+}
+
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name) :
name(p_name),
return_val(p_ret),
@@ -316,6 +339,18 @@ MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const Pr
arguments.push_back(p_param5);
}
+MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5, const PropertyInfo &p_param6) :
+ name(p_name),
+ return_val(p_ret),
+ flags(METHOD_FLAG_NORMAL) {
+ arguments.push_back(p_param1);
+ arguments.push_back(p_param2);
+ arguments.push_back(p_param3);
+ arguments.push_back(p_param4);
+ arguments.push_back(p_param5);
+ arguments.push_back(p_param6);
+}
+
Object::Connection::operator Variant() const {
Dictionary d;
d["signal"] = signal;
diff --git a/core/object/object.h b/core/object/object.h
index 7cbedd29d9..8117783fae 100644
--- a/core/object/object.h
+++ b/core/object/object.h
@@ -225,6 +225,7 @@ struct MethodInfo {
MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3);
MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4);
MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5);
+ MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5, const PropertyInfo &p_param6);
MethodInfo(Variant::Type ret);
MethodInfo(Variant::Type ret, const String &p_name);
MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1);
@@ -232,12 +233,14 @@ struct MethodInfo {
MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3);
MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4);
MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5);
+ MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5, const PropertyInfo &p_param6);
MethodInfo(const PropertyInfo &p_ret, const String &p_name);
MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1);
MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2);
MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3);
MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4);
MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5);
+ MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5, const PropertyInfo &p_param6);
};
// API used to extend in GDNative and other C compatible compiled languages.