summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-06 00:42:14 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-06 00:42:14 +0000
commit97aa9cdb2a971d66113b6b246ad56cc046be04e1 (patch)
tree288ab594891196ed8205e6429e4202a17f9a0892 /crawl-ref/source/tilereg.cc
parent10eb277e4017ab8e5bc54fc8db59e35b3c49ee0b (diff)
downloadcrawl-ref-97aa9cdb2a971d66113b6b246ad56cc046be04e1.tar.gz
crawl-ref-97aa9cdb2a971d66113b6b246ad56cc046be04e1.zip
Fixing tiles text cursor appearing in the wrong region.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7146 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilereg.cc')
-rw-r--r--crawl-ref/source/tilereg.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 7c42150300..1648320403 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -2162,7 +2162,7 @@ void TextRegion::_setcursortype(int curstype)
void TextRegion::render()
{
- if (cursor_x > 0 && cursor_y > 0)
+ if (this == TextRegion::cursor_region && cursor_x > 0 && cursor_y > 0)
{
int idx = cursor_x + mx * cursor_y;
@@ -2268,6 +2268,20 @@ struct box_vert
void MessageRegion::render()
{
+ int idx = -1;
+ unsigned char char_back;
+ unsigned char col_back;
+
+ if (this == TextRegion::cursor_region && cursor_x > 0 && cursor_y > 0)
+ {
+ idx = cursor_x + mx * cursor_y;
+ char_back = cbuf[idx];
+ col_back = abuf[idx];
+
+ cbuf[idx] = '_';
+ abuf[idx] = WHITE;
+ }
+
if (m_overlay)
{
unsigned int height;
@@ -2323,6 +2337,12 @@ void MessageRegion::render()
}
m_font->render_textblock(sx + ox, sy + oy, cbuf, abuf, mx, my, m_overlay);
+
+ if (idx >= 0)
+ {
+ cbuf[idx] = char_back;
+ abuf[idx] = col_back;
+ }
}
CRTRegion::CRTRegion(FTFont *font) : TextRegion(font)