From 0fb344dfeda53e81a70e89be45bda6d5c0614e7e Mon Sep 17 00:00:00 2001 From: Borja Lorente Date: Wed, 22 Jun 2016 22:09:10 +0200 Subject: [PATCH] MACVENTURE: Hack for dynamic object drawing --- engines/macventure/gui.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp index 5c1747cb186..1ac1d0b0f80 100644 --- a/engines/macventure/gui.cpp +++ b/engines/macventure/gui.cpp @@ -26,9 +26,6 @@ #include "macventure/macventure.h" #include "macventure/gui.h" -//Test -#include "common/system.h" - namespace MacVenture { enum MenuAction; @@ -103,8 +100,10 @@ Gui::~Gui() { void Gui::draw() { - drawWindows(); + // Will be performance-improved after the milestone + _wm.setFullRefresh(true); + drawWindows(); drawTitle(); _wm.draw(); @@ -225,7 +224,6 @@ void Gui::initGUI() { if (!loadControls()) error("Could not load controls"); - draw(); } @@ -506,6 +504,8 @@ void Gui::drawMainGameWindow() { Graphics::ManagedSurface *srf = _mainGameWindow->getSurface(); BorderBounds border = borderBounds(getWindowData(kMainGameWindow).type); + _mainGameWindow->setDirty(true); + if (!_assets.contains(3)) { _assets[3] = new ImageAsset(3, _graphics); } @@ -518,11 +518,6 @@ void Gui::drawMainGameWindow() { drawObjectsInWindow(kMainGameWindow, _mainGameWindow->getSurface()); - // To be deleted - _wm.draw(); - - g_system->updateScreen(); - } void Gui::drawSelfWindow() { @@ -549,11 +544,8 @@ void Gui::drawObjectsInWindow(WindowReference target, Graphics::ManagedSurface * border.topOffset * 2 + pos.y, mode); - // To be deleted + // To be deleted, this is a big hack, but it doesn't work without it. _wm.draw(); - - g_system->updateScreen(); - } }