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

Function drawGraphKeyIndustries

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

0x0046D47F

Source from the content-addressed store, hash-verified

1420
1421 // 0x0046D47F
1422 static void drawGraphKeyIndustries(Window* self, Gfx::DrawingContext& drawingCtx, uint16_t x, uint16_t& y)
1423 {
1424 auto tr = Gfx::TextRenderer(drawingCtx);
1425
1426 for (uint8_t i = 0; i < ObjectManager::getMaxObjects(ObjectType::industry); i++)
1427 {
1428 auto industry = ObjectManager::get<IndustryObject>(i);
1429
1430 if (industry == nullptr)
1431 {
1432 continue;
1433 }
1434
1435 if (!(self->var_854 & (1 << i)) || !(mapFrameNumber & (1 << 2)))
1436 {
1437 auto colour = kIndustryColours[_assignedIndustryColours[i]];
1438
1439 drawingCtx.drawRect(x, y + 3, 5, 5, colour, Gfx::RectFlags::none);
1440 }
1441
1442 FormatArguments args{};
1443 args.push(industry->name);
1444
1445 auto stringId = StringIds::small_black_string;
1446
1447 if (self->var_854 & (1 << i))
1448 {
1449 stringId = StringIds::small_white_string;
1450 }
1451
1452 auto point = Point(x + 6, y);
1453 tr.drawStringLeftClipped(point, 94, Colour::black, stringId, args);
1454
1455 y += 10;
1456 }
1457 }
1458
1459 // 0x0046D5A4
1460 static void drawGraphKeyRoutes(Window* self, Gfx::DrawingContext& drawingCtx, uint16_t x, uint16_t& y)

Callers 1

drawFunction · 0.85

Calls 5

TextRendererClass · 0.85
getMaxObjectsFunction · 0.85
drawStringLeftClippedMethod · 0.80
drawRectMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected