diff --git a/code/nel/include/nel/sound/clustered_sound.h b/code/nel/include/nel/sound/clustered_sound.h index 4b28a71ec..e37762b20 100644 --- a/code/nel/include/nel/sound/clustered_sound.h +++ b/code/nel/include/nel/sound/clustered_sound.h @@ -189,7 +189,7 @@ public: const std::vector > &getAudioPath() { return _AudioPath;} - + static void buildSheets(const std::string &packedSheetPath); private: diff --git a/code/nel/include/nel/sound/u_audio_mixer.h b/code/nel/include/nel/sound/u_audio_mixer.h index 089013797..a1fb2b3cc 100644 --- a/code/nel/include/nel/sound/u_audio_mixer.h +++ b/code/nel/include/nel/sound/u_audio_mixer.h @@ -169,6 +169,10 @@ public: static std::string buildSampleBank(const std::vector &sampleList, const std::string &bankDir, const std::string &bankName); /// Build the sound bank packed sheets file from georges sound sheet files with .sound extension in the search path, and return the path to the written file. static std::string buildSoundBank(const std::string &packedSheetDir); + /// Build the cluster sound_group sheets. + static std::string buildClusteredSoundGroupSheets(const std::string &packedSheetDir); + /// Build the user var binding sheets. + static std::string buildUserVarBindingSheets(const std::string &packedSheetDir); /** Set the global path to the sample banks * If you have specified some sample bank to load in the * mixer config file, you MUST set the sample path diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index fdc6f6e11..0f3ff1110 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -988,6 +988,23 @@ std::string UAudioMixer::buildSoundBank(const std::string &packedSheetDir) return dir + "sounds.packed_sheets"; } +/// Build the cluster sound_group sheets. +std::string UAudioMixer::buildClusteredSoundGroupSheets(const std::string &packedSheetDir) +{ + std::string dir = CPath::standardizePath(packedSheetDir, true); + CClusteredSound::buildSheets(dir); + return dir + "sound_groups.packed_sheets"; +} + +/// Build the user var binding sheets. +std::string UAudioMixer::buildUserVarBindingSheets(const std::string &packedSheetDir) +{ + std::string dir = CPath::standardizePath(packedSheetDir, true); + std::map container; + ::loadForm("user_var_binding", dir + "user_var_binding.packed_sheets", container, true, false); + return dir + "user_var_binding.packed_sheets"; +} + void CAudioMixerUser::setBackgroundFlagName(uint flagIndex, const std::string &flagName) { if (flagIndex < TBackgroundFlags::NB_BACKGROUND_FLAGS) diff --git a/code/nel/src/sound/clustered_sound.cpp b/code/nel/src/sound/clustered_sound.cpp index 6e62f3176..52a9848da 100644 --- a/code/nel/src/sound/clustered_sound.cpp +++ b/code/nel/src/sound/clustered_sound.cpp @@ -160,10 +160,6 @@ public: }; -// this structure is fill by the loadForm() function and will contain all you need -std::map Container; - - CClusteredSound::CClusteredSound() : _Scene(0), _RootCluster(0), @@ -173,21 +169,27 @@ CClusteredSound::CClusteredSound() } +void CClusteredSound::buildSheets(const std::string &packedSheetPath) +{ + std::map container; + ::loadForm("sound_group", packedSheetPath + "sound_groups.packed_sheets", container, true, false); +} void CClusteredSound::init(NL3D::CScene *scene, float portalInterpolate, float maxEarDist, float minGain) { // load the sound_group sheets - ::loadForm("sound_group", CAudioMixerUser::instance()->getPackedSheetPath()+"sound_groups.packed_sheets", Container, CAudioMixerUser::instance()->getPackedSheetUpdate(), false); + std::map container; + ::loadForm("sound_group", CAudioMixerUser::instance()->getPackedSheetPath()+"sound_groups.packed_sheets", container, CAudioMixerUser::instance()->getPackedSheetUpdate(), false); // copy the container data into internal structure - std::map::iterator first(Container.begin()), last(Container.end()); + std::map::iterator first(container.begin()), last(container.end()); for (; first != last; ++first) { _SoundGroupToSound.insert(first->second._SoundGroupAssoc.begin(), first->second._SoundGroupAssoc.end()); } // and clear the temporary Container - Container.clear(); + container.clear(); _Scene = scene; diff --git a/code/nel/tools/sound/build_soundbank/build_soundbank.cpp b/code/nel/tools/sound/build_soundbank/build_soundbank.cpp index 082b08e90..9829a1898 100644 --- a/code/nel/tools/sound/build_soundbank/build_soundbank.cpp +++ b/code/nel/tools/sound/build_soundbank/build_soundbank.cpp @@ -88,6 +88,8 @@ int main(int nNbArg, char **ppArgs) // build the sound bank UAudioMixer::buildSoundBank(exportDir); + UAudioMixer::buildClusteredSoundGroupSheets(exportDir); + UAudioMixer::buildUserVarBindingSheets(exportDir); // and that's all folks return EXIT_SUCCESS;