diff options
author | johndoe123 | 2014-12-12 13:12:12 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | 9d98f92298c7e0c494b0ae6455a5f0183080db70 (patch) | |
tree | ef54e0d117025bfe315fc858e65b9460a1d31bec /engines/illusions/screentext.cpp | |
parent | 36ec0fafdb186ad55a0d6c08e38b96ef84fa60a8 (diff) | |
download | scummvm-rg350-9d98f92298c7e0c494b0ae6455a5f0183080db70.tar.gz scummvm-rg350-9d98f92298c7e0c494b0ae6455a5f0183080db70.tar.bz2 scummvm-rg350-9d98f92298c7e0c494b0ae6455a5f0183080db70.zip |
ILLUSIONS: Add text drawing to BBDOU
Diffstat (limited to 'engines/illusions/screentext.cpp')
-rw-r--r-- | engines/illusions/screentext.cpp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/engines/illusions/screentext.cpp b/engines/illusions/screentext.cpp index 018decba36..8c31705300 100644 --- a/engines/illusions/screentext.cpp +++ b/engines/illusions/screentext.cpp @@ -56,15 +56,28 @@ void ScreenText::updateTextInfoPosition(Common::Point position) { } void ScreenText::clipTextInfoPosition(Common::Point &position) { - // TODO Set min/max for BBDOU - if (position.x < 2) - position.x = 2; - else if (position.x + _dimensions._width > 318) - position.x = 318 - _dimensions._width; - if (position.y < 2) - position.y = 2; - else if (position.y + _dimensions._height > 198) - position.y = 198 - _dimensions._height; + // TODO Move values outside + if (_vm->getGameId() == kGameIdBBDOU) { + // BBDOU + if (position.x < 2) + position.x = 2; + else if (position.x + _dimensions._width > 638) + position.x = 638 - _dimensions._width; + if (position.y < 2) + position.y = 2; + else if (position.y + _dimensions._height > 478) + position.y = 478 - _dimensions._height; + } else { + // Duckman + if (position.x < 2) + position.x = 2; + else if (position.x + _dimensions._width > 318) + position.x = 318 - _dimensions._width; + if (position.y < 2) + position.y = 2; + else if (position.y + _dimensions._height > 198) + position.y = 198 - _dimensions._height; + } } bool ScreenText::refreshScreenText(FontResource *font, WidthHeight dimensions, Common::Point offsPt, @@ -72,6 +85,7 @@ bool ScreenText::refreshScreenText(FontResource *font, WidthHeight dimensions, C TextDrawer textDrawer; bool done = textDrawer.wrapText(font, text, &dimensions, offsPt, textFlags, outTextPtr); _surface = _vm->_screen->allocSurface(dimensions._width, dimensions._height); + _surface->fillRect(Common::Rect(0, 0, _surface->w, _surface->h), _vm->_screen->getColorKey1()); _dimensions = dimensions; textDrawer.drawText(_vm->_screen, _surface, color2, color1); return done; |