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

Method DrawWidget

src/terraform_gui.cpp:554–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552 }
553
554 void DrawWidget(const Rect &r, WidgetID widget) const override
555 {
556 if (widget != WID_ETT_DOTS) return;
557
558 int center_x = RoundDivSU(r.left + r.right, 2);
559 int center_y = RoundDivSU(r.top + r.bottom, 2);
560
561 int n = _terraform_size * _terraform_size;
562 const int8_t *coords = &_multi_terraform_coords[0][0];
563
564 assert(n != 0);
565 do {
566 DrawSprite(SPR_WHITE_POINT, PAL_NONE, center_x + ScaleGUITrad(coords[0]), center_y + ScaleGUITrad(coords[1]));
567 coords += 2;
568 } while (--n);
569 }
570
571 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
572 {

Callers

nothing calls this directly

Calls 3

RoundDivSUFunction · 0.85
DrawSpriteFunction · 0.85
ScaleGUITradFunction · 0.70

Tested by

no test coverage detected