From 2f3328a039ac31368dfc9d93ae95702c0d9db827 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Sat, 6 Apr 2019 16:12:59 +0200 Subject: [PATCH] Fix wrong method binds and registered class --- core/class_db.cpp | 5 +++++ core/class_db.h | 1 + modules/assimp/register_types.cpp | 6 ++++++ modules/mono/glue/base_object_glue.cpp | 2 +- scene/2d/animated_sprite.cpp | 2 +- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/class_db.cpp b/core/class_db.cpp index 219bdbddd82..f7b446707d9 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -249,6 +249,11 @@ void ClassDB::set_current_api(APIType p_api) { current_api = p_api; } +ClassDB::APIType ClassDB::get_current_api() { + + return current_api; +} + HashMap ClassDB::classes; HashMap ClassDB::resource_base_extensions; HashMap ClassDB::compat_classes; diff --git a/core/class_db.h b/core/class_db.h index 321682d76b6..f18a7113d72 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -371,6 +371,7 @@ public: static void init(); static void set_current_api(APIType p_api); + static APIType get_current_api(); static void cleanup(); }; diff --git a/modules/assimp/register_types.cpp b/modules/assimp/register_types.cpp index 0afb1e72bf8..2e8181372ea 100644 --- a/modules/assimp/register_types.cpp +++ b/modules/assimp/register_types.cpp @@ -44,7 +44,13 @@ static void _editor_init() { void register_assimp_types() { #ifdef TOOLS_ENABLED + ClassDB::APIType prev_api = ClassDB::get_current_api(); + ClassDB::set_current_api(ClassDB::API_EDITOR); + ClassDB::register_class(); + + ClassDB::set_current_api(prev_api); + EditorNode::add_init_callback(_editor_init); #endif } diff --git a/modules/mono/glue/base_object_glue.cpp b/modules/mono/glue/base_object_glue.cpp index b690de0d204..7f367fa0953 100644 --- a/modules/mono/glue/base_object_glue.cpp +++ b/modules/mono/glue/base_object_glue.cpp @@ -192,7 +192,7 @@ MonoBoolean godot_icall_DynamicGodotObject_InvokeMember(Object *p_ptr, MonoStrin *r_result = GDMonoMarshal::variant_to_mono_object(result); - return error.error == OK; + return error.error == Variant::CallError::CALL_OK; } MonoBoolean godot_icall_DynamicGodotObject_GetMember(Object *p_ptr, MonoString *p_name, MonoObject **r_result) { diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 7a50574be20..932db8f0011 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -679,7 +679,7 @@ void AnimatedSprite::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_playing", "playing"), &AnimatedSprite::_set_playing); ClassDB::bind_method(D_METHOD("_is_playing"), &AnimatedSprite::_is_playing); - ClassDB::bind_method(D_METHOD("play", "anim", "backwards"), &AnimatedSprite::play, DEFVAL(StringName())); + ClassDB::bind_method(D_METHOD("play", "anim", "backwards"), &AnimatedSprite::play, DEFVAL(StringName()), DEFVAL(false)); ClassDB::bind_method(D_METHOD("stop"), &AnimatedSprite::stop); ClassDB::bind_method(D_METHOD("is_playing"), &AnimatedSprite::is_playing);