MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / MapXYZToViewport

Function MapXYZToViewport

src/viewport.cpp:200–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198static VpSpriteSorter _vp_sprite_sorter = nullptr;
199
200static Point MapXYZToViewport(const Viewport &vp, int x, int y, int z)
201{
202 Point p = RemapCoords(x, y, z);
203 p.x -= vp.virtual_width / 2;
204 p.y -= vp.virtual_height / 2;
205 return p;
206}
207
208/**
209 * Initialize viewport of the window for use.

Callers 3

InitializeWindowViewportFunction · 0.85
UpdateViewportPositionFunction · 0.85
ScrollWindowToFunction · 0.85

Calls 1

RemapCoordsFunction · 0.85

Tested by

no test coverage detected