Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8608


Ignore:
Timestamp:
May 26, 2011, 4:58:18 PM (14 years ago)
Author:
landauf
Message:

removed some redundant code in MoodManager

Location:
code/branches/presentation/src/orxonox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/orxonox/MoodManager.cc

    r8351 r8608  
    9393
    9494
    95     std::string MoodListener::mood_s;
    96 
    9795    MoodListener::MoodListener()
    9896    {
     
    102100    /*static*/ void MoodListener::changedMood(const std::string& mood)
    103101    {
    104         mood_s = mood;
    105102        for (ObjectList<MoodListener>::iterator it = ObjectList<MoodListener>::begin(); it; ++it)
    106             it->moodChanged(mood_s);
     103            it->moodChanged(mood);
    107104    }
    108105}
  • code/branches/presentation/src/orxonox/MoodManager.h

    r7163 r8608  
    5050            virtual ~MoodListener() {}
    5151
    52             const std::string& getMood() const { return mood_s; }
    53 
    5452        private:
    5553            virtual void moodChanged(const std::string& mood) = 0;
    5654
    5755            static void changedMood(const std::string& mood);
    58             static std::string mood_s;
    5956    };
    6057
  • code/branches/presentation/src/orxonox/sound/AmbientSound.cc

    r8351 r8608  
    8282    {
    8383        this->ambientSource_ = source;
    84         this->moodChanged(this->getMood());
     84        this->moodChanged(MoodManager::getInstance().getMood());
    8585    }
    8686
     
    8989        if (GameMode::playsSound())
    9090        {
    91             const std::string& path = "ambient/" + MoodManager::getInstance().getMood() + '/' + this->ambientSource_;
     91            const std::string& path = "ambient/" + mood + '/' + this->ambientSource_;
    9292            shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path);
    9393            if (fileInfo != NULL)
Note: See TracChangeset for help on using the changeset viewer.