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

Function BuildOwnerLegend

src/smallmap_gui.cpp:341–361  ·  view source on GitHub ↗

* Completes the array for the owned property legend. */

Source from the content-addressed store, hash-verified

339 * Completes the array for the owned property legend.
340 */
341void BuildOwnerLegend()
342{
343 _legend_land_owners[1].colour = PixelColour{static_cast<uint8_t>(_heightmap_schemes[_settings_client.gui.smallmap_land_colour].default_colour)};
344
345 int i = NUM_NO_COMPANY_ENTRIES;
346 for (const Company *c : Company::Iterate()) {
347 _legend_land_owners[i].colour = GetColourGradient(c->colour, SHADE_LIGHT);
348 _legend_land_owners[i].company = c->index;
349 _legend_land_owners[i].show_on_map = true;
350 _legend_land_owners[i].col_break = false;
351 _legend_land_owners[i].end = false;
352 _company_to_list_pos[c->index] = i;
353 i++;
354 }
355
356 /* Terminate the list */
357 _legend_land_owners[i].end = true;
358
359 /* Store maximum amount of owner legend entries. */
360 _smallmap_company_count = i;
361}
362
363struct AndOr {
364 uint32_t mor;

Callers 6

DoStartupNewCompanyFunction · 0.85
CmdSetCompanyColourFunction · 0.85
RedrawSmallmapFunction · 0.85
OnInitMethod · 0.85
OnPaintMethod · 0.85

Calls 1

GetColourGradientFunction · 0.85

Tested by

no test coverage detected