diff options
author | evktalo <evktalo@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-12 21:49:29 +0000 |
---|---|---|
committer | evktalo <evktalo@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-12 21:49:29 +0000 |
commit | d5b27617e39b944aad44a8f6305e07a5db439ea7 (patch) | |
tree | 13833158d763d1ed541332c5eca3bdd334a53de5 /crawl-ref/source/libw32c.cc | |
parent | 8d0155c915f8d3fca9afd3d7bb61ab01ee8a6c2a (diff) | |
download | crawl-ref-d5b27617e39b944aad44a8f6305e07a5db439ea7.tar.gz crawl-ref-d5b27617e39b944aad44a8f6305e07a5db439ea7.zip |
Commit r10201 to 0.5: fix BR#2820443.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10202 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libw32c.cc')
-rw-r--r-- | crawl-ref/source/libw32c.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc index 7e55786cdd..b5626f0c1b 100644 --- a/crawl-ref/source/libw32c.cc +++ b/crawl-ref/source/libw32c.cc @@ -81,6 +81,8 @@ static HANDLE inbuf = NULL; static HANDLE outbuf = NULL; static int current_color = -1; static bool cursor_is_enabled = false; +static CONSOLE_CURSOR_INFO initial_cci; +static bool have_initial_cci = false; // dirty line (sx,ex,y) static int chsx = 0, chex = 0, chy = -1; // cursor position (start at 0,0 --> 1,1) @@ -365,6 +367,10 @@ void init_libw32c(void) GetConsoleTitle( oldTitle, 78 ); SetConsoleTitle( CRAWL " " VERSION ); + // Use the initial Windows setting for cursor size if it exists. + // TODO: Respect changing cursor size manually while Crawl is running. + have_initial_cci = GetConsoleCursorInfo( outbuf, &initial_cci ); + #ifdef __MINGW32__ install_sighandlers(); #endif @@ -402,6 +408,7 @@ void init_libw32c(void) if (OutputCP != PREFERRED_CODEPAGE) SetConsoleOutputCP(PREFERRED_CODEPAGE); + } void deinit_libw32c(void) @@ -450,7 +457,9 @@ void _setcursortype_internal(bool curstype) if (curstype == cursor_is_enabled) return; - cci.dwSize = 5; + cci.dwSize = have_initial_cci && initial_cci.dwSize ? initial_cci.dwSize + : 5; + cci.bVisible = curstype? TRUE : FALSE; cursor_is_enabled = curstype; SetConsoleCursorInfo( outbuf, &cci ); |