Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 19, 2007, 8:54:28 PM (17 years ago)
Author:
snellen
Message:

explosions now have sound

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/effects/explosion.cc

    r10695 r10724  
    4343                            ->addMethod("explode", Executor3<Explosion, lua_State*, float, float, float>(&Explosion::explode))
    4444                            ->addMethod("setExplosionSound", Executor1<Explosion, lua_State*, const std::string&>(&Explosion::setExplosionSound))
     45                            ->addMethod("playSound", Executor0<Explosion, lua_State*>(&Explosion::playSound))
    4546                       );
    4647
     
    123124  this->toList(OM_DEAD_TICK);
    124125  this->lifeCycle = 0.0;
    125  
    126   this->explosionSound.play(this->explosionSoundBuffer, OrxSound::SoundEngine::getInstance()->getEffectsVolume(), 0.01, true);
     126  this->explosionSound.play(this->explosionSoundBuffer, OrxSound::SoundEngine::getInstance()->getEffectsVolume(), 0.01, false);
     127
    127128}
    128129
     
    135136}
    136137
     138void Explosion::playSound()
     139{
     140 if (!this->explosionSound.isPlaying())
     141  this->explosionSound.play(this->explosionSoundBuffer, OrxSound::SoundEngine::getInstance()->getEffectsVolume(), 0.01, false);
     142}
    137143
    138144/**
Note: See TracChangeset for help on using the changeset viewer.