summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-11-06 11:02:40 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-11-06 11:02:40 -0300
commitfc676fa6f8de6b0b24cf54ecfa3f9221c607095c (patch)
tree61f54bf6c962b21c9047b26cc740e684db967d25
parent0dbedd18fc62f700e92a4cf581e505d849bc47ad (diff)
missing files with fixes for shower of bullets
-rw-r--r--drivers/theoraplayer/src/TheoraVideoClip.cpp2
-rw-r--r--drivers/theoraplayer/video_stream_theoraplayer.cpp18
-rw-r--r--scene/2d/area_2d.cpp4
-rw-r--r--servers/physics_2d/space_2d_sw.cpp2
4 files changed, 18 insertions, 8 deletions
diff --git a/drivers/theoraplayer/src/TheoraVideoClip.cpp b/drivers/theoraplayer/src/TheoraVideoClip.cpp
index 3ee4b83370..b71319e6a1 100644
--- a/drivers/theoraplayer/src/TheoraVideoClip.cpp
+++ b/drivers/theoraplayer/src/TheoraVideoClip.cpp
@@ -75,7 +75,7 @@ TheoraVideoClip::~TheoraVideoClip()
if (mAudioInterface)
{
mAudioMutex->lock(); // ensure a thread isn't using this mutex
- memdelete(mAudioInterface); // notify audio interface it's time to call it a day
+ delete mAudioInterface; // notify audio interface it's time to call it a day
mAudioMutex ->unlock();
delete mAudioMutex;
}
diff --git a/drivers/theoraplayer/video_stream_theoraplayer.cpp b/drivers/theoraplayer/video_stream_theoraplayer.cpp
index 8cb393b79b..fdf612ff0f 100644
--- a/drivers/theoraplayer/video_stream_theoraplayer.cpp
+++ b/drivers/theoraplayer/video_stream_theoraplayer.cpp
@@ -240,6 +240,11 @@ public:
owner->setTimer(this);
};
+ void stop() {
+
+ stream->stop();
+ };
+
void update(float time_increase)
{
mTime = (float)(stream->get_total_wrote() / channels) / freq;
@@ -257,7 +262,7 @@ public:
TheoraAudioInterface* createInstance(TheoraVideoClip* owner, int nChannels, int freq) {
printf("************** creating audio output\n");
- TheoraAudioInterface* ta = memnew(TPAudioGodot(owner, nChannels, freq));
+ TheoraAudioInterface* ta = new TPAudioGodot(owner, nChannels, freq);
return ta;
};
};
@@ -267,13 +272,16 @@ static TPAudioGodotFactory* audio_factory = NULL;
void VideoStreamTheoraplayer::stop() {
playing = false;
- if (clip)
+ if (clip) {
+ clip->stop();
clip->seek(0);
+ };
};
void VideoStreamTheoraplayer::play() {
playing = true;
+ started = true;
};
bool VideoStreamTheoraplayer::is_playing() const {
@@ -452,12 +460,14 @@ void VideoStreamTheoraplayer::set_file(const String& p_file) {
VideoStreamTheoraplayer::~VideoStreamTheoraplayer() {
- //if (mgr) {
+ stop();
+ //if (mgr) { // this should be a singleton or static or something
// memdelete(mgr);
//};
//mgr = NULL;
if (clip) {
- delete clip; // created by video manager with new
+ mgr->destroyVideoClip(clip);
+ clip = NULL;
};
};
diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp
index 48fa74cc6d..33176c4f34 100644
--- a/scene/2d/area_2d.cpp
+++ b/scene/2d/area_2d.cpp
@@ -162,7 +162,7 @@ void Area2D::_body_inout(int p_status,const RID& p_body, int p_instance, int p_b
E->get().shapes.insert(ShapePair(p_body_shape,p_area_shape));
- if (E->get().in_tree) {
+ if (!node || E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_enter_shape,objid,node,p_body_shape,p_area_shape);
}
@@ -188,7 +188,7 @@ void Area2D::_body_inout(int p_status,const RID& p_body, int p_instance, int p_b
eraseit=true;
}
- if (node && E->get().in_tree) {
+ if (!node || E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_exit_shape,objid,obj,p_body_shape,p_area_shape);
}
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp
index 8b72436936..b642242d02 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -437,6 +437,7 @@ Physics2DDirectSpaceStateSW::Physics2DDirectSpaceStateSW() {
void* Space2DSW::_broadphase_pair(CollisionObject2DSW *A,int p_subindex_A,CollisionObject2DSW *B,int p_subindex_B,void *p_self) {
+
CollisionObject2DSW::Type type_A=A->get_type();
CollisionObject2DSW::Type type_B=B->get_type();
if (type_A>type_B) {
@@ -451,7 +452,6 @@ void* Space2DSW::_broadphase_pair(CollisionObject2DSW *A,int p_subindex_A,Collis
if (type_A==CollisionObject2DSW::TYPE_AREA) {
-
ERR_FAIL_COND_V(type_B!=CollisionObject2DSW::TYPE_BODY,NULL);
Area2DSW *area=static_cast<Area2DSW*>(A);
Body2DSW *body=static_cast<Body2DSW*>(B);