Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
May 24, 2006, 3:57:04 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the Weather effects back here

Location:
trunk/src/world_entities
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/helicopter.cc

    r7337 r7810  
    2525
    2626#include "util/loading/factory.h"
     27#include "util/loading/resource_manager.h"
     28
    2729#include "key_mapper.h"
    2830#include "event_handler.h"
     
    4951{
    5052  this->setPlayer(NULL);
     53
     54  if (this->chopperBuffer != NULL)
     55    ResourceManager::getInstance()->unload(this->chopperBuffer);
    5156}
    5257
     
    96101  this->getWeaponManager().changeWeaponConfig(1);
    97102  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
     103
     104  //load sound
     105  if (this->chopperBuffer != NULL)
     106    ResourceManager::getInstance()->unload(this->chopperBuffer);
     107  this->chopperBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/chopper.wav", WAV);
     108
    98109}
    99110
     
    205216  State::getCameraNode()->setParentSoft(this->getWeaponManager().getFixedTarget());
    206217  State::getCameraTargetNode()->setParentSoft(this->getWeaponManager().getFixedTarget());
     218
     219  this->soundSource.loop(this->chopperBuffer);
     220  // PRINTF(0)( "Playing ChopperSound\n" );
    207221}
    208222
     
    211225  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    212226  this->detachCamera();
    213 
     227  this->soundSource.stop();
    214228}
    215229
  • trunk/src/world_entities/space_ships/helicopter.h

    r7346 r7810  
    1010#include "playable.h"
    1111
     12#include "sound_buffer.h"
     13#include "sound_source.h"
    1214
    1315class Helicopter : public Playable
     
    7173    float                 airViscosity;
    7274
     75    OrxSound::SoundSource soundSource;
     76    OrxSound::SoundBuffer*chopperBuffer;
     77
    7378};
    7479
Note: See TracChangeset for help on using the changeset viewer.