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/>.
19 #ifndef RY_LIGHT_CYCLE_H
20 #define RY_LIGHT_CYCLE_H
29 /** Description of light cycle for a single season
31 struct CSeasonLightCycle
35 float DuskToNightHour
;
38 ///////////////////////////////////////////////////////////////
41 // build from a Georges form
42 void build(const NLGEORGES::UFormElm
&item
);
44 void serial(NLMISC::IStream
&f
)
46 f
.serial(DayHour
, DayToDuskHour
, DuskToNightHour
, NightHour
, NightToDayHour
);
51 /** Description of a complete light cycle for each season
55 float RealDayLength
; // real length of the day, in seconds
56 float NumHours
; // number of ryzom hours in a day
57 uint32 MaxNumColorSteps
; // the max number of color steps
58 CSeasonLightCycle SeasonLightCycle
[EGSPD::CSeason::Invalid
]; // description of each season
59 ///////////////////////////////////////////////////////////////
62 // build from a Georges form
63 void build(const NLGEORGES::UFormElm
&item
);
64 // Build from a sheet file
65 void build(const char *sheetName
);
67 void serial(NLMISC::IStream
&f
)
69 f
.serial(RealDayLength
, NumHours
, MaxNumColorSteps
);
70 for(uint k
= 0; k
< EGSPD::CSeason::Invalid
; ++k
)
72 f
.serial(SeasonLightCycle
[k
]);