Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/sound/AmbientSound.cc

    r10624 r11071  
    9292        {
    9393            const std::string& path = "ambient/" + mood + '/' + this->ambientSource_;
    94             shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path);
    95             if (fileInfo != NULL)
     94            std::shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path);
     95            if (fileInfo != nullptr)
    9696            {
    9797                orxout(user_info) << "Loading ambient sound " << path << "..." << endl; // TODO: make this output internal if we implement sound streaming
  • code/trunk/src/orxonox/sound/AmbientSound.h

    r9939 r11071  
    5050        AmbientSound();
    5151
    52         void play();
    53         bool stop();
    54         void pause();
     52        virtual void play() override;
     53        virtual bool stop() override;
     54        virtual void pause() override;
    5555
    5656        bool setAmbientSource(const std::string& source);
     
    6666
    6767    private:
    68         void preDestroy();
    69         float getRealVolume();
    70         bool moodChanged(const std::string& mood);
     68        virtual void preDestroy() override;
     69        virtual float getRealVolume() override;
     70        virtual bool moodChanged(const std::string& mood) override;
    7171        inline void ambientSourceChanged()
    7272            { this->setAmbientSource(this->ambientSource_); }
  • code/trunk/src/orxonox/sound/BaseSound.cc

    r10624 r11071  
    4949        , volume_(0.7)
    5050        , bLooping_(false)
    51         , state_(Stopped)
     51        , state_(State::Stopped)
    5252        , pitch_ (1.0)
    5353    {
     
    6363    BaseSound::~BaseSound()
    6464    {
    65         if (this->state_ != Stopped)
     65        if (this->state_ != State::Stopped)
    6666            this->stop();
    6767        // Release buffer
    68         if (this->soundBuffer_ != NULL)
     68        if (this->soundBuffer_ != nullptr)
    6969        {
    7070            assert(GameMode::playsSound());
     
    8383    void BaseSound::doPlay()
    8484    {
    85         this->state_ = Playing;
    86         if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING && this->soundBuffer_ != NULL)
     85        this->state_ = State::Playing;
     86        if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING && this->soundBuffer_ != nullptr)
    8787        {
    8888            if (!alIsSource(this->audioSource_))
     
    102102    bool BaseSound::doStop()
    103103    {
    104         this->state_ = Stopped;
     104        this->state_ = State::Stopped;
    105105        if (alIsSource(this->audioSource_))
    106106        {
     
    123123        if (this->isStopped())
    124124            return;
    125         this->state_ = Paused;
     125        this->state_ = State::Paused;
    126126        if (alIsSource(this->audioSource_))
    127127            alSourcePause(this->audioSource_);
     
    151151            orxout(internal_warning, context::sound) << "Setting source parameters to 0 failed: "
    152152                                                     << SoundManager::getALErrorString(error) << endl;
    153         assert(this->soundBuffer_ != NULL);
     153        assert(this->soundBuffer_ != nullptr);
    154154        alSourcei(this->audioSource_, AL_BUFFER, this->soundBuffer_->getBuffer());
    155155        if (ALuint error = alGetError())
     
    209209        }
    210210
    211         if (this->soundBuffer_ != NULL)
     211        if (this->soundBuffer_ != nullptr)
    212212        {
    213213            if (this->soundBuffer_->getFilename() == source)
     
    233233        // Get new sound buffer
    234234        this->soundBuffer_ = SoundManager::getInstance().getSoundBuffer(this->source_);
    235         if (this->soundBuffer_ == NULL)
     235        if (this->soundBuffer_ == nullptr)
    236236            return;
    237237
     
    256256        else // No source acquired so far, but might be set to playing or paused
    257257        {
    258             State state = static_cast<State>(this->state_); // save
     258            State state = this->state_; // save
    259259            if (this->isPlaying() || this->isPaused())
    260260                doPlay();
    261             if (state == Paused)
    262             {
    263                 this->state_ = Paused;
     261            if (state == State::Paused)
     262            {
     263                this->state_ = State::Paused;
    264264                doPause();
    265265            }
     
    271271        switch (this->state_)
    272272        {
    273             case Playing:
     273            case State::Playing:
    274274                this->play();
    275275                break;
    276             case Paused:
     276            case State::Paused:
    277277                this->pause();
    278278                break;
    279             case Stopped:
     279            case State::Stopped:
    280280            default:
    281281                this->stop();
  • code/trunk/src/orxonox/sound/BaseSound.h

    r9667 r11071  
    3333
    3434#include <string>
    35 #include <boost/shared_ptr.hpp>
     35#include <memory>
    3636#include <OgreDataStream.h>
    3737#include "core/object/Listable.h"
     
    5454        virtual void pause() { this->doPause(); }
    5555
    56         bool isPlaying() const { return this->state_ == Playing; }
    57         bool isPaused()  const { return this->state_ == Paused; }
    58         bool isStopped() const { return this->state_ == Stopped; }
     56        bool isPlaying() const { return this->state_ == State::Playing; }
     57        bool isPaused()  const { return this->state_ == State::Paused; }
     58        bool isStopped() const { return this->state_ == State::Stopped; }
    5959
    6060        virtual void setSource(const std::string& source);
     
    7676
    7777    protected:
    78         enum State
     78        enum class State
    7979        {
    8080            Stopped,
     
    107107        ALuint          audioSource_;
    108108        bool            bPooling_;
    109         shared_ptr<SoundBuffer> soundBuffer_;
     109        std::shared_ptr<SoundBuffer> soundBuffer_;
    110110        std::string     source_;
    111111        float           volume_;
    112112        bool            bLooping_;
    113         uint8_t         state_;       // This Variable is actually of type State
     113        State           state_;       // This Variable is actually of type State
    114114        float           pitch_;
    115115
  • code/trunk/src/orxonox/sound/SoundBuffer.cc

    r8858 r11071  
    3939namespace orxonox
    4040{
    41     SoundBuffer::SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer> >::iterator poolIterator)
     41    SoundBuffer::SoundBuffer(const std::string& filename, std::list<std::shared_ptr<SoundBuffer>>::iterator poolIterator)
    4242        : filename_(filename)
    4343        , audioBuffer_(AL_NONE)
     
    4545    {
    4646        if (this->filename_.empty())
    47             ThrowException(General, "SoundBuffer construction: fileInfo was NULL");
     47            ThrowException(General, "SoundBuffer construction: fileInfo was nullptr");
    4848
    4949        // Get resource info
    50         shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename);
    51         if (fileInfo == NULL)
     50        std::shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename);
     51        if (fileInfo == nullptr)
    5252        {
    5353            orxout(internal_error, context::sound) << "Sound file '" << filename << "' not found" << endl;
     
    8383    }
    8484
    85     void SoundBuffer::loadStandard(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)
     85    void SoundBuffer::loadStandard(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)
    8686    {
    8787        // Read everything into a temporary buffer
     
    127127    }
    128128
    129     void SoundBuffer::loadOgg(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)
     129    void SoundBuffer::loadOgg(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)
    130130    {
    131131        char inbuffer[256*1024];
     
    138138        vorbisCallbacks.seek_func  = &seekVorbis;
    139139        vorbisCallbacks.tell_func  = &tellVorbis;
    140         vorbisCallbacks.close_func = NULL;
     140        vorbisCallbacks.close_func = nullptr;
    141141
    142142        OggVorbis_File vf;
    143         int ret = ov_open_callbacks(dataStream.get(), &vf, NULL, 0, vorbisCallbacks);
     143        int ret = ov_open_callbacks(dataStream.get(), &vf, nullptr, 0, vorbisCallbacks);
    144144        if (ret < 0)
    145145        {
  • code/trunk/src/orxonox/sound/SoundBuffer.h

    r10624 r11071  
    3333
    3434#include <list>
    35 #include <boost/shared_ptr.hpp>
     35#include <memory>
    3636#include "core/Resource.h"
    3737
     
    4545    {
    4646        friend class SoundManager;
    47 #if !defined(_MSC_VER) || _MSC_VER >= 1500
    48         // Make sure nobody deletes an instance (using strong pointers)
    49         template <class T>
    50         friend void boost::checked_delete(T*);
    51 #endif
    5247
    5348    public:
    54 #if defined(_MSC_VER) && _MSC_VER < 1500
    5549        ~SoundBuffer();
    56 #endif
    5750        inline ALuint getBuffer()
    5851            { return this->audioBuffer_; }
     
    6457
    6558    private:
    66         SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer> >::iterator poolIterator);
    67 #if !defined(_MSC_VER) || _MSC_VER >= 1500
    68         ~SoundBuffer();
    69 #endif
    70         void loadStandard(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
    71         void loadOgg(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
     59        SoundBuffer(const std::string& filename, std::list<std::shared_ptr<SoundBuffer>>::iterator poolIterator);
     60        void loadStandard(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
     61        void loadOgg(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
    7262
    7363        std::string filename_;
    7464        ALuint audioBuffer_;
    75         std::list<shared_ptr<SoundBuffer> >::iterator poolIterator_;
     65        std::list<std::shared_ptr<SoundBuffer>>::iterator poolIterator_;
    7666    };
    7767}
  • code/trunk/src/orxonox/sound/SoundManager.cc

    r10624 r11071  
    8383            ThrowException(InitialisationAborted, "Sound: Not loading at all");
    8484#if !defined(ORXONOX_PLATFORM_APPLE)
    85         if (!alutInitWithoutContext(NULL, NULL))
     85        if (!alutInitWithoutContext(nullptr, nullptr))
    8686            ThrowException(InitialisationFailed, "Sound Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError()));
    8787        Loki::ScopeGuard alutExitGuard = Loki::MakeGuard(&alutExit);
     
    9090/*
    9191        // Get list of available sound devices and display them
    92         const char* devices = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
     92        const char* devices = alcGetString(nullptr, ALC_DEVICE_SPECIFIER);
    9393        char* device = new char[strlen(devices)+1];
    9494        strcpy(device, devices);
     
    110110        this->device_ = alcOpenDevice(renderDevice.c_str());
    111111*/
    112         this->device_ = alcOpenDevice(NULL);
    113         if (this->device_ == NULL)
     112        this->device_ = alcOpenDevice(nullptr);
     113        if (this->device_ == nullptr)
    114114            ThrowException(InitialisationFailed, "Sound Error: Could not open sound device.");
    115115        Loki::ScopeGuard closeDeviceGuard = Loki::MakeGuard(&alcCloseDevice, this->device_);
    116116
    117117        // Create sound context and make it the currently used one
    118         this->context_ = alcCreateContext(this->device_, NULL);
    119         if (this->context_ == NULL)
     118        this->context_ = alcCreateContext(this->device_, nullptr);
     119        if (this->context_ == nullptr)
    120120            ThrowException(InitialisationFailed, "Sound Error: Could not create ALC context");
    121121        Loki::ScopeGuard desroyContextGuard = Loki::MakeGuard(&alcDestroyContext, this->context_);
     
    189189
    190190        // Relieve context to destroy it
    191         if (!alcMakeContextCurrent(NULL))
     191        if (!alcMakeContextCurrent(nullptr))
    192192            orxout(internal_error, context::sound) << "Could not unset ALC context" << endl;
    193193        alcDestroyContext(this->context_);
     
    294294        {
    295295        case SoundType::All:
    296             for (ObjectList<BaseSound>::iterator it = ObjectList<BaseSound>::begin(); it != ObjectList<BaseSound>::end(); ++it)
    297                 (*it)->updateVolume();
     296            for (BaseSound* sound : ObjectList<BaseSound>())
     297                sound->updateVolume();
    298298            break;
    299299        case SoundType::Music:
    300             for (ObjectList<AmbientSound>::iterator it = ObjectList<AmbientSound>::begin(); it != ObjectList<AmbientSound>::end(); ++it)
    301                 (*it)->updateVolume();
     300            for (AmbientSound* sound : ObjectList<AmbientSound>())
     301                sound->updateVolume();
    302302            break;
    303303        case SoundType::Effects:
    304             for (ObjectList<WorldSound>::iterator it = ObjectList<WorldSound>::begin(); it != ObjectList<WorldSound>::end(); ++it)
    305                 (*it)->updateVolume();
     304            for (WorldSound* sound : ObjectList<WorldSound>())
     305                sound->updateVolume();
    306306            break;
    307307        default:
     
    350350    void SoundManager::registerAmbientSound(AmbientSound* newAmbient)
    351351    {
    352         if (newAmbient != NULL && !this->bDestructorCalled_)
     352        if (newAmbient != nullptr && !this->bDestructorCalled_)
    353353        {
    354354            for (AmbientList::const_iterator it = this->ambientSounds_.begin(); it != this->ambientSounds_.end(); ++it)
     
    373373    void SoundManager::unregisterAmbientSound(AmbientSound* oldAmbient)
    374374    {
    375         if (oldAmbient == NULL || ambientSounds_.empty() || this->bDestructorCalled_)
     375        if (oldAmbient == nullptr || ambientSounds_.empty() || this->bDestructorCalled_)
    376376            return;
    377377
     
    405405    void SoundManager::pauseAmbientSound(AmbientSound* ambient)
    406406    {
    407         if (ambient != NULL)
    408         {
    409             for (AmbientList::iterator it = this->ambientSounds_.begin(); it != this->ambientSounds_.end(); ++it)
    410             {
    411                 if (it->first == ambient)
     407        if (ambient != nullptr)
     408        {
     409            for (std::pair<AmbientSound*, bool>& pair : this->ambientSounds_)
     410            {
     411                if (pair.first == ambient)
    412412                {
    413                     it->second = true;
    414                     this->fadeOut(it->first);
     413                    pair.second = true;
     414                    this->fadeOut(pair.first);
    415415                    return;
    416416                }
     
    422422    {
    423423        // If we're already fading out --> remove that
    424         for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++)
     424        for (std::list<StrongPtr<AmbientSound>>::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++)
    425425        {
    426426            if (*it == sound)
     
    438438    {
    439439        // If we're already fading in --> remove that
    440         for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++)
     440        for (std::list<StrongPtr<AmbientSound>>::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++)
    441441        {
    442442            if (*it == sound)
     
    461461
    462462        // FADE IN
    463         for (std::list<StrongPtr<AmbientSound> >::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); )
     463        for (std::list<StrongPtr<AmbientSound>>::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); )
    464464        {
    465465            if ((*it)->getVolume() + this->crossFadeStep_*dt > 1.0f)
     
    476476
    477477        // FADE OUT
    478         for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); )
     478        for (std::list<StrongPtr<AmbientSound>>::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); )
    479479        {
    480480            if ((*it)->getVolume() - this->crossFadeStep_*dt < 0.0f)
     
    505505    }
    506506
    507     shared_ptr<SoundBuffer> SoundManager::getSoundBuffer(const std::string& filename)
    508     {
    509         shared_ptr<SoundBuffer> buffer;
     507    std::shared_ptr<SoundBuffer> SoundManager::getSoundBuffer(const std::string& filename)
     508    {
     509        std::shared_ptr<SoundBuffer> buffer;
    510510        // Check active or pooled buffers
    511511        SoundBufferMap::const_iterator it = this->soundBuffers_.find(filename);
     
    538538    }
    539539
    540     void SoundManager::releaseSoundBuffer(const shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer)
     540    void SoundManager::releaseSoundBuffer(const std::shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer)
    541541    {
    542542        // Check if others are still using the buffer
     
    551551                while (this->effectsPoolSize_ + it->second->getSize() > this->maxEffectsPoolSize_s && !this->effectsPool_.empty())
    552552                {
    553                     shared_ptr<SoundBuffer> bufferDel = this->effectsPool_.back();
     553                    std::shared_ptr<SoundBuffer> bufferDel = this->effectsPool_.back();
    554554                    this->effectsPoolSize_ -= bufferDel->getSize();
    555555                    bufferDel->poolIterator_ = this->effectsPool_.end();
     
    576576            ALuint source = this->availableSoundSources_.back();
    577577            this->availableSoundSources_.pop_back();
    578             this->usedSoundSources_.push_back(std::make_pair(source, object));
     578            this->usedSoundSources_.emplace_back(source, object);
    579579            return source;
    580580        }
     
    588588                if (alIsSource(source) && !alGetError())
    589589                {
    590                     this->usedSoundSources_.push_back(std::make_pair(source, object));
     590                    this->usedSoundSources_.emplace_back(source, object);
    591591                    return source;
    592592                }
     
    606606#endif
    607607        this->availableSoundSources_.push_back(source);
    608         for (std::vector<std::pair<ALuint, BaseSound*> >::iterator it = this->usedSoundSources_.begin();
     608        for (std::vector<std::pair<ALuint, BaseSound*>>::iterator it = this->usedSoundSources_.begin();
    609609            it != this->usedSoundSources_.end(); ++it)
    610610        {
  • code/trunk/src/orxonox/sound/SoundManager.h

    r10624 r11071  
    3636#include <map>
    3737#include <string>
    38 #include <boost/shared_ptr.hpp>
     38#include <memory>
    3939
    4040#include "util/Singleton.h"
     
    6868        ~SoundManager();
    6969
    70         void preUpdate(const Clock& time);
    71         void postUpdate(const Clock& time) { /*no action*/ }
     70        virtual void preUpdate(const Clock& time) override;
     71        virtual void postUpdate(const Clock& time) override { /*no action*/ }
    7272        void setConfigValues();
    7373
     
    9696        // tolua_end
    9797
    98         shared_ptr<SoundBuffer> getSoundBuffer(const std::string& filename);
    99         void releaseSoundBuffer(const shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer);
     98        std::shared_ptr<SoundBuffer> getSoundBuffer(const std::string& filename);
     99        void releaseSoundBuffer(const std::shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer);
    100100
    101101        ALuint getSoundSource(BaseSound* object);
     
    125125
    126126        // Ambient sound related
    127         typedef std::list<std::pair<AmbientSound*, bool> > AmbientList;
     127        typedef std::list<std::pair<AmbientSound*, bool>> AmbientList;
    128128        AmbientList                        ambientSounds_;
    129129        //! Absolute change per second (0.1 means 10% of the nominal volume) for cross fading
    130130        float                              crossFadeStep_;
    131         std::list<StrongPtr<AmbientSound> > fadeInList_;
    132         std::list<StrongPtr<AmbientSound> > fadeOutList_;
     131        std::list<StrongPtr<AmbientSound>> fadeInList_;
     132        std::list<StrongPtr<AmbientSound>> fadeOutList_;
    133133
    134134        // Volume related
     
    139139        static const unsigned int maxEffectsPoolSize_s = 40 * 1024 * 1024;
    140140        unsigned int effectsPoolSize_;
    141         typedef std::list<shared_ptr<SoundBuffer> > EffectsPoolList;
     141        typedef std::list<std::shared_ptr<SoundBuffer>> EffectsPoolList;
    142142        EffectsPoolList effectsPool_;
    143         typedef std::map<std::string, shared_ptr<SoundBuffer> > SoundBufferMap;
     143        typedef std::map<std::string, std::shared_ptr<SoundBuffer>> SoundBufferMap;
    144144        SoundBufferMap soundBuffers_;
    145145
     
    148148        unsigned int maxSources_;
    149149        std::vector<ALuint> availableSoundSources_;
    150         std::vector<std::pair<ALuint, BaseSound*> > usedSoundSources_;
     150        std::vector<std::pair<ALuint, BaseSound*>> usedSoundSources_;
    151151
    152152        bool bDestructorCalled_; ///< Becomes true if the destructor is called - used to prevent ambient sounds from registering after the lists were cleared
  • code/trunk/src/orxonox/sound/SoundStreamer.cc

    r8858 r11071  
    4545        vorbisCallbacks.seek_func  = &seekVorbis;
    4646        vorbisCallbacks.tell_func  = &tellVorbis;
    47         vorbisCallbacks.close_func = NULL;
     47        vorbisCallbacks.close_func = nullptr;
    4848
    4949        OggVorbis_File vf;
    50         int ret = ov_open_callbacks(dataStream.get(), &vf, NULL, 0, vorbisCallbacks);
     50        int ret = ov_open_callbacks(dataStream.get(), &vf, nullptr, 0, vorbisCallbacks);
    5151        if (ret < 0)
    5252        {
     
    6868        int current_section;
    6969
    70         for(int i = 0; i < 4; i++)
     70        for(ALuint& initbuffer : initbuffers)
    7171        {
    7272            long ret = ov_read(&vf, inbuffer, sizeof(inbuffer), 0, 2, 1, &current_section);
     
    8282            }
    8383
    84             alBufferData(initbuffers[i], format, &inbuffer, ret, vorbisInfo->rate);
     84            alBufferData(initbuffer, format, &inbuffer, ret, vorbisInfo->rate);
    8585        }
    8686        alSourceQueueBuffers(audioSource, 4, initbuffers);
  • code/trunk/src/orxonox/sound/WorldAmbientSound.cc

    r10624 r11071  
    4949        this->ambientSound_ = new AmbientSound();
    5050        this->registerVariables();
    51         soundList_.push_back("Earth.ogg");
    52         soundList_.push_back("Jupiter.ogg");
    53         soundList_.push_back("Mars.ogg");
    54         soundList_.push_back("allgorythm-lift_up.ogg");
    55         soundList_.push_back("allgorythm-resonance_blaster.ogg");
    56         soundList_.push_back("AlphaCentauri.ogg");
    57         soundList_.push_back("Asteroid_rocks.ogg");
    58         soundList_.push_back("Ganymede.ogg");
    59         soundList_.push_back("luke_grey_-_hypermode.ogg");
     51        soundList_.emplace_back("Earth.ogg");
     52        soundList_.emplace_back("Jupiter.ogg");
     53        soundList_.emplace_back("Mars.ogg");
     54        soundList_.emplace_back("allgorythm-lift_up.ogg");
     55        soundList_.emplace_back("allgorythm-resonance_blaster.ogg");
     56        soundList_.emplace_back("AlphaCentauri.ogg");
     57        soundList_.emplace_back("Asteroid_rocks.ogg");
     58        soundList_.emplace_back("Ganymede.ogg");
     59        soundList_.emplace_back("luke_grey_-_hypermode.ogg");
    6060
    6161    }
     
    114114
    115115        //HACK: Assuption - there is only one WorldAmbientSound in a level and only one level is used.
    116         for (ObjectList<WorldAmbientSound>::iterator it = ObjectList<WorldAmbientSound>::begin();
    117              it != ObjectList<WorldAmbientSound>::end(); ++it)
     116        for (WorldAmbientSound* sound : ObjectList<WorldAmbientSound>())
    118117        {
    119             while(it->ambientSound_->setAmbientSource(WorldAmbientSound::soundList_[WorldAmbientSound::soundNumber_]) == false){
     118            while(sound->ambientSound_->setAmbientSource(WorldAmbientSound::soundList_[WorldAmbientSound::soundNumber_]) == false){
    120119                WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size();
    121120            }
  • code/trunk/src/orxonox/sound/WorldAmbientSound.h

    r9939 r11071  
    5050            virtual ~WorldAmbientSound();
    5151
    52             void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    53             void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     52            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     53            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
    5454
    55             virtual void changedActivity();
     55            virtual void changedActivity() override;
    5656
    5757            void play();
  • code/trunk/src/orxonox/sound/WorldSound.cc

    r9939 r11071  
    5858        registerVariable(bLooping_, ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::loopingChanged));
    5959        registerVariable(pitch_,    ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::pitchChanged));
    60         registerVariable((uint8_t&)(BaseSound::state_), ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::stateChanged));
     60        registerVariable(BaseSound::state_, ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::stateChanged));
    6161    }
    6262
  • code/trunk/src/orxonox/sound/WorldSound.h

    r9667 r11071  
    4747        WorldSound(Context* context);
    4848
    49         void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    50         void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
    51         void changedActivity();
     49        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     50        virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
     51        virtual void changedActivity() override;
    5252
    53         void tick(float dt);
     53        virtual void tick(float dt) override;
    5454
    5555    protected:
     
    5858    private:
    5959        void registerVariables();
    60         void initialiseSource();
    61         float getRealVolume();
     60        virtual void initialiseSource() override;
     61        virtual float getRealVolume() override;
    6262    };
    6363}
Note: See TracChangeset for help on using the changeset viewer.