Use configured resolution for login/outgame/ingame
[ryzomcore.git] / ryzom / client / src / client_sheets / animation_fx_sheet.cpp
blobf5a84490d72a502fa4655e18aed4e4b2a4985180
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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/>.
19 #include "stdpch.h"
20 #include "animation_fx_sheet.h"
21 #include "nel/georges/u_form_elm.h"
24 using namespace NLGEORGES;
26 // ***************************************************************************
27 // CAnimationFXSheet
28 // ***************************************************************************
30 //-----------------------------------------------
31 // CAnimationFXSheet
32 //-----------------------------------------------
33 CAnimationFXSheet::CAnimationFXSheet(const std::string &psName, const float *userParams)
35 Type = ANIMATION_FX;
36 PSName = psName;
37 StickMode.Mode = CFXStickMode::Spawn;
38 if (!userParams)
40 UserParam[0] = UserParam[1] = UserParam[2] = UserParam[3] = 0.f;
42 else
44 std::copy(userParams, userParams + 4, UserParam);
46 Color = NLMISC::CRGBA::White;
47 ScaleFX = false;
48 RepeatMode = Loop;
49 RayRefLength = 1.f;
50 }// CAnimationFXSheet //
52 //-----------------------------------------------
53 // build with prefix
54 //-----------------------------------------------
55 void CAnimationFXSheet::build(const NLGEORGES::UFormElm &item, const std::string &prefix /* = ""*/)
57 bool ok = true;
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());
72 if (okRepeatMode)
74 RepeatMode = (TRepeatMode) repeatMode;
76 ok &= okRepeatMode;
77 if (!ok)
79 nlwarning("couldn't read all fields");
81 }// build //
83 //-----------------------------------------------
84 // build
85 //-----------------------------------------------
86 void CAnimationFXSheet::build(const NLGEORGES::UFormElm &item)
88 build(item, "");
92 //-----------------------------------------------
93 // serial
94 //-----------------------------------------------
95 void CAnimationFXSheet::serial(NLMISC::IStream &f)
97 f.serial(PSName);
98 f.serial(StickMode);
99 for(uint k = 0; k < 4; ++k)
101 f.serial(UserParam[k]);
103 f.serial(TrajectoryAnim);
104 f.serial(Color);
105 f.serial(ScaleFX);
106 f.serialEnum(RepeatMode);
107 f.serial(RayRefLength);
108 }// serial //