diff options
author | Borja Lorente | 2016-08-13 23:46:29 +0200 |
---|---|---|
committer | Borja Lorente | 2016-08-19 16:29:17 +0200 |
commit | 2f1368646f11e9569bd981a93035a2e43edd2aca (patch) | |
tree | 9022e2e00e971a1ed9ac761a170a1a9db7766d35 | |
parent | 6f9a17199cc01b72de2045cda7eee2c97e8c6ccb (diff) | |
download | scummvm-rg350-2f1368646f11e9569bd981a93035a2e43edd2aca.tar.gz scummvm-rg350-2f1368646f11e9569bd981a93035a2e43edd2aca.tar.bz2 scummvm-rg350-2f1368646f11e9569bd981a93035a2e43edd2aca.zip |
MACVENTURE: Fix window object drawing
-rw-r--r-- | engines/macventure/gui.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp index ff14cf3b5d..9359097b8a 100644 --- a/engines/macventure/gui.cpp +++ b/engines/macventure/gui.cpp @@ -367,6 +367,7 @@ void Gui::clearAssets() { for (; it != _assets.end(); it++) { delete it->_value; } + _assets.clear(); } bool Gui::loadMenus() { @@ -672,9 +673,11 @@ void Gui::drawObjectsInWindow(const WindowData &targetData, Graphics::ManagedSur if (targetData.children.size() == 0) return; - Graphics::ManagedSurface *composeSurface = new Graphics::ManagedSurface(); - createInnerSurface(composeSurface, surface, border); - composeSurface->clear(kColorGreen); + Graphics::ManagedSurface composeSurface; + createInnerSurface(&composeSurface, surface, border); + assert(composeSurface.w <= surface->w && + composeSurface.h <= surface->h); + composeSurface.clear(kColorGreen); for (uint i = 0; i < targetData.children.size(); i++) { child = targetData.children[i].obj; @@ -684,7 +687,7 @@ void Gui::drawObjectsInWindow(const WindowData &targetData, Graphics::ManagedSur ensureAssetLoaded(child); _assets[child]->blitInto( - composeSurface, + &composeSurface, pos.x, pos.y, mode); @@ -694,7 +697,7 @@ void Gui::drawObjectsInWindow(const WindowData &targetData, Graphics::ManagedSur child == _draggedObj.id) { _assets[child]->blitInto( - composeSurface, pos.x, pos.y, kBlitOR); + &composeSurface, pos.x, pos.y, kBlitOR); } } @@ -705,8 +708,7 @@ void Gui::drawObjectsInWindow(const WindowData &targetData, Graphics::ManagedSur } } Common::Point composePosition = Common::Point(border.leftOffset, border.topOffset); - surface->transBlitFrom(*composeSurface, composePosition, kColorGreen); - delete composeSurface; + surface->transBlitFrom(composeSurface, composePosition, kColorGreen); } void Gui::drawWindowTitle(WindowReference target, Graphics::ManagedSurface * surface) { |