diff options
author | Adam Borowski <kilobyte@angband.pl> | 2010-10-15 02:17:01 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2010-10-15 02:17:01 +0200 |
commit | f7717330f1e10f18464a68edc1b595dd6a6b9527 (patch) | |
tree | daff37556fe8b661c5d268b1429f73ae6669153d /crawl-ref/source/libw32c.cc | |
parent | e7572d74b30900124d9a896843f42b1c957d20c2 (diff) | |
parent | 448542e984ad690be6be5869e0f47072981ed2ce (diff) | |
download | crawl-ref-f7717330f1e10f18464a68edc1b595dd6a6b9527.tar.gz crawl-ref-f7717330f1e10f18464a68edc1b595dd6a6b9527.zip |
Merge branch 'master' into unicode
Diffstat (limited to 'crawl-ref/source/libw32c.cc')
-rw-r--r-- | crawl-ref/source/libw32c.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc index 4017bf6e7c..9f34b154c5 100644 --- a/crawl-ref/source/libw32c.cc +++ b/crawl-ref/source/libw32c.cc @@ -259,20 +259,20 @@ void set_string_input(bool value) outmodes = 0; } - if ( SetConsoleMode( inbuf, inmodes ) == 0) + if (SetConsoleMode(inbuf, inmodes) == 0) { fputs("Error initialising console input mode.", stderr); exit(0); } - if ( SetConsoleMode( outbuf, outmodes ) == 0) + if (SetConsoleMode(outbuf, outmodes) == 0) { fputs("Error initialising console output mode.", stderr); exit(0); } // now flush it - FlushConsoleInputBuffer( inbuf ); + FlushConsoleInputBuffer(inbuf); } #ifdef TARGET_COMPILER_MINGW @@ -339,8 +339,8 @@ static void w32_term_resizer() void init_libw32c(void) { - inbuf = GetStdHandle( STD_INPUT_HANDLE ); - outbuf = GetStdHandle( STD_OUTPUT_HANDLE ); + inbuf = GetStdHandle(STD_INPUT_HANDLE); + outbuf = GetStdHandle(STD_OUTPUT_HANDLE); if (inbuf == INVALID_HANDLE_VALUE || outbuf == INVALID_HANDLE_VALUE) { @@ -356,14 +356,14 @@ void init_libw32c(void) // 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 ); + have_initial_cci = GetConsoleCursorInfo(outbuf, &initial_cci); #ifdef TARGET_COMPILER_MINGW install_sighandlers(); #endif // by default, set string input to false: use char-input only - set_string_input( false ); + set_string_input(false); // set up screen size set_w32_screen_size(); @@ -448,7 +448,7 @@ void _setcursortype_internal(bool curstype) cci.bVisible = curstype? TRUE : FALSE; cursor_is_enabled = curstype; - SetConsoleCursorInfo( outbuf, &cci ); + SetConsoleCursorInfo(outbuf, &cci); // now, if we just changed from NOCURSOR to CURSOR, // actually move screen cursor @@ -584,7 +584,7 @@ void cprintf(const char *format, ...) va_list argp; char buffer[4096]; // one could hope it's enough - va_start( argp, format ); + va_start(argp, format); vsnprintf(buffer, sizeof(buffer), format, argp); cprintf_aux(buffer); @@ -639,7 +639,7 @@ static int ck_tr[] = // 2, 10, 14, 8, 0, 12, 25, 11, 21 , }; -static int key_to_command( int keyin ) +static int key_to_command(int keyin) { if (keyin >= CK_UP && keyin <= CK_CTRL_PGDN) return ck_tr[ keyin - CK_UP ]; @@ -650,7 +650,7 @@ static int key_to_command( int keyin ) return keyin; } -int vk_translate( WORD VirtCode, CHAR c, DWORD cKeys) +int vk_translate(WORD VirtCode, CHAR c, DWORD cKeys) { bool shftDown = false; bool ctrlDown = false; @@ -782,7 +782,7 @@ int getch_ck(void) bool waiting_for_event = true; while (waiting_for_event) { - if (ReadConsoleInput( inbuf, &ir, 1, &nread) == 0) + if (ReadConsoleInput(inbuf, &ir, 1, &nread) == 0) fputs("Error in ReadConsoleInput()!", stderr); if (nread > 0) { @@ -794,9 +794,9 @@ int getch_ck(void) // ignore if it is a 'key up' - we only want 'key down' if (kr->bKeyDown) { - key = vk_translate( kr->wVirtualKeyCode, + key = vk_translate(kr->wVirtualKeyCode, kr->uChar.AsciiChar, - kr->dwControlKeyState ); + kr->dwControlKeyState); if (key > 0) { repeat_count = kr->wRepeatCount - 1; @@ -828,7 +828,7 @@ int getch_ck(void) int getch(void) { int c = getch_ck(); - return key_to_command( c ); + return key_to_command(c); } int kbhit() @@ -879,7 +879,7 @@ void update_screen() bFlush(); } -bool set_buffering( bool value ) +bool set_buffering(bool value) { bool oldValue = buffering; |