From 83ba94002baa7641da4d19d8a53b713a10464ee4 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 25 Jul 2012 10:15:04 +0200 Subject: [PATCH] Fixed: Compile error in MFC Object Viewer with sound sheet id as CSheetId --- code/nel/tools/3d/object_viewer/edit_ps_sound.cpp | 10 +++++----- code/nel/tools/3d/object_viewer/pick_sound.cpp | 4 ++-- code/nel/tools/3d/object_viewer/pick_sound.h | 8 ++++---- code/nel/tools/3d/object_viewer/sound_anim_dlg.cpp | 10 +++++----- code/nel/tools/3d/object_viewer/sound_system.cpp | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/code/nel/tools/3d/object_viewer/edit_ps_sound.cpp b/code/nel/tools/3d/object_viewer/edit_ps_sound.cpp index afb53aa84..891818a43 100644 --- a/code/nel/tools/3d/object_viewer/edit_ps_sound.cpp +++ b/code/nel/tools/3d/object_viewer/edit_ps_sound.cpp @@ -159,7 +159,7 @@ END_MESSAGE_MAP() void CEditPSSound::OnBrowseSound() { // CPickSound::TNameVect names; - vector names; + vector names; NLSOUND::UAudioMixer *audioMixer = CSoundSystem::getAudioMixer(); @@ -172,7 +172,7 @@ void CEditPSSound::OnBrowseSound() if (ps.DoModal() == IDOK) { - m_SoundName = NLMISC::CStringMapper::unmap(ps.getName()).c_str(); + m_SoundName = ps.getName().toString().c_str(); _Sound->setSoundName(ps.getName()); updateModifiedFlag(); UpdateData(FALSE); @@ -184,7 +184,7 @@ BOOL CEditPSSound::OnInitDialog() CDialog::OnInitDialog(); nlassert(_Sound); - m_SoundName = NLMISC::CStringMapper::unmap(_Sound->getSoundName()).c_str(); + m_SoundName = _Sound->getSoundName().toString().c_str(); UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control @@ -195,7 +195,7 @@ void CEditPSSound::OnChangeSoundName() { nlassert(_Sound); UpdateData(); - _Sound->setSoundName( NLMISC::CStringMapper::map((LPCTSTR) m_SoundName) ); + _Sound->setSoundName(NLMISC::CSheetId((LPCTSTR)m_SoundName, "sound")); updateModifiedFlag(); } @@ -209,7 +209,7 @@ void CEditPSSound::OnSpawn() // play the currently selected sound void CEditPSSound::OnPlaySound() { - CSoundSystem::play(std::string((LPCTSTR) m_SoundName)); + CSoundSystem::play(std::string((LPCTSTR)m_SoundName)); } void CEditPSSound::OnMute() diff --git a/code/nel/tools/3d/object_viewer/pick_sound.cpp b/code/nel/tools/3d/object_viewer/pick_sound.cpp index 0a6452861..280a65326 100644 --- a/code/nel/tools/3d/object_viewer/pick_sound.cpp +++ b/code/nel/tools/3d/object_viewer/pick_sound.cpp @@ -74,7 +74,7 @@ BOOL CPickSound::OnInitDialog() for (TNameVect::iterator it = _Names.begin(); it != _Names.end(); ++it) { - m_NameList.AddString(NLMISC::CStringMapper::unmap(*it).c_str()); + m_NameList.AddString((*it).toString().c_str()); } _Timer = SetTimer (1, 100, NULL); @@ -111,7 +111,7 @@ void CPickSound::OnSelchange() nlassert(m_NameList.GetTextLen(m_NameList.GetCurSel()) < 1024); m_NameList.GetText(m_NameList.GetCurSel(), str); - _CurrName = NLMISC::CStringMapper::map(str); + _CurrName = NLMISC::CSheetId(str, "sound"); } diff --git a/code/nel/tools/3d/object_viewer/pick_sound.h b/code/nel/tools/3d/object_viewer/pick_sound.h index cbcf74601..5331ab912 100644 --- a/code/nel/tools/3d/object_viewer/pick_sound.h +++ b/code/nel/tools/3d/object_viewer/pick_sound.h @@ -23,7 +23,7 @@ #endif // _MSC_VER > 1000 // pick_sound.h : header file // -#include "nel/misc/string_mapper.h" +#include "nel/misc/sheet_id.h" #include #include @@ -40,11 +40,11 @@ class CPickSound : public CDialog { // Construction public: - typedef std::vector TNameVect; + typedef std::vector TNameVect; CPickSound(const TNameVect &names, CWnd* pParent = NULL); // standard constructor - const NLMISC::TStringId &getName(void) const { return _CurrName; } + const NLMISC::CSheetId &getName(void) const { return _CurrName; } // Dialog Data //{{AFX_DATA(CPickSound) @@ -63,7 +63,7 @@ public: // Implementation protected: TNameVect _Names; - NLMISC::TStringId _CurrName; + NLMISC::CSheetId _CurrName; UINT_PTR _Timer; diff --git a/code/nel/tools/3d/object_viewer/sound_anim_dlg.cpp b/code/nel/tools/3d/object_viewer/sound_anim_dlg.cpp index add1d14c0..965ad3d90 100644 --- a/code/nel/tools/3d/object_viewer/sound_anim_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/sound_anim_dlg.cpp @@ -126,18 +126,18 @@ void CSoundAnimDlg::updateSounds() { if (_SelectedMarker != 0) { - vector sounds; + vector sounds; _SelectedMarker->getSounds(sounds); CListBox* list = (CListBox*) GetDlgItem(IDC_SOUND_ANIM_LIST); list->ResetContent(); - vector::iterator iter; + vector::iterator iter; for (iter = sounds.begin(); iter != sounds.end(); iter++) { - list->AddString(CStringMapper::unmap(*iter).c_str()); + list->AddString((*iter).toString().c_str()); } list->UpdateData(); @@ -151,7 +151,7 @@ void CSoundAnimDlg::OnAddSound() if (_SelectedMarker != 0) { // CPickSound::TNameVect names; - vector names; + vector names; NLSOUND::UAudioMixer *audioMixer = CSoundSystem::getAudioMixer(); @@ -183,7 +183,7 @@ void CSoundAnimDlg::OnRemoveSound() if (list->GetText(list->GetCurSel(), s) != LB_ERR) { string name(s); - _SelectedMarker->removeSound(CStringMapper::map(name)); + _SelectedMarker->removeSound(NLMISC::CSheetId(name, "sound")); updateSounds(); } } diff --git a/code/nel/tools/3d/object_viewer/sound_system.cpp b/code/nel/tools/3d/object_viewer/sound_system.cpp index 187a7f5c2..69e10ea18 100644 --- a/code/nel/tools/3d/object_viewer/sound_system.cpp +++ b/code/nel/tools/3d/object_viewer/sound_system.cpp @@ -168,7 +168,7 @@ void CSoundSystem::play(const string &soundName) { if (_AudioMixer) { - NLSOUND::USource *src = _AudioMixer->createSource(CStringMapper::map(soundName), true); + NLSOUND::USource *src = _AudioMixer->createSource(NLMISC::CSheetId(soundName, "sound"), true); if (src) { src->setLooping(false); @@ -187,7 +187,7 @@ USource *CSoundSystem::create(const std::string &soundName) { if (_AudioMixer) { - NLSOUND::USource *src = _AudioMixer->createSource(CStringMapper::map(soundName), false); + NLSOUND::USource *src = _AudioMixer->createSource(NLMISC::CSheetId(soundName, "sound"), false); if (src) { src->setLooping(false);