Fixed: Compile error in MFC Object Viewer with sound sheet id as CSheetId
This commit is contained in:
parent
f4f7965550
commit
83ba94002b
5 changed files with 18 additions and 18 deletions
|
@ -159,7 +159,7 @@ END_MESSAGE_MAP()
|
||||||
void CEditPSSound::OnBrowseSound()
|
void CEditPSSound::OnBrowseSound()
|
||||||
{
|
{
|
||||||
// CPickSound::TNameVect names;
|
// CPickSound::TNameVect names;
|
||||||
vector<NLMISC::TStringId> names;
|
vector<NLMISC::CSheetId> names;
|
||||||
|
|
||||||
|
|
||||||
NLSOUND::UAudioMixer *audioMixer = CSoundSystem::getAudioMixer();
|
NLSOUND::UAudioMixer *audioMixer = CSoundSystem::getAudioMixer();
|
||||||
|
@ -172,7 +172,7 @@ void CEditPSSound::OnBrowseSound()
|
||||||
|
|
||||||
if (ps.DoModal() == IDOK)
|
if (ps.DoModal() == IDOK)
|
||||||
{
|
{
|
||||||
m_SoundName = NLMISC::CStringMapper::unmap(ps.getName()).c_str();
|
m_SoundName = ps.getName().toString().c_str();
|
||||||
_Sound->setSoundName(ps.getName());
|
_Sound->setSoundName(ps.getName());
|
||||||
updateModifiedFlag();
|
updateModifiedFlag();
|
||||||
UpdateData(FALSE);
|
UpdateData(FALSE);
|
||||||
|
@ -184,7 +184,7 @@ BOOL CEditPSSound::OnInitDialog()
|
||||||
CDialog::OnInitDialog();
|
CDialog::OnInitDialog();
|
||||||
|
|
||||||
nlassert(_Sound);
|
nlassert(_Sound);
|
||||||
m_SoundName = NLMISC::CStringMapper::unmap(_Sound->getSoundName()).c_str();
|
m_SoundName = _Sound->getSoundName().toString().c_str();
|
||||||
|
|
||||||
UpdateData(FALSE);
|
UpdateData(FALSE);
|
||||||
return TRUE; // return TRUE unless you set the focus to a control
|
return TRUE; // return TRUE unless you set the focus to a control
|
||||||
|
@ -195,7 +195,7 @@ void CEditPSSound::OnChangeSoundName()
|
||||||
{
|
{
|
||||||
nlassert(_Sound);
|
nlassert(_Sound);
|
||||||
UpdateData();
|
UpdateData();
|
||||||
_Sound->setSoundName( NLMISC::CStringMapper::map((LPCTSTR) m_SoundName) );
|
_Sound->setSoundName(NLMISC::CSheetId((LPCTSTR)m_SoundName, "sound"));
|
||||||
updateModifiedFlag();
|
updateModifiedFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ void CEditPSSound::OnSpawn()
|
||||||
// play the currently selected sound
|
// play the currently selected sound
|
||||||
void CEditPSSound::OnPlaySound()
|
void CEditPSSound::OnPlaySound()
|
||||||
{
|
{
|
||||||
CSoundSystem::play(std::string((LPCTSTR) m_SoundName));
|
CSoundSystem::play(std::string((LPCTSTR)m_SoundName));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEditPSSound::OnMute()
|
void CEditPSSound::OnMute()
|
||||||
|
|
|
@ -74,7 +74,7 @@ BOOL CPickSound::OnInitDialog()
|
||||||
|
|
||||||
for (TNameVect::iterator it = _Names.begin(); it != _Names.end(); ++it)
|
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);
|
_Timer = SetTimer (1, 100, NULL);
|
||||||
|
@ -111,7 +111,7 @@ void CPickSound::OnSelchange()
|
||||||
nlassert(m_NameList.GetTextLen(m_NameList.GetCurSel()) < 1024);
|
nlassert(m_NameList.GetTextLen(m_NameList.GetCurSel()) < 1024);
|
||||||
|
|
||||||
m_NameList.GetText(m_NameList.GetCurSel(), str);
|
m_NameList.GetText(m_NameList.GetCurSel(), str);
|
||||||
_CurrName = NLMISC::CStringMapper::map(str);
|
_CurrName = NLMISC::CSheetId(str, "sound");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#endif // _MSC_VER > 1000
|
#endif // _MSC_VER > 1000
|
||||||
// pick_sound.h : header file
|
// pick_sound.h : header file
|
||||||
//
|
//
|
||||||
#include "nel/misc/string_mapper.h"
|
#include "nel/misc/sheet_id.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -40,11 +40,11 @@ class CPickSound : public CDialog
|
||||||
{
|
{
|
||||||
// Construction
|
// Construction
|
||||||
public:
|
public:
|
||||||
typedef std::vector<NLMISC::TStringId> TNameVect;
|
typedef std::vector<NLMISC::CSheetId> TNameVect;
|
||||||
CPickSound(const TNameVect &names, CWnd* pParent = NULL); // standard constructor
|
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
|
// Dialog Data
|
||||||
//{{AFX_DATA(CPickSound)
|
//{{AFX_DATA(CPickSound)
|
||||||
|
@ -63,7 +63,7 @@ public:
|
||||||
// Implementation
|
// Implementation
|
||||||
protected:
|
protected:
|
||||||
TNameVect _Names;
|
TNameVect _Names;
|
||||||
NLMISC::TStringId _CurrName;
|
NLMISC::CSheetId _CurrName;
|
||||||
|
|
||||||
UINT_PTR _Timer;
|
UINT_PTR _Timer;
|
||||||
|
|
||||||
|
|
|
@ -126,18 +126,18 @@ void CSoundAnimDlg::updateSounds()
|
||||||
{
|
{
|
||||||
if (_SelectedMarker != 0)
|
if (_SelectedMarker != 0)
|
||||||
{
|
{
|
||||||
vector<NLMISC::TStringId> sounds;
|
vector<NLMISC::CSheetId> sounds;
|
||||||
|
|
||||||
_SelectedMarker->getSounds(sounds);
|
_SelectedMarker->getSounds(sounds);
|
||||||
|
|
||||||
CListBox* list = (CListBox*) GetDlgItem(IDC_SOUND_ANIM_LIST);
|
CListBox* list = (CListBox*) GetDlgItem(IDC_SOUND_ANIM_LIST);
|
||||||
list->ResetContent();
|
list->ResetContent();
|
||||||
|
|
||||||
vector<NLMISC::TStringId>::iterator iter;
|
vector<NLMISC::CSheetId>::iterator iter;
|
||||||
|
|
||||||
for (iter = sounds.begin(); iter != sounds.end(); iter++)
|
for (iter = sounds.begin(); iter != sounds.end(); iter++)
|
||||||
{
|
{
|
||||||
list->AddString(CStringMapper::unmap(*iter).c_str());
|
list->AddString((*iter).toString().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
list->UpdateData();
|
list->UpdateData();
|
||||||
|
@ -151,7 +151,7 @@ void CSoundAnimDlg::OnAddSound()
|
||||||
if (_SelectedMarker != 0)
|
if (_SelectedMarker != 0)
|
||||||
{
|
{
|
||||||
// CPickSound::TNameVect names;
|
// CPickSound::TNameVect names;
|
||||||
vector<NLMISC::TStringId> names;
|
vector<NLMISC::CSheetId> names;
|
||||||
|
|
||||||
|
|
||||||
NLSOUND::UAudioMixer *audioMixer = CSoundSystem::getAudioMixer();
|
NLSOUND::UAudioMixer *audioMixer = CSoundSystem::getAudioMixer();
|
||||||
|
@ -183,7 +183,7 @@ void CSoundAnimDlg::OnRemoveSound()
|
||||||
if (list->GetText(list->GetCurSel(), s) != LB_ERR)
|
if (list->GetText(list->GetCurSel(), s) != LB_ERR)
|
||||||
{
|
{
|
||||||
string name(s);
|
string name(s);
|
||||||
_SelectedMarker->removeSound(CStringMapper::map(name));
|
_SelectedMarker->removeSound(NLMISC::CSheetId(name, "sound"));
|
||||||
updateSounds();
|
updateSounds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,7 +168,7 @@ void CSoundSystem::play(const string &soundName)
|
||||||
{
|
{
|
||||||
if (_AudioMixer)
|
if (_AudioMixer)
|
||||||
{
|
{
|
||||||
NLSOUND::USource *src = _AudioMixer->createSource(CStringMapper::map(soundName), true);
|
NLSOUND::USource *src = _AudioMixer->createSource(NLMISC::CSheetId(soundName, "sound"), true);
|
||||||
if (src)
|
if (src)
|
||||||
{
|
{
|
||||||
src->setLooping(false);
|
src->setLooping(false);
|
||||||
|
@ -187,7 +187,7 @@ USource *CSoundSystem::create(const std::string &soundName)
|
||||||
{
|
{
|
||||||
if (_AudioMixer)
|
if (_AudioMixer)
|
||||||
{
|
{
|
||||||
NLSOUND::USource *src = _AudioMixer->createSource(CStringMapper::map(soundName), false);
|
NLSOUND::USource *src = _AudioMixer->createSource(NLMISC::CSheetId(soundName, "sound"), false);
|
||||||
if (src)
|
if (src)
|
||||||
{
|
{
|
||||||
src->setLooping(false);
|
src->setLooping(false);
|
||||||
|
|
Loading…
Reference in a new issue