summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/reference.h6
-rw-r--r--modules/gdnative/gdnative.cpp3
-rw-r--r--modules/gdnative/godot/gdnative.h1
-rw-r--r--servers/SCsub2
4 files changed, 7 insertions, 5 deletions
diff --git a/core/reference.h b/core/reference.h
index 4e2d6c36c0..90f2791f4b 100644
--- a/core/reference.h
+++ b/core/reference.h
@@ -330,7 +330,7 @@ struct PtrToArg<Ref<T> > {
_FORCE_INLINE_ static Ref<T> convert(const void *p_ptr) {
- return Ref<T>(reinterpret_cast<const T *>(p_ptr));
+ return Ref<T>(const_cast<T *>(reinterpret_cast<const T *>(p_ptr)));
}
_FORCE_INLINE_ static void encode(Ref<T> p_val, const void *p_ptr) {
@@ -355,7 +355,7 @@ struct PtrToArg<RefPtr> {
_FORCE_INLINE_ static RefPtr convert(const void *p_ptr) {
- return Ref<Reference>(reinterpret_cast<const Reference *>(p_ptr)).get_ref_ptr();
+ return Ref<Reference>(const_cast<Reference *>(reinterpret_cast<const Reference *>(p_ptr))).get_ref_ptr();
}
_FORCE_INLINE_ static void encode(RefPtr p_val, const void *p_ptr) {
@@ -370,7 +370,7 @@ struct PtrToArg<const RefPtr &> {
_FORCE_INLINE_ static RefPtr convert(const void *p_ptr) {
- return Ref<Reference>(reinterpret_cast<const Reference *>(p_ptr)).get_ref_ptr();
+ return Ref<Reference>(const_cast<Reference *>(reinterpret_cast<const Reference *>(p_ptr))).get_ref_ptr();
}
};
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp
index e810c33f1c..158f7fd94d 100644
--- a/modules/gdnative/gdnative.cpp
+++ b/modules/gdnative/gdnative.cpp
@@ -185,6 +185,8 @@ void GDNative::_bind_methods() {
}
void GDNative::set_library(Ref<GDNativeLibrary> p_library) {
+ ERR_EXPLAIN("Tried to change library of GDNative when it is already set");
+ ERR_FAIL_COND(library.is_valid());
library = p_library;
}
@@ -229,6 +231,7 @@ bool GDNative::initialize() {
options.core_api_hash = ClassDB::get_api_hash(ClassDB::API_CORE);
options.editor_api_hash = ClassDB::get_api_hash(ClassDB::API_EDITOR);
options.no_api_hash = ClassDB::get_api_hash(ClassDB::API_NONE);
+ options.gd_native_library = (godot_object *)(get_library().ptr());
library_init_fpointer(&options);
diff --git a/modules/gdnative/godot/gdnative.h b/modules/gdnative/godot/gdnative.h
index 510bf36cd4..b0343272ef 100644
--- a/modules/gdnative/godot/gdnative.h
+++ b/modules/gdnative/godot/gdnative.h
@@ -265,6 +265,7 @@ typedef struct {
uint64_t core_api_hash;
uint64_t editor_api_hash;
uint64_t no_api_hash;
+ godot_object *gd_native_library; // pointer to GDNativeLibrary that is being initialized
} godot_gdnative_init_options;
typedef struct {
diff --git a/servers/SCsub b/servers/SCsub
index eefa6278c4..df2daf7223 100644
--- a/servers/SCsub
+++ b/servers/SCsub
@@ -11,8 +11,6 @@ SConscript('physics/SCsub')
SConscript('physics_2d/SCsub')
SConscript('visual/SCsub')
SConscript('audio/SCsub')
-SConscript('spatial_sound/SCsub')
-SConscript('spatial_sound_2d/SCsub')
lib = env.Library("servers", env.servers_sources)