#include "supertux/sector.hpp"
#include "util/reader.hpp"
-AmbientSound::AmbientSound(const Reader& lisp)
+AmbientSound::AmbientSound(const Reader& lisp) :
+ name(),
+ position(),
+ dimension(),
+ sample(),
+ sound_source(),
+ latency(),
+ distance_factor(),
+ distance_bias(),
+ silence_distance(),
+ maximumvolume(),
+ targetvolume(),
+ currentvolume(),
+ volume_ptr()
{
name="";
position.x = 0;
latency=0;
}
-AmbientSound::AmbientSound(Vector pos, float factor, float bias, float vol, std::string file)
+AmbientSound::AmbientSound(Vector pos, float factor, float bias, float vol, std::string file) :
+ name(),
+ position(),
+ dimension(),
+ sample(),
+ sound_source(),
+ latency(),
+ distance_factor(),
+ distance_bias(),
+ silence_distance(),
+ maximumvolume(),
+ targetvolume(),
+ currentvolume(),
+ volume_ptr()
{
position.x=pos.x;
position.y=pos.y;
latency=0;
}
-AmbientSound::~AmbientSound() {
+AmbientSound::~AmbientSound()
+{
stop_playing();
}
}
void
-AmbientSound::stop_playing() {
+AmbientSound::stop_playing()
+{
delete sound_source;
sound_source = 0;
}