From fdd949bb00d5d3b5bda54ef85f8fde3682dc2c27 Mon Sep 17 00:00:00 2001 From: Borja Lorente Date: Sat, 9 Jul 2016 19:46:10 +0200 Subject: MACVENTURE: Fix exits drawing --- engines/macventure/gui.cpp | 12 ++++++++---- engines/macventure/gui.h | 9 +++++---- engines/macventure/macventure.cpp | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) (limited to 'engines/macventure') diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp index 05c479be83..5a26482e9d 100644 --- a/engines/macventure/gui.cpp +++ b/engines/macventure/gui.cpp @@ -717,8 +717,8 @@ void Gui::drawDraggedObject() { ImageAsset *asset = _assets[_draggedObj.id]; _draggedSurface.create(asset->getWidth(), asset->getHeight(), _screen.format); - _screen.copyRectToSurface(_draggedSurface, _draggedObj.pos.x, _draggedObj.pos.y, - Common::Rect(asset->getWidth() - 1, asset->getHeight() - 1)); + //_screen.copyRectToSurface(_draggedSurface, _draggedObj.pos.x, _draggedObj.pos.y, + // Common::Rect(asset->getWidth() - 1, asset->getHeight() - 1)); asset->blitInto(&_draggedSurface, 0, 0, kBlitBIC); @@ -773,6 +773,10 @@ void Gui::updateWindow(WindowReference winID, bool containerOpen) { } } +void Gui::clearExits() { + _exitsData->clear(); +} + void Gui::unselectExits() { Common::Array::const_iterator it = _exitsData->begin(); for (; it != _exitsData->end(); ++it) { @@ -806,8 +810,8 @@ void Gui::updateExit(ObjID obj) { data.titleLength = 0; data.refcon = (ControlAction)obj; // Objects can be exits (actions) Common::Point pos = _engine->getObjExitPosition(obj); - pos.x = border.leftOffset; - pos.y = border.topOffset; + pos.x += border.leftOffset; + pos.y += border.topOffset; data.bounds = Common::Rect(pos.x, pos.y, pos.x + kExitButtonWidth, pos.y + kExitButtonHeight); data.visible = true; diff --git a/engines/macventure/gui.h b/engines/macventure/gui.h index cd0799d66d..55dd180029 100644 --- a/engines/macventure/gui.h +++ b/engines/macventure/gui.h @@ -112,7 +112,7 @@ struct WindowData { bool updateScroll; }; -enum ControlType { // HACK, should correspond exactly with the types of controls (sliders etc) +enum ControlType { // HACK, should correspond exactly with the types of controls (sliders etc) kControlExitBox = 0, kControlExamine = 1, kControlOpen = 2, @@ -152,7 +152,7 @@ struct ControlData { uint16 scrollMax; uint16 scrollMin; uint16 cdef; - ControlAction refcon; + ControlAction refcon; ControlType type; uint8 titleLength; char* title; @@ -240,6 +240,7 @@ public: void addChild(WindowReference target, ObjID child); void removeChild(WindowReference target, ObjID child); + void clearExits(); void unselectExits(); void updateExit(ObjID id); @@ -274,7 +275,7 @@ private: // Attributes Graphics::ManagedSurface _draggedSurface; DraggedObj _draggedObj; - + Cursor *_cursor; ConsoleText *_consoleText; @@ -359,7 +360,7 @@ public: ~Cursor() {} void tick() { - executeState(); + executeState(); changeState(kTickCol); } diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp index 9994df2c73..28bfa65a98 100644 --- a/engines/macventure/macventure.cpp +++ b/engines/macventure/macventure.cpp @@ -546,7 +546,7 @@ void MacVentureEngine::unselectObject(ObjID objID) { void MacVentureEngine::updateExits() { - // exitWin.killControls(); + _gui->clearExits(); _gui->unselectExits(); Common::Array exits = _world->getChildren(_world->getObjAttr(1, kAttrParentObject), true); -- cgit v1.2.3