aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure/gui.h
diff options
context:
space:
mode:
authorBorja Lorente2016-08-08 18:36:51 +0200
committerBorja Lorente2016-08-19 16:29:15 +0200
commit560185903cf13dbb91ce916dc7347cec6f968c12 (patch)
treece9c65dba80aa7fb845eb22d4b01c7683fdc4787 /engines/macventure/gui.h
parent4f6609f704edf2ee38582cb2d2f17a7017d79732 (diff)
downloadscummvm-rg350-560185903cf13dbb91ce916dc7347cec6f968c12.tar.gz
scummvm-rg350-560185903cf13dbb91ce916dc7347cec6f968c12.tar.bz2
scummvm-rg350-560185903cf13dbb91ce916dc7347cec6f968c12.zip
MACVENTURE: Fix console drawing bug
Diffstat (limited to 'engines/macventure/gui.h')
-rw-r--r--engines/macventure/gui.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/engines/macventure/gui.h b/engines/macventure/gui.h
index 12b499ad30..7d1a08aa5b 100644
--- a/engines/macventure/gui.h
+++ b/engines/macventure/gui.h
@@ -161,6 +161,8 @@ public:
void loadGame(int slot);
void saveInto(int slot);
+ void createInnerSurface(Graphics::ManagedSurface *innerSurface, Graphics::ManagedSurface *outerSurface, const BorderBounds &borders);
+
private: // Attributes
@@ -377,6 +379,10 @@ static void cursorTimerHandler(void *refCon) {
}
+enum {
+ kConsoleLeftOffset = 2
+};
+
class ConsoleText {
public:
@@ -407,14 +413,23 @@ public:
updateScroll();
}
- void renderInto(Graphics::ManagedSurface *target, uint leftOffset) {
+ void renderInto(Graphics::ManagedSurface *target, const BorderBounds borders, int textOffset) {
target->fillRect(target->getBounds(), kColorWhite);
+
+ Graphics::ManagedSurface *composeSurface = new Graphics::ManagedSurface();
+ _gui->createInnerSurface(composeSurface, target, borders);
+ composeSurface->clear(kColorGreen);
+
const Graphics::Font *font = &_gui->getCurrentFont();
uint y = target->h - font->getFontHeight();
for (uint i = _scrollPos; i != 0; i--) {
- font->drawString(target, _lines[i], leftOffset, y, font->getStringWidth(_lines[i]), kColorBlack);
+ font->drawString(target, _lines[i], textOffset, y, font->getStringWidth(_lines[i]), kColorBlack);
y -= font->getFontHeight();
}
+
+ Common::Point composePosition = Common::Point(borders.leftOffset, borders.topOffset);
+ target->transBlitFrom(*composeSurface, composePosition, kColorGreen);
+ delete composeSurface;
}
void updateScroll() {