diff options
author | Janne Lahdenpera <felirx@gmail.com> | 2010-04-29 19:07:09 +0300 |
---|---|---|
committer | Janne Lahdenpera <felirx@gmail.com> | 2010-04-29 19:07:09 +0300 |
commit | 9de4bc955ad79c3bff8a1581965f6a64b8dfb3c2 (patch) | |
tree | 6d2db6017293f60d2843b2461a97881b9e29cc1a /crawl-ref/source/libw32c.cc | |
parent | ee828f30457768c20577742559a921af9a746141 (diff) | |
download | crawl-ref-9de4bc955ad79c3bff8a1581965f6a64b8dfb3c2.tar.gz crawl-ref-9de4bc955ad79c3bff8a1581965f6a64b8dfb3c2.zip |
Implement textbackground() for Win console builds
Signed-off-by: Janne Lahdenpera <felirx@gmail.com>
Diffstat (limited to 'crawl-ref/source/libw32c.cc')
-rw-r--r-- | crawl-ref/source/libw32c.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc index c37c31cb3b..1431ea7bb7 100644 --- a/crawl-ref/source/libw32c.cc +++ b/crawl-ref/source/libw32c.cc @@ -553,6 +553,17 @@ void textcolor(int c) current_color = macro_fg | (macro_bg << 4); } +void textbackground(int c) +{ + // change current background color used to stamp chars + // parameter does NOT come bitshifted by four + short bg = c & 0xF; + short macro_bg = Options.colour[bg]; + + current_color = current_color | (macro_bg << 4); +} + + static void cprintf_aux(const char *s) { // early out -- not initted yet @@ -864,12 +875,6 @@ void delay(int ms) Sleep((DWORD)ms); } -void textbackground(int c) -{ - // do nothing - UNUSED( c ); -} - int get_console_string(char *buf, int maxlen) { DWORD nread; |