diff options
author | Jörg Müller <nexyon@gmail.com> | 2014-03-04 02:57:59 +0400 |
---|---|---|
committer | Jörg Müller <nexyon@gmail.com> | 2015-07-28 15:01:52 +0300 |
commit | 96dd213e7ecabeffc682aee40b4102296ab062de (patch) | |
tree | ab07e2786bcd81b137c40f8ce2084ccec62075e6 /source/gameengine/Converter/KX_ConvertActuators.cpp | |
parent | d3acfa1d87ccc7932b61311b7084951dcce67eba (diff) |
Audaspace: preparing to use standalone library.
- Renamed some functions.
- Using C API instead of C++ in the game engine, as the standalone is C++11.
Diffstat (limited to 'source/gameengine/Converter/KX_ConvertActuators.cpp')
-rw-r--r-- | source/gameengine/Converter/KX_ConvertActuators.cpp | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 10ee228b33f..1acbd0b1608 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -43,7 +43,6 @@ #ifdef WITH_AUDASPACE # include "AUD_C-API.h" -# include "AUD_ChannelMapperFactory.h" #endif // Actuators @@ -385,7 +384,7 @@ void BL_ConvertActuators(const char* maggiename, { bSound* sound = soundact->sound; bool is3d = soundact->flag & ACT_SND_3D_SOUND ? true : false; - boost::shared_ptr<AUD_IFactory> snd_sound; + AUD_Sound* snd_sound = NULL; KX_3DSoundSettings settings; settings.cone_inner_angle = RAD2DEGF(soundact->sound3D.cone_inner_angle); settings.cone_outer_angle = RAD2DEGF(soundact->sound3D.cone_outer_angle); @@ -404,27 +403,12 @@ void BL_ConvertActuators(const char* maggiename, } else { - snd_sound = *reinterpret_cast<boost::shared_ptr<AUD_IFactory>*>(sound->playback_handle); + snd_sound = sound->playback_handle; // if sound shall be 3D but isn't mono, we have to make it mono! if (is3d) { - try - { - boost::shared_ptr<AUD_IReader> reader = snd_sound->createReader(); - if (reader->getSpecs().channels != AUD_CHANNELS_MONO) - { - AUD_DeviceSpecs specs; - specs.channels = AUD_CHANNELS_MONO; - specs.rate = AUD_RATE_INVALID; - specs.format = AUD_FORMAT_INVALID; - snd_sound = boost::shared_ptr<AUD_IFactory>(new AUD_ChannelMapperFactory(snd_sound, specs)); - } - } - catch(AUD_Exception&) - { - // sound cannot be played... ignore - } + snd_sound = AUD_monoSound(snd_sound); } } KX_SoundActuator* tmpsoundact = @@ -436,6 +420,10 @@ void BL_ConvertActuators(const char* maggiename, settings, soundActuatorType); + // if we made it mono, we have to free it + if(snd_sound != sound->playback_handle && snd_sound != NULL) + AUD_unload(snd_sound); + tmpsoundact->SetName(bact->name); baseact = tmpsoundact; } |