Fix "no remove aqua speed" bug when player leaves the water
[ryzomcore.git] / nel / src / sound / stream_sound.cpp
blob65902f4ca109ef137142a56b7c68dac95624ab6d
1 // NeL - MMORPG Framework <https://wiki.ryzom.dev/>
2 // Copyright (C) 2010-2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2010 Matt RAYKOWSKI (sfb) <matt.raykowski@gmail.com>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "stdsound.h"
21 #include "nel/sound/stream_sound.h"
23 #if NLSOUND_SHEET_VERSION_BUILT < 2
24 #include "nel/sound/group_controller_root.h"
25 #endif
27 namespace NLSOUND
30 CStreamSound::CStreamSound()
31 : m_Alpha(1.0f)
35 CStreamSound::~CStreamSound()
39 void CStreamSound::importForm(const std::string &filename, NLGEORGES::UFormElm &root)
41 // cannot do this debug check because used also by CStreamFileSound
42 /*NLGEORGES::UFormElm *psoundType;
43 std::string dfnName;
45 // some basic checking.
46 root.getNodeByName(&psoundType, ".SoundType");
47 nlassert(psoundType != NULL);
48 psoundType->getDfnName(dfnName);
49 nlassert(dfnName == "stream_sound.dfn");*/
51 // Call the base class
52 CSound::importForm(filename, root);
54 // MaxDistance
55 root.getValueByName(_MaxDist, ".SoundType.MaxDistance");
57 // MinDistance
58 root.getValueByName(_MinDist, ".SoundType.MinDistance");
60 // Alpha
61 root.getValueByName(m_Alpha, ".SoundType.Alpha");
63 #if NLSOUND_SHEET_VERSION_BUILT < 2
64 _GroupController = CGroupControllerRoot::getInstance()->getGroupController(NLSOUND_SHEET_V1_DEFAULT_SOUND_STREAM_GROUP_CONTROLLER);
65 #endif
68 void CStreamSound::serial(NLMISC::IStream &s)
70 CSound::serial(s);
72 s.serial(_MinDist);
73 s.serial(m_Alpha);
75 #if NLSOUND_SHEET_VERSION_BUILT < 2
76 if (s.isReading())
77 _GroupController = CGroupControllerRoot::getInstance()->getGroupController(NLSOUND_SHEET_V1_DEFAULT_SOUND_STREAM_GROUP_CONTROLLER);
78 #endif
81 } /* namespace NLSOUND */
83 /* end of file */