From 2f5b1f08efe697287c3e28c2cf97eb31996f23a9 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 1 Aug 2017 00:32:05 +0200 Subject: WAGE: Render console text in MacTextWindow --- engines/wage/gui-console.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/engines/wage/gui-console.cpp b/engines/wage/gui-console.cpp index 16da99f996..c2f1753ced 100644 --- a/engines/wage/gui-console.cpp +++ b/engines/wage/gui-console.cpp @@ -203,12 +203,14 @@ void Gui::renderConsole(Graphics::ManagedSurface *g, const Common::Rect &r) { const Graphics::Font *font = getConsoleFont(); _consoleLineHeight = font->getFontHeight(); - int textW = r.width() - kConWPadding * 2; - int textH = r.height() - kConHPadding * 2; if (textReflow) reflowText(); +#ifndef USE_MACTEXTWINDOW + int textW = r.width() - kConWPadding * 2; + int textH = r.height() - kConHPadding * 2; + const int firstLine = _scrollPos / _consoleLineHeight; const int lastLine = MIN((_scrollPos + textH) / _consoleLineHeight + 1, _lines.size()); const int xOff = kConWOverlap; @@ -219,8 +221,6 @@ void Gui::renderConsole(Graphics::ManagedSurface *g, const Common::Rect &r) { if (fullRedraw) _consoleNumLines = (r.height() - 2 * kConWPadding) / _consoleLineHeight - 2; -#ifndef USE_MACTEXTWINDOW - for (int line = firstLine; line < lastLine; line++) { const char *str = _lines[line].c_str(); int color = kColorBlack; @@ -302,8 +302,6 @@ void Gui::renderConsole(Graphics::ManagedSurface *g, const Common::Rect &r) { y1 += _consoleLineHeight; } -#endif - // Now we need to clip it to the screen int xcon = r.left - kConOverscan; int ycon = r.top - kConOverscan; @@ -326,11 +324,8 @@ void Gui::renderConsole(Graphics::ManagedSurface *g, const Common::Rect &r) { if (rr.bottom > _screen.h - 1) rr.bottom = _screen.h - 1; -#ifdef USE_MACTEXTWINDOW - _consoleWindow->drawText(&_console, 0, 0, boundsR.width(), boundsR.height(), boundsR.left + 7, boundsR.top + 7); -#endif // USE_MACTEXTWINDOW - g->copyRectToSurface(_console, xcon, ycon, boundsR); +#endif } void Gui::drawInput() { -- cgit v1.2.3