Changed: #1469 StringId conversion to CSheetId for sounds
--HG-- branch : gsoc2012-fabien
This commit is contained in:
parent
dd6f2f2611
commit
a55297c29a
4 changed files with 11 additions and 10 deletions
|
@ -253,8 +253,8 @@ private:
|
||||||
/// The current cluster playing source indexed with sound group id
|
/// The current cluster playing source indexed with sound group id
|
||||||
TClusterSoundCont _Sources;
|
TClusterSoundCont _Sources;
|
||||||
|
|
||||||
//typedef CHashMap<NLMISC::CSheetId, NLMISC::CSheetId, NLMISC::CSheetIdHashMapTraits> TStringStringMap;
|
typedef CHashMap<NLMISC::CSheetId, NLMISC::CSheetId, NLMISC::CSheetIdHashMapTraits> TStringStringMap;
|
||||||
typedef CHashMap<NLMISC::TStringId, NLMISC::TStringId, NLMISC::CStringIdHashMapTraits> TStringStringMap;
|
//typedef CHashMap<NLMISC::TStringId, NLMISC::TStringId, NLMISC::CStringIdHashMapTraits> TStringStringMap;
|
||||||
/// The sound_group to sound assoc
|
/// The sound_group to sound assoc
|
||||||
TStringStringMap _SoundGroupToSound;
|
TStringStringMap _SoundGroupToSound;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1895,7 +1895,7 @@ retrySound:
|
||||||
|
|
||||||
if (invalid)
|
if (invalid)
|
||||||
{
|
{
|
||||||
nlwarning("The sound %s contain an infinite recursion !", id->getName().toString()/*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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ float EAX_MATERIAL_PARAM[] =
|
||||||
class CSoundGroupSerializer
|
class CSoundGroupSerializer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::vector<std::pair<NLMISC::TStringId, NLMISC::TStringId> > _SoundGroupAssoc;
|
std::vector<std::pair<NLMISC::CSheetId, NLMISC::CSheetId> > _SoundGroupAssoc;
|
||||||
|
|
||||||
// load the values using the george sheet (called by GEORGE::loadForm)
|
// load the values using the george sheet (called by GEORGE::loadForm)
|
||||||
void readGeorges (const NLMISC::CSmartPtr<NLGEORGES::UForm> &form, const std::string &/* name */)
|
void readGeorges (const NLMISC::CSmartPtr<NLGEORGES::UForm> &form, const std::string &/* name */)
|
||||||
|
@ -103,7 +103,7 @@ public:
|
||||||
sound = sound.substr(0, n);
|
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(...)
|
catch(...)
|
||||||
|
@ -131,15 +131,15 @@ public:
|
||||||
s.serial(soundGroup);
|
s.serial(soundGroup);
|
||||||
s.serial(sound);
|
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
|
else
|
||||||
{
|
{
|
||||||
std::string soundGroup;
|
std::string soundGroup;
|
||||||
std::string sound;
|
std::string sound;
|
||||||
|
|
||||||
soundGroup = CStringMapper::unmap(_SoundGroupAssoc[i].first);
|
soundGroup = _SoundGroupAssoc[i].first.toString();// CStringMapper::unmap(_SoundGroupAssoc[i].first);
|
||||||
sound = CStringMapper::unmap(_SoundGroupAssoc[i].second);
|
sound = _SoundGroupAssoc[i].second.toString(); //CStringMapper::unmap(_SoundGroupAssoc[i].second);
|
||||||
|
|
||||||
s.serial(soundGroup);
|
s.serial(soundGroup);
|
||||||
s.serial(sound);
|
s.serial(sound);
|
||||||
|
@ -292,7 +292,7 @@ void CClusteredSound::update(const CVector &listenerPos, const CVector &/* view
|
||||||
TStringStringMap::iterator it2(_SoundGroupToSound.find(soundGroup));
|
TStringStringMap::iterator it2(_SoundGroupToSound.find(soundGroup));
|
||||||
if (it2 != _SoundGroupToSound.end())
|
if (it2 != _SoundGroupToSound.end())
|
||||||
{
|
{
|
||||||
NLMISC::TStringId soundName = it2->second;
|
NLMISC::CSheetId soundName = it2->second;
|
||||||
CClusterSound cs;
|
CClusterSound cs;
|
||||||
|
|
||||||
// nldebug("Found the sound [%s] for sound group [%s]", CStringMapper::unmap(soundName).c_str(), CStringMapper::unmap(soundGroup).c_str());
|
// nldebug("Found the sound [%s] for sound group [%s]", CStringMapper::unmap(soundName).c_str(), CStringMapper::unmap(soundGroup).c_str());
|
||||||
|
|
|
@ -2006,7 +2006,8 @@ public:
|
||||||
virtual void execute (CCtrlBase * /* pCaller */, const string &Params)
|
virtual void execute (CCtrlBase * /* pCaller */, const string &Params)
|
||||||
{
|
{
|
||||||
string sName = getParam(Params, "name");
|
string sName = getParam(Params, "name");
|
||||||
TStringId id = CStringMapper::map(sName);
|
//TStringId id = CStringMapper::map(sName);
|
||||||
|
CSheetId id = CSheetId(sName);
|
||||||
if (SoundMngr != NULL)
|
if (SoundMngr != NULL)
|
||||||
SoundMngr->spawnSource(id,CVector(0,0,0));
|
SoundMngr->spawnSource(id,CVector(0,0,0));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue