From 4d1843a95e26a64ff3ff0b967d721794dbf0fe46 Mon Sep 17 00:00:00 2001 From: frosch Date: Mon, 15 Aug 2016 18:32:48 +0000 Subject: (svn r27627) -Codechange: Deduplicate some cursor magic into SetMouseCursorBusy. --- src/gfx.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/gfx.cpp') diff --git a/src/gfx.cpp b/src/gfx.cpp index f3a98461d..909f6729e 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -1572,6 +1572,19 @@ void CursorTick() } } +/** + * Set or unset the ZZZ cursor. + * @param busy Whether to show the ZZZ cursor. + */ +void SetMouseCursorBusy(bool busy) +{ + if (busy) { + if (_cursor.sprite == SPR_CURSOR_MOUSE) SetMouseCursor(SPR_CURSOR_ZZZ, PAL_NONE); + } else { + if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE, PAL_NONE); + } +} + /** * Assign a single non-animated sprite to the cursor. * @param sprite Sprite to draw for the cursor. -- cgit v1.2.3-54-g00ecf