Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 14, 2007, 4:46:18 PM (17 years ago)
Author:
snellen
Message:

changes on soundengine and mover by fabian landau

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/effects/explosion.cc

    r10665 r10695  
    2525#include "particles/sprite_particles.h"
    2626
     27#include "sound/resource_sound_buffer.h"
     28#include "sound_engine.h"
     29
     30
    2731ObjectListDefinition(Explosion);
    2832CREATE_FAST_FACTORY_STATIC(Explosion);
     
    3842                        //Explode !
    3943                            ->addMethod("explode", Executor3<Explosion, lua_State*, float, float, float>(&Explosion::explode))
     44                            ->addMethod("setExplosionSound", Executor1<Explosion, lua_State*, const std::string&>(&Explosion::setExplosionSound))
    4045                       );
    4146
     
    5560  this->lifeCycle = 0.0f;
    5661  this->lifeTime = .5f;
    57 
     62 
     63  this->explosionSound.setSourceNode(this);
     64 
    5865}
    5966
     
    6572{
    6673  delete this->emitter;
    67 
     74  if (this->explosionSound.isPlaying())
     75    this->explosionSound.stop();
    6876  /* this is normaly done by World.cc by deleting the ParticleEngine */
    6977  if (Explosion::explosionParticles != NULL && Explosion::objectList().size() <= 1)
     
    8896  explosion->emitter->setSize(Vector(x,y,z));
    8997  explosion->activate();
     98 
     99 
    90100}
    91101
     
    113123  this->toList(OM_DEAD_TICK);
    114124  this->lifeCycle = 0.0;
     125 
     126  this->explosionSound.play(this->explosionSoundBuffer, OrxSound::SoundEngine::getInstance()->getEffectsVolume(), 0.01, true);
    115127}
    116128
Note: See TracChangeset for help on using the changeset viewer.