MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / CStaticMap

Method CStaticMap

engine/Poseidon/UI/Map/UIMap.cpp:243–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243CStaticMap::CStaticMap(ControlsContainer* parent, int idc, const ParamEntry& cls, float scaleMin, float scaleMax,
244 float scaleDefault)
245 : CStatic(parent, idc, cls)
246{
247 _defaultCenter.Init();
248 _defaultCenter[0] = (Pars >> "CfgWorlds" >> Glob.header.worldname >> "centerPosition")[0];
249 _defaultCenter[1] = 0;
250 _defaultCenter[2] = (Pars >> "CfgWorlds" >> Glob.header.worldname >> "centerPosition")[1];
251
252 float sizeLand = LandGrid * LandRange;
253 saturate(_defaultCenter[0], 0, sizeLand);
254 saturate(_defaultCenter[2], 0, sizeLand);
255
256 _colorSeaPacked = GetPackedColor(cls >> "colorSea");
257 _colorSea = Color((ColorVal)_colorSeaPacked);
258 _colorForest = GetPackedColor(cls >> "colorForest");
259
260 _colorCountlines = GetPackedColor(cls >> "colorCountlines");
261 _colorCountlinesWater = GetPackedColor(cls >> "colorCountlinesWater");
262 _colorForestBorder = GetPackedColor(cls >> "colorForestBorder");
263 _colorNames = GetPackedColor(cls >> "colorNames");
264
265 _colorInactive = GetPackedColor(cls >> "colorInactive");
266
267 _fontLabel = GLOB_ENGINE->LoadFont(GetFontID(cls >> "fontLabel"));
268 const ParamEntry* entry = cls.FindEntry("sizeLabel");
269 if (entry)
270 {
271 _sizeLabel = (float)(*entry) * _fontLabel->Height();
272 }
273 else
274 {
275 _sizeLabel = cls >> "sizeExLabel";
276 }
277 _fontGrid = GLOB_ENGINE->LoadFont(GetFontID(cls >> "fontGrid"));
278 entry = cls.FindEntry("sizeGrid");
279 if (entry)
280 {
281 _sizeGrid = (float)(*entry) * _fontGrid->Height();
282 }
283 else
284 {
285 _sizeGrid = cls >> "sizeExGrid";
286 }
287 _fontUnits = GLOB_ENGINE->LoadFont(GetFontID(cls >> "fontUnits"));
288 entry = cls.FindEntry("sizeUnits");
289 if (entry)
290 {
291 _sizeUnits = (float)(*entry) * _fontUnits->Height();
292 }
293 else
294 {
295 _sizeUnits = cls >> "sizeExUnits";
296 }
297 _fontNames = GLOB_ENGINE->LoadFont(GetFontID(cls >> "fontNames"));
298 entry = cls.FindEntry("sizeNames");
299 if (entry)
300 {

Callers

nothing calls this directly

Calls 11

saturateFunction · 0.85
GetPackedColorFunction · 0.85
ColorClass · 0.85
GetFontIDFunction · 0.85
GlobLoadTextureFunction · 0.85
GetPictureNameFunction · 0.85
InitMethod · 0.45
LoadFontMethod · 0.45
FindEntryMethod · 0.45
HeightMethod · 0.45
LoadMethod · 0.45

Tested by

no test coverage detected