1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
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/>.
18 #include "nel/ligo/ligo_material.h"
21 #include "nel/ligo/ligo_error.h"
23 //using namespace NL3D;
32 // ***************************************************************************
34 bool CMaterial::build (const CZoneTemplate
&tplt
, const CLigoConfig
&config
, CLigoError
&errors
)
40 const std::vector
<CZoneEdge
> &edges
= tplt
.getEdges ();
42 // This template should have 4 edges
43 if (edges
.size() != 4)
45 errors
.MainError
= CLigoError::MustHave4Edges
;
49 // The 1st edge must be symetrical
50 if (!edges
[0].isSymetrical (config
, errors
))
56 // The others must be the same edges
58 for (edge
=1; edge
<edges
.size(); edge
++)
61 if (!edges
[0].isTheSame (edges
[edge
], config
, errors
))
71 // Ok, build the material
79 // ***************************************************************************
81 void CMaterial::serial (NLMISC::IStream
&s
)
83 // Serial the main node
84 s
.xmlPush ("LIGO_MATERIAL");
87 s
.serialCheck (NELID("TMOL"));
90 /*sint ver =*/ s
.serialVersion (0);
92 // Serial the zoneedge
93 s
.xmlSerial (_ZoneEdge
, "ZONE_EDGE");
95 // Close the main node
99 // ***************************************************************************