Skip to content

Commit

Permalink
Fix wrong method binds and registered class
Browse files Browse the repository at this point in the history
  • Loading branch information
neikeq committed Apr 6, 2019
1 parent 74719b8 commit 2f3328a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions core/class_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<StringName, ClassDB::ClassInfo> ClassDB::classes;
HashMap<StringName, StringName> ClassDB::resource_base_extensions;
HashMap<StringName, StringName> ClassDB::compat_classes;
Expand Down
1 change: 1 addition & 0 deletions core/class_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ class ClassDB {
static void init();

static void set_current_api(APIType p_api);
static APIType get_current_api();
static void cleanup();
};

Expand Down
6 changes: 6 additions & 0 deletions modules/assimp/register_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<EditorSceneImporterAssimp>();

ClassDB::set_current_api(prev_api);

EditorNode::add_init_callback(_editor_init);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion modules/mono/glue/base_object_glue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/animated_sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2f3328a

Please sign in to comment.