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

Function CreateStaticMapMain

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

Source from the content-addressed store, hash-verified

2508
2509 DrawCoord ptMap(mouseX, mouseY);
2510 DrawCoord offset(mouseX - _x, mouseY - _y);
2511 Vector3 pt = ScreenToWorld(ptMap);
2512
2513 _scaleX = scale;
2514 Precalculate();
2515
2516 float invSizeLand = 1.0 / (LandGrid * LandRange);
2517 float xMap = pt.X() * invSizeLand * _invScaleX;
2518 float yMap = (1.0 - pt.Z() * invSizeLand) * _invScaleY;
2519 _mapX = offset.x - xMap;

Callers 1

OnCreateCtrlMethod · 0.85

Calls 6

SetVisibleRectMethod · 0.80
XMethod · 0.45
YMethod · 0.45
WMethod · 0.45
HMethod · 0.45
CenterMethod · 0.45

Tested by

no test coverage detected