diff options
author | Eugene Sandulenko | 2016-04-15 10:08:33 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-04-15 17:24:14 +0200 |
commit | 6a415da6b970a8922dcdeea31d35b836289533d9 (patch) | |
tree | af47e6feee1193fa4a1e0082e3450a50f4c287a0 /engines | |
parent | 0e4c846a39cdf5c8370106ba87b24ac7936818fd (diff) | |
download | scummvm-rg350-6a415da6b970a8922dcdeea31d35b836289533d9.tar.gz scummvm-rg350-6a415da6b970a8922dcdeea31d35b836289533d9.tar.bz2 scummvm-rg350-6a415da6b970a8922dcdeea31d35b836289533d9.zip |
WAGE: Started screen composing
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wage/gui.cpp | 10 | ||||
-rw-r--r-- | engines/wage/macwindow.cpp | 18 | ||||
-rw-r--r-- | engines/wage/macwindow.h | 2 |
3 files changed, 20 insertions, 10 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 8d605fee1c..f20f18c233 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -284,13 +284,19 @@ void Gui::drawScene() { MacWindow *w = _wm.getWindow(_sceneWindowId); w->setDimensions(*_scene->_designBounds); + _scene->paint(w->getSurface(), 0, 0); + w->draw(&_screen); + g_system->copyRectToScreen(_screen.getBasePtr(_scene->_designBounds->left, _scene->_designBounds->top), + _screen.pitch, _scene->_designBounds->left, _scene->_designBounds->top, + _scene->_designBounds->width(), _scene->_designBounds->height()); + _sceneDirty = true; _consoleDirty = true; _menuDirty = true; _consoleFullRedraw = true; - _scene->paint(&_screen, _scene->_designBounds->left, _scene->_designBounds->top); + //_scene->paint(&_screen, _scene->_designBounds->left, _scene->_designBounds->top); _sceneArea.left = _scene->_designBounds->left + kBorderWidth - 2; _sceneArea.top = _scene->_designBounds->top + kBorderWidth - 2; @@ -302,7 +308,7 @@ void Gui::drawScene() { _consoleTextArea.setWidth(_scene->_textBounds->width() - 2 * kBorderWidth); _consoleTextArea.setHeight(_scene->_textBounds->height() - 2 * kBorderWidth); - paintBorder(&_screen, _sceneArea, kWindowScene); + //paintBorder(&_screen, _sceneArea, kWindowScene); } // Render console diff --git a/engines/wage/macwindow.cpp b/engines/wage/macwindow.cpp index dee80dee93..d1b65640aa 100644 --- a/engines/wage/macwindow.cpp +++ b/engines/wage/macwindow.cpp @@ -80,29 +80,32 @@ void MacWindow::resize(int w, int h) { _surface.free(); _surface.create(w, h, Graphics::PixelFormat::createFormatCLUT8()); _borderSurface.free(); - _borderSurface.create(w + 2 * kBorderWidth, h + 2 * kBorderWidth, Graphics::PixelFormat::createFormatCLUT8()); + _borderSurface.create(w, h, Graphics::PixelFormat::createFormatCLUT8()); + _composeSurface.free(); + _composeSurface.create(w, h, Graphics::PixelFormat::createFormatCLUT8()); _dims.setWidth(w); _dims.setHeight(h); - - _borderDims.setWidth(w + 2 * kBorderWidth); - _borderDims.setHeight(h + 2 * kBorderWidth); - move(_dims.left, _dims.top); // Update _borderDims position } void MacWindow::move(int x, int y) { _dims.moveTo(x, y); - _borderDims.moveTo(x - kBorderWidth, y - kBorderWidth); } void MacWindow::setDimensions(const Common::Rect &r) { resize(r.width(), r.height()); - move(r.left, r.top); + _dims.moveTo(r.left, r.top); } void MacWindow::draw(Graphics::ManagedSurface *g, bool forceRedraw) { if (_borderIsDirty || forceRedraw) drawBorder(); + + // Compose + _composeSurface.blitFrom(_surface, _surface.getBounds(), Common::Point(0, 0)); + _composeSurface.transBlitFrom(_borderSurface, kColorGreen); + + g->transBlitFrom(_composeSurface, _composeSurface.getBounds(), Common::Point(_dims.left, _dims.top), kColorGreen2); } const Graphics::Font *MacWindow::getTitleFont() { @@ -145,6 +148,7 @@ void MacWindow::drawBorder() { Graphics::ManagedSurface *g = &_borderSurface; g->clear(kColorGreen2); + g->fillRect(Common::Rect(kBorderWidth, kBorderWidth, width - kBorderWidth, height - kBorderWidth), kColorGreen); drawBox(g, x, y, size, size); drawBox(g, x + width - size - 1, y, size, size); diff --git a/engines/wage/macwindow.h b/engines/wage/macwindow.h index b8a04a2af8..e635528c23 100644 --- a/engines/wage/macwindow.h +++ b/engines/wage/macwindow.h @@ -92,6 +92,7 @@ private: private: Graphics::ManagedSurface _surface; Graphics::ManagedSurface _borderSurface; + Graphics::ManagedSurface _composeSurface; bool _scrollable; bool _active; bool _borderIsDirty; @@ -100,7 +101,6 @@ private: float _scrollPos, _scrollSize; Common::Rect _dims; - Common::Rect _borderDims; Common::String _title; }; |