summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libdos.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-17 13:11:17 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-17 13:11:17 +0000
commita8855a831f9a789f19e2525962d0e5c4a8463a18 (patch)
tree0a2b9caa6732a4cfa392df0352649a6cfccdff1c /crawl-ref/source/libdos.cc
parent39379c48505b14bfbe8ac8292e5938ad33d5989a (diff)
downloadcrawl-ref-a8855a831f9a789f19e2525962d0e5c4a8463a18.tar.gz
crawl-ref-a8855a831f9a789f19e2525962d0e5c4a8463a18.zip
An attempt at a more comprehensive fix for cursor inconsistencies between
platforms. We'll probably need to tweak this further. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@659 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libdos.cc')
-rw-r--r--crawl-ref/source/libdos.cc56
1 files changed, 35 insertions, 21 deletions
diff --git a/crawl-ref/source/libdos.cc b/crawl-ref/source/libdos.cc
index 4eb30860f0..86c7aec1b6 100644
--- a/crawl-ref/source/libdos.cc
+++ b/crawl-ref/source/libdos.cc
@@ -1,21 +1,35 @@
-/*
- * File: libdos.cc
- * Summary: Functions for DOS support.
- * Written by: Darshan Shaligram
- *
- * Added for Crawl Reference by $Author: nlanza $ on $Date: 2006-09-26T03:22:57.300929Z $
- */
-
-// Every .cc must include AppHdr or bad things happen.
-#include "AppHdr.h"
-#include <termios.h>
-
-void init_libdos()
-{
- struct termios charmode;
-
- tcgetattr (0, &charmode);
- // Ignore Ctrl-C
- charmode.c_lflag &= ~ISIG;
- tcsetattr (0, TCSANOW, &charmode);
-}
+/*
+ * File: libdos.cc
+ * Summary: Functions for DOS support.
+ * Written by: Darshan Shaligram
+ *
+ * Added for Crawl Reference by $Author: nlanza $ on $Date: 2006-09-26T03:22:57.300929Z $
+ */
+
+// Every .cc must include AppHdr or bad things happen.
+#include "AppHdr.h"
+#include <termios.h>
+#include <conio.h>
+
+static bool cursor_is_enabled = true;
+
+void init_libdos()
+{
+ struct termios charmode;
+
+ tcgetattr (0, &charmode);
+ // Ignore Ctrl-C
+ charmode.c_lflag &= ~ISIG;
+ tcsetattr (0, TCSANOW, &charmode);
+}
+
+void set_cursor_enabled(bool enabled)
+{
+ cursor_is_enabled = enabled;
+ _setcursortype( enabled? _NORMALCURSOR : _NOCURSOR );
+}
+
+bool is_cursor_enabled()
+{
+ return (cursor_is_enabled);
+}