diff options
author | Borja Lorente | 2016-08-08 18:06:29 +0200 |
---|---|---|
committer | Borja Lorente | 2016-08-19 16:29:15 +0200 |
commit | 4f6609f704edf2ee38582cb2d2f17a7017d79732 (patch) | |
tree | 852e956a77582200e02933f4057216976c8b20cc | |
parent | 9676b6f7fe2c9f6ec94ebcce17da5f78c362b3ac (diff) | |
download | scummvm-rg350-4f6609f704edf2ee38582cb2d2f17a7017d79732.tar.gz scummvm-rg350-4f6609f704edf2ee38582cb2d2f17a7017d79732.tar.bz2 scummvm-rg350-4f6609f704edf2ee38582cb2d2f17a7017d79732.zip |
MACVENTURE: Refactor object drawing
-rw-r--r-- | engines/macventure/gui.cpp | 24 | ||||
-rw-r--r-- | engines/macventure/gui.h | 2 |
2 files changed, 13 insertions, 13 deletions
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp index 66288d0906..caa756f755 100644 --- a/engines/macventure/gui.cpp +++ b/engines/macventure/gui.cpp @@ -564,7 +564,8 @@ void Gui::drawMainGameWindow() { border.topOffset, kBlitDirect); } - drawObjectsInWindow(kMainGameWindow, _mainGameWindow->getSurface()); + + drawObjectsInWindow(data, _mainGameWindow->getSurface()); if (MACVENTURE_DEBUG_GUI) { Graphics::MacWindow *win = findWindow(data.refcon); @@ -579,7 +580,7 @@ void Gui::drawMainGameWindow() { } void Gui::drawSelfWindow() { - drawObjectsInWindow(kSelfWindow, _selfWindow->getSurface()); + drawObjectsInWindow(getWindowData(kSelfWindow), _selfWindow->getSurface()); if (_engine->isObjSelected(1)) invertWindowColors(kSelfWindow); findWindow(kSelfWindow)->setDirty(true); } @@ -594,7 +595,7 @@ void Gui::drawInventories() { srf->clear(kColorGreen); BorderBounds border = borderBounds(data.type); srf->fillRect(srf->getBounds(), kColorWhite); - drawObjectsInWindow(data.refcon, srf); + drawObjectsInWindow(data, srf); if (MACVENTURE_DEBUG_GUI) { Graphics::MacWindow *win = findWindow(data.refcon); @@ -641,14 +642,13 @@ void Gui::drawConsoleWindow() { _consoleText->renderInto(srf, bounds.leftOffset); } -void Gui::drawObjectsInWindow(WindowReference target, Graphics::ManagedSurface *surface) { - WindowData &data = findWindowData(target); - BorderBounds border = borderBounds(data.type); +void Gui::drawObjectsInWindow(const WindowData &targetData, Graphics::ManagedSurface *surface) { + BorderBounds border = borderBounds(targetData.type); Common::Point pos; ObjID child; BlitMode mode; - if (data.children.size() == 0) return; + if (targetData.children.size() == 0) return; Graphics::ManagedSurface *composeSurface = new Graphics::ManagedSurface(); composeSurface->create( @@ -657,11 +657,11 @@ void Gui::drawObjectsInWindow(WindowReference target, Graphics::ManagedSurface * 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; + for (uint i = 0; i < targetData.children.size(); i++) { + child = targetData.children[i].obj; + mode = (BlitMode)targetData.children[i].mode; pos = _engine->getObjPosition(child); - pos -= data.scrollPos; + pos -= targetData.scrollPos; ensureAssetLoaded(child); _assets[child]->blitInto( @@ -682,7 +682,7 @@ void Gui::drawObjectsInWindow(WindowReference target, Graphics::ManagedSurface * // For test if (MACVENTURE_DEBUG_GUI) { Common::Rect testBounds = _engine->getObjBounds(child); - testBounds.translate(-data.scrollPos.x, -data.scrollPos.y); + testBounds.translate(-targetData.scrollPos.x, -targetData.scrollPos.y); surface->frameRect(testBounds, kColorGreen); } } diff --git a/engines/macventure/gui.h b/engines/macventure/gui.h index a62264cb6f..12b499ad30 100644 --- a/engines/macventure/gui.h +++ b/engines/macventure/gui.h @@ -219,7 +219,7 @@ private: // Methods void drawConsoleWindow(); void drawDraggedObject(); - void drawObjectsInWindow(WindowReference target, Graphics::ManagedSurface *surface); + void drawObjectsInWindow(const WindowData &targetData, Graphics::ManagedSurface *surface); void drawWindowTitle(WindowReference target, Graphics::ManagedSurface *surface); void drawDialog(); |