summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-06-18 21:07:32 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-06-18 21:07:32 -0300
commit969fa3cc73e3523fe066357b4f45ca0b52353fea (patch)
tree5d444538763e68e093c38a35580ad45a9c268bbb /scene/resources
parent33bf180067eb0beb1a514adcdfb6a59cc5f4ac55 (diff)
-Added AudioStreamPlayer2D, for 2D positional sound
-Added ability for Area2D to redirect positional sound to a specific audio bus
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/world_2d.cpp7
-rw-r--r--scene/resources/world_2d.h4
2 files changed, 6 insertions, 5 deletions
diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp
index ec9ec96e50..36d2a38b3d 100644
--- a/scene/resources/world_2d.cpp
+++ b/scene/resources/world_2d.cpp
@@ -360,16 +360,17 @@ RID World2D::get_space() {
return space;
}
-RID World2D::get_sound_space() {
+void World2D::get_viewport_list(List<Viewport *> *r_viewports) {
- return sound_space;
+ for (Map<Viewport *, SpatialIndexer2D::ViewportData>::Element *E = indexer->viewports.front(); E; E = E->next()) {
+ r_viewports->push_back(E->key());
+ }
}
void World2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_canvas"), &World2D::get_canvas);
ClassDB::bind_method(D_METHOD("get_space"), &World2D::get_space);
- ClassDB::bind_method(D_METHOD("get_sound_space"), &World2D::get_sound_space);
ClassDB::bind_method(D_METHOD("get_direct_space_state:Physics2DDirectSpaceState"), &World2D::get_direct_space_state);
}
diff --git a/scene/resources/world_2d.h b/scene/resources/world_2d.h
index 2b6e7e7383..35c8ce390f 100644
--- a/scene/resources/world_2d.h
+++ b/scene/resources/world_2d.h
@@ -44,7 +44,6 @@ class World2D : public Resource {
RID canvas;
RID space;
- RID sound_space;
SpatialIndexer2D *indexer;
@@ -66,10 +65,11 @@ protected:
public:
RID get_canvas();
RID get_space();
- RID get_sound_space();
Physics2DDirectSpaceState *get_direct_space_state();
+ void get_viewport_list(List<Viewport *> *r_viewports);
+
World2D();
~World2D();
};