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

Function SetCursorSprite

src/gfx.cpp:1656–1664  ·  view source on GitHub ↗

* Switch cursor to different sprite. * @param cursor Sprite to draw for the cursor. * @param pal Palette to use for recolouring. */

Source from the content-addressed store, hash-verified

1654 * @param pal Palette to use for recolouring.
1655 */
1656static void SetCursorSprite(CursorID cursor, PaletteID pal)
1657{
1658 if (_cursor.sprites.size() == 1 && _cursor.sprites[0].image.sprite == cursor && _cursor.sprites[0].image.pal == pal) return;
1659
1660 _cursor.sprites.clear();
1661 _cursor.sprites.emplace_back(cursor, pal, 0, 0);
1662
1663 UpdateCursorSize();
1664}
1665
1666static void SwitchAnimatedCursor()
1667{

Callers 2

SwitchAnimatedCursorFunction · 0.85
SetMouseCursorFunction · 0.85

Calls 3

UpdateCursorSizeFunction · 0.85
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected