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

Function GetSquareScaledSpriteSize

src/widget.cpp:83–88  ·  view source on GitHub ↗

* Scale sprite size for GUI, as a square. * Offset is ignored. * @param sprid The sprite to get the size from. * @return The square scaled dimension of the sprite. */

Source from the content-addressed store, hash-verified

81 * @return The square scaled dimension of the sprite.
82 */
83Dimension GetSquareScaledSpriteSize(SpriteID sprid)
84{
85 Dimension d = GetScaledSpriteSize(sprid);
86 uint x = std::max(d.width, d.height);
87 return {x, x};
88}
89
90static Dimension _toolbar_image_size{}; ///< Cached dimension of maximal toolbar sprite size.
91extern Dimension GetToolbarMaximalImageSize();

Callers 3

DrawImageTextButtonsFunction · 0.85
SetupSmallestSizeMethod · 0.85

Calls 1

GetScaledSpriteSizeFunction · 0.85

Tested by

no test coverage detected