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

Method OnPaint

src/smallmap_gui.cpp:1582–1596  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1580 }
1581
1582 void OnPaint() override
1583 {
1584 if (this->map_type == SMT_OWNER) {
1585 for (const LegendAndColour *tbl = _legend_table[this->map_type]; !tbl->end; ++tbl) {
1586 if (tbl->company != CompanyID::Invalid() && !Company::IsValidID(tbl->company)) {
1587 /* Rebuild the owner legend. */
1588 BuildOwnerLegend();
1589 this->InvalidateData(1);
1590 break;
1591 }
1592 }
1593 }
1594
1595 this->DrawWidgets();
1596 }
1597
1598 void DrawWidget(const Rect &r, WidgetID widget) const override
1599 {

Callers

nothing calls this directly

Calls 4

InvalidFunction · 0.85
BuildOwnerLegendFunction · 0.85
DrawWidgetsMethod · 0.80
InvalidateDataMethod · 0.45

Tested by

no test coverage detected