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

Function open

src/OpenLoco/src/Ui/Windows/Main.cpp:28–52  ·  view source on GitHub ↗

0x00438A6C, 0x0043CB9F

Source from the content-addressed store, hash-verified

26
27 // 0x00438A6C, 0x0043CB9F
28 void open()
29 {
30 const int32_t uiWidth = Ui::width();
31 const int32_t uiHeight = Ui::height();
32
33 auto window = WindowManager::createWindow(
34 WindowType::main,
35 { 0, 0 },
36 { uiWidth, uiHeight },
37 Ui::WindowFlags::stickToBack,
38 getEvents());
39
40 window->setWidgets(_widgets);
41 window->widgets[widx::viewport].bottom = uiHeight;
42 window->widgets[widx::viewport].right = uiWidth;
43
44 WindowManager::setCurrentRotation(0);
45 ViewportManager::create(
46 window,
47 0,
48 { window->x, window->y },
49 { window->width, window->height },
50 ZoomLevel::full,
51 { (World::kMapRows * World::kTileSize) / 2 - 1, (World::kMapRows * World::kTileSize) / 2 - 1, 480 });
52 }
53
54 // 0x0043B2E4
55 static void draw(Ui::Window& window, Gfx::DrawingContext& drawingCtx)

Callers 2

zoomMenuDropdownFunction · 0.70
townsMenuDropdownFunction · 0.70

Calls 6

widthFunction · 0.85
heightFunction · 0.85
setCurrentRotationFunction · 0.85
setWidgetsMethod · 0.80
createFunction · 0.70
createWindowFunction · 0.50

Tested by

no test coverage detected