aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBorja Lorente2016-07-09 19:46:10 +0200
committerBorja Lorente2016-08-14 18:50:19 +0200
commitfdd949bb00d5d3b5bda54ef85f8fde3682dc2c27 (patch)
treee978ad1f46761d947e2264c9e256f29c2705bed7
parent9ac125392587aa02f1e874fd5bf095cb56da9564 (diff)
downloadscummvm-rg350-fdd949bb00d5d3b5bda54ef85f8fde3682dc2c27.tar.gz
scummvm-rg350-fdd949bb00d5d3b5bda54ef85f8fde3682dc2c27.tar.bz2
scummvm-rg350-fdd949bb00d5d3b5bda54ef85f8fde3682dc2c27.zip
MACVENTURE: Fix exits drawing
-rw-r--r--engines/macventure/gui.cpp12
-rw-r--r--engines/macventure/gui.h9
-rw-r--r--engines/macventure/macventure.cpp2
3 files changed, 14 insertions, 9 deletions
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<CommandButton>::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<ObjID> exits = _world->getChildren(_world->getObjAttr(1, kAttrParentObject), true);