Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8516 in orxonox.OLD for branches/bsp_model


Ignore:
Timestamp:
Jun 16, 2006, 2:53:00 AM (19 years ago)
Author:
patrick
Message:

bsp: added a sound source to the generic npc as a start

Location:
branches/bsp_model/src/world_entities/npcs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/world_entities/npcs/generic_npc.cc

    r8515 r8516  
    2323#include "interactive_model.h"
    2424#include "md2/md2Model.h"
     25
     26#include "sound_buffer.h"
     27
     28#include "loading/resource_manager.h"
    2529
    2630#include "generic_npc.h"
     
    6165  this->setClassID(CL_GENERIC_NPC, "GenericNPC");
    6266  this->toList(OM_GROUP_00);
     67
     68  if (this->soundBuffer != NULL)
     69    ResourceManager::getInstance()->unload(this->soundBuffer);
     70  this->soundBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/rain.wav", WAV);
    6371}
    6472
  • branches/bsp_model/src/world_entities/npcs/generic_npc.h

    r8515 r8516  
    1111
    1212#include <string>
     13//
     14#include "sound_source.h"
    1315
     16namespace OrxSound{ class SoundSource; }
     17namespace OrxSound{ class SoundBuffer; }
    1418
    1519class TiXmlElement;
     
    2630
    2731  void setAnimation(int animationIndex, int animPlaybackMode);
     32  /** sets the sound volume to @param vol: volume of the sound */
     33  inline void setVolume(float vol) { this->soundVolume = vol; }
    2834
    2935  bool playAnimation(int animationIndex, int animPlaybackMode);
     
    3743
    3844 private:
    39 
     45   OrxSound::SoundSource                   soundSource;
     46   OrxSound::SoundBuffer*                  soundBuffer;
     47   float                                   soundVolume;
    4048};
    4149
Note: See TracChangeset for help on using the changeset viewer.