From 9062c8f3c306f1d0f73b969fbf7b4759cd2b19ab Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 17 Dec 2006 13:28:00 +0000 Subject: Fixed broken Windows compile. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@660 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/libw32c.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'crawl-ref/source/libw32c.cc') 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) ); -- cgit v1.2.3-54-g00ecf