diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-25 06:29:18 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-25 06:29:18 +0000 |
commit | ce96d334e703f1a087a62b55dd5dd82f35fe5e1e (patch) | |
tree | 441be44a234beceb03328601a6c695f45101d014 /crawl-ref | |
parent | 9f5555209ea63a352cb14aae686cee5d257e5a8c (diff) | |
download | crawl-ref-ce96d334e703f1a087a62b55dd5dd82f35fe5e1e.tar.gz crawl-ref-ce96d334e703f1a087a62b55dd5dd82f35fe5e1e.zip |
Fix broken DOS and Windows compiles.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@703 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/libdos.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/libdos.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/libw32c.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/libw32c.h | 1 |
4 files changed, 20 insertions, 0 deletions
diff --git a/crawl-ref/source/libdos.cc b/crawl-ref/source/libdos.cc index 86c7aec1b6..b105896ba9 100644 --- a/crawl-ref/source/libdos.cc +++ b/crawl-ref/source/libdos.cc @@ -33,3 +33,12 @@ bool is_cursor_enabled() { return (cursor_is_enabled); } + +// This will force the cursor down to the next line. +void clear_to_end_of_line() +{ + const int pos = wherex(); + const int cols = get_number_of_cols(); + if (pos <= cols) + cprintf("%*s", cols - pos + 1, ""); +} diff --git a/crawl-ref/source/libdos.h b/crawl-ref/source/libdos.h index b6fd3d6c05..72872acdd5 100644 --- a/crawl-ref/source/libdos.h +++ b/crawl-ref/source/libdos.h @@ -7,5 +7,6 @@ inline void enable_smart_cursor(bool ) { } inline bool is_smart_cursor_enabled() { return (false); } void set_cursor_enabled(bool enabled); bool is_cursor_enabled(); +void clear_to_end_of_line(); #endif diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc index 09501eb5bd..7dc5b696e3 100644 --- a/crawl-ref/source/libw32c.cc +++ b/crawl-ref/source/libw32c.cc @@ -463,6 +463,15 @@ void _setcursortype_internal(bool curstype) gotoxy(cx+1, cy+1); } +// This will force the cursor down to the next line. +void clear_to_end_of_line() +{ + const int pos = wherex(); + const int cols = get_number_of_cols(); + if (pos <= cols) + cprintf("%*s", cols - pos + 1, ""); +} + void clrscr(void) { int x,y; diff --git a/crawl-ref/source/libw32c.h b/crawl-ref/source/libw32c.h index e4efd254c1..758b854e9e 100644 --- a/crawl-ref/source/libw32c.h +++ b/crawl-ref/source/libw32c.h @@ -22,6 +22,7 @@ void set_cursor_enabled(bool enabled); bool is_cursor_enabled(); void clrscr(void); +void clear_to_end_of_line(); void gotoxy(int x, int y); void textcolor(int c); void textattr(int c); |