Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10695 in orxonox.OLD for trunk/src/world_entities


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

changes on soundengine and mover by fabian landau

Location:
trunk/src/world_entities
Files:
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/WorldEntities.am

    r10638 r10695  
    1212                world_entities/npcs/repair_station.cc \
    1313                world_entities/npcs/attractor_mine.cc \
    14                 world_entities/npcs/mover.cc \
    1514                \
    1615                \
     
    7978                world_entities/environments/planet.cc \
    8079                world_entities/environments/bsp_entity.cc \
     80                world_entities/environments/mover.cc \
     81                world_entities/environments/mover_station.cc \
     82                world_entities/environments/mover_station_list.cc \
     83                world_entities/environments/mover_trigger.cc \
     84                world_entities/environments/mover_trigger_approach.cc \
     85                world_entities/environments/mover_trigger_delay_list.cc \
     86                world_entities/environments/mover_trigger_event.cc \
     87                world_entities/environments/mover_trigger_event_list.cc \
     88                world_entities/environments/mover_trigger_intervisibility.cc \
     89                world_entities/environments/mover_trigger_key.cc \
     90                world_entities/environments/mover_trigger_list.cc \
     91                world_entities/environments/mover_trigger_pointer_list.cc \
     92                world_entities/environments/mover_trigger_mapstart.cc \
    8193                \
    8294                \
     
    146158                npcs/repair_station.h \
    147159                npcs/attractor_mine.h \
    148                 npcs/mover.h \
    149160                \
    150161                environments/environment.h \
     
    224235                environments/mapped_water.h \
    225236                environments/rotor.h \
     237                environments/mover.h \
     238                environments/mover_station.h \
     239                environments/mover_station_list.h \
     240                environments/mover_trigger.h \
     241                environments/mover_trigger_approach.h \
     242                environments/mover_trigger_delay_list.h \
     243                environments/mover_trigger_event.h \
     244                environments/mover_trigger_event_list.h \
     245                environments/mover_trigger_intervisibility.h \
     246                environments/mover_trigger_key.h \
     247                environments/mover_trigger_list.h \
     248                environments/mover_trigger_pointer_list.h \
     249                environments/mover_trigger_mapstart.h \
    226250                \
    227251                elements/image_entity.h \
  • 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
  • trunk/src/world_entities/effects/explosion.h

    r10665 r10695  
    88
    99#include "world_entity.h"
     10#include "sound_source.h"
     11#include "sound_buffer.h"
     12#include "sound/resource_sound_buffer.h"
    1013
    1114class SpriteParticles;
     
    1922    static void explode (PNode* position, const Vector& size);
    2023    void explode (float x, float y, float z); /// Explode at the current position with size (x,y,z)
     24    void setExplosionSound(const std::string& newExplosionSound){  this->explosionSoundBuffer = OrxSound::ResourceSoundBuffer(newExplosionSound);  }
    2125   
    2226    Explosion ();
     
    3640    static SpriteParticles*    explosionParticles;
    3741    BoxEmitter*                emitter;
     42   
     43    OrxSound::SoundSource      explosionSound;
     44    OrxSound::SoundBuffer      explosionSoundBuffer;
    3845};
    3946
Note: See TracChangeset for help on using the changeset viewer.