mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-25 08:16:16 +00:00
Changed: #1469 StringId conversion to CSheetId for sounds
This commit is contained in:
parent
5e55faf0ba
commit
8b23735773
4 changed files with 11 additions and 10 deletions
|
@ -253,8 +253,8 @@ private:
|
|||
/// The current cluster playing source indexed with sound group id
|
||||
TClusterSoundCont _Sources;
|
||||
|
||||
//typedef CHashMap<NLMISC::CSheetId, NLMISC::CSheetId, NLMISC::CSheetIdHashMapTraits> TStringStringMap;
|
||||
typedef CHashMap<NLMISC::TStringId, NLMISC::TStringId, NLMISC::CStringIdHashMapTraits> TStringStringMap;
|
||||
typedef CHashMap<NLMISC::CSheetId, NLMISC::CSheetId, NLMISC::CSheetIdHashMapTraits> TStringStringMap;
|
||||
//typedef CHashMap<NLMISC::TStringId, NLMISC::TStringId, NLMISC::CStringIdHashMapTraits> TStringStringMap;
|
||||
/// The sound_group to sound assoc
|
||||
TStringStringMap _SoundGroupToSound;
|
||||
};
|
||||
|
|
|
@ -1895,7 +1895,7 @@ retrySound:
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ float EAX_MATERIAL_PARAM[] =
|
|||
class CSoundGroupSerializer
|
||||
{
|
||||
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)
|
||||
void readGeorges (const NLMISC::CSmartPtr<NLGEORGES::UForm> &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);
|
||||
|
@ -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());
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue