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

Method DrawWidget

src/tree_gui.cpp:165–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163 }
164
165 void DrawWidget(const Rect &r, WidgetID widget) const override
166 {
167 if (widget >= WID_BT_TYPE_BUTTON_FIRST) {
168 const int index = widget - WID_BT_TYPE_BUTTON_FIRST;
169 /* Trees "grow" in the centre on the bottom line of the buttons */
170 DrawSprite(tree_sprites[index].sprite, tree_sprites[index].pal, CentreBounds(r.left, r.right, 0), r.bottom - ScaleGUITrad(BUTTON_BOTTOM_OFFSET));
171 }
172 }
173
174 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
175 {

Callers

nothing calls this directly

Calls 3

DrawSpriteFunction · 0.85
CentreBoundsFunction · 0.85
ScaleGUITradFunction · 0.70

Tested by

no test coverage detected