diff options
author | Paul Gilbert | 2014-03-04 22:33:27 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-03-04 22:33:27 -0500 |
commit | 568fc31b3090a70aa922479991540d4f5c2e918c (patch) | |
tree | f77e83b0b738479e369520513d8741ac05883ca2 /engines/mads/dialogs.cpp | |
parent | 1607a9104700e987cacfec41aaafd25d979aeb98 (diff) | |
download | scummvm-rg350-568fc31b3090a70aa922479991540d4f5c2e918c.tar.gz scummvm-rg350-568fc31b3090a70aa922479991540d4f5c2e918c.tar.bz2 scummvm-rg350-568fc31b3090a70aa922479991540d4f5c2e918c.zip |
MADS: Beginnings of code support for Scene::drawElements
Diffstat (limited to 'engines/mads/dialogs.cpp')
-rw-r--r-- | engines/mads/dialogs.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/engines/mads/dialogs.cpp b/engines/mads/dialogs.cpp index e4c7682a38..d159d48ace 100644 --- a/engines/mads/dialogs.cpp +++ b/engines/mads/dialogs.cpp @@ -34,7 +34,7 @@ Dialog::Dialog(MADSEngine *vm): _vm(vm), _savedSurface(nullptr), } Dialog::~Dialog() { - restore(_vm->_screen); + restore(&_vm->_screen); } @@ -55,21 +55,21 @@ void Dialog::restore(MSurface *s) { void Dialog::draw() { // Save the screen portion the dialog will overlap - save(_vm->_screen); + save(&_vm->_screen); // Draw the dialog // Fill entire content of dialog - _vm->_screen->fillRect(Common::Rect(_position.x, _position.y, + _vm->_screen.fillRect(Common::Rect(_position.x, _position.y, _position.x + _width, _position.y + _height), TEXTDIALOG_BACKGROUND); // Draw the outer edge lines - _vm->_screen->hLine(_position.x + 1, _position.y + _height - 2, + _vm->_screen.hLine(_position.x + 1, _position.y + _height - 2, _position.x + _width - 2, TEXTDIALOG_EDGE); - _vm->_screen->hLine(_position.x, _position.y + _height - 1, + _vm->_screen.hLine(_position.x, _position.y + _height - 1, _position.x + _width - 1, TEXTDIALOG_EDGE); - _vm->_screen->vLine(_position.x + _width - 2, _position.y + 2, + _vm->_screen.vLine(_position.x + _width - 2, _position.y + 2, _position.y + _height - 2, TEXTDIALOG_EDGE); - _vm->_screen->vLine(_position.x + _width - 1, _position.y + 1, + _vm->_screen.vLine(_position.x + _width - 1, _position.y + 1, _position.y + _height - 1, TEXTDIALOG_EDGE); // Draw the gravelly dialog content @@ -82,7 +82,7 @@ void Dialog::drawContent(const Common::Rect &r, int seed, byte color1, byte colo uint16 currSeed = seed ? seed : 0xB78E; for (int yp = 0; yp < r.height(); ++yp) { - byte *destP = _vm->_screen->getBasePtr(r.left, r.top + yp); + byte *destP = _vm->_screen.getBasePtr(r.left, r.top + yp); for (int xp = 0; xp < r.width(); ++xp) { uint16 seedAdjust = currSeed; @@ -246,10 +246,10 @@ void TextDialog::draw() { if (_position.y == -1) _position.y = 100 - (_height / 2); - if ((_position.x + _width) > _vm->_screen->getWidth()) - _position.x = _vm->_screen->getWidth() - (_position.x + _width); - if ((_position.y + _height) > _vm->_screen->getHeight()) - _position.y = _vm->_screen->getHeight() - (_position.y + _height); + if ((_position.x + _width) > _vm->_screen.getWidth()) + _position.x = _vm->_screen.getWidth() - (_position.x + _width); + if ((_position.y + _height) > _vm->_screen.getHeight()) + _position.y = _vm->_screen.getHeight() - (_position.y + _height); // Draw the underlying dialog Dialog::draw(); @@ -259,7 +259,7 @@ void TextDialog::draw() { for (int lineNum = 0; lineNum < _numLines; ++lineNum) { if (_lineXp[lineNum] == -1) { // Draw a line across the entire dialog - _vm->_screen->hLine(_position.x + 2, + _vm->_screen.hLine(_position.x + 2, lineYp + (_vm->_font->getHeight() + 1) / 2, _position.x + _width - 4, TEXTDIALOG_BLACK); } else { @@ -269,13 +269,13 @@ void TextDialog::draw() { if (_lineXp[lineNum] & 0x40) ++yp; - _vm->_font->writeString(_vm->_screen, _lines[lineNum], + _vm->_font->writeString(&_vm->_screen, _lines[lineNum], Common::Point(xp, yp), 0, 1); if (_lineXp[lineNum] & 0x80) { // Draw an underline under the text int lineWidth = _vm->_font->getWidth(_lines[lineNum], 1); - _vm->_screen->hLine(xp, yp + _vm->_font->getHeight(), xp + lineWidth, + _vm->_screen.hLine(xp, yp + _vm->_font->getHeight(), xp + lineWidth, TEXTDIALOG_BLACK); } } |