MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / create

Function create

src/OpenLoco/src/ViewportManager.cpp:141–154  ·  view source on GitHub ↗

0x004CA2D0 * ax : x * eax >> 16 : y * bx : width * ebx >> 16 : height * cl : zoom * edx >> 14 : flags (bit 30 zoom related, bit 31 set if entityId used) * Optional one of 2 * 1. * ecx >> 16 : tile_z * dx : tile_x * edx >> 16 : tile_y * 2. * dx : entityId */

Source from the content-addressed store, hash-verified

139 * dx : entityId
140 */
141 Viewport* create(Window* window, int viewportIndex, Ui::Point origin, Ui::Size size, ZoomLevel zoom, EntityId entityId)
142 {
143 Viewport* viewport = initViewport(origin, size, zoom);
144
145 if (viewport == nullptr)
146 {
147 return nullptr;
148 }
149
150 window->viewports[viewportIndex] = viewport;
151 focusViewportOn(window, viewportIndex, entityId);
152
153 return viewport;
154 }
155
156 /* 0x004CA2D0
157 * ax : x

Callers

nothing calls this directly

Calls 2

focusViewportOnFunction · 0.85
initViewportFunction · 0.70

Tested by

no test coverage detected