diff options
author | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-27 15:36:10 +0000 |
---|---|---|
committer | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-27 15:36:10 +0000 |
commit | 55fd4d9fe704f53be2f1c530195d72715836ece9 (patch) | |
tree | 1a1c1a343bb61638024ba057f149c9637e0f18e1 /crawl-ref/source/tilereg.cc | |
parent | efde5f5a0ac8266096eaf03b82cfaf18db0d7c29 (diff) | |
download | crawl-ref-55fd4d9fe704f53be2f1c530195d72715836ece9.tar.gz crawl-ref-55fd4d9fe704f53be2f1c530195d72715836ece9.zip |
Added '_' cursor for some text inputs that were missing it.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7040 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilereg.cc')
-rw-r--r-- | crawl-ref/source/tilereg.cc | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 6d241280c5..95f99f1f7d 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -2097,13 +2097,13 @@ void TextRegion::cgotoxy(int x, int y) if (cursor_region != NULL && cursor_flag) { - cursor_region ->erase_cursor(); + cursor_x = -1; + cursor_y = -1; cursor_region = NULL; } if (cursor_flag) { - text_mode->draw_cursor(print_x, print_y); cursor_x = print_x; cursor_y = print_y; cursor_region = text_mode; @@ -2124,30 +2124,40 @@ void TextRegion::_setcursortype(int curstype) { cursor_flag = curstype; if (cursor_region != NULL) - cursor_region->erase_cursor(); + { + cursor_x = -1; + cursor_y = -1; + } if (curstype) { - text_mode->draw_cursor(print_x, print_y); cursor_x = print_x; cursor_y = print_y; cursor_region = text_mode; } } -void TextRegion::draw_cursor(int x, int y) +void TextRegion::render() { - // TODO enne -} + if (cursor_x > 0 && cursor_y > 0) + { + int idx = cursor_x + mx * cursor_y; -void TextRegion::erase_cursor() -{ - // TODO enne -} + unsigned char char_back = cbuf[idx]; + unsigned char col_back = abuf[idx]; -void TextRegion::render() -{ - m_font->render_textblock(sx + ox, sy + oy, cbuf, abuf, mx, my); + cbuf[idx] = '_'; + abuf[idx] = WHITE; + + m_font->render_textblock(sx + ox, sy + oy, cbuf, abuf, mx, my); + + cbuf[idx] = char_back; + abuf[idx] = col_back; + } + else + { + m_font->render_textblock(sx + ox, sy + oy, cbuf, abuf, mx, my); + } } void TextRegion::clear() |