summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libw32c.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-17 13:28:00 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-17 13:28:00 +0000
commit9062c8f3c306f1d0f73b969fbf7b4759cd2b19ab (patch)
tree7b1b0f751b8431a18a8f1c354f549617b363a703 /crawl-ref/source/libw32c.cc
parenta8855a831f9a789f19e2525962d0e5c4a8463a18 (diff)
downloadcrawl-ref-9062c8f3c306f1d0f73b969fbf7b4759cd2b19ab.tar.gz
crawl-ref-9062c8f3c306f1d0f73b969fbf7b4759cd2b19ab.zip
Fixed broken Windows compile.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@660 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libw32c.cc')
-rw-r--r--crawl-ref/source/libw32c.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc
index 1905c5bd56..09501eb5bd 100644
--- a/crawl-ref/source/libw32c.cc
+++ b/crawl-ref/source/libw32c.cc
@@ -81,7 +81,7 @@ char oldTitle[80];
static HANDLE inbuf = NULL;
static HANDLE outbuf = NULL;
static int current_color = -1;
-static bool current_cursor = _NOCURSOR;
+static bool cursor_is_enabled = false;
// dirty line (sx,ex,y)
static int chsx=0, chex=0, chy=-1;
// cursor position (start at 0,0 --> 1,1)
@@ -104,7 +104,7 @@ static bool w32_smart_cursor = true;
#define WIN32COLOR(col) (WORD)(col)
static void writeChar(char c);
static void bFlush(void);
-static void _setcursortype_internal(int curstype);
+static void _setcursortype_internal(bool curstype);
// [ds] Unused for portability reasons
/*
@@ -288,7 +288,7 @@ void bFlush(void)
chy = -1;
// if cursor is not NOCURSOR, update screen
- if (current_cursor != _NOCURSOR)
+ if (cursor_is_enabled)
{
COORD xy;
xy.X = cx;
@@ -383,7 +383,7 @@ void init_libw32c(void)
textcolor(DARKGREY);
// initialise cursor to NONE.
- _setcursortype_internal(_NOCURSOR);
+ _setcursortype_internal(false);
// buffering defaults to ON -- very important!
setBuffering(true);
@@ -425,7 +425,7 @@ void deinit_libw32c(void)
setStringInput(true);
// set cursor and normal textcolor
- _setcursortype_internal(_NORMALCURSOR);
+ _setcursortype_internal(true);
textcolor(DARKGREY);
// finally, restore title
@@ -440,26 +440,26 @@ void set_cursor_enabled(bool enabled)
bool is_cursor_enabled()
{
- return (current_cursor);
+ return (cursor_is_enabled);
}
void _setcursortype_internal(bool curstype)
{
CONSOLE_CURSOR_INFO cci;
- if (curstype == current_cursor)
+ if (curstype == cursor_is_enabled)
return;
cci.dwSize = 5;
cci.bVisible = curstype? TRUE : FALSE;
- current_cursor = curstype;
+ cursor_is_enabled = curstype;
CLOCKIN
SetConsoleCursorInfo( outbuf, &cci );
CLOCKOUT(1)
// now, if we just changed from NOCURSOR to CURSOR,
// actually move screen cursor
- if (current_cursor != _NOCURSOR)
+ if (cursor_is_enabled)
gotoxy(cx+1, cy+1);
}
@@ -518,7 +518,7 @@ void gotoxy(int x, int y)
cy = y-1;
// if cursor is not NOCURSOR, update screen
- if (current_cursor != _NOCURSOR)
+ if (cursor_is_enabled)
{
COORD xy;
xy.X = cx;
@@ -729,9 +729,9 @@ int getch_ck(void)
return repeat_key;
}
- const bool oldValue = current_cursor;
+ const bool oldValue = cursor_is_enabled;
if (w32_smart_cursor)
- _setcursortype_internal(_NORMALCURSOR);
+ _setcursortype_internal(true);
while(1)
{
@@ -825,10 +825,10 @@ int getConsoleString(char *buf, int maxlen)
setStringInput( true );
// force cursor
- const bool oldValue = current_cursor;
+ const bool oldValue = cursor_is_enabled;
if (w32_smart_cursor)
- _setcursortype_internal(_NORMALCURSOR);
+ _setcursortype_internal(true);
// set actual screen color to current color
SetConsoleTextAttribute( outbuf, WIN32COLOR(current_color) );