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

Method DrawHorConnection

src/industry_gui.cpp:2363–2368  ·  view source on GitHub ↗

* Draw a horizontal cargo connection. * @param left Left-most coordinate to draw. * @param right Right-most coordinate to draw. * @param top Top coordinate of the cargo connection. * @param csp Cargo to draw. */

Source from the content-addressed store, hash-verified

2361 * @param csp Cargo to draw.
2362 */
2363 static void DrawHorConnection(int left, int right, int top, const CargoSpec *csp)
2364 {
2365 GfxDrawLine(left, top, right, top, CARGO_LINE_COLOUR);
2366 GfxFillRect(left, top + 1, right, top + CargoesField::cargo_line.height - 2, csp->legend_colour, FILLRECT_OPAQUE);
2367 GfxDrawLine(left, top + CargoesField::cargo_line.height - 1, right, top + CargoesField::cargo_line.height - 1, CARGO_LINE_COLOUR);
2368 }
2369};
2370
2371static_assert(MAX_CARGOES >= std::tuple_size_v<decltype(IndustrySpec::produced_cargo)>);

Callers

nothing calls this directly

Calls 2

GfxDrawLineFunction · 0.85
GfxFillRectFunction · 0.70

Tested by

no test coverage detected