summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libutil.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-11 15:31:45 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-11 15:31:45 +0000
commit04ef4ac34d7bbc5358a3adbf542071599e71c515 (patch)
treef1a7f48c32bd700ac49cace190c67b3f5434df7f /crawl-ref/source/libutil.cc
parent370f12250ba294042472a110a006769e42f1bff4 (diff)
downloadcrawl-ref-04ef4ac34d7bbc5358a3adbf542071599e71c515.tar.gz
crawl-ref-04ef4ac34d7bbc5358a3adbf542071599e71c515.zip
[1657502] Added use_fake_cursor option to make Crawl draw a cursor for Unix
terminals that cannot draw cursors on black spaces or darkgrey areas. May need some work, since the fake cursor tends to leave artifacts on the scrolling edge. Removed the +1 X offset to the viewport. Fixed crash when monster wielding a weapon of orc slaying hits player (Erik). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1016 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libutil.cc')
-rw-r--r--crawl-ref/source/libutil.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index 5246c2704d..096eeffc8a 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -140,7 +140,7 @@ int unmangle_direction_keys(int keyin, int km)
// the shell can do damage with.
bool shell_safe(const char *file)
{
- int match = strcspn(file, "`$*?|><&\n");
+ int match = strcspn(file, "\\`$*?|><&\n!");
return !(match >= 0 && file[match]);
}
@@ -302,6 +302,20 @@ int c_getch()
#endif
}
+// Wrapper around gotoxy that can draw a fake cursor for Unix terms where
+// cursoring over darkgray or black causes problems.
+void cursorxy(int x, int y)
+{
+#ifdef UNIX
+ if (Options.use_fake_cursor)
+ fakecursorxy(x, y);
+ else
+ gotoxy(x, y);
+#else
+ gotoxy(x, y);
+#endif
+}
+
// cprintf that knows how to wrap down lines (primitive, but what the heck)
int wrapcprintf( int wrapcol, const char *s, ... )
{