Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2009, 4:03:03 PM (15 years ago)
Author:
youngk
Message:

Implemented automatic ambient sound file path fetch according to current mood.
Valid moods are: default and dnb
BUG Loading of a second sound fails (independent of the file used). Probably an error in BaseSound::setSource().

File:
1 edited

Legend:

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

    r5982 r6031  
    8585    }
    8686
     87    void AmbientSound::setSource(const std::string& source)
     88    {
     89        if(source.find('/') == std::string.npos)
     90        {
     91            std::string filePath = SoundManager::getInstance().getAmbientPath(source);
     92            if(!(filePath.empty()))
     93            {
     94                BaseSound::setSource(filePath);
     95                return;
     96            }
     97        }
     98        COUT(3) << source << ": Not a valid name! Ambient sound will not change." << std::endl;       
     99    }
     100
    87101    void AmbientSound::changedActivity()
    88102    {
Note: See TracChangeset for help on using the changeset viewer.