Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 8, 2009, 10:09:39 AM (14 years ago)
Author:
rgrieder
Message:

Switched from ResourceInfo to std::string for the buffer identification. That should speed up BaseSound::setSource() by factor 10 if the buffer already exists.

File:
1 edited

Legend:

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

    r6260 r6270  
    6262    BaseSound::~BaseSound()
    6363    {
    64         this->setSource("");
     64        this->setSource(std::string());
    6565        if (GameMode::playsSound() && alIsSource(this->audioSource_))
    6666            alDeleteSources(1, &this->audioSource_);
     
    191191            return;
    192192
    193         // Get DataStream from the resources
    194         shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(source);
    195         if (fileInfo == NULL)
    196         {
    197             COUT(2) << "Sound: Warning: Sound file '" << source << "' not found" << std::endl;
    198             return;
    199         }
    200 
    201         this->soundBuffer_ = SoundManager::getInstance().getSoundBuffer(fileInfo);
     193        this->soundBuffer_ = SoundManager::getInstance().getSoundBuffer(this->source_);
    202194        if (this->soundBuffer_ == NULL)
    203195            return;
Note: See TracChangeset for help on using the changeset viewer.