Fix sound sheet build code that caused random and missing values

hg/develop
kaetemi 5 years ago committed by Jan Boon
parent ed8a5c14a7
commit 02305cdb33

@ -171,6 +171,8 @@ CComplexSound::CComplexSound() :
_PatternMode(CComplexSound::MODE_UNDEFINED),
_TicksPerSeconds(1.0f),
_XFadeLength(3000), // default to 3000 sec.
_DoFadeIn(true),
_DoFadeOut(true),
_MaxDistValid(false),
_Duration(0),
_DurationValid(false)
@ -314,7 +316,8 @@ void CComplexSound::importForm(const std::string& filename, NLGEORGES::UFormElm&
if (mode == "Chained" || mode == "Sparse")
{
// XFade length
formRoot.getValueByName(_XFadeLength, ".SoundType.XFadeLength");
if (!formRoot.getValueByName(_XFadeLength, ".SoundType.XFadeLength"))
formRoot.getValueByName(_XFadeLength, ".SoundType.XFadeLenght"); // WORKAROUND: Typo in sound assets
// Fade in/out flag.
formRoot.getValueByName(_DoFadeIn, ".SoundType.DoFadeIn");
formRoot.getValueByName(_DoFadeOut, ".SoundType.DoFadeOut");

@ -38,6 +38,7 @@ CSimpleSound::CSimpleSound() :
_Registered(false),
_Buffer(NULL),
// _Detailed(false), // not used?
_Alpha(1.0),
_NeedContext(false)
{
// init with NULL in case of unexecpted access

@ -41,7 +41,7 @@ using namespace std;
namespace NLSOUND {
CStreamFileSound::CStreamFileSound()
CStreamFileSound::CStreamFileSound() : m_Async(true)
{
}

@ -21,16 +21,16 @@
#include "nel/sound/group_controller_root.h"
#endif
namespace NLSOUND {
namespace NLSOUND
{
CStreamSound::CStreamSound()
: m_Alpha(1.0f)
{
}
CStreamSound::~CStreamSound()
{
}
void CStreamSound::importForm(const std::string &filename, NLGEORGES::UFormElm &root)
@ -60,7 +60,6 @@ void CStreamSound::importForm(const std::string &filename, NLGEORGES::UFormElm &
#if NLSOUND_SHEET_VERSION_BUILT < 2
_GroupController = CGroupControllerRoot::getInstance()->getGroupController(NLSOUND_SHEET_V1_DEFAULT_SOUND_STREAM_GROUP_CONTROLLER);
#endif
}
void CStreamSound::serial(NLMISC::IStream &s)
@ -71,9 +70,9 @@ void CStreamSound::serial(NLMISC::IStream &s)
s.serial(m_Alpha);
#if NLSOUND_SHEET_VERSION_BUILT < 2
if (s.isReading()) _GroupController = CGroupControllerRoot::getInstance()->getGroupController(NLSOUND_SHEET_V1_DEFAULT_SOUND_STREAM_GROUP_CONTROLLER);
if (s.isReading())
_GroupController = CGroupControllerRoot::getInstance()->getGroupController(NLSOUND_SHEET_V1_DEFAULT_SOUND_STREAM_GROUP_CONTROLLER);
#endif
}
} /* namespace NLSOUND */

Loading…
Cancel
Save