aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBorja Lorente2016-08-08 17:54:13 +0200
committerBorja Lorente2016-08-19 16:29:15 +0200
commit9676b6f7fe2c9f6ec94ebcce17da5f78c362b3ac (patch)
tree34bf518a983a9018604e2a6c5aa1f0c582cb2ccc
parentdd3527517690c3fdd065dfaacfef936666f139e0 (diff)
downloadscummvm-rg350-9676b6f7fe2c9f6ec94ebcce17da5f78c362b3ac.tar.gz
scummvm-rg350-9676b6f7fe2c9f6ec94ebcce17da5f78c362b3ac.tar.bz2
scummvm-rg350-9676b6f7fe2c9f6ec94ebcce17da5f78c362b3ac.zip
MACVENTURE: Fix window resizing bug
-rw-r--r--engines/macventure/gui.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 5fa746ce3d..66288d0906 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -589,13 +589,11 @@ void Gui::drawInventories() {
Graphics::ManagedSurface *srf;
for (uint i = 0; i < _inventoryWindows.size(); i++) {
const WindowData &data = getWindowData((WindowReference)(kInventoryStart + i));
- srf = findWindow(data.refcon)->getSurface();
+ Graphics::MacWindow *win = findWindow(data.refcon);
+ srf = win->getSurface();
+ srf->clear(kColorGreen);
BorderBounds border = borderBounds(data.type);
- srf->fillRect(Common::Rect(
- border.leftOffset,
- border.topOffset,
- srf->w + border.rightOffset,
- srf->h + border.bottomOffset), kColorWhite);
+ srf->fillRect(srf->getBounds(), kColorWhite);
drawObjectsInWindow(data.refcon, srf);
if (MACVENTURE_DEBUG_GUI) {
@@ -643,7 +641,7 @@ void Gui::drawConsoleWindow() {
_consoleText->renderInto(srf, bounds.leftOffset);
}
-void Gui::drawObjectsInWindow(WindowReference target, Graphics::ManagedSurface * surface) {
+void Gui::drawObjectsInWindow(WindowReference target, Graphics::ManagedSurface *surface) {
WindowData &data = findWindowData(target);
BorderBounds border = borderBounds(data.type);
Common::Point pos;
@@ -652,16 +650,22 @@ void Gui::drawObjectsInWindow(WindowReference target, Graphics::ManagedSurface *
if (data.children.size() == 0) return;
+ Graphics::ManagedSurface *composeSurface = new Graphics::ManagedSurface();
+ composeSurface->create(
+ surface->w - border.leftOffset - border.rightOffset,
+ surface->h - border.topOffset - border.bottomOffset,
+ surface->format);
+ composeSurface->clear(kColorGreen);
+
for (uint i = 0; i < data.children.size(); i++) {
child = data.children[i].obj;
mode = (BlitMode)data.children[i].mode;
pos = _engine->getObjPosition(child);
- pos += Common::Point(border.leftOffset, border.topOffset);
pos -= data.scrollPos;
ensureAssetLoaded(child);
_assets[child]->blitInto(
- surface,
+ composeSurface,
pos.x,
pos.y,
mode);
@@ -671,7 +675,7 @@ void Gui::drawObjectsInWindow(WindowReference target, Graphics::ManagedSurface *
child == _draggedObj.id) {
_assets[child]->blitInto(
- surface, pos.x, pos.y, kBlitOR);
+ composeSurface, pos.x, pos.y, kBlitOR);
}
}
@@ -681,8 +685,10 @@ void Gui::drawObjectsInWindow(WindowReference target, Graphics::ManagedSurface *
testBounds.translate(-data.scrollPos.x, -data.scrollPos.y);
surface->frameRect(testBounds, kColorGreen);
}
-
}
+ Common::Point composePosition = Common::Point(border.leftOffset, border.topOffset);
+ surface->transBlitFrom(*composeSurface, composePosition, kColorGreen);
+ delete composeSurface;
}
void Gui::drawWindowTitle(WindowReference target, Graphics::ManagedSurface * surface) {