Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4205 in orxonox.OLD for orxonox/branches/openAL


Ignore:
Timestamp:
May 17, 2005, 2:09:59 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/openAL: segfault-prevention :)

Location:
orxonox/branches/openAL/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/openAL/src/lib/sound/sound_engine.cc

    r4204 r4205  
    234234
    235235  // updating the Listeners Position
    236   if (this->listener)
     236  if (likely(this->listener != NULL))
    237237    {
    238238      alListener3f(AL_POSITION,
     
    256256  while (enumSource)
    257257    {
    258       alSource3f(enumSource->getID(), AL_POSITION,
    259                  enumSource->getNode()->getAbsCoor().x,
    260                  enumSource->getNode()->getAbsCoor().y,
    261                  enumSource->getNode()->getAbsCoor().z);
    262       alSource3f(enumSource->getID(), AL_VELOCITY,
    263                  enumSource->getNode()->getVelocity().x,
    264                  enumSource->getNode()->getVelocity().y,
    265                  enumSource->getNode()->getVelocity().z);
    266 
     258      if (likely(enumSource->getNode()!=NULL))
     259      {
     260        alSource3f(enumSource->getID(), AL_POSITION,
     261                   enumSource->getNode()->getAbsCoor().x,
     262                   enumSource->getNode()->getAbsCoor().y,
     263                   enumSource->getNode()->getAbsCoor().z);
     264        alSource3f(enumSource->getID(), AL_VELOCITY,
     265                   enumSource->getNode()->getVelocity().x,
     266                   enumSource->getNode()->getVelocity().y,
     267                   enumSource->getNode()->getVelocity().z);
     268      }
    267269      enumSource = iterator->nextElement();
    268270    }
  • orxonox/branches/openAL/src/lib/sound/sound_engine.h

    r4204 r4205  
    7171  virtual ~SoundEngine(void);
    7272
    73   SoundSource* createSource(const char* fileName, PNode* sourceNode);
     73  SoundSource* createSource(const char* fileName, PNode* sourceNode = NULL);
    7474
    7575  void setListener(PNode* listener);
  • orxonox/branches/openAL/src/story_entities/world.cc

    r4204 r4205  
    490490
    491491  SoundEngine::getInstance()->setListener(tn);
    492   SoundBuffer* tBuffer = new SoundBuffer(ResourceManager::getFullName("sound/explo.wav"));
    493492  SoundSource* tSound = SoundEngine::getInstance()->createSource("sound/explo.wav", this->localPlayer);
    494493  tSound->setRolloffFactor(0);
Note: See TracChangeset for help on using the changeset viewer.