Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 23, 2009, 8:45:56 PM (16 years ago)
Author:
rgrieder
Message:

Mood changes should now be working and with immediate (but delayed because of loading) effect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/sound/AmbientSound.cc

    r6394 r6406  
    3535#include "core/XMLPort.h"
    3636#include "SoundManager.h"
    37 #include "MoodManager.h"
    3837
    3938namespace orxonox
     
    111110    {
    112111        this->ambientSource_ = source;
     112        this->moodChanged(this->getMood());
     113    }
     114
     115    void AmbientSound::moodChanged(const std::string& mood)
     116    {
    113117        if (GameMode::playsSound())
    114118        {
    115             const std::string& path = "ambient/" + MoodManager::getInstance().getMood() + '/' + source;
     119            const std::string& path = "ambient/" + MoodManager::getInstance().getMood() + '/' + this->ambientSource_;
    116120            shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path);
    117121            if (fileInfo != NULL)
    118122                this->setSource(path);
    119123            else
    120                 COUT(3) << "Sound: " << source << ": Not a valid name! Ambient sound will not change." << std::endl;
     124                COUT(3) << "Sound: " << this->ambientSource_ << ": Not a valid name! Ambient sound will not change." << std::endl;
    121125        }
    122126    }
Note: See TracChangeset for help on using the changeset viewer.