summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorreduz <juan@okamstudio.com>2015-12-26 10:27:04 -0300
committerreduz <juan@okamstudio.com>2015-12-26 10:27:04 -0300
commit9d9520f227d58c2499e906d72002cf631e40f4c8 (patch)
treed2f238c5048c4aeb199e28b39117559ccd42318c /scene
parent13964f59c1359473980916ea1f930fef1c28331a (diff)
parentdfd7bdb00528eb9a45e21a5c99d0e76bd642e74c (diff)
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/area_2d.cpp2
-rw-r--r--scene/2d/area_2d.h4
-rw-r--r--scene/3d/area.cpp2
-rw-r--r--scene/3d/area.h4
-rw-r--r--scene/audio/stream_player.cpp7
-rw-r--r--scene/audio/stream_player.h1
6 files changed, 15 insertions, 5 deletions
diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp
index c44b46adbf..5038752b22 100644
--- a/scene/2d/area_2d.cpp
+++ b/scene/2d/area_2d.cpp
@@ -652,7 +652,7 @@ void Area2D::_bind_methods() {
ADD_SIGNAL( MethodInfo("area_exit",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D")));
- ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"space_override",PROPERTY_HINT_ENUM,"Disabled,Combine,Replace"),_SCS("set_space_override_mode"),_SCS("get_space_override_mode"));
+ ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"space_override",PROPERTY_HINT_ENUM,"Disabled,Combine,Combine-Replace,Replace,Replace-Combine"),_SCS("set_space_override_mode"),_SCS("get_space_override_mode"));
ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"gravity_point"),_SCS("set_gravity_is_point"),_SCS("is_gravity_a_point"));
ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"gravity_distance_scale", PROPERTY_HINT_RANGE,"0,1024,0.001"),_SCS("set_gravity_distance_scale"),_SCS("get_gravity_distance_scale"));
ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"gravity_vec"),_SCS("set_gravity_vector"),_SCS("get_gravity_vector"));
diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h
index f5a88390e7..2b74655109 100644
--- a/scene/2d/area_2d.h
+++ b/scene/2d/area_2d.h
@@ -40,7 +40,9 @@ public:
enum SpaceOverride {
SPACE_OVERRIDE_DISABLED,
SPACE_OVERRIDE_COMBINE,
- SPACE_OVERRIDE_REPLACE
+ SPACE_OVERRIDE_COMBINE_REPLACE,
+ SPACE_OVERRIDE_REPLACE,
+ SPACE_OVERRIDE_REPLACE_COMBINE
};
private:
diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp
index ff35837bc0..47cebd25a2 100644
--- a/scene/3d/area.cpp
+++ b/scene/3d/area.cpp
@@ -579,7 +579,7 @@ void Area::_bind_methods() {
ADD_SIGNAL( MethodInfo("area_enter",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area")));
ADD_SIGNAL( MethodInfo("area_exit",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area")));
- ADD_PROPERTY( PropertyInfo(Variant::INT,"space_override",PROPERTY_HINT_ENUM,"Disabled,Combine,Replace"),_SCS("set_space_override_mode"),_SCS("get_space_override_mode"));
+ ADD_PROPERTY( PropertyInfo(Variant::INT,"space_override",PROPERTY_HINT_ENUM,"Disabled,Combine,Combine-Replace,Replace,Replace-Combine"),_SCS("set_space_override_mode"),_SCS("get_space_override_mode"));
ADD_PROPERTY( PropertyInfo(Variant::BOOL,"gravity_point"),_SCS("set_gravity_is_point"),_SCS("is_gravity_a_point"));
ADD_PROPERTY( PropertyInfo(Variant::REAL,"gravity_distance_scale", PROPERTY_HINT_RANGE,"0,1024,0.001"),_SCS("set_gravity_distance_scale"),_SCS("get_gravity_distance_scale"));
ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"gravity_vec"),_SCS("set_gravity_vector"),_SCS("get_gravity_vector"));
diff --git a/scene/3d/area.h b/scene/3d/area.h
index f03955d1e7..529a116937 100644
--- a/scene/3d/area.h
+++ b/scene/3d/area.h
@@ -40,7 +40,9 @@ public:
enum SpaceOverride {
SPACE_OVERRIDE_DISABLED,
SPACE_OVERRIDE_COMBINE,
- SPACE_OVERRIDE_REPLACE
+ SPACE_OVERRIDE_COMBINE_REPLACE,
+ SPACE_OVERRIDE_REPLACE,
+ SPACE_OVERRIDE_REPLACE_COMBINE
};
private:
diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp
index 4cfca0492a..d08fdd0c76 100644
--- a/scene/audio/stream_player.cpp
+++ b/scene/audio/stream_player.cpp
@@ -75,7 +75,10 @@ void StreamPlayer::sp_update() {
//check that all this audio has been flushed before stopping the stream
int to_mix = resampler.get_total() - resampler.get_todo();
if (to_mix==0) {
- stop();
+ if (!stop_request) {
+ stop_request=true;
+ call_deferred("stop");
+ }
return;
}
@@ -164,6 +167,7 @@ void StreamPlayer::stop() {
//_THREAD_SAFE_METHOD_
AudioServer::get_singleton()->stream_set_active(stream_rid,false);
+ stop_request=false;
playback->stop();
resampler.flush();
@@ -389,6 +393,7 @@ StreamPlayer::StreamPlayer() {
stream_rid=AudioServer::get_singleton()->audio_stream_create(&internal_stream);
buffering_ms=500;
loop_point=0;
+ stop_request=false;
}
diff --git a/scene/audio/stream_player.h b/scene/audio/stream_player.h
index be090f50e1..0a29e78de7 100644
--- a/scene/audio/stream_player.h
+++ b/scene/audio/stream_player.h
@@ -66,6 +66,7 @@ class StreamPlayer : public Node {
float volume;
float loop_point;
int buffering_ms;
+ volatile bool stop_request;
AudioRBResampler resampler;