Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 17, 2006, 1:40:05 PM (19 years ago)
Author:
amaechler
Message:

branches/atmospheric_engine: loop updates and chopper sound

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/atmospheric_engine/src/lib/sound/sound_source.cc

    r7646 r7647  
    122122      alSourceStop(this->sourceID);
    123123    alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
     124    alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE  );
    124125    alSourcePlay(this->sourceID);
    125126
     
    145146  alSourceStop(this->sourceID);
    146147  alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
     148  alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE  );
    147149  alSourcePlay(this->sourceID);
    148150
     
    157159
    158160/**
    159  * @brief Plays back buffer on this Source and loops it
     161 * @brief Plays and loops a SoundSource
     162 */
     163void SoundSource::loop()
     164{
     165  if (this->buffer && this->retrieveSource())
     166  {
     167    if (this->bPlay)
     168      alSourceStop(this->sourceID);
     169
     170    alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
     171    alSourcei (this->sourceID, AL_LOOPING,  AL_TRUE  );
     172    alSourcePlay(this->sourceID);
     173
     174    if (DEBUG >= 3)
     175      SoundEngine::checkError("Play LoopSource", __LINE__);
     176    this->bPlay = true;
     177  }
     178}
     179
     180
     181/**
     182 * @brief Plays and loops buffer on this Source
    160183 * @param buffer the buffer to play back on this Source
    161184 */
Note: See TracChangeset for help on using the changeset viewer.