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

Function draw

src/OpenLoco/src/Ui/Windows/MapWindow.cpp:1675–1740  ·  view source on GitHub ↗

0x0046B779

Source from the content-addressed store, hash-verified

1673
1674 // 0x0046B779
1675 static void draw(Window& self, Gfx::DrawingContext& drawingCtx)
1676 {
1677 auto tr = Gfx::TextRenderer(drawingCtx);
1678
1679 self.draw(drawingCtx);
1680 drawTabs(self, drawingCtx);
1681
1682 {
1683 auto x = self.x + self.width - 104;
1684 uint16_t y = self.y + 44;
1685
1686 switch (self.currentTab + widx::tabOverall)
1687 {
1688 case widx::tabOverall:
1689 drawGraphKeyOverall(&self, drawingCtx, x, y);
1690 break;
1691
1692 case widx::tabVehicles:
1693 drawGraphKeyVehicles(&self, drawingCtx, x, y);
1694 break;
1695
1696 case widx::tabIndustries:
1697 drawGraphKeyIndustries(&self, drawingCtx, x, y);
1698 break;
1699
1700 case widx::tabRoutes:
1701 drawGraphKeyRoutes(&self, drawingCtx, x, y);
1702 break;
1703
1704 case widx::tabOwnership:
1705 drawGraphKeyCompanies(&self, drawingCtx, x, y);
1706 break;
1707 }
1708
1709 y -= self.y;
1710 y += 14;
1711 y = std::max<uint16_t>(y, kMinWindowSize.height);
1712
1713 self.minHeight = y;
1714 }
1715
1716 FormatArguments args{};
1717
1718 switch (self.currentTab + widx::tabOverall)
1719 {
1720 case widx::tabOverall:
1721 case widx::tabRoutes:
1722 case widx::tabOwnership:
1723 args.push(StringIds::empty);
1724 break;
1725
1726 case widx::tabVehicles:
1727 formatVehicleString(&self, args);
1728 break;
1729
1730 case widx::tabIndustries:
1731 formatIndustryString(&self, args);
1732 break;

Callers

nothing calls this directly

Calls 13

TextRendererClass · 0.85
drawGraphKeyOverallFunction · 0.85
drawGraphKeyVehiclesFunction · 0.85
drawGraphKeyIndustriesFunction · 0.85
drawGraphKeyRoutesFunction · 0.85
drawGraphKeyCompaniesFunction · 0.85
formatVehicleStringFunction · 0.85
formatIndustryStringFunction · 0.85
drawStringLeftClippedMethod · 0.80
drawTabsFunction · 0.70
drawMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected