1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
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/>.
22 #ifndef CL_CONTINENT_MANAGER_BUILD_H
23 #define CL_CONTINENT_MANAGER_BUILD_H
25 #include "nel/misc/vector_2f.h"
26 #include "nel/ligo/primitive.h"
36 Capital
, // A city ( icon and text)
37 Village
, // A city ( icon and text)
38 Outpost
, // An outpost ( icon and text)
39 Stable
, // A stable ( icon and no text)
40 Region
, // A region (no icon and text)
41 Place
, // (lieu-dit) (no icon and text)
42 Street
, // A Street (no icon and text)
47 NLMISC::CVector2f Pos
; // Center of the zone
48 NLLIGO::CPrimZone Zone
; // Region & Place
49 std::string TitleTextID
; // should be converted with CStringManagerClient::getPlaceLocalizedName() to get the actual title in utf-8 string
58 void serial(NLMISC::IStream
&f
)
64 f
.serial(TitleTextID
);
67 static NLMISC::CVector2f
getZoneCenter(const NLLIGO::CPrimZone
&z
)
69 NLMISC::CVector2f vMin
, vMax
;
70 if (z
.VPoints
.empty())
71 return NLMISC::CVector2f(0,0);
72 vMin
= vMax
= z
.VPoints
[0];
73 for (uint32 i
= 1; i
< z
.VPoints
.size(); ++i
)
75 if (z
.VPoints
[i
].x
< vMin
.x
) vMin
.x
= z
.VPoints
[i
].x
;
76 if (z
.VPoints
[i
].y
< vMin
.y
) vMin
.y
= z
.VPoints
[i
].y
;
77 if (z
.VPoints
[i
].x
> vMax
.x
) vMax
.x
= z
.VPoints
[i
].x
;
78 if (z
.VPoints
[i
].y
> vMax
.y
) vMax
.y
= z
.VPoints
[i
].y
;
83 NLMISC::CVector2f
getZoneCenter()
85 return getZoneCenter(Zone
);
89 extern bool buildLMConts(const std::string
&worldSheet
, const std::string
&primitivesPath
, const std::string
&dataPath
);
91 #define LM_PACKED_FILE "lmconts.packed"
92 #define WORLD_MAP_FILE "global_world_map.primitive"
94 #endif // CL_CONTINENT_MANAGER_BUILD_H
96 /* End of continent_manager_build.h */