diff options
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/area_2d.cpp | 10 | ||||
-rw-r--r-- | scene/2d/area_2d.h | 4 | ||||
-rw-r--r-- | scene/2d/audio_stream_player_2d.cpp | 8 | ||||
-rw-r--r-- | scene/2d/audio_stream_player_2d.h | 2 | ||||
-rw-r--r-- | scene/2d/collision_object_2d.cpp | 2 |
5 files changed, 13 insertions, 13 deletions
diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 9fc6c8d23a..9ee77a710c 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -557,12 +557,12 @@ bool Area2D::is_overriding_audio_bus() const { return audio_bus_override; } -void Area2D::set_audio_bus(const StringName &p_audio_bus) { +void Area2D::set_audio_bus_name(const StringName &p_audio_bus) { audio_bus = p_audio_bus; } -StringName Area2D::get_audio_bus() const { +StringName Area2D::get_audio_bus_name() const { for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { if (AudioServer::get_singleton()->get_bus_name(i) == audio_bus) { @@ -644,8 +644,8 @@ void Area2D::_bind_methods() { ClassDB::bind_method(D_METHOD("overlaps_body", "body"), &Area2D::overlaps_body); ClassDB::bind_method(D_METHOD("overlaps_area", "area"), &Area2D::overlaps_area); - ClassDB::bind_method(D_METHOD("set_audio_bus", "name"), &Area2D::set_audio_bus); - ClassDB::bind_method(D_METHOD("get_audio_bus"), &Area2D::get_audio_bus); + ClassDB::bind_method(D_METHOD("set_audio_bus_name", "name"), &Area2D::set_audio_bus_name); + ClassDB::bind_method(D_METHOD("get_audio_bus_name"), &Area2D::get_audio_bus_name); ClassDB::bind_method(D_METHOD("set_audio_bus_override", "enable"), &Area2D::set_audio_bus_override); ClassDB::bind_method(D_METHOD("is_overriding_audio_bus"), &Area2D::is_overriding_audio_bus); @@ -679,7 +679,7 @@ void Area2D::_bind_methods() { ADD_GROUP("Audio Bus", "audio_bus_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "audio_bus_override"), "set_audio_bus_override", "is_overriding_audio_bus"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "audio_bus_name", PROPERTY_HINT_ENUM, ""), "set_audio_bus", "get_audio_bus"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "audio_bus_name", PROPERTY_HINT_ENUM, ""), "set_audio_bus_name", "get_audio_bus_name"); BIND_ENUM_CONSTANT(SPACE_OVERRIDE_DISABLED); BIND_ENUM_CONSTANT(SPACE_OVERRIDE_COMBINE); diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h index c56cf651a1..09ccb364e6 100644 --- a/scene/2d/area_2d.h +++ b/scene/2d/area_2d.h @@ -186,8 +186,8 @@ public: void set_audio_bus_override(bool p_override); bool is_overriding_audio_bus() const; - void set_audio_bus(const StringName &p_audio_bus); - StringName get_audio_bus() const; + void set_audio_bus_name(const StringName &p_audio_bus); + StringName get_audio_bus_name() const; Area2D(); ~Area2D(); diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index 4b108996f0..c40aeb764e 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -145,7 +145,7 @@ void AudioStreamPlayer2D::_notification(int p_what) { if (!area2d->is_overriding_audio_bus()) continue; - StringName bus_name = area2d->get_audio_bus(); + StringName bus_name = area2d->get_audio_bus_name(); bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus_name); break; } @@ -284,10 +284,10 @@ bool AudioStreamPlayer2D::is_playing() const { return false; } -float AudioStreamPlayer2D::get_position() { +float AudioStreamPlayer2D::get_playback_position() { if (stream_playback.is_valid()) { - return stream_playback->get_position(); + return stream_playback->get_playback_position(); } return 0; @@ -395,7 +395,7 @@ void AudioStreamPlayer2D::_bind_methods() { ClassDB::bind_method(D_METHOD("stop"), &AudioStreamPlayer2D::stop); ClassDB::bind_method(D_METHOD("is_playing"), &AudioStreamPlayer2D::is_playing); - ClassDB::bind_method(D_METHOD("get_position"), &AudioStreamPlayer2D::get_position); + ClassDB::bind_method(D_METHOD("get_playback_position"), &AudioStreamPlayer2D::get_playback_position); ClassDB::bind_method(D_METHOD("set_bus", "bus"), &AudioStreamPlayer2D::set_bus); ClassDB::bind_method(D_METHOD("get_bus"), &AudioStreamPlayer2D::get_bus); diff --git a/scene/2d/audio_stream_player_2d.h b/scene/2d/audio_stream_player_2d.h index 112d05856b..85104fce21 100644 --- a/scene/2d/audio_stream_player_2d.h +++ b/scene/2d/audio_stream_player_2d.h @@ -72,7 +72,7 @@ public: void seek(float p_seconds); void stop(); bool is_playing() const; - float get_position(); + float get_playback_position(); void set_bus(const StringName &p_bus); StringName get_bus() const; diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index ce56b85a9e..73e5dc6021 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -82,7 +82,7 @@ uint32_t CollisionObject2D::create_shape_owner(Object *p_owner) { uint32_t id; if (shapes.size() == 0) { - id = 1; + id = 0; } else { id = shapes.back()->key() + 1; } |