aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure/macventure.cpp
diff options
context:
space:
mode:
authorBorja Lorente2016-06-30 08:41:25 +0200
committerBorja Lorente2016-08-14 18:43:13 +0200
commit517aceefcb397ccda476dc7e2b02d6da5595e4fd (patch)
treee0430870cb341ba64f903d3042bffecfc744ea19 /engines/macventure/macventure.cpp
parent246fec28f55ca646a77985cd7b95a33b2cae994d (diff)
downloadscummvm-rg350-517aceefcb397ccda476dc7e2b02d6da5595e4fd.tar.gz
scummvm-rg350-517aceefcb397ccda476dc7e2b02d6da5595e4fd.tar.bz2
scummvm-rg350-517aceefcb397ccda476dc7e2b02d6da5595e4fd.zip
MACVENTURE: Add scene transition
Diffstat (limited to 'engines/macventure/macventure.cpp')
-rw-r--r--engines/macventure/macventure.cpp44
1 files changed, 38 insertions, 6 deletions
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index 8624159a95..08b5ec90c1 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -174,7 +174,7 @@ void MacVentureEngine::requestUnpause() {
void MacVentureEngine::selectControl(ControlReference id) {
ControlAction action = referenceToAction(id);
- debug(4, "Select control %x", action);
+ debug(2, "Select control %x", action);
_selectedControl = action;
}
@@ -190,7 +190,7 @@ void MacVentureEngine::activateCommand(ControlReference id) {
_activeControl = kNoCommand;
_activeControl = action;
}
- debug(4, "Activating Command %x... Command %x is active", action, _activeControl);
+ debug(2, "Activating Command %x... Command %x is active", action, _activeControl);
refreshReady();
}
@@ -520,6 +520,17 @@ void MacVentureEngine::unselectObject(ObjID objID) {
}
}
+
+void MacVentureEngine::updateExits() {
+ // exitWin.killControls();
+ _gui->unselectExits();
+
+ Common::Array<ObjID> exits = _world->getChildren(_world->getObjAttr(1, kAttrParentObject), true);
+ for (uint i = 0; i < exits.size(); i++)
+ _gui->updateExit(exits[i]);
+
+}
+
int MacVentureEngine::findObjectInArray(ObjID objID, const Common::Array<ObjID> &list) {
// Find the object in the current selection
bool found = false;
@@ -542,7 +553,7 @@ Common::String MacVentureEngine::getPrefixString(uint flag, ObjID obj) {
if (ndx) {
return _decodingNamingArticles->getString(ndx);
} else {
- return Common::String("missigno ");
+ return Common::String("m1551gn0 ");
}
}
@@ -551,7 +562,20 @@ Common::String MacVentureEngine::getNoun(ObjID ndx) {
}
void MacVentureEngine::highlightExit(ObjID objID) {
- warning("highlightExit: unimplemented");
+ //ObjID ctl = _gui->getWinChild(obj);
+ /*if (ctl) {
+ if (findObjectInArray(obj, _selectedObjs) != -1)
+ _gui->selectExit(ctl);
+ else
+ _gui->unselectExit(ctl);
+ }
+ if (obj == _world->getObjAttr(1, kAttrParentObject)) {
+ if (findObjectInArray(obj, _selectedObjs) != -1)
+ _gui->selectExit(obj);
+ else
+ _gui->unselectExit(obj);
+ }*/
+ //updateWindow(findParentWindow(obj));
}
void MacVentureEngine::selectPrimaryObject(ObjID objID) {
@@ -587,7 +611,7 @@ void MacVentureEngine::openObject(ObjID objID) {
if (objID == _world->getObjAttr(1, kAttrParentObject)) {
_gui->updateWindowInfo(kMainGameWindow, objID, _world->getChildren(objID, true));
_gui->updateWindow(kMainGameWindow, _world->getObjAttr(objID, kAttrContainerOpen));
- //_gui->drawExits();
+ updateExits();
_gui->setWindowTitle(kMainGameWindow, _world->getText(objID, objID, objID)); // it ignores source and target in the original
} else { // Open inventory window
Common::Point p(_world->getObjAttr(objID, kAttrPosX), _world->getObjAttr(objID, kAttrPosY));
@@ -649,7 +673,7 @@ void MacVentureEngine::checkObject(QueuedObject old) {
old.hidden != _world->getObjAttr(id, kAttrHiddenExit) ||
old.exitx != _world->getObjAttr(id, kAttrExitX) ||
old.exity != _world->getObjAttr(id, kAttrExitY))
- _gui->drawExit(id);
+ _gui->updateExit(id);
}
WindowReference win = getObjWindow(id);
ObjID cur = id;
@@ -787,12 +811,20 @@ bool MacVentureEngine::isObjExit(ObjID objID) {
return _world->getObjAttr(objID, kAttrIsExit);
}
+bool MacVentureEngine::isHiddenExit(ObjID objID) {
+ return _world->getObjAttr(objID, kAttrHiddenExit);
+}
+
Common::Point MacVentureEngine::getObjExitPosition(ObjID objID) {
uint x = _world->getObjAttr(objID, kAttrExitX);
uint y = _world->getObjAttr(objID, kAttrExitY);
return Common::Point(x, y);
}
+ObjID MacVentureEngine::getParent(ObjID objID) {
+ return _world->getObjAttr(objID, kAttrParentObject);
+}
+
Common::Rect MacVentureEngine::getObjBounds(ObjID objID) {
Common::Point pos = getObjPosition(objID);
uint w = _gui->getObjWidth(objID); // This shouldn't go here