1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "animation_fx_sheet.h"
21 #include "nel/georges/u_form_elm.h"
24 using namespace NLGEORGES
;
26 // ***************************************************************************
28 // ***************************************************************************
30 //-----------------------------------------------
32 //-----------------------------------------------
33 CAnimationFXSheet::CAnimationFXSheet(const std::string
&psName
, const float *userParams
)
37 StickMode
.Mode
= CFXStickMode::Spawn
;
40 UserParam
[0] = UserParam
[1] = UserParam
[2] = UserParam
[3] = 0.f
;
44 std::copy(userParams
, userParams
+ 4, UserParam
);
46 Color
= NLMISC::CRGBA::White
;
50 }// CAnimationFXSheet //
52 //-----------------------------------------------
54 //-----------------------------------------------
55 void CAnimationFXSheet::build(const NLGEORGES::UFormElm
&item
, const std::string
&prefix
/* = ""*/)
58 ok
&= item
.getValueByName(PSName
, (prefix
+ "PSName").c_str());
59 ok
&= item
.getValueByName(UserParam
[0], (prefix
+ "UserParam0").c_str());
60 ok
&= item
.getValueByName(UserParam
[1], (prefix
+ "UserParam1").c_str());
61 ok
&= item
.getValueByName(UserParam
[2], (prefix
+ "UserParam2").c_str());
62 ok
&= item
.getValueByName(UserParam
[3], (prefix
+ "UserParam3").c_str());
63 ok
&= item
.getValueByName(Color
, (prefix
+ "Color").c_str());
64 ok
&= item
.getValueByName(TrajectoryAnim
, (prefix
+ "TrajectoryAnim").c_str());
65 ok
&= item
.getValueByName(ScaleFX
, (prefix
+ "ScaleFX").c_str());
66 ok
&= item
.getValueByName(RayRefLength
, (prefix
+ "RayRefLength").c_str());
68 ok
&= StickMode
.build(item
, (prefix
+ "StickMode.").c_str());
70 uint32 repeatMode
= Loop
;
71 bool okRepeatMode
= item
.getValueByName(repeatMode
, (prefix
+ "RepeatMode").c_str());
74 RepeatMode
= (TRepeatMode
) repeatMode
;
79 nlwarning("couldn't read all fields");
83 //-----------------------------------------------
85 //-----------------------------------------------
86 void CAnimationFXSheet::build(const NLGEORGES::UFormElm
&item
)
92 //-----------------------------------------------
94 //-----------------------------------------------
95 void CAnimationFXSheet::serial(NLMISC::IStream
&f
)
99 for(uint k
= 0; k
< 4; ++k
)
101 f
.serial(UserParam
[k
]);
103 f
.serial(TrajectoryAnim
);
106 f
.serialEnum(RepeatMode
);
107 f
.serial(RayRefLength
);