Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10724 in orxonox.OLD for branches


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

explosions now have sound

Location:
branches/presentation/src/world_entities/effects
Files:
2 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/**
  • branches/presentation/src/world_entities/effects/explosion.h

    r10698 r10724  
    2323    void explode (float x, float y, float z); /// Explode at the current position with size (x,y,z)
    2424    void setExplosionSound(const std::string& newExplosionSound){  this->explosionSoundBuffer = OrxSound::ResourceSoundBuffer(newExplosionSound);  }
     25    void playSound();
    2526   
    2627    Explosion ();
Note: See TracChangeset for help on using the changeset viewer.