diff --git a/code/nel/include/nel/3d/cluster.h b/code/nel/include/nel/3d/cluster.h index 552d7474a..14b3fb13c 100644 --- a/code/nel/include/nel/3d/cluster.h +++ b/code/nel/include/nel/3d/cluster.h @@ -21,6 +21,7 @@ #include "nel/misc/string_mapper.h" #include "nel/misc/plane.h" #include "nel/misc/aabbox.h" +#include "nel/misc/sheet_id.h" #include "nel/3d/transform.h" @@ -125,9 +126,9 @@ public: //\name Sound related. //@{ void setSoundGroup(const std::string &soundGroup); - void setSoundGroup(const NLMISC::TStringId &soundGroupId); + void setSoundGroup(const NLMISC::CSheetId &soundGroupId); const std::string &getSoundGroup(); - NLMISC::TStringId getSoundGroupId(); + NLMISC::CSheetId getSoundGroupId(); void setEnvironmentFx(const std::string &environmentFx); void setEnvironmentFx(const NLMISC::TStringId &environmentFxId); const std::string &getEnvironmentFx(); @@ -188,7 +189,7 @@ private: std::vector _Volume; /// Sound group name id - NLMISC::TStringId _SoundGroupId; + NLMISC::CSheetId _SoundGroupId; /// Environement Fx name Id (using CStringMapper) NLMISC::TStringId _EnvironmentFxId; diff --git a/code/nel/include/nel/3d/ps_sound.h b/code/nel/include/nel/3d/ps_sound.h index 4b923d4f1..af5a7cc94 100644 --- a/code/nel/include/nel/3d/ps_sound.h +++ b/code/nel/include/nel/3d/ps_sound.h @@ -21,6 +21,7 @@ #include "nel/misc/string_mapper.h" #include "nel/3d/ps_located.h" #include "nel/3d/ps_attrib.h" +#include "nel/misc/sheet_id.h" @@ -63,13 +64,13 @@ public: virtual void step(TPSProcessPass pass); /// set the name of the sound - void setSoundName(const NLMISC::TStringId &soundName) + void setSoundName(const NLMISC::CSheetId &soundName) { _SoundName = soundName; } /// get the name of the sound - const NLMISC::TStringId &getSoundName(void) const + const NLMISC::CSheetId &getSoundName(void) const { return _SoundName; } @@ -161,7 +162,7 @@ protected: void removeAllSources(); CPSAttrib _Sounds; - NLMISC::TStringId _SoundName; + NLMISC::CSheetId _SoundName; float _Gain; CPSAttribMaker * _GainScheme; float _Pitch; diff --git a/code/nel/include/nel/3d/u_ps_sound_impl.h b/code/nel/include/nel/3d/u_ps_sound_impl.h index f5436c842..bf45b6387 100644 --- a/code/nel/include/nel/3d/u_ps_sound_impl.h +++ b/code/nel/include/nel/3d/u_ps_sound_impl.h @@ -162,7 +162,7 @@ public: /// inherited from IPSSoundServer - UPSSoundInstance *createSound(const NLMISC::TStringId &soundName, bool spawned = true) + UPSSoundInstance *createSound(const NLMISC::CSheetId &soundName, bool spawned = true) { if (!_AudioMixer) return NULL; diff --git a/code/nel/include/nel/3d/u_ps_sound_interface.h b/code/nel/include/nel/3d/u_ps_sound_interface.h index c382b01bd..82002470b 100644 --- a/code/nel/include/nel/3d/u_ps_sound_interface.h +++ b/code/nel/include/nel/3d/u_ps_sound_interface.h @@ -19,6 +19,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/string_mapper.h" +#include "nel/misc/sheet_id.h" #include namespace NLMISC @@ -50,7 +51,7 @@ struct UPSSoundServer * \param spawn true if the sound must be spawned e.g it continues after this interface is removed * \param cb useful only for spawned sound, it tells when a spawned sound has been removed */ - virtual UPSSoundInstance *createSound(const NLMISC::TStringId &soundName, bool spawn = false) = 0; + virtual UPSSoundInstance *createSound(const NLMISC::CSheetId &soundName, bool spawn = false) = 0; }; diff --git a/code/nel/include/nel/sound/audio_mixer_user.h b/code/nel/include/nel/sound/audio_mixer_user.h index 20561b981..d8949c3d3 100644 --- a/code/nel/include/nel/sound/audio_mixer_user.h +++ b/code/nel/include/nel/sound/audio_mixer_user.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -180,7 +181,7 @@ public: // Load environment sounds ; treeRoot can be null if you don't want an access to the envsounds // virtual void loadEnvSounds( const char *filename, UEnvSound **treeRoot=NULL ); /// Get a TSoundId from a name (returns NULL if not found) - virtual TSoundId getSoundId( const NLMISC::TStringId &name ); + virtual TSoundId getSoundId( const NLMISC::CSheetId &name ); /// Gets the group controller for the given group tree path with separator '/', if it doesn't exist yet it will be created. /// Examples: "music", "effects", "dialog", "music/background", "music/loading", "music/player", etcetera @@ -192,7 +193,7 @@ public: * pass a callback function that will be called (if not NULL) just before deleting the spawned * source. */ - virtual USource *createSource( const NLMISC::TStringId &name, bool spawn=false, TSpawnEndCallback cb=NULL, void *cbUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL); + virtual USource *createSource( const NLMISC::CSheetId &name, bool spawn=false, TSpawnEndCallback cb=NULL, void *cbUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL); /// Add a logical sound source (by sound id). To remove a source, just delete it. See createSource(const char*) virtual USource *createSource( TSoundId id, bool spawn=false, TSpawnEndCallback cb=NULL, void *cbUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL); /// Add a source which was created by an EnvSound @@ -223,7 +224,7 @@ public: /// Return the names of the sounds (call this method after loadSounds()) - virtual void getSoundNames( std::vector &names ) const; + virtual void getSoundNames( std::vector &names ) const; /// Return the number of mixing tracks (voices) virtual uint getPolyphony() const { return (uint)_Tracks.size(); } /// Return the number of sources instance. @@ -444,7 +445,7 @@ private: /// Witch parameter to control TControledParamId ParamId; /// The controled sounds names. - std::vector SoundNames; + std::vector SoundNames; /// Current parameter value float Value; /// All the sources controled by this variable diff --git a/code/nel/include/nel/sound/background_sound.h b/code/nel/include/nel/sound/background_sound.h index 859035687..54e91e712 100644 --- a/code/nel/include/nel/sound/background_sound.h +++ b/code/nel/include/nel/sound/background_sound.h @@ -64,7 +64,7 @@ public: /// Associtation clas for storage of sound / filter. struct TSoundInfo { - NLMISC::TStringId SoundName; + NLMISC::CSheetId SoundName; UAudioMixer::TBackgroundFlags Filter; void serial(NLMISC::IStream &s) @@ -73,11 +73,11 @@ public: if (s.isReading()) { s.serial(soundName); - SoundName = NLMISC::CStringMapper::map(soundName); + SoundName = NLMISC::CSheetId(soundName);/*NLMISC::CStringMapper::map(soundName)*/; } else { - soundName = NLMISC::CStringMapper::unmap(SoundName); + soundName = SoundName.toString();/* NLMISC::CStringMapper::unmap(SoundName)*/; s.serial(soundName); } s.serial(Filter); diff --git a/code/nel/include/nel/sound/background_sound_manager.h b/code/nel/include/nel/sound/background_sound_manager.h index ad06f610f..11f33d2be 100644 --- a/code/nel/include/nel/sound/background_sound_manager.h +++ b/code/nel/include/nel/sound/background_sound_manager.h @@ -229,7 +229,7 @@ private: struct TSoundData { /// The name of the sound. - NLMISC::TStringId SoundName; + NLMISC::CSheetId SoundName; /// The reference to the sound. CSound *Sound; /// A source instance of the sound (may be NULL). diff --git a/code/nel/include/nel/sound/clustered_sound.h b/code/nel/include/nel/sound/clustered_sound.h index 4b28a71ec..0736c5a5c 100644 --- a/code/nel/include/nel/sound/clustered_sound.h +++ b/code/nel/include/nel/sound/clustered_sound.h @@ -249,11 +249,12 @@ private: /// The segment of all the audio path. std::vector > _AudioPath; - typedef CHashMap TClusterSoundCont; + typedef CHashMap TClusterSoundCont; /// The current cluster playing source indexed with sound group id TClusterSoundCont _Sources; - typedef CHashMap TStringStringMap; + typedef CHashMap TStringStringMap; + //typedef CHashMap TStringStringMap; /// The sound_group to sound assoc TStringStringMap _SoundGroupToSound; }; diff --git a/code/nel/include/nel/sound/complex_sound.h b/code/nel/include/nel/sound/complex_sound.h index 24d889575..a55649433 100644 --- a/code/nel/include/nel/sound/complex_sound.h +++ b/code/nel/include/nel/sound/complex_sound.h @@ -52,8 +52,8 @@ public: const std::vector &getSoundSeq() const { return _SoundSeq;} const std::vector &getDelaySeq() const { return _DelaySeq;} - NLMISC::TStringId getSound(uint index) const { return !_Sounds.empty() ? _Sounds[index%_Sounds.size()]:0;} - const std::vector &getSounds() const { return _Sounds;} + NLMISC::CSheetId getSound(uint index) const { return !_Sounds.empty() ? _Sounds[index%_Sounds.size()]:NLMISC::CSheetId::Unknown;} + const std::vector &getSounds() const { return _Sounds;} uint32 getFadeLength() const { return _XFadeLength;} @@ -87,7 +87,7 @@ private: virtual float getMaxDistance() const; TPATTERN_MODE _PatternMode; - std::vector _Sounds; + std::vector _Sounds; float _TicksPerSeconds; std::vector _SoundSeq; /// Sequence of delay in millisec. diff --git a/code/nel/include/nel/sound/context_sound.h b/code/nel/include/nel/sound/context_sound.h index b6cc201f0..13683ac56 100644 --- a/code/nel/include/nel/sound/context_sound.h +++ b/code/nel/include/nel/sound/context_sound.h @@ -133,7 +133,7 @@ class CContextSoundContainer : public IContextSoundContainer virtual void addSound(CSound *sound, const std::string &baseName) { - const std::string &patternName = NLMISC::CStringMapper::unmap(sound->getName()); + const std::string &patternName = sound->getName().toString(); /*NLMISC::CStringMapper::unmap(sound->getName())*/; nlassert(patternName.size() >= baseName.size()); std::string arg; @@ -172,7 +172,7 @@ class CContextSoundContainer : public IContextSoundContainer if (i != NbJoker) return; - nlassertex(i==NbJoker, ("Error while adding sound '%s' into context sound container", NLMISC::CStringMapper::unmap(sound->getName()).c_str())); + nlassertex(i==NbJoker, ("Error while adding sound '%s' into context sound container", sound->getName().toString().c_str()/*NLMISC::CStringMapper::unmap(sound->getName()).c_str()*/)); sint randomValue = 0; if (UseRandom) @@ -187,7 +187,7 @@ class CContextSoundContainer : public IContextSoundContainer } else if (!arg.empty()) { - nlassertex (!ok, ("Error while adding sound '%s' into context sound container", NLMISC::CStringMapper::unmap(sound->getName()).c_str())); + nlassertex (!ok, ("Error while adding sound '%s' into context sound container", sound->getName().toString().c_str()/*NLMISC::CStringMapper::unmap(sound->getName()).c_str()*/)); // end of the argument. NLMISC::fromString(arg, randomValue); arg.clear(); @@ -199,13 +199,13 @@ class CContextSoundContainer : public IContextSoundContainer // read the potential last arg. if (!arg.empty()) { - nlassertex (!ok, ("Error while adding sound '%s' into context sound container", NLMISC::CStringMapper::unmap(sound->getName()).c_str())); + nlassertex (!ok, ("Error while adding sound '%s' into context sound container", sound->getName().toString().c_str()/*NLMISC::CStringMapper::unmap(sound->getName()).c_str()*/)); // end of the argument. NLMISC::fromString(arg, randomValue); arg.clear(); ok = true; } - nlassertex (ok, ("Error while adding sound '%s' into context sound container", NLMISC::CStringMapper::unmap(sound->getName()).c_str())); + nlassertex (ok, ("Error while adding sound '%s' into context sound container", sound->getName().toString().c_str()/*NLMISC::CStringMapper::unmap(sound->getName()).c_str()*/)); } else @@ -221,9 +221,9 @@ class CContextSoundContainer : public IContextSoundContainer if (!ret.second) { typename THashContextSound::iterator it = _ContextSounds.find(cm); - nlassertex(it != _ContextSounds.end(), ("Error wile adding soudn '%s' into context sound container", NLMISC::CStringMapper::unmap(sound->getName()).c_str())); + nlassertex(it != _ContextSounds.end(), ("Error wile adding soudn '%s' into context sound container", sound->getName().toString().c_str()/*NLMISC::CStringMapper::unmap(sound->getName()).c_str()*/)); - nlwarning("Sound %s has the same context matcher as the sound %s", NLMISC::CStringMapper::unmap(sound->getName()).c_str(), NLMISC::CStringMapper::unmap(it->second->getName()).c_str()); + nlwarning("Sound %s has the same context matcher as the sound %s", sound->getName().toString().c_str()/*NLMISC::CStringMapper::unmap(sound->getName()).c_str()*/, it->second->getName().toString().c_str() /*NLMISC::CStringMapper::unmap(it->second->getName()).c_str()*/); } } @@ -249,7 +249,7 @@ class CContextSoundContainer : public IContextSoundContainer typename THashContextSound::const_iterator first(_ContextSounds.begin()), last(_ContextSounds.end()); for (; first != last; ++first) { - subsounds.push_back(std::make_pair(NLMISC::CStringMapper::unmap(first->second->getName()), first->second)); + subsounds.push_back(std::make_pair(first->second->getName().toString()/*NLMISC::CStringMapper::unmap(first->second->getName())*/, first->second)); } } diff --git a/code/nel/include/nel/sound/sound.h b/code/nel/include/nel/sound/sound.h index f81f6a9b7..c4c494912 100644 --- a/code/nel/include/nel/sound/sound.h +++ b/code/nel/include/nel/sound/sound.h @@ -22,6 +22,7 @@ #include "nel/misc/string_mapper.h" #include "nel/sound/u_source.h" #include "nel/georges/u_form_elm.h" +#include "nel/misc/sheet_id.h" #include namespace NLSOUND { @@ -35,7 +36,7 @@ class CGroupController; /// Sound names hash map //typedef std::hash_map TSoundMap; -typedef CHashMap TSoundMap; +typedef CHashMap TSoundMap; /// Sound names set (for ambiant sounds) typedef std::set TSoundSet; @@ -99,7 +100,7 @@ public: /// Return the length of the sound in ms virtual uint32 getDuration() = 0; /// Return the name (must be unique) - const NLMISC::TStringId& getName() const { return _Name; } + const NLMISC::CSheetId& getName() const { return _Name; } /// Return the min distance (if detailed()) (default 1.0f if not implemented by sound type) virtual float getMinDistance() const { return _MinDist; } @@ -121,7 +122,8 @@ public: bool operator<( const CSound& otherSound ) const { - return NLMISC::CStringMapper::unmap(_Name) < NLMISC::CStringMapper::unmap(otherSound._Name); + //return NLMISC::CStringMapper::unmap(_Name) < NLMISC::CStringMapper::unmap(otherSound._Name); + return _Name.toString() < otherSound._Name.toString(); } protected: @@ -142,7 +144,7 @@ protected: float _MaxDist; // Sound name. - NLMISC::TStringId _Name; + NLMISC::CSheetId _Name; /// An optional user var controler. NLMISC::TStringId _UserVarControler; diff --git a/code/nel/include/nel/sound/sound_anim_marker.h b/code/nel/include/nel/sound/sound_anim_marker.h index 583febbfc..8a00a1bed 100644 --- a/code/nel/include/nel/sound/sound_anim_marker.h +++ b/code/nel/include/nel/sound/sound_anim_marker.h @@ -20,6 +20,7 @@ #include "nel/misc/string_mapper.h" #include "nel/3d/cluster.h" #include "nel/sound/u_source.h" +#include "nel/misc/sheet_id.h" namespace NLMISC @@ -31,7 +32,7 @@ namespace NLMISC namespace NLSOUND { -typedef std::set TMarkerSoundSet; +typedef std::set TMarkerSoundSet; class UAudioMixer; @@ -50,13 +51,13 @@ public: virtual float getTime() const { return _Time; } /** Add a new sound in the set of to-be-played sounds for this marker */ - virtual void addSound(const NLMISC::TStringId &soundName); + virtual void addSound(const NLMISC::CSheetId &soundName); /** Remove a sound */ - virtual void removeSound(const NLMISC::TStringId &soundName); + virtual void removeSound(const NLMISC::CSheetId &soundName); /** Return the set of sounds of this marker */ - virtual void getSounds(std::vector &sounds); + virtual void getSounds(std::vector &sounds); /** Play all the sounds of this marker */ virtual void play(UAudioMixer* mixer, NL3D::CCluster *cluster, CSoundContext &context); diff --git a/code/nel/include/nel/sound/sound_bank.h b/code/nel/include/nel/sound/sound_bank.h index 7d3d7e446..8a4573849 100644 --- a/code/nel/include/nel/sound/sound_bank.h +++ b/code/nel/include/nel/sound/sound_bank.h @@ -20,6 +20,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/string_mapper.h" #include "nel/sound/audio_mixer_user.h" +#include "nel/misc/sheet_id.h" #include namespace NLSOUND { @@ -67,16 +68,16 @@ public: bool isLoaded(); /// Return a sound corresponding to a name. - CSound *getSound(const NLMISC::TStringId &name); + CSound *getSound(const NLMISC::CSheetId &name); /// Return the names of the sounds - void getNames( std::vector &names ); + void getNames( std::vector &names ); /// Return the number of sounds in this bank. uint countSounds(); void addSound(CSound *sound); - void removeSound(const NLMISC::TStringId &name); + void removeSound(const NLMISC::CSheetId &name); private: @@ -88,7 +89,7 @@ private: typedef CHashMap TBufferAssocContainer; /// Sound names hash map // typedef std::hash_map TSoundTable; - typedef CHashMap TSoundTable; + typedef CHashMap TSoundTable; /// Assoc from buffer to sound. Used for sound unloading. TBufferAssocContainer _BufferAssoc; diff --git a/code/nel/include/nel/sound/source_common.h b/code/nel/include/nel/sound/source_common.h index 96f11aabe..2369b9a7d 100644 --- a/code/nel/include/nel/sound/source_common.h +++ b/code/nel/include/nel/sound/source_common.h @@ -23,6 +23,7 @@ #include "nel/3d/cluster.h" #include "nel/sound/sound.h" #include "nel/sound/group_controller.h" +#include "nel/misc/sheet_id.h" namespace NLSOUND { diff --git a/code/nel/include/nel/sound/u_audio_mixer.h b/code/nel/include/nel/sound/u_audio_mixer.h index 74c96f0dd..0d845f9c3 100644 --- a/code/nel/include/nel/sound/u_audio_mixer.h +++ b/code/nel/include/nel/sound/u_audio_mixer.h @@ -19,6 +19,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/string_mapper.h" +#include "nel/misc/sheet_id.h" #include "nel/sound/u_source.h" #include "nel/sound/u_group_controller.h" #include "nel/ligo/primitive.h" @@ -284,7 +285,7 @@ public: //@} /// Get a TSoundId from a name (returns NULL if not found) - virtual TSoundId getSoundId( const NLMISC::TStringId &name ) = 0; + virtual TSoundId getSoundId( const NLMISC::CSheetId &name ) = 0; /// Gets the group controller for the given group tree path with separator '/', if it doesn't exist yet it will be created. /// Examples: "music", "effects", "dialog", "music/background", "music/loading", "music/player", etcetera @@ -296,7 +297,7 @@ public: * pass a callback function that will be called (if not NULL) just before deleting the spawned * source. */ - virtual USource *createSource(const NLMISC::TStringId &name, bool spawn=false, TSpawnEndCallback cb=NULL, void *callbackUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL) = 0; + virtual USource *createSource(const NLMISC::CSheetId &name, bool spawn=false, TSpawnEndCallback cb=NULL, void *callbackUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL) = 0; /// Add a logical sound source (by sound id). To remove a source, just delete it. See createSource(const char*) virtual USource *createSource(TSoundId id, bool spawn=false, TSpawnEndCallback cb=NULL, void *callbackUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL) = 0; @@ -320,7 +321,7 @@ public: //@{ //@name Statistic and utility methods /// Fill a vector with the names of all loaded sounds. - virtual void getSoundNames( std::vector &names ) const = 0; + virtual void getSoundNames( std::vector &names ) const = 0; /// Return the number of mixing tracks (voices) virtual uint getPolyphony() const = 0; /// Return the number of sources diff --git a/code/nel/samples/sound/sound_sources/main.cpp b/code/nel/samples/sound/sound_sources/main.cpp index 006a5ad41..3ece14f73 100644 --- a/code/nel/samples/sound/sound_sources/main.cpp +++ b/code/nel/samples/sound/sound_sources/main.cpp @@ -100,7 +100,7 @@ USource *OnAddSource( const char *name, float x, float y, float z ) /* * Create a source with sound 'name', and set some of its initial properties, if successful */ - USource *source = AudioMixer->createSource( CStringMapper::map(name) ); + USource *source = AudioMixer->createSource( /*CStringMapper::map(name)*/ CSheetId(name) ); if ( source != NULL ) { source->setPos( CVector(x,y,z) ); diff --git a/code/nel/samples/sound/stream_file/stream_file.cpp b/code/nel/samples/sound/stream_file/stream_file.cpp index cd40d6b76..060c4b433 100644 --- a/code/nel/samples/sound/stream_file/stream_file.cpp +++ b/code/nel/samples/sound/stream_file/stream_file.cpp @@ -97,7 +97,7 @@ static void initSample() //NLMISC::CHTimer::startBench(); - s_Source = s_AudioMixer->createSource(CStringMapper::map("stream_file")); + s_Source = s_AudioMixer->createSource(/*CStringMapper::map("stream_file")*/ CSheetId("stream_file")); nlassert(s_Source); s_StreamFileSource = dynamic_cast(s_Source); nlassert(s_StreamFileSource); diff --git a/code/nel/samples/sound/stream_ogg_vorbis/stream_ogg_vorbis.cpp b/code/nel/samples/sound/stream_ogg_vorbis/stream_ogg_vorbis.cpp index 6f3f0d19c..490ae8dd5 100644 --- a/code/nel/samples/sound/stream_ogg_vorbis/stream_ogg_vorbis.cpp +++ b/code/nel/samples/sound/stream_ogg_vorbis/stream_ogg_vorbis.cpp @@ -87,7 +87,7 @@ static void initSample() //NLMISC::CHTimer::startBench(); - USource *source = s_AudioMixer->createSource(CStringMapper::map("default_stream")); + USource *source = s_AudioMixer->createSource(CSheetId("default_stream")/*CStringMapper::map("default_stream")*/); nlassert(source); s_StreamSource = dynamic_cast(source); nlassert(s_StreamSource); diff --git a/code/nel/src/3d/cluster.cpp b/code/nel/src/3d/cluster.cpp index 2faebcec7..cb34b7f10 100644 --- a/code/nel/src/3d/cluster.cpp +++ b/code/nel/src/3d/cluster.cpp @@ -51,7 +51,9 @@ CCluster::CCluster () // map a no fx string _EnvironmentFxId = CStringMapper::map("no fx"); // map a no soundgroup string - _SoundGroupId = CStringMapper::map(""); + _SoundGroupId = NLMISC::CSheetId::Unknown; /*CStringMapper::map("")*/; + nldebug("SOUNDSHEET: %s", _SoundGroupId.toString().c_str()); + // I am a transform cluster CTransform::setIsCluster(true); @@ -76,18 +78,21 @@ CCluster::~CCluster() void CCluster::setSoundGroup(const std::string &soundGroup) { - _SoundGroupId = CStringMapper::map(soundGroup); + _SoundGroupId = NLMISC::CSheetId(soundGroup);/*CStringMapper::map(soundGroup);*/ + nldebug("SOUNDSHEET: %s", _SoundGroupId.toString().c_str()); + } -void CCluster::setSoundGroup(const NLMISC::TStringId &soundGroupId) +void CCluster::setSoundGroup(const NLMISC::CSheetId &soundGroupId) { _SoundGroupId = soundGroupId; + nldebug("SOUNDSHEET: %s", _SoundGroupId.toString().c_str()); } const std::string &CCluster::getSoundGroup() { - return CStringMapper::unmap(_SoundGroupId); + return _SoundGroupId.toString();/*CStringMapper::unmap(_SoundGroupId)*/; } -NLMISC::TStringId CCluster::getSoundGroupId() +NLMISC::CSheetId CCluster::getSoundGroupId() { return _SoundGroupId; } @@ -304,7 +309,8 @@ void CCluster::serial (NLMISC::IStream&f) std::string envFxName; f.serial(soundGroup); - _SoundGroupId = CStringMapper::map(soundGroup); + _SoundGroupId = NLMISC::CSheetId(soundGroup); /*CStringMapper::map(soundGroup)*/; + nldebug("SOUNDSHEET: %s", _SoundGroupId.toString().c_str()); f.serial(envFxName); if (envFxName == "") @@ -314,7 +320,7 @@ void CCluster::serial (NLMISC::IStream&f) else { // write the sound group - std::string soundGroup = CStringMapper::unmap(_SoundGroupId); + std::string soundGroup = _SoundGroupId.toString();/*CStringMapper::unmap(_SoundGroupId)*/; f.serial(soundGroup); // write the env fx name std::string envFxName = CStringMapper::unmap(_EnvironmentFxId); diff --git a/code/nel/src/3d/ps_sound.cpp b/code/nel/src/3d/ps_sound.cpp index a1c8d0982..322bd2729 100644 --- a/code/nel/src/3d/ps_sound.cpp +++ b/code/nel/src/3d/ps_sound.cpp @@ -43,7 +43,7 @@ CPSSound::CPSSound() : _Gain(1.f), { NL_PS_FUNC(CPSSound_CPSSound) if (CParticleSystem::getSerializeIdentifierFlag()) _Name = std::string("sound"); - _SoundName = NLMISC::CStringMapper::emptyId(); + _SoundName = NLMISC::CSheetId::Unknown /*NLMISC::CStringMapper::emptyId()*/; } // *************************************************************************************************** @@ -265,11 +265,11 @@ void CPSSound::serial(NLMISC::IStream &f) throw(NLMISC::EStream) { std::string soundName; f.serial(soundName); - _SoundName = NLMISC::CStringMapper::map(soundName); + _SoundName = NLMISC::CSheetId(soundName)/*NLMISC::CStringMapper::map(soundName)*/; } else { - std::string soundName = NLMISC::CStringMapper::unmap(_SoundName); + std::string soundName = _SoundName.toString()/*NLMISC::CStringMapper::unmap(_SoundName)*/; f.serial(soundName); } diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index b9d26a882..016f3d13d 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -23,6 +23,7 @@ #include "nel/misc/command.h" #include "nel/misc/file.h" #include "nel/misc/path.h" +#include "nel/misc/sheet_id.h" #include "nel/georges/u_form_loader.h" #include "nel/georges/u_form_elm.h" @@ -1051,7 +1052,7 @@ public: items->getArrayValue(soundName, i); soundName = soundName.substr(0, soundName.find(".sound")); - cs.SoundNames.push_back(CStringMapper::map(soundName)); + cs.SoundNames.push_back(CSheetId(soundName)/*CStringMapper::map(soundName)*/); } if (!cs.SoundNames.empty()) @@ -1101,7 +1102,7 @@ void CAudioMixerUser::initUserVar() TUserVarControlsContainer::iterator first(_UserVarControls.begin()), last(_UserVarControls.end()); for(; first != last; ++first) { - std::vector::iterator first2(first->second.SoundNames.begin()), last2(first->second.SoundNames.end()); + std::vector::iterator first2(first->second.SoundNames.begin()), last2(first->second.SoundNames.end()); for (; first2 != last2; ++first2) { CSound *sound = getSoundId(*first2); @@ -1132,7 +1133,7 @@ void CAudioMixerUser::CControledSources::serial(NLMISC::IStream &s) for (uint i=0; igetSound(name); } @@ -1894,7 +1895,7 @@ retrySound: if (invalid) { - nlwarning("The sound %s contain an infinite recursion !", CStringMapper::unmap(id->getName()).c_str()); + nlwarning("The sound %s contain an infinite recursion !", id->getName().toString().c_str()/*CStringMapper::unmap(id->getName()).c_str()*/); return NULL; } @@ -2035,7 +2036,7 @@ retrySound: // ****************************************************************** -USource *CAudioMixerUser::createSource( const NLMISC::TStringId &name, bool spawn, TSpawnEndCallback cb, void *userParam, NL3D::CCluster *cluster, CSoundContext *context, UGroupController *groupController) +USource *CAudioMixerUser::createSource( const NLMISC::CSheetId &name, bool spawn, TSpawnEndCallback cb, void *userParam, NL3D::CCluster *cluster, CSoundContext *context, UGroupController *groupController) { return createSource( getSoundId( name ), spawn, cb, userParam, cluster, context, groupController); } @@ -2162,7 +2163,7 @@ bool CAudioMixerUser::unloadSampleBank(const std::string &name) // ****************************************************************** -void CAudioMixerUser::getSoundNames( std::vector &names ) const +void CAudioMixerUser::getSoundNames( std::vector &names ) const { _SoundBank->getNames(names); } diff --git a/code/nel/src/sound/background_sound.cpp b/code/nel/src/sound/background_sound.cpp index ac4cc58cf..66de89e79 100644 --- a/code/nel/src/sound/background_sound.cpp +++ b/code/nel/src/sound/background_sound.cpp @@ -84,7 +84,7 @@ void CBackgroundSound::importForm(const std::string& filename, NLGEORGES::UFormE // Read the sound name. std::string soundName; psoundItem->getValueByName(soundName, "Sound"); - sound.SoundName = CStringMapper::map(CFile::getFilenameWithoutExtension(soundName)); + sound.SoundName = NLMISC::CSheetId(CFile::getFilenameWithoutExtension(soundName));/*CStringMapper::map(CFile::getFilenameWithoutExtension(soundName))*/; // Read the environnement flag. @@ -133,7 +133,7 @@ void CBackgroundSound::getSubSoundList(std::vectorgetSoundId(first->SoundName); - subsounds.push_back(make_pair(CStringMapper::unmap(first->SoundName), sound)); + subsounds.push_back(make_pair(first->SoundName.toString()/*CStringMapper::unmap(first->SoundName)*/, sound)); } } diff --git a/code/nel/src/sound/background_sound_manager.cpp b/code/nel/src/sound/background_sound_manager.cpp index c93e0bab0..4eb5b042d 100644 --- a/code/nel/src/sound/background_sound_manager.cpp +++ b/code/nel/src/sound/background_sound_manager.cpp @@ -86,7 +86,7 @@ void CBackgroundSoundManager::addSound(const std::string &soundName, uint layerI CAudioMixerUser *mixer = CAudioMixerUser::instance(); TSoundData sd; - sd.SoundName = CStringMapper::map(soundName); + sd.SoundName = /*CStringMapper::map(soundName)*/ NLMISC::CSheetId(soundName); sd.Sound = mixer->getSoundId(sd.SoundName); sd.Source = 0; @@ -133,7 +133,7 @@ void CBackgroundSoundManager::addSound(const std::string &soundName, uint layerI } else { - nlwarning ("The sound '%s' can't be loaded", CStringMapper::unmap(sd.SoundName).c_str()); + nlwarning ("The sound '%s' can't be loaded", sd.SoundName.toString().c_str()/*CStringMapper::unmap(sd.SoundName).c_str()*/); } } @@ -1437,14 +1437,14 @@ void CBackgroundSoundManager::TSoundData::serial(NLMISC::IStream &s) { CAudioMixerUser *mixer = CAudioMixerUser::instance(); s.serial(str); - SoundName = NLMISC::CStringMapper::map(str); + SoundName = /*NLMISC::CStringMapper::map(str)*/ NLMISC::CSheetId(str); Sound = mixer->getSoundId(SoundName); Source = NULL; Selected = false; } else { - s.serial(const_cast(NLMISC::CStringMapper::unmap(SoundName))); + s.serial(const_cast(SoundName.toString()/*NLMISC::CStringMapper::unmap(SoundName)*/)); } s.serial(MinBox); s.serial(MaxBox); diff --git a/code/nel/src/sound/clustered_sound.cpp b/code/nel/src/sound/clustered_sound.cpp index 6e62f3176..c2a8db8ef 100644 --- a/code/nel/src/sound/clustered_sound.cpp +++ b/code/nel/src/sound/clustered_sound.cpp @@ -70,7 +70,7 @@ float EAX_MATERIAL_PARAM[] = class CSoundGroupSerializer { public: - std::vector > _SoundGroupAssoc; + std::vector > _SoundGroupAssoc; // load the values using the george sheet (called by GEORGE::loadForm) void readGeorges (const NLMISC::CSmartPtr &form, const std::string &/* name */) @@ -103,7 +103,7 @@ public: sound = sound.substr(0, n); } - _SoundGroupAssoc.push_back(make_pair(CStringMapper::map(soundGroup), CStringMapper::map(sound))); + _SoundGroupAssoc.push_back(make_pair(CSheetId(soundGroup), CSheetId(sound) /*CStringMapper::map(soundGroup), CStringMapper::map(sound)*/)); } } catch(...) @@ -131,15 +131,15 @@ public: s.serial(soundGroup); s.serial(sound); - _SoundGroupAssoc.push_back(make_pair(CStringMapper::map(soundGroup), CStringMapper::map(sound))); + _SoundGroupAssoc.push_back(make_pair(CSheetId(soundGroup), CSheetId(sound) /*CStringMapper::map(soundGroup), CStringMapper::map(sound)*/)); } else { std::string soundGroup; std::string sound; - soundGroup = CStringMapper::unmap(_SoundGroupAssoc[i].first); - sound = CStringMapper::unmap(_SoundGroupAssoc[i].second); + soundGroup = _SoundGroupAssoc[i].first.toString();// CStringMapper::unmap(_SoundGroupAssoc[i].first); + sound = _SoundGroupAssoc[i].second.toString(); //CStringMapper::unmap(_SoundGroupAssoc[i].second); s.serial(soundGroup); s.serial(sound); @@ -254,10 +254,10 @@ void CClusteredSound::update(const CVector &listenerPos, const CVector &/* view TClusterStatusMap::const_iterator first(_AudibleClusters.begin()), last(_AudibleClusters.end()); for (; first != last; ++first ) { - static NLMISC::TStringId NO_SOUND_GROUP = CStringMapper::emptyId(); + static NLMISC::CSheetId NO_SOUND_GROUP = /*CStringMapper::emptyId()*/NLMISC::CSheetId::Unknown; const CClusterSoundStatus &css = first->second; CCluster *cluster = first->first; - NLMISC::TStringId soundGroup; + NLMISC::CSheetId soundGroup; soundGroup = cluster->getSoundGroupId(); @@ -292,7 +292,7 @@ void CClusteredSound::update(const CVector &listenerPos, const CVector &/* view TStringStringMap::iterator it2(_SoundGroupToSound.find(soundGroup)); if (it2 != _SoundGroupToSound.end()) { - NLMISC::TStringId soundName = it2->second; + NLMISC::CSheetId soundName = it2->second; CClusterSound cs; // nldebug("Found the sound [%s] for sound group [%s]", CStringMapper::unmap(soundName).c_str(), CStringMapper::unmap(soundGroup).c_str()); diff --git a/code/nel/src/sound/complex_sound.cpp b/code/nel/src/sound/complex_sound.cpp index 30b97347f..ae770eb8d 100644 --- a/code/nel/src/sound/complex_sound.cpp +++ b/code/nel/src/sound/complex_sound.cpp @@ -19,6 +19,7 @@ #include "nel/misc/path.h" #include "nel/misc/common.h" #include "nel/sound/audio_mixer_user.h" +#include "nel/misc/sheet_id.h" using namespace std; using namespace NLMISC; @@ -63,11 +64,11 @@ void CComplexSound::parseSequence(const std::string &str, std::vector &s void CComplexSound::getSubSoundList(std::vector > &subsounds) const { CAudioMixerUser *mixer = CAudioMixerUser::instance(); - std::vector::const_iterator first(_Sounds.begin()), last(_Sounds.end()); + std::vector::const_iterator first(_Sounds.begin()), last(_Sounds.end()); for (; first != last; ++first) { CSound *sound = mixer->getSoundId(*first); - subsounds.push_back(make_pair(CStringMapper::unmap(*first), sound)); + subsounds.push_back(make_pair((*first).toString()/*CStringMapper::unmap(*first)*/, sound)); } } @@ -83,7 +84,7 @@ uint32 CComplexSound::getDuration() CAudioMixerUser *mixer = CAudioMixerUser::instance(); vector durations; - std::vector::iterator first(_Sounds.begin()), last(_Sounds.end()); + std::vector::iterator first(_Sounds.begin()), last(_Sounds.end()); for (; first != last; ++first) { CSound *sound = mixer->getSoundId(*first); @@ -204,7 +205,7 @@ float CComplexSound::getMaxDistance() const CComplexSound *This = const_cast(this); This->_MaxDist = 0.0f; - std::vector::const_iterator first(_Sounds.begin()), last(_Sounds.end()); + std::vector::const_iterator first(_Sounds.begin()), last(_Sounds.end()); for (; first != last; ++first) { @@ -236,7 +237,7 @@ void CComplexSound::serial(NLMISC::IStream &s) { std::string name; s.serial(name); - _Sounds.push_back(CStringMapper::map(name)); + _Sounds.push_back(/*CStringMapper::map(name)*/NLMISC::CSheetId(name)); } } else @@ -245,7 +246,7 @@ void CComplexSound::serial(NLMISC::IStream &s) s.serial(nb); for (uint i=0; igetArrayValue(soundname, i)) { soundname = CFile::getFilenameWithoutExtension(soundname); - _Sounds.push_back(CStringMapper::map(soundname)); + _Sounds.push_back(NLMISC::CSheetId(soundname)/*CStringMapper::map(soundname)*/); } } } diff --git a/code/nel/src/sound/complex_source.cpp b/code/nel/src/sound/complex_source.cpp index 25f6e413e..685897413 100644 --- a/code/nel/src/sound/complex_source.cpp +++ b/code/nel/src/sound/complex_source.cpp @@ -190,9 +190,9 @@ void CComplexSource::playStuf() case CComplexSound::MODE_ALL_IN_ONE: { // just spanw all the listed source. - const std::vector &sounds = _PatternSound->getSounds(); + const std::vector &sounds = _PatternSound->getSounds(); - std::vector::const_iterator first(sounds.begin()), last(sounds.end()); + std::vector::const_iterator first(sounds.begin()), last(sounds.end()); if (_AllSources.empty()) { @@ -524,7 +524,7 @@ void CComplexSource::onUpdate() else { // no sound after, just set an event at end of current sound to stop the complex sound. - nldebug("Setting last event for sound %s in %u millisec.", CStringMapper::unmap(_Source1->getSound()->getName()).c_str(), _Source1->getSound()->getDuration()); + nldebug("Setting last event for sound %s in %u millisec.", _Source1->getSound()->getName().toString().c_str()/*CStringMapper::unmap(_Source1->getSound()->getName()).c_str()*/, _Source1->getSound()->getDuration()); if (_PatternSound->doFadeOut()) { // set the event to begin fade out. diff --git a/code/nel/src/sound/context_sound.cpp b/code/nel/src/sound/context_sound.cpp index ea24835cc..71ffb9b20 100644 --- a/code/nel/src/sound/context_sound.cpp +++ b/code/nel/src/sound/context_sound.cpp @@ -187,7 +187,7 @@ void CContextSound::init() } else { - nlassertex(nbJoker < SoundContextNbArgs, ("Error will trying to play ContextSound '%s'", CStringMapper::unmap(_Name).c_str())); + nlassertex(nbJoker < SoundContextNbArgs, ("Error will trying to play ContextSound '%s'", _Name.toString().c_str()/*CStringMapper::unmap(_Name).c_str()*/)); fromString(index, contextArgIndex[nbJoker++]); parseArg = false; index = ""; @@ -195,13 +195,13 @@ void CContextSound::init() } else if (*first == 'r') { - nlassertex(useRandom == false, ("Error will trying to play ContextSound '%s'", CStringMapper::unmap(_Name).c_str())); + nlassertex(useRandom == false, ("Error will trying to play ContextSound '%s'", _Name.toString().c_str()/*CStringMapper::unmap(_Name).c_str()*/)); useRandom = true; } } else if (*first == '%') { - nlassertex(useRandom == false, ("Error will trying to play ContextSound '%s'", CStringMapper::unmap(_Name).c_str())); + nlassertex(useRandom == false, ("Error will trying to play ContextSound '%s'", _Name.toString().c_str()/*CStringMapper::unmap(_Name).c_str()*/)); parseArg = true; } } @@ -215,7 +215,7 @@ void CContextSound::init() } else { - nlassertex(nbJoker < SoundContextNbArgs, ("Error will trying to play ContextSound '%s'", CStringMapper::unmap(_Name).c_str())); + nlassertex(nbJoker < SoundContextNbArgs, ("Error will trying to play ContextSound '%s'", _Name.toString().c_str()/*CStringMapper::unmap(_Name).c_str()*/)); fromString(index, contextArgIndex[nbJoker++]); parseArg = false; } @@ -247,7 +247,7 @@ void CContextSound::init() LM_CASE_CONTAINER_CREATOR(9) LM_CASE_CONTAINER_CREATOR(10) default: - nlwarning("Unsuported number of context argument in context sound '%s'!", CStringMapper::unmap(_Name).c_str()); + nlwarning("Unsuported number of context argument in context sound '%s'!", _Name.toString().c_str()/*CStringMapper::unmap(_Name).c_str()*/); return; } // cleanup macro @@ -257,14 +257,14 @@ void CContextSound::init() // ok, we have the container, now fill it with the sound { - std::vector allSounds; + std::vector allSounds; // CSoundBank::getSoundNames(allSounds); CAudioMixerUser::instance()->getSoundNames(allSounds); - std::vector::iterator first(allSounds.begin()), last(allSounds.end()); + std::vector::iterator first(allSounds.begin()), last(allSounds.end()); for (; first != last; ++first) { - const std::string &soundName = CStringMapper::unmap(*first); + const std::string &soundName = first->toString()/*CStringMapper::unmap(*first)*/; if (soundName.size() > _BaseName.size()) { uint i; diff --git a/code/nel/src/sound/sound.cpp b/code/nel/src/sound/sound.cpp index f4432a478..bb9fd9372 100644 --- a/code/nel/src/sound/sound.cpp +++ b/code/nel/src/sound/sound.cpp @@ -137,11 +137,11 @@ void CSound::serial(NLMISC::IStream &s) { std::string name; s.serial(name); - _Name = CStringMapper::map(name); + _Name = NLMISC::CSheetId(name);//CStringMapper::map(name); } else { - std::string name = CStringMapper::unmap(_Name); + std::string name = _Name.toString();//CStringMapper::unmap(_Name); s.serial(name); } @@ -170,7 +170,7 @@ void CSound::serial(NLMISC::IStream &s) void CSound::importForm(const std::string& filename, NLGEORGES::UFormElm& root) { // Name - _Name = CStringMapper::map(CFile::getFilenameWithoutExtension(filename)); + _Name = NLMISC::CSheetId(CFile::getFilenameWithoutExtension(filename));//CStringMapper::map(CFile::getFilenameWithoutExtension(filename)); // InternalConeAngle uint32 inner; diff --git a/code/nel/src/sound/sound_anim_marker.cpp b/code/nel/src/sound/sound_anim_marker.cpp index cf1198280..40e058589 100644 --- a/code/nel/src/sound/sound_anim_marker.cpp +++ b/code/nel/src/sound/sound_anim_marker.cpp @@ -41,7 +41,7 @@ void CSoundAnimMarker::play(UAudioMixer* mixer, NL3D::CCluster *cluster, CSoundC for (; first != last; ++first) { - USource* source = mixer->createSource((*first), true, NULL, NULL, cluster, &context); + USource* source = mixer->createSource(NLMISC::CSheetId(*first), true, NULL, NULL, cluster, &context); if (source != NULL) { source->setRelativeGain(context.RelativeGain); @@ -53,19 +53,19 @@ void CSoundAnimMarker::play(UAudioMixer* mixer, NL3D::CCluster *cluster, CSoundC // ******************************************************** -void CSoundAnimMarker::addSound(const NLMISC::TStringId& soundName) +void CSoundAnimMarker::addSound(const NLMISC::CSheetId& soundName) { pair inserted; inserted = _Sounds.insert(soundName); if (inserted.second == false) { - nlwarning("Duplicate sound (%s)", CStringMapper::unmap(soundName).c_str()); + nlwarning("Duplicate sound (%s)",/* CStringMapper::unmap(soundName).c_str()*/soundName.toString().c_str()); } } // ******************************************************** -void CSoundAnimMarker::removeSound(const NLMISC::TStringId &soundName) +void CSoundAnimMarker::removeSound(const NLMISC::CSheetId &soundName) { TMarkerSoundSet::iterator iter = _Sounds.find(soundName); if (iter != _Sounds.end()) @@ -74,13 +74,13 @@ void CSoundAnimMarker::removeSound(const NLMISC::TStringId &soundName) } else { - nlwarning("No sound was removed (%s)", CStringMapper::unmap(soundName).c_str()); + nlwarning("No sound was removed (%s)", soundName.toString().c_str()/*CStringMapper::unmap(soundName).c_str()*/); } } // ******************************************************** -void CSoundAnimMarker::getSounds(vector &sounds) +void CSoundAnimMarker::getSounds(vector &sounds) { sounds.insert(sounds.end(), _Sounds.begin(), _Sounds.end()); diff --git a/code/nel/src/sound/sound_animation.cpp b/code/nel/src/sound/sound_animation.cpp index 87b39f144..5ea3f87cb 100644 --- a/code/nel/src/sound/sound_animation.cpp +++ b/code/nel/src/sound/sound_animation.cpp @@ -73,7 +73,7 @@ void CSoundAnimation::save() { // File stream COFile file; - vector sounds; + vector sounds; // Open the file if (!file.open(_Filename.c_str())) @@ -108,11 +108,11 @@ void CSoundAnimation::save() marker->getSounds(sounds); - vector::iterator iter2; + vector::iterator iter2; for (iter2 = sounds.begin(); iter2 != sounds.end(); iter2++) { xmlNodePtr soundNode = xmlNewChild ( markerNode, NULL, (const xmlChar*)"SOUND", NULL ); - xmlSetProp (soundNode, (const xmlChar*)"name", (const xmlChar*) CStringMapper::unmap(*iter2).c_str()); + xmlSetProp (soundNode, (const xmlChar*)"name", (const xmlChar*)iter2->toString().c_str() /*CStringMapper::unmap(*iter2).c_str()*/); } sounds.clear(); @@ -190,7 +190,7 @@ void CSoundAnimation::load() throw NLMISC::Exception("Invalid sound animation marker"); } - marker->addSound(CStringMapper::map(string(name))); + marker->addSound(NLMISC::CSheetId(string(name))/*CStringMapper::map(string(name))*/); xmlFree ((void*)name); diff --git a/code/nel/src/sound/sound_bank.cpp b/code/nel/src/sound/sound_bank.cpp index 6d2034438..93cf09de4 100644 --- a/code/nel/src/sound/sound_bank.cpp +++ b/code/nel/src/sound/sound_bank.cpp @@ -128,7 +128,7 @@ void CSoundBank::addSound(CSound *sound) nlassert(ret.second); } -void CSoundBank::removeSound(const NLMISC::TStringId &name) +void CSoundBank::removeSound(const NLMISC::CSheetId &name) { _Sounds.erase(name); } @@ -152,10 +152,10 @@ public: {} // load the values using the george sheet (called by GEORGE::loadForm) - void readGeorges (const NLMISC::CSmartPtr &form, const std::string &name) + void readGeorges (const NLMISC::CSmartPtr &form, const NLMISC::CSheetId &name) { // just call the sound creation method with the xml form. - Sound = CSound::createSound(name, form->getRootNode()); + Sound = CSound::createSound(name.toString(), form->getRootNode()); // success ? // if (_Sound != 0) @@ -258,14 +258,16 @@ public: void CSoundBank::load(const std::string &packedSheetDir, bool packedSheetUpdate) { // this structure is fill by the loadForm() function and will contain all you need - std::map Container; + //std::map Container; + std::map Container; nlassert(!_Loaded); // Just call the GEORGE::loadFrom method to read all available sounds ::loadForm("sound", packedSheetDir + "sounds.packed_sheets", Container, packedSheetUpdate, false); _Loaded = true; // add all the loaded sound in the sound banks - std::map::iterator first(Container.begin()), last(Container.end()); + //std::map::iterator first(Container.begin()), last(Container.end()); + std::map::iterator first(Container.begin()), last(Container.end()); for (; first != last; ++first) { if (first->second.Sound != 0) @@ -328,7 +330,7 @@ bool CSoundBank::isLoaded() /* * Return a sound sample corresponding to a name. */ -CSound* CSoundBank::getSound(const NLMISC::TStringId &name) +CSound* CSoundBank::getSound(const NLMISC::CSheetId &name) { // Find sound TSoundTable::iterator iter = _Sounds.find(name); @@ -345,7 +347,7 @@ CSound* CSoundBank::getSound(const NLMISC::TStringId &name) /** * Return the names of the sounds */ -void CSoundBank::getNames( std::vector &names ) +void CSoundBank::getNames( std::vector &names ) { TSoundTable::const_iterator iter; for (iter = _Sounds.begin(); iter != _Sounds.end(); ++iter) diff --git a/code/nel/src/sound/stream_file_sound.cpp b/code/nel/src/sound/stream_file_sound.cpp index 83641cdf7..b86f0b5df 100644 --- a/code/nel/src/sound/stream_file_sound.cpp +++ b/code/nel/src/sound/stream_file_sound.cpp @@ -74,9 +74,11 @@ void CStreamFileSound::serial(NLMISC::IStream &s) void CStreamFileSound::setMusicFilePath(const std::string &filePath, bool async, bool loop) { #if !FINAL_VERSION - _Name = NLMISC::CStringMapper::map(std::string(""); + //_Name = NLMISC::CStringMapper::map(std::string(""); + _Name = NLMISC::CSheetId(std::string(""); #else - _Name = NLMISC::CStringMapper::map(""); + //_Name = NLMISC::CStringMapper::map(""); + _Name = NLMISC::CSheetId(""); #endif _ConeInnerAngle = NLMISC::Pi * 2; _ConeOuterAngle = NLMISC::Pi * 2; diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 84ba25060..f6f7d7e3f 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -419,7 +419,7 @@ CClientConfig::CClientConfig() // only force patching under Windows by default #ifdef NL_OS_WINDOWS - PatchWanted = true; + PatchWanted = false;//true; #else PatchWanted = false; #endif diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 71fc7f14d..1990003b0 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -5055,14 +5055,14 @@ NLMISC_COMMAND(reloadFogMaps, "Force to reload all the fog maps", "<>") NLMISC_COMMAND(dumpSounds, "Dump names of all loaded sound", "<>") { if (!args.empty()) return false; - std::vector sounds; + std::vector sounds; extern CSoundManager *SoundMngr; if (!SoundMngr) return false; if (!SoundMngr->getMixer()) return false; SoundMngr->getMixer()->getSoundNames(sounds); for(uint k = 0; k < sounds.size(); ++k) { - nlinfo(NLMISC::CStringMapper::unmap(sounds[k]).c_str()); + nlinfo(sounds[k].toString()/*NLMISC::CStringMapper::unmap(sounds[k])*/.c_str()); } return true; } diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index 76d2ecf69..3f94368d5 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -2006,7 +2006,8 @@ public: virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { string sName = getParam(Params, "name"); - TStringId id = CStringMapper::map(sName); + //TStringId id = CStringMapper::map(sName); + CSheetId id = CSheetId(sName); if (SoundMngr != NULL) SoundMngr->spawnSource(id,CVector(0,0,0)); } diff --git a/code/ryzom/client/src/sound_manager.cpp b/code/ryzom/client/src/sound_manager.cpp index a8aa3a287..f87c6cdee 100644 --- a/code/ryzom/client/src/sound_manager.cpp +++ b/code/ryzom/client/src/sound_manager.cpp @@ -624,7 +624,7 @@ void CSoundManager::init(IProgressCallback *progressCallBack) // add a new source to the world, attached to the specified entity // return 0 if creation failed, sound id if creation was successful //----------------------------------------------- -CSoundManager::TSourceId CSoundManager::addSource( const NLMISC::TStringId &soundName, const NLMISC::CVector &position, bool play, bool loop, const CEntityId &id) +CSoundManager::TSourceId CSoundManager::addSource( const NLMISC::CSheetId &soundName, const NLMISC::CVector &position, bool play, bool loop, const CEntityId &id) { uint32 retValue = 0; @@ -634,7 +634,7 @@ CSoundManager::TSourceId CSoundManager::addSource( const NLMISC::TStringId &soun // If the source is valid. if(pSource == 0) { - nlwarning("Sound '%s' not found !", CStringMapper::unmap(soundName).c_str()); + nlwarning("Sound '%s' not found !", /*CStringMapper::unmap(soundName).c_str()*/soundName.toString().c_str()); return retValue; } @@ -672,7 +672,7 @@ CSoundManager::TSourceId CSoundManager::addSource( const NLMISC::TStringId &soun // spawn a new source to the world // return false if creation failed, true if creation was successful //----------------------------------------------- -bool CSoundManager::spawnSource(const NLMISC::TStringId &soundName, CSoundContext &context) +bool CSoundManager::spawnSource(const NLMISC::CSheetId &soundName, CSoundContext &context) { if (!_PlaySound) return false; @@ -683,7 +683,7 @@ bool CSoundManager::spawnSource(const NLMISC::TStringId &soundName, CSoundContex // If the source is valid. if(pSource == 0) { - nlwarning("Sound '%s' not found !", soundName); + nlwarning("Sound '%s' not found !", soundName.toString().c_str()); return false; } @@ -702,7 +702,7 @@ bool CSoundManager::spawnSource(const NLMISC::TStringId &soundName, CSoundContex // spawn a new source to the world // return false if creation failed, true if creation was successful //----------------------------------------------- -bool CSoundManager::spawnSource(const NLMISC::TStringId &soundName, const NLMISC::CVector &position) +bool CSoundManager::spawnSource(const NLMISC::CSheetId &soundName, const NLMISC::CVector &position) { if (!_PlaySound) return false; @@ -712,7 +712,7 @@ bool CSoundManager::spawnSource(const NLMISC::TStringId &soundName, const NLMISC // If the source is valid. if(pSource == 0) { - nlwarning("Sound '%s' not found !", CStringMapper::unmap(soundName).c_str ()); + nlwarning("Sound '%s' not found !", /*CStringMapper::unmap(soundName).c_str ()*/soundName.toString().c_str()); return false; } diff --git a/code/ryzom/client/src/sound_manager.h b/code/ryzom/client/src/sound_manager.h index 1c03824e3..e2131e880 100644 --- a/code/ryzom/client/src/sound_manager.h +++ b/code/ryzom/client/src/sound_manager.h @@ -32,6 +32,7 @@ // sound #include "nel/sound/u_audio_mixer.h" #include "nel/sound/u_listener.h" +#include "nel/misc/sheet_id.h" extern class CSoundManager *SoundMngr; @@ -88,13 +89,13 @@ public: /// Return the audio mixer instance pointer. NLSOUND::UAudioMixer *getMixer(); - TSourceId addSource( const NLMISC::TStringId &soundName, const NLMISC::CVector &position, bool play = true , bool loop = false, const NLMISC::CEntityId &id = NLMISC::CEntityId::Unknown ); + TSourceId addSource( const NLMISC::CSheetId &soundName, const NLMISC::CVector &position, bool play = true , bool loop = false, const NLMISC::CEntityId &id = NLMISC::CEntityId::Unknown ); /// spawn a new source to the world but sound manager don't keep any link and the sound will be automatically deleted when finnished - bool spawnSource (const NLMISC::TStringId &soundName, NLSOUND::CSoundContext &context); + bool spawnSource (const NLMISC::CSheetId &soundName, NLSOUND::CSoundContext &context); /// spawn a new source to the world but sound manager don't keep any link and the sound will be automatically deleted when finnished - bool spawnSource( const NLMISC::TStringId &soundName, const NLMISC::CVector &position ); + bool spawnSource( const NLMISC::CSheetId &soundName, const NLMISC::CVector &position ); /** * remove a source diff --git a/code/ryzom/common/data_leveldesign/primitives/newbieland/urban_newbieland.primitive b/code/ryzom/common/data_leveldesign/primitives/newbieland/urban_newbieland.primitive index 0aa00b3bb..42cd70726 100644 --- a/code/ryzom/common/data_leveldesign/primitives/newbieland/urban_newbieland.primitive +++ b/code/ryzom/common/data_leveldesign/primitives/newbieland/urban_newbieland.primitive @@ -1,7 +1,7 @@ - + class @@ -126,6 +126,10 @@ #mission tags and pre-requisites replayable solo + mission_category : Killing + player_replay_timer : 10 + global_replay_timer : 10 + mission_icon : tets #Variables declaration decl : bot : giver @@ -138,7 +142,7 @@ mission_title : WELCOME_RYZOM_CORE_TITLE mission_desc : WELCOME_RYZOM_CORE_DESC # step_4 - kill_fauna : chdfa1 3 + kill_fauna : chdfa1 1 recv_money : 10000 @@ -154,6 +158,157 @@ + + + class + mission + + + name + HUNTING_GROUNDS + + + script + # script generated from 'urban_newbieland.primitive' + + #mission tags and pre-requisites + replayable + guild + mission_category : Killing + player_replay_timer : 10 + global_replay_timer : 10 + mission_icon : test + + #Variables declaration + decl : bot : giver + decl : bot : player + decl : bot : chiang_the_strong + + #pre-requisites + req_guild + req_grade : Leader + + #script + mission_title : WELCOME_RYZOM_CORE_DESC + mission_desc : WELCOME_RYZOM_CORE_TITLE + # step_4 + spawn_mission : WELCOME_RYZOM_CORE : chiang_the_strong : guild + set_obj : MIS_DO_MISSION + mission : WELCOME_RYZOM_CORE 2 + kill_fauna : chdfa1 2 + recv_money : 100000 + recv_money : 20: guild + + + + + + class + alias + + + name + alias + + + + + + class + mission + + + name + GUILD_MISSION + + + script + # script generated from 'guild_missions.primitive' + + #mission tags and pre-requisites + replayable + guild + mission_category : Killing + + #Variables declaration + decl : bot : giver + decl : bot : player + decl : bot : chiang_the_strong + + #pre-requisites + req_guild + req_grade : Leader + + #script + mission_title : GUILD_MISSION_TITLE + mission_desc : GUILD_MISSION_DESC + # step + spawn_mission : SOLO_GUILD_MISSION : chiang_the_strong : guild + set_obj : MIS_DO_MISSION + mission : SOLO_GUILD_MISSION 2 + kill_fauna : chdfa1 2 + recv_money : 100: guild + recv_money : 50 + + + + + + class + alias + + + name + alias + + + + + + class + mission + + + name + SOLO_GUILD_MISSION + + + script + # script generated from 'guild_missions.primitive' + + #mission tags and pre-requisites + replayable + solo + mission_category : Killing + not_proposed + + #Variables declaration + decl : bot : giver + decl : bot : player + decl : bot : chiang_the_strong + + #pre-requisites + + #script + mission_title : SOLO_GUILD_MISSION_TITLE + mission_desc : SOLO_GUILD_MISSION_DESC + # step + kill_fauna : chdfa1 1 + recv_money : 20 + + + + + + class + alias + + + name + alias + + + @@ -317,6 +472,46 @@ + + + + chat_parameters + shop:guild_creator + menu: MENU_WHOAMI WHOAMI_GUILD_CLERK + + + class + npc_bot + + + equipment + CU: 4 + CL: 4 + + + is_stuck + true + + + name + creator + + + sheet_client + fyhc3old + + + + + class + alias + + + name + alias + + + @@ -396,19 +591,8 @@ chat_parameters - shop : NEWBIELAND_LARMOR_ALL - item : icmalb.sitem 10 - item : icmalb.sitem 20 - item : icmalb.sitem 50 - item : icfalb.sitem 10 - item : icfalb.sitem 20 - item : icfalb.sitem 50 - item : ictalb.sitem 10 - item : ictalb.sitem 20 - item : ictalb.sitem 50 - item : iczalb.sitem 10 - item : iczalb.sitem 20 - item : iczalb.sitem 50 + shop:guild_creator + menu: MENU_WHOAMI WHOAMI_GUILD_CLERK class @@ -444,6 +628,119 @@ + + + class + npc_folder + + + name + Guild creator + + + + + class + alias + + + name + alias + + + + + class + npc_zone + + + name + Npc Zone + + + + + class + alias + + + name + alias + + + + + bot_sheet_client + maha2 + + + class + npc_group + + + name + Group + + + + class + npc_group_parameters + + + name + parameters + + + + + + class + alias + + + name + alias + + + + + + chat_parameters + shop:guild_creator + menu: MENU_WHOAMI WHOAMI_GUILD_CLERK + + + class + npc_bot + + + equipment + CU: 4 + CL: 4 + + + name + guild_creator + + + sheet_client + fyhc3old + + + + + class + alias + + + name + alias + + + + + + @@ -455,14 +752,38 @@ missions_editor + + audience + solo + + + auto_remove_from_journal + false + + + automatic + false + class mission_tree + + fail_if_inventory_is_full + false + giver_primitive urban_newbieland.primitive + + global_replay_timer + 10 + + + mission_category + Killing + mission_description WELCOME_RYZOM_CORE_DESC @@ -471,10 +792,18 @@ mission_giver $givervar@fullname$ + + mission_icon + tets + mission_title WELCOME_RYZOM_CORE_TITLE + + mono_instance + false + name WELCOME_RYZOM_CORE @@ -483,10 +812,34 @@ need_validation false + + non_abandonnable + false + + + not_in_journal + false + + + not_proposed + false + + + phrase_auto_menu + TEST + + + player_replay_timer + 10 + replayable true + + run_only_once + false + class @@ -571,7 +924,7 @@ fauna/quantity - chdfa1 3 + chdfa1 1 @@ -597,6 +950,263 @@ + + + audience + guild + + + auto_remove_from_journal + false + + + automatic + false + + + class + mission_tree + + + fail_if_inventory_is_full + false + + + giver_primitive + urban_newbieland.primitive + + + global_replay_timer + 10 + + + mission_category + Killing + + + mission_description + WELCOME_RYZOM_CORE_TITLE + + + mission_giver + $givervar@fullname$ + + + mission_icon + test + + + mission_title + WELCOME_RYZOM_CORE_DESC + + + mono_instance + false + + + name + HUNTING_GROUNDS + + + need_validation + false + + + non_abandonnable + false + + + not_in_journal + false + + + not_proposed + false + + + phrase_auto_menu + TEST + + + player_replay_timer + 10 + + + replayable + true + + + run_only_once + false + + + + class + variables + + + name + variables + + + + class + var_npc + + + npc_function + fct_ranger_leader + + + npc_name + chiang_the_strong + + + var_name + givervar + + + + + + class + pre_requisite + + + name + pre_requisite + + + require_guild_grade + Leader + + + require_guild_membership + true + + + + + + class + alias + + + name + alias + + + + + class + step + + + name + step_4 + + + + class + actions + + + name + pre_actions + + + + class + spawn_mission + + + giver_name + chiang_the_strong + + + guild + true + + + mission_name + WELCOME_RYZOM_CORE + + + + + + class + mission_objectives + + + name + objectives + + + + class + do_mission + + + mission_names + WELCOME_RYZOM_CORE 2 + + + overload_objective + MIS_DO_MISSION + + + + + class + kill + + + fauna/quantity + chdfa1 2 + + + name + kill chdfa1 2 + + + + + + class + actions + + + name + post_actions + + + + amount + 100000 + + + class + recv_money + + + + + amount + 20 + + + class + recv_money + + + guild + true + + + + + diff --git a/code/ryzom/server/frontend_service.cfg b/code/ryzom/server/frontend_service.cfg index c9392bd51..a73c02316 100644 --- a/code/ryzom/server/frontend_service.cfg +++ b/code/ryzom/server/frontend_service.cfg @@ -6,7 +6,7 @@ BandwidthRatio = 1; FSUDPPort = 47851; -FSListenHost = "open.ryzom.com"; +FSListenHost = "192.168.1.112"; #include "frontend_service_default.cfg" diff --git a/code/ryzom/server/shard_start_cmake.bat b/code/ryzom/server/shard_start_cmake.bat index 943a0b5f3..9d68b5272 100644 --- a/code/ryzom/server/shard_start_cmake.bat +++ b/code/ryzom/server/shard_start_cmake.bat @@ -3,7 +3,7 @@ REM This script will start all the services with good parameters REM set MODE=Debug -set MODE=..\..\build\bin\Release +set MODE=..\..\build\bin\Debug rem AS start %MODE%\ryzom_admin_service.exe --fulladminname=admin_executor_service --shortadminname=AES