aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2016-02-04 11:32:06 +0100
committerEugene Sandulenko2016-02-14 17:13:00 +0100
commitd585719c2d4034b17d9a49584e45775c1f357727 (patch)
tree3bff880012f9450c9c542932107815cd53e5ef85 /engines
parent9d9e769b5e8bd70a00a3e5bde9ce6b3ab95ee6ae (diff)
downloadscummvm-rg350-d585719c2d4034b17d9a49584e45775c1f357727.tar.gz
scummvm-rg350-d585719c2d4034b17d9a49584e45775c1f357727.tar.bz2
scummvm-rg350-d585719c2d4034b17d9a49584e45775c1f357727.zip
WAGE: First attempt to draw partial highlights
Diffstat (limited to 'engines')
-rw-r--r--engines/wage/gui.cpp37
1 files changed, 35 insertions, 2 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index fc7ae01f76..0bf1c345a6 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -506,8 +506,41 @@ void Gui::renderConsole(Graphics::Surface *g, Common::Rect &r) {
Design::drawFilledRect(&_console, trect, kColorBlack, _patterns, kPatternSolid);
}
- if (*str)
- font->drawString(&_console, _lines[line], x1, y1, textW, color);
+ if (line == _selectionStartY || line == _selectionEndY) {
+ if (_selectionStartY != _selectionEndY) {
+ int color1 = kColorWhite;
+ int color2 = kColorBlack;
+ int midpoint = _selectionStartX;
+
+ if (_selectionStartY > _selectionEndY)
+ SWAP(color1, color2);
+
+ if (line == _selectionEndY) {
+ SWAP(color1, color2);
+ midpoint = _selectionEndY;
+ }
+
+ Common::String beg(_lines[line].c_str(), &_lines[line].c_str()[midpoint]);
+ Common::String end(&_lines[line].c_str()[midpoint]);
+
+ warning("beg: %s end: %s", beg.c_str(), end.c_str());
+
+ int rectW = font->getStringWidth(beg) + kConWPadding + kConWOverlap;
+ Common::Rect trect(0, y1, _console.w, y1 + _consoleLineHeight);
+ if (color1 == kColorWhite)
+ trect.right = rectW;
+ else
+ trect.left = rectW;
+
+ Design::drawFilledRect(&_console, trect, kColorBlack, _patterns, kPatternSolid);
+
+ font->drawString(&_console, beg, x1, y1, textW, color1);
+ font->drawString(&_console, end, x1 + rectW, y1, textW, color2);
+ }
+ } else {
+ if (*str)
+ font->drawString(&_console, _lines[line], x1, y1, textW, color);
+ }
y1 += _consoleLineHeight;
}