summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2009-03-17 16:28:21 +0000
committerglx <glx@openttd.org>2009-03-17 16:28:21 +0000
commite968f5c572be817b661e702e4a8ceb38f44b13c2 (patch)
tree4a9f6cf9e82e5fa806400dc4fad6efa70c278117 /src
parent93be9a1c905b92f2f68c24d71eb718197b9ed7bc (diff)
downloadopenttd-e968f5c572be817b661e702e4a8ceb38f44b13c2.tar.xz
(svn r15752) -Fix: don't try to (un)draw the cursor when the screen is not ready
Diffstat (limited to 'src')
-rw-r--r--src/gfx.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 4423bff19..aeac0db1d 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -1285,6 +1285,9 @@ void ScreenSizeChanged()
void UndrawMouseCursor()
{
+ /* Don't undraw the mouse cursor if the screen is not ready */
+ if (_screen.dst_ptr == NULL) return;
+
if (_cursor.visible) {
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
_cursor.visible = false;
@@ -1300,6 +1303,9 @@ void DrawMouseCursor()
return;
#endif
+ /* Don't draw the mouse cursor if the screen is not ready */
+ if (_screen.dst_ptr == NULL) return;
+
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
int x;
int y;