Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7318 in orxonox.OLD for trunk/src/lib/sound/sound_engine.cc


Ignore:
Timestamp:
Apr 17, 2006, 2:55:51 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: SoundSource in the Menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/sound/sound_engine.cc

    r7317 r7318  
    124124 * @param sourceNode The sourceNode to bind this SoundSource to.
    125125 * @returns The newly created SoundSource
    126 
    127    acctualy this is nothing more than a wrapper around the ResourceManager.
     126 *
     127 * acctualy this is nothing more than a wrapper around the ResourceManager.
    128128*/
    129129SoundSource* SoundEngine::createSource(const std::string& fileName, PNode* sourceNode)
    130130{
    131   return new SoundSource(sourceNode, (SoundBuffer*)ResourceManager::getInstance()->load(fileName, WAV, RP_LEVEL));
     131  SoundBuffer* buffer = NULL;
     132  if (!fileName.empty())
     133  {
     134     buffer= (SoundBuffer*)ResourceManager::getInstance()->load(fileName, WAV, RP_LEVEL);
     135     if (buffer == NULL)
     136       PRINTF(2)("Wav-Sound %s could not be loaded onto new Source\n", fileName.c_str());
     137  }
     138    return new SoundSource(sourceNode, buffer);
    132139}
    133140
     
    151158 * @param source the Source to fill with the Value.
    152159 */
    153 bool SoundEngine::popALSource(ALuint& source)
     160void SoundEngine::popALSource(ALuint& source)
    154161{
    155162  assert (source == 0);
    156 
    157163  /// @TODO try to create more sources if needed
    158164  if (!this->ALSources.empty())
     
    162168    this->ALSources.pop();
    163169    SDL_mutexV(this->sourceMutex);
    164     return true;
    165   }
    166   else
    167     return false;
     170  }
    168171}
    169172
Note: See TracChangeset for help on using the changeset viewer.