X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsoundscape.cpp;h=0b126ac01bde48190480adb6a0f94fce5568652c;hb=2a685e572e2ab8d9f50129de3f0869628edb3d8e;hp=694c8842231f30e5b077e0de42eac82c3da0af31;hpb=72a8ee9c7d0ff973b20a27184b0c493d3fd5ae59;p=libs%2Fal.git diff --git a/source/soundscape.cpp b/source/soundscape.cpp index 694c884..0b126ac 100644 --- a/source/soundscape.cpp +++ b/source/soundscape.cpp @@ -2,7 +2,7 @@ This file is part of libmspal Copyright © 2008 Mikko Rasa, Mikkosoft Productions -Diestributed under the LGPL +Distributed under the LGPL */ #include "source.h" @@ -19,19 +19,19 @@ SoundScape::~SoundScape() delete *i; } -void SoundScape::add_source(Source *src) +void SoundScape::add_source(Source &src) { - sources.push_back(src); + sources.push_back(&src); } -Source *SoundScape::play(const Buffer &buf, float x, float y, float z) +Source &SoundScape::play(const Buffer &buf, float x, float y, float z) { - Source *src=new Source; - add_source(src); + Source *src = new Source; + add_source(*src); src->set_buffer(buf); src->set_position(x, y, z); src->play(); - return src; + return *src; } void SoundScape::tick() @@ -41,7 +41,7 @@ void SoundScape::tick() if((*i)->get_state()==STOPPED) { delete *i; - i=sources.erase(i); + i = sources.erase(i); } else ++i;