summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2016-08-15 18:32:48 +0000
committerfrosch <frosch@openttd.org>2016-08-15 18:32:48 +0000
commit4d1843a95e26a64ff3ff0b967d721794dbf0fe46 (patch)
tree45cc7785faf095e617ca096deb1d9d7ff0cfbde6 /src/gfx.cpp
parentca6493f2e638fe528107eb88d8be83815b5110b3 (diff)
downloadopenttd-4d1843a95e26a64ff3ff0b967d721794dbf0fe46.tar.xz
(svn r27627) -Codechange: Deduplicate some cursor magic into SetMouseCursorBusy.
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index f3a98461d..909f6729e 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -1573,6 +1573,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.
* @param pal Palette to use for recolouring.