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

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

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

@ -18,19 +18,19 @@
#include "nel/sound/stream_sound.h" #include "nel/sound/stream_sound.h"
#if NLSOUND_SHEET_VERSION_BUILT < 2 #if NLSOUND_SHEET_VERSION_BUILT < 2
# include "nel/sound/group_controller_root.h" #include "nel/sound/group_controller_root.h"
#endif #endif
namespace NLSOUND { namespace NLSOUND
{
CStreamSound::CStreamSound() CStreamSound::CStreamSound()
: m_Alpha(1.0f)
{ {
} }
CStreamSound::~CStreamSound() CStreamSound::~CStreamSound()
{ {
} }
void CStreamSound::importForm(const std::string &filename, NLGEORGES::UFormElm &root) void CStreamSound::importForm(const std::string &filename, NLGEORGES::UFormElm &root)
@ -49,7 +49,7 @@ void CStreamSound::importForm(const std::string &filename, NLGEORGES::UFormElm &
CSound::importForm(filename, root); CSound::importForm(filename, root);
// MaxDistance // MaxDistance
root.getValueByName(_MaxDist, ".SoundType.MaxDistance"); root.getValueByName(_MaxDist, ".SoundType.MaxDistance");
// MinDistance // MinDistance
root.getValueByName(_MinDist, ".SoundType.MinDistance"); root.getValueByName(_MinDist, ".SoundType.MinDistance");
@ -60,7 +60,6 @@ void CStreamSound::importForm(const std::string &filename, NLGEORGES::UFormElm &
#if NLSOUND_SHEET_VERSION_BUILT < 2 #if NLSOUND_SHEET_VERSION_BUILT < 2
_GroupController = CGroupControllerRoot::getInstance()->getGroupController(NLSOUND_SHEET_V1_DEFAULT_SOUND_STREAM_GROUP_CONTROLLER); _GroupController = CGroupControllerRoot::getInstance()->getGroupController(NLSOUND_SHEET_V1_DEFAULT_SOUND_STREAM_GROUP_CONTROLLER);
#endif #endif
} }
void CStreamSound::serial(NLMISC::IStream &s) void CStreamSound::serial(NLMISC::IStream &s)
@ -71,9 +70,9 @@ void CStreamSound::serial(NLMISC::IStream &s)
s.serial(m_Alpha); s.serial(m_Alpha);
#if NLSOUND_SHEET_VERSION_BUILT < 2 #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 #endif
} }
} /* namespace NLSOUND */ } /* namespace NLSOUND */

Loading…
Cancel
Save