diff options
Diffstat (limited to 'engines')
56 files changed, 628 insertions, 354 deletions
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 5fed92051c..d2f088dcd8 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -22,10 +22,14 @@ #include "common/config-manager.h" #include "common/debug-channels.h" +#include "common/events.h" #include "engines/util.h" #include "graphics/cursorman.h" +#include "graphics/palette.h" + +#include "image/iff.h" #include "cine/cine.h" #include "cine/bg_list.h" @@ -89,6 +93,10 @@ void CineEngine::syncSoundSettings() { } Common::Error CineEngine::run() { + if (g_cine->getGameType() == GType_FW && (g_cine->getFeatures() & GF_CD)) { + showSplashScreen(); + } + // Initialize backend initGraphics(320, 200, false); @@ -239,4 +247,45 @@ void CineEngine::initialize() { } } +void CineEngine::showSplashScreen() { + Common::File file; + if (!file.open("sony.lbm")) + return; + + Image::IFFDecoder decoder; + if (!decoder.loadStream(file)) + return; + + const Graphics::Surface *surface = decoder.getSurface(); + if (surface->w == 640 && surface->h == 480) { + initGraphics(640, 480, true); + + const byte *palette = decoder.getPalette(); + int paletteColorCount = decoder.getPaletteColorCount(); + g_system->getPaletteManager()->setPalette(palette, 0, paletteColorCount); + + g_system->copyRectToScreen(surface->getPixels(), 640, 0, 0, 640, 480); + g_system->updateScreen(); + + Common::EventManager *eventMan = g_system->getEventManager(); + + bool done = false; + uint32 now = g_system->getMillis(); + + while (!done && g_system->getMillis() - now < 2000) { + Common::Event event; + while (eventMan->pollEvent(event)) { + if (event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE) { + done = true; + break; + } + if (shouldQuit()) + done = true; + } + } + } + + decoder.destroy(); +} + } // End of namespace Cine diff --git a/engines/cine/cine.h b/engines/cine/cine.h index e620d2ffa5..71a0c242b6 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -145,6 +145,7 @@ public: private: void initialize(); + void showSplashScreen(); void resetEngine(); bool loadPlainSaveFW(Common::SeekableReadStream &in, CineSaveGameFormat saveGameFormat); bool loadTempSaveOS(Common::SeekableReadStream &in); diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index 7815475d37..68b63d398a 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -419,7 +419,7 @@ bool GameLoader::unloadScene(int sceneId) { if (_sc2array[sceneTag]._isLoaded) saveScenePicAniInfos(sceneId); - _sc2array[sceneTag]._motionController->freeItems(); + _sc2array[sceneTag]._motionController->detachAllObjects(); delete tag->_scene; tag->_scene = 0; diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp index 84e9688e30..4aac3485f4 100644 --- a/engines/fullpipe/interaction.cpp +++ b/engines/fullpipe/interaction.cpp @@ -311,7 +311,7 @@ LABEL_38: if (abs(xpos - subj->_ox) > 1 || abs(ypos - subj->_oy) > 1 || (inter->_staticsId2 != 0 && (subj->_statics == 0 || subj->_statics->_staticsId != inter->_staticsId2))) { - mq = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->method34(subj, xpos, ypos, 1, inter->_staticsId2); + mq = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->startMove(subj, xpos, ypos, 1, inter->_staticsId2); if (!mq) return false; diff --git a/engines/fullpipe/lift.cpp b/engines/fullpipe/lift.cpp index 9a3d91540a..d066c89d4a 100644 --- a/engines/fullpipe/lift.cpp +++ b/engines/fullpipe/lift.cpp @@ -324,7 +324,7 @@ void FullpipeEngine::lift_walkAndGo() { ExCommand *ex; if (abs(_liftX - _aniMan->_ox) > 1 || abs(_liftY - _aniMan->_oy) > 1 || _aniMan->_movement || _aniMan->_statics->_staticsId != ST_MAN_UP) { - mq = getCurrSceneSc2MotionController()->method34(_aniMan, _liftX, _liftY, 1, ST_MAN_UP); + mq = getCurrSceneSc2MotionController()->startMove(_aniMan, _liftX, _liftY, 1, ST_MAN_UP); if (mq) { ex = new ExCommand(0, 17, MSG_LIFT_CLICKBUTTON, 0, 0, 0, 1, 0, 0, 0); diff --git a/engines/fullpipe/messagehandlers.cpp b/engines/fullpipe/messagehandlers.cpp index d4f79d1dd8..94754ad22a 100644 --- a/engines/fullpipe/messagehandlers.cpp +++ b/engines/fullpipe/messagehandlers.cpp @@ -781,7 +781,7 @@ int MovGraph_messageHandler(ExCommand *cmd) { int off = (node->_field_14 >> 16) & 0xFF; double off2 = ((link->_movGraphNode2->_field_14 >> 8) & 0xff) - off; - top = off + (int)(sqrt(sq) * off2 / link->_distance); + top = off + (int)(sqrt(sq) * off2 / link->_z); } else { top = (gr->calcOffset(ani->_ox, ani->_oy)->_field_14 >> 8) & 0xff; } diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 5845ad1501..1a61cb742a 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -88,7 +88,7 @@ bool MctlCompound::load(MfcArchive &file) { for (int i = 0; i < count; i++) { debug(6, "CompoundArray[%d]", i); - MctlCompoundArrayItem *obj = new MctlCompoundArrayItem(); + MctlItem *obj = new MctlItem(); obj->_motionControllerObj = (MotionController *)file.readClass(); @@ -114,14 +114,14 @@ bool MctlCompound::load(MfcArchive &file) { return true; } -void MctlCompound::addObject(StaticANIObject *obj) { +void MctlCompound::attachObject(StaticANIObject *obj) { for (uint i = 0; i < _motionControllers.size(); i++) - _motionControllers[i]->_motionControllerObj->addObject(obj); + _motionControllers[i]->_motionControllerObj->attachObject(obj); } -int MctlCompound::removeObject(StaticANIObject *obj) { +int MctlCompound::detachObject(StaticANIObject *obj) { for (uint i = 0; i < _motionControllers.size(); i++) - _motionControllers[i]->_motionControllerObj->removeObject(obj); + _motionControllers[i]->_motionControllerObj->detachObject(obj); return 1; } @@ -150,12 +150,12 @@ void MctlCompound::initMovGraph2() { } } -void MctlCompound::freeItems() { +void MctlCompound::detachAllObjects() { for (uint i = 0; i < _motionControllers.size(); i++) - _motionControllers[i]->_motionControllerObj->freeItems(); + _motionControllers[i]->_motionControllerObj->detachAllObjects(); } -MessageQueue *MctlCompound::method34(StaticANIObject *ani, int sourceX, int sourceY, int fuzzyMatch, int staticsId) { +MessageQueue *MctlCompound::startMove(StaticANIObject *ani, int sourceX, int sourceY, int fuzzyMatch, int staticsId) { int idx = -1; int sourceIdx = -1; @@ -187,7 +187,7 @@ MessageQueue *MctlCompound::method34(StaticANIObject *ani, int sourceX, int sour return 0; if (idx == sourceIdx) - return _motionControllers[idx]->_motionControllerObj->method34(ani, sourceX, sourceY, fuzzyMatch, staticsId); + return _motionControllers[idx]->_motionControllerObj->startMove(ani, sourceX, sourceY, fuzzyMatch, staticsId); double dist; MctlConnectionPoint *cp = findClosestConnectionPoint(ani->_ox, ani->_oy, idx, sourceX, sourceY, sourceIdx, &dist); @@ -195,7 +195,7 @@ MessageQueue *MctlCompound::method34(StaticANIObject *ani, int sourceX, int sour if (!cp) return 0; - MessageQueue *mq = _motionControllers[idx]->_motionControllerObj->doWalkTo(ani, cp->_connectionX, cp->_connectionY, 1, cp->_field_14); + MessageQueue *mq = _motionControllers[idx]->_motionControllerObj->doWalkTo(ani, cp->_connectionX, cp->_connectionY, 1, cp->_mctlmirror); if (!mq) return 0; @@ -264,7 +264,7 @@ MessageQueue *MctlCompound::doWalkTo(StaticANIObject *subj, int xpos, int ypos, if (!closestP) return 0; - MessageQueue *mq = _motionControllers[match1]->_motionControllerObj->doWalkTo(subj, closestP->_connectionX, closestP->_connectionY, 1, closestP->_field_14); + MessageQueue *mq = _motionControllers[match1]->_motionControllerObj->doWalkTo(subj, closestP->_connectionX, closestP->_connectionY, 1, closestP->_mctlmirror); ExCommand *ex; @@ -287,7 +287,7 @@ MessageQueue *MctlCompound::doWalkTo(StaticANIObject *subj, int xpos, int ypos, return mq; } -MctlCompoundArrayItem::~MctlCompoundArrayItem() { +MctlItem::~MctlItem() { delete _movGraphReactObj; delete _motionControllerObj; } @@ -304,7 +304,7 @@ MctlLadder::MctlLadder() { } MctlLadder::~MctlLadder() { - freeItems(); + detachAllObjects(); } int MctlLadder::collisionDetection(StaticANIObject *man) { @@ -326,7 +326,7 @@ int MctlLadder::collisionDetection(StaticANIObject *man) { return res; } -void MctlLadder::addObject(StaticANIObject *obj) { +void MctlLadder::attachObject(StaticANIObject *obj) { if (findObjectPos(obj) < 0) { MctlLadderMovement *movement = new MctlLadderMovement; @@ -391,7 +391,7 @@ bool MctlLadder::initMovement(StaticANIObject *ani, MctlLadderMovement *movement return true; } -void MctlLadder::freeItems() { +void MctlLadder::detachAllObjects() { _mgm.clear(); for (uint i = 0; i < _ladmovements.size(); i++) { @@ -402,7 +402,7 @@ void MctlLadder::freeItems() { _ladmovements.clear(); } -MessageQueue *MctlLadder::method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { +MessageQueue *MctlLadder::startMove(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { MessageQueue *mq = doWalkTo(subj, xpos, ypos, fuzzyMatch, staticsId); if (mq) { @@ -661,7 +661,7 @@ void MctlCompound::replaceNodeX(int from, int to) { node->_x = to; } - gr->calcNodeDistancesAndAngles(); + gr->recalcLinkParams(); } } } @@ -669,10 +669,9 @@ void MctlCompound::replaceNodeX(int from, int to) { MctlConnectionPoint::MctlConnectionPoint() { _connectionX = 0; _connectionY = 0; - _field_C = 0; - _field_10 = 0; - _field_14 = 0; - _field_16 = 0; + _mctlflags = 0; + _mctlstatic = 0; + _mctlmirror = 0; _messageQueueObj = 0; _motionControllerObj = 0; } @@ -779,7 +778,7 @@ bool MovGraph::load(MfcArchive &file) { return true; } -void MovGraph::addObject(StaticANIObject *obj) { +void MovGraph::attachObject(StaticANIObject *obj) { _mgm.clear(); _mgm.addItem(obj->_id); @@ -796,13 +795,13 @@ void MovGraph::addObject(StaticANIObject *obj) { _mgm.addItem(obj->_id); // FIXME: Is it really needed? } -int MovGraph::removeObject(StaticANIObject *obj) { - warning("STUB: MovGraph::removeObject()"); +int MovGraph::detachObject(StaticANIObject *obj) { + warning("STUB: MovGraph::detachObject()"); return 0; } -void MovGraph::freeItems() { +void MovGraph::detachAllObjects() { for (uint i = 0; i < _items.size(); i++) { _items[i]->free(); @@ -812,7 +811,7 @@ void MovGraph::freeItems() { _items.clear(); } -Common::Array<MovItem *> *MovGraph::method28(StaticANIObject *ani, int x, int y, int flag1, int *rescount) { +Common::Array<MovItem *> *MovGraph::getPaths(StaticANIObject *ani, int x, int y, int flag1, int *rescount) { *rescount = 0; if (_items.size() <= 0) @@ -828,7 +827,7 @@ Common::Array<MovItem *> *MovGraph::method28(StaticANIObject *ani, int x, int y, } _items[idx]->free(); - calcNodeDistancesAndAngles(); + recalcLinkParams(); _items[idx]->movarr._movSteps.clear(); @@ -838,7 +837,7 @@ Common::Array<MovItem *> *MovGraph::method28(StaticANIObject *ani, int x, int y, point.y = ani->_oy; if (!calcChunk(idx, ani->_ox, ani->_oy, &_items[idx]->movarr, 0)) - findClosestLink(idx, &point, &_items[idx]->movarr); + getNearestPoint(idx, &point, &_items[idx]->movarr); _items[idx]->count = 0; @@ -873,12 +872,12 @@ Common::Array<MovItem *> *MovGraph::method28(StaticANIObject *ani, int x, int y, return 0; } -bool MovGraph::method2C(StaticANIObject *obj, int x, int y) { +bool MovGraph::setPosImmediate(StaticANIObject *obj, int x, int y) { obj->setOXY(x, y); - return method3C(obj, 1); + return resetPosition(obj, 1); } -MessageQueue *MovGraph::method34(StaticANIObject *ani, int xpos, int ypos, int fuzzyMatch, int staticsId) { +MessageQueue *MovGraph::startMove(StaticANIObject *ani, int xpos, int ypos, int fuzzyMatch, int staticsId) { if (!ani) { if (!_items.size()) return 0; @@ -896,7 +895,7 @@ MessageQueue *MovGraph::method34(StaticANIObject *ani, int xpos, int ypos, int f return 0; int count; - Common::Array<MovItem *> *movitems = method28(ani, xpos, ypos, fuzzyMatch, &count); + Common::Array<MovItem *> *movitems = getPaths(ani, xpos, ypos, fuzzyMatch, &count); if (!movitems) return 0; @@ -941,9 +940,9 @@ MessageQueue *MovGraph::method34(StaticANIObject *ani, int xpos, int ypos, int f int count2; ani->setSomeDynamicPhaseIndex(ex->_field_14); - method28(ani, xpos, ypos, fuzzyMatch, &count2); + getPaths(ani, xpos, ypos, fuzzyMatch, &count2); - int idx = getItemIndexByStaticAni(ani); + int idx = getObjectIndex(ani); count = _items[idx]->count; movitems = _items[idx]->movitems; } @@ -951,12 +950,12 @@ MessageQueue *MovGraph::method34(StaticANIObject *ani, int xpos, int ypos, int f return method50(ani, _callback1(ani, movitems, count), staticsId); } -void MovGraph::changeCallback(MovArr *(*callback1)(StaticANIObject *ani, Common::Array<MovItem *> *items, signed int counter)) { +void MovGraph::setSelFunc(MovArr *(*callback1)(StaticANIObject *ani, Common::Array<MovItem *> *items, signed int counter)) { _callback1 = callback1; } -bool MovGraph::method3C(StaticANIObject *ani, int flag) { - int idx = getItemIndexByStaticAni(ani); +bool MovGraph::resetPosition(StaticANIObject *ani, int flag) { + int idx = getObjectIndex(ani); if (idx == -1) return false; @@ -967,7 +966,7 @@ bool MovGraph::method3C(StaticANIObject *ani, int flag) { point.x = ani->_ox; point.y = ani->_oy; - findClosestLink(idx, &point, &movarr); + getNearestPoint(idx, &point, &movarr); ani->setOXY(point.x, point.y); if (flag) { @@ -990,15 +989,15 @@ bool MovGraph::method3C(StaticANIObject *ani, int flag) { return true; } -bool MovGraph::method44(StaticANIObject *ani, int x, int y) { - int idx = getItemIndexByStaticAni(ani); +bool MovGraph::canDropInventory(StaticANIObject *ani, int x, int y) { + int idx = getObjectIndex(ani); MovArr m; if (idx != -1) { if (x != -1 || y != -1) { int counter; - Common::Array<MovItem *> *movitem = method28(ani, x, y, 0, &counter); + Common::Array<MovItem *> *movitem = getPaths(ani, x, y, 0, &counter); if (movitem) { MovArr *movarr = _callback1(ani, movitem, counter); @@ -1021,13 +1020,13 @@ MessageQueue *MovGraph::doWalkTo(StaticANIObject *subj, int xpos, int ypos, int PicAniInfo picAniInfo; int ss; - Common::Array<MovItem *> *movitem = method28(subj, xpos, ypos, fuzzyMatch, &ss); + Common::Array<MovItem *> *movitem = getPaths(subj, xpos, ypos, fuzzyMatch, &ss); subj->getPicAniInfo(&picAniInfo); if (movitem) { MovArr *goal = _callback1(subj, movitem, ss); - int idx = getItemIndexByStaticAni(subj); + int idx = getObjectIndex(subj); for (int i = 0; i < _items[idx]->count; i++) { if ((*_items[idx]->movitems)[i]->movarr == goal) { @@ -1052,10 +1051,10 @@ MessageQueue *MovGraph::doWalkTo(StaticANIObject *subj, int xpos, int ypos, int } } - movitem = method28(subj, xpos, ypos, fuzzyMatch, &ss); + movitem = getPaths(subj, xpos, ypos, fuzzyMatch, &ss); if (movitem) { MovArr *goal = _callback1(subj, movitem, ss); - int idx = getItemIndexByStaticAni(subj); + int idx = getObjectIndex(subj); if (_items[idx]->count > 0) { int arridx = 0; @@ -1106,7 +1105,7 @@ MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x int rescount; - Common::Array<MovItem *> *movitems = method28(ani, x1, y1, flag1, &rescount); + Common::Array<MovItem *> *movitems = getPaths(ani, x1, y1, flag1, &rescount); if (!movitems) { ani->setPicAniInfo(&picinfo); @@ -1117,7 +1116,7 @@ MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x MessageQueue *res = 0; MovArr *goal = _callback1(ani, movitems, rescount); - int idx = getItemIndexByStaticAni(ani); + int idx = getObjectIndex(ani); MovGraphItem *movgitem = _items[idx]; int cnt = movgitem->count; @@ -1177,16 +1176,16 @@ MessageQueue *MovGraph::fillMGMinfo(StaticANIObject *ani, MovArr *movarr, int st if (i == movarr->_movStepCount - 1) { nx = movarr->_point.x; ny = movarr->_point.y; - nd = st->link->_movGraphNode1->_distance; + nd = st->link->_movGraphNode1->_z; } else { if (st->sfield_0) { nx = st->link->_movGraphNode1->_x; ny = st->link->_movGraphNode1->_y; - nd = st->link->_movGraphNode1->_distance; + nd = st->link->_movGraphNode1->_z; } else { nx = st->link->_movGraphNode2->_x; ny = st->link->_movGraphNode2->_y; - nd = st->link->_movGraphNode2->_distance; + nd = st->link->_movGraphNode2->_z; } } @@ -1294,14 +1293,14 @@ double MovGraph::calcDistance(Common::Point *point, MovGraphLink *link, int fuzz double dist2x = (double)(n2x - n1x); double dist2y = (double)(n2y - n1y); double dist1 = sqrt(dist1y * dist1y + dist1x * dist1x); - double dist2 = ((double)(n1y - n2y) * dist1y + dist2x * dist1x) / link->_distance / dist1; + double dist2 = ((double)(n1y - n2y) * dist1y + dist2x * dist1x) / link->_z / dist1; double distm = dist2 * dist1; double res = sqrt(1.0 - dist2 * dist2) * dist1; - if (dist2 <= 0.0 || distm >= link->_distance) { + if (dist2 <= 0.0 || distm >= link->_z) { if (fuzzyMatch) { if (dist2 > 0.0) { - if (distm >= link->_distance) { + if (distm >= link->_z) { point->x = n2x; point->y = n2y; } @@ -1313,14 +1312,14 @@ double MovGraph::calcDistance(Common::Point *point, MovGraphLink *link, int fuzz return -1.0; } } else { - point->x = (int)(n1x + (dist2x * distm / link->_distance)); - point->y = (int)(n1y + (dist2y * distm / link->_distance)); + point->x = (int)(n1x + (dist2x * distm / link->_z)); + point->y = (int)(n1y + (dist2y * distm / link->_z)); } return res; } -void MovGraph::calcNodeDistancesAndAngles() { +void MovGraph::recalcLinkParams() { for (ObList::iterator i = _links.begin(); i != _links.end(); ++i) { assert(((CObject *)*i)->_objtype == kObjTypeMovGraphLink); @@ -1328,11 +1327,11 @@ void MovGraph::calcNodeDistancesAndAngles() { lnk->_flags &= 0x7FFFFFFF; - lnk->calcNodeDistanceAndAngle(); + lnk->recalcLength(); } } -bool MovGraph::findClosestLink(int unusedArg, Common::Point *p, MovArr *movarr) { +bool MovGraph::getNearestPoint(int unusedArg, Common::Point *p, MovArr *movarr) { MovGraphLink *link = 0; double mindist = 1.0e20; int resx = 0, resy = 0; @@ -1348,7 +1347,7 @@ bool MovGraph::findClosestLink(int unusedArg, Common::Point *p, MovArr *movarr) double dx3 = lnk->_movGraphNode2->_x - lnk->_movGraphNode1->_x; double dy3 = lnk->_movGraphNode2->_y - lnk->_movGraphNode1->_y; double sq1 = sqrt(dy1 * dy1 + dx1 * dx1); - double sdist = (dy3 * dy1 + dx3 * dx1) / lnk->_distance / sq1; + double sdist = (dy3 * dy1 + dx3 * dx1) / lnk->_z / sq1; double ldist = sdist * sq1; double dist = sqrt(1.0 - sdist * sdist) * sq1; @@ -1357,14 +1356,14 @@ bool MovGraph::findClosestLink(int unusedArg, Common::Point *p, MovArr *movarr) dist = sqrt(dx1 * dx1 + dy1 * dy1); } - if (ldist > lnk->_distance) { - ldist = lnk->_distance; + if (ldist > lnk->_z) { + ldist = lnk->_z; dist = sqrt(dx2 * dx2 + dy2 * dy2); } - if (ldist >= 0.0 && ldist <= lnk->_distance && dist < mindist) { - resx = lnk->_movGraphNode1->_x + (int)(dx3 * ldist / lnk->_distance); - resy = lnk->_movGraphNode1->_y + (int)(dy3 * ldist / lnk->_distance); + if (ldist >= 0.0 && ldist <= lnk->_z && dist < mindist) { + resx = lnk->_movGraphNode1->_x + (int)(dx3 * ldist / lnk->_z); + resy = lnk->_movGraphNode1->_y + (int)(dy3 * ldist / lnk->_z); mindist = dist; link = lnk; @@ -1387,7 +1386,7 @@ bool MovGraph::findClosestLink(int unusedArg, Common::Point *p, MovArr *movarr) return false; } -int MovGraph::getItemIndexByStaticAni(StaticANIObject *ani) { +int MovGraph::getObjectIndex(StaticANIObject *ani) { for (uint i = 0; i < _items.size(); i++) if (_items[i]->ani == ani) return i; @@ -1418,7 +1417,7 @@ Common::Array<MovArr *> *MovGraph::genMovArr(int x, int y, int *arrSize, int fla movarr->_link = lnk; movarr->_dist = ((double)(lnk->_movGraphNode1->_y - lnk->_movGraphNode2->_y) * (double)(lnk->_movGraphNode1->_y - point.y) + (double)(lnk->_movGraphNode2->_x - lnk->_movGraphNode1->_x) * (double)(point.x - lnk->_movGraphNode1->_x)) / - lnk->_distance / lnk->_distance; + lnk->_z / lnk->_z; movarr->_point = point; arr->push_back(movarr); @@ -1447,7 +1446,7 @@ Common::Array<MovArr *> *MovGraph::genMovArr(int x, int y, int *arrSize, int fla movarr->_link = lnk; movarr->_dist = ((double)(lnk->_movGraphNode1->_y - lnk->_movGraphNode2->_y) * (double)(lnk->_movGraphNode1->_y - y) + (double)(lnk->_movGraphNode2->_x - lnk->_movGraphNode1->_x) * (double)(x - lnk->_movGraphNode1->_x)) / - lnk->_distance / lnk->_distance; + lnk->_z / lnk->_z; movarr->_point.x = x; movarr->_point.y = y; @@ -1548,7 +1547,7 @@ bool MovGraph::calcChunk(int idx, int x, int y, MovArr *arr, int a6) { Common::Array<MovArr *> *movarr = genMovArr(x, y, &arrSize, 0, 1); if (!movarr) - return findClosestLink(idx, 0, arr); + return getNearestPoint(idx, 0, arr); bool res = false; @@ -1777,8 +1776,8 @@ bool MovGraph2::initDirections(StaticANIObject *obj, MovGraph2Item *item) { return true; } -void MovGraph2::addObject(StaticANIObject *obj) { - MovGraph::addObject(obj); +void MovGraph2::attachObject(StaticANIObject *obj) { + MovGraph::attachObject(obj); int id = getItemIndexByGameObjectId(obj->_id); @@ -2031,20 +2030,20 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) { return mq; } -int MovGraph2::removeObject(StaticANIObject *obj) { - warning("STUB: MovGraph2::removeObject()"); +int MovGraph2::detachObject(StaticANIObject *obj) { + warning("STUB: MovGraph2::detachObject()"); return 0; } -void MovGraph2::freeItems() { +void MovGraph2::detachAllObjects() { for (uint i = 0; i < _items2.size(); i++) delete _items2[i]; _items2.clear(); } -MessageQueue *MovGraph2::method34(StaticANIObject *ani, int xpos, int ypos, int fuzzyMatch, int staticsId) { +MessageQueue *MovGraph2::startMove(StaticANIObject *ani, int xpos, int ypos, int fuzzyMatch, int staticsId) { if (!ani->isIdle()) return 0; @@ -2240,9 +2239,9 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int int dx2, dy2; if (linkInfoSource.node) - movInfo1.distance1 = linkInfoSource.node->_distance; + movInfo1.distance1 = linkInfoSource.node->_z; else - movInfo1.distance1 = linkInfoSource.link->_movGraphNode1->_distance; + movInfo1.distance1 = linkInfoSource.link->_movGraphNode1->_z; if (linkInfoDest.node) { dx2 = linkInfoDest.node->_x; @@ -2251,16 +2250,16 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int movInfo1.pt2.x = linkInfoDest.node->_x; movInfo1.pt2.y = linkInfoDest.node->_y; - movInfo1.distance2 = linkInfoDest.node->_distance; + movInfo1.distance2 = linkInfoDest.node->_z; } else { movInfo1.pt2.x = xpos; movInfo1.pt2.y = ypos; MovGraphNode *nod = linkInfoDest.link->_movGraphNode1; double dst1 = sqrt((double)((ypos - nod->_y) * (ypos - nod->_y) + (xpos - nod->_x) * (xpos - nod->_x))); - int dst = linkInfoDest.link->_movGraphNode2->_distance - nod->_distance; + int dst = linkInfoDest.link->_movGraphNode2->_z - nod->_z; - movInfo1.distance2 = (int)(nod->_distance + (dst1 * (double)dst / linkInfoDest.link->_distance)); + movInfo1.distance2 = (int)(nod->_z + (dst1 * (double)dst / linkInfoDest.link->_z)); calcDistance(&movInfo1.pt2, linkInfoDest.link, 1); @@ -2397,8 +2396,8 @@ int MovGraph2::findLink(Common::Array<MovGraphLink *> *linkList, int idx, Common rect->bottom = node2->_y; } if (point) { - point->x = node3->_distance; - point->y = node2->_distance; + point->x = node3->_z; + point->y = node2->_z; } if (abs(node3->_x - node2->_x) <= abs(node3->_y - node2->_y)) @@ -2659,7 +2658,7 @@ MovGraphLink *MovGraph2::findLink2(int x, int y) { double n1dx = n1x - x; double n1dy = n1y - y; double dst1 = sqrt(n1dy * n1dy + n1dx * n1dx); - double coeff1 = ((n1y - n2y) * n1dy + (n2x - n1x) * n1dx) / lnk->_distance / dst1; + double coeff1 = ((n1y - n2y) * n1dy + (n2x - n1x) * n1dx) / lnk->_z / dst1; double dst3 = coeff1 * dst1; double dst2 = sqrt(1.0 - coeff1 * coeff1) * dst1; @@ -2667,11 +2666,11 @@ MovGraphLink *MovGraph2::findLink2(int x, int y) { dst3 = 0.0; dst2 = sqrt(n1dy * n1dy + n1dx * n1dx); } - if (dst3 > lnk->_distance) { - dst3 = lnk->_distance; + if (dst3 > lnk->_z) { + dst3 = lnk->_z; dst2 = sqrt((n2x - x) * (n2x - x) + (n2y - y) * (n2y - y)); } - if (dst3 >= 0.0 && dst3 <= lnk->_distance && dst2 < mindist) { + if (dst3 >= 0.0 && dst3 <= lnk->_z && dst2 < mindist) { mindist = dst2; res = lnk; } @@ -2704,11 +2703,11 @@ double MovGraph2::findMinPath(LinkInfo *linkInfoSource, LinkInfo *linkInfoDest, double newDistance = findMinPath(&linkInfoWorkSource, linkInfoDest, &tmpList); - if (newDistance >= 0.0 && (minDistance < 0.0 || newDistance + lnk->_distance < minDistance)) { + if (newDistance >= 0.0 && (minDistance < 0.0 || newDistance + lnk->_z < minDistance)) { listObj->clear(); listObj->push_back(tmpList); - minDistance = newDistance + lnk->_distance; + minDistance = newDistance + lnk->_z; } lnk->_flags &= 0x7FFFFFFF; @@ -2775,7 +2774,7 @@ MovGraphNode *MovGraph::calcOffset(int ox, int oy) { } MovGraphLink::MovGraphLink() { - _distance = 0; + _z = 0; _angle = 0; _flags = 0x10000000; _movGraphNode2 = 0; @@ -2809,10 +2808,10 @@ bool MovGraphLink::load(MfcArchive &file) { debug(8, "GraphNode2"); _movGraphNode2 = (MovGraphNode *)file.readClass(); - _distance = file.readDouble(); + _z = file.readDouble(); _angle = file.readDouble(); - debug(8, "distance: %g, angle: %g", _distance, _angle); + debug(8, "distance: %g, angle: %g", _z, _angle); _movGraphReact = (MovGraphReact *)file.readClass(); _name = file.readPascalString(); @@ -2820,12 +2819,12 @@ bool MovGraphLink::load(MfcArchive &file) { return true; } -void MovGraphLink::calcNodeDistanceAndAngle() { +void MovGraphLink::recalcLength() { if (_movGraphNode1) { double dx = _movGraphNode2->_x - _movGraphNode1->_x; double dy = _movGraphNode2->_y - _movGraphNode1->_y; - _distance = sqrt(dy * dy + dx * dx); + _z = sqrt(dy * dy + dx * dx); _angle = atan2(dx, dy); } } @@ -2836,7 +2835,7 @@ bool MovGraphNode::load(MfcArchive &file) { _field_14 = file.readUint32LE(); _x = file.readUint32LE(); _y = file.readUint32LE(); - _distance = file.readUint32LE(); + _z = file.readUint32LE(); return true; } @@ -3032,7 +3031,7 @@ int startWalkTo(int objId, int objKey, int x, int y, int fuzzyMatch) { MctlCompound *mc = getCurrSceneSc2MotionController(); if (mc) - return (mc->method34(g_fp->_currentScene->getStaticANIObject1ById(objId, objKey), x, y, fuzzyMatch, 0) != 0); + return (mc->startMove(g_fp->_currentScene->getStaticANIObject1ById(objId, objKey), x, y, fuzzyMatch, 0) != 0); return 0; } @@ -3042,7 +3041,7 @@ bool doSomeAnimation(int objId, int objKey, int a3) { MctlCompound *cmp = getCurrSceneSc2MotionController(); if (ani && cmp) - return cmp->method3C(ani, a3); + return cmp->resetPosition(ani, a3); return false; } diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index c488039e22..a40d810ffa 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -48,19 +48,19 @@ public: virtual bool load(MfcArchive &file); virtual void methodC() {} virtual void method10() {} - virtual void clearEnabled() { _isEnabled = false; } - virtual void setEnabled() { _isEnabled = true; } - virtual void addObject(StaticANIObject *obj) {} - virtual int removeObject(StaticANIObject *obj) { return 0; } - virtual void freeItems() {} - virtual Common::Array<MovItem *> *method28(StaticANIObject *ani, int x, int y, int flag1, int *rescount) { return 0; } - virtual bool method2C(StaticANIObject *obj, int x, int y) { return false; } + virtual void deactivate() { _isEnabled = false; } + virtual void activate() { _isEnabled = true; } + virtual void attachObject(StaticANIObject *obj) {} + virtual int detachObject(StaticANIObject *obj) { return 0; } + virtual void detachAllObjects() {} + virtual Common::Array<MovItem *> *getPaths(StaticANIObject *ani, int x, int y, int flag1, int *rescount) { return 0; } + virtual bool setPosImmediate(StaticANIObject *obj, int x, int y) { return false; } virtual int method30() { return 0; } - virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { return 0; } - virtual void changeCallback(MovArr *(*_callback1)(StaticANIObject *ani, Common::Array<MovItem *> *items, signed int counter)) {} - virtual bool method3C(StaticANIObject *ani, int flag) { return 0; } + virtual MessageQueue *startMove(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { return 0; } + virtual void setSelFunc(MovArr *(*_callback1)(StaticANIObject *ani, Common::Array<MovItem *> *items, signed int counter)) {} + virtual bool resetPosition(StaticANIObject *ani, int flag) { return 0; } virtual int method40() { return 0; } - virtual bool method44(StaticANIObject *ani, int x, int y) { return false; } + virtual bool canDropInventory(StaticANIObject *ani, int x, int y) { return false; } virtual int method48() { return -1; } virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { return 0; } @@ -82,7 +82,7 @@ public: virtual bool pointInRegion(int x, int y); }; -class MctlCompoundArrayItem : public CObject { +class MctlItem : public CObject { public: MotionController *_motionControllerObj; MovGraphReact *_movGraphReactObj; @@ -92,11 +92,11 @@ public: int _field_28; public: - MctlCompoundArrayItem() : _movGraphReactObj(0), _motionControllerObj(0), _field_20(0), _field_24(0), _field_28(0) {} - ~MctlCompoundArrayItem(); + MctlItem() : _movGraphReactObj(0), _motionControllerObj(0), _field_20(0), _field_24(0), _field_28(0) {} + ~MctlItem(); }; -class MctlCompoundArray : public Common::Array<MctlCompoundArrayItem *>, public CObject { +class MctlCompoundArray : public Common::Array<MctlItem *>, public CObject { public: virtual bool load(MfcArchive &file); }; @@ -109,10 +109,10 @@ public: virtual bool load(MfcArchive &file); - virtual void addObject(StaticANIObject *obj); - virtual int removeObject(StaticANIObject *obj); - virtual void freeItems(); - virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); + virtual void attachObject(StaticANIObject *obj); + virtual int detachObject(StaticANIObject *obj); + virtual void detachAllObjects(); + virtual MessageQueue *startMove(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); void initMovGraph2(); @@ -156,10 +156,10 @@ public: virtual ~MctlLadder(); int collisionDetection(StaticANIObject *man); - virtual void addObject(StaticANIObject *obj); - virtual int removeObject(StaticANIObject *obj) { return 1; } - virtual void freeItems(); - virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); + virtual void attachObject(StaticANIObject *obj); + virtual int detachObject(StaticANIObject *obj) { return 1; } + virtual void detachAllObjects(); + virtual MessageQueue *startMove(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); MessageQueue *controllerWalkTo(StaticANIObject *ani, int off); @@ -173,12 +173,12 @@ class MovGraphNode : public CObject { public: int _x; int _y; - int _distance; + int _z; int16 _field_10; int _field_14; public: - MovGraphNode() : _x(0), _y(0), _distance(0), _field_10(0), _field_14(0) { _objtype = kObjTypeMovGraphNode; } + MovGraphNode() : _x(0), _y(0), _z(0), _field_10(0), _field_14(0) { _objtype = kObjTypeMovGraphNode; } virtual bool load(MfcArchive &file); }; @@ -225,7 +225,7 @@ class MovGraphLink : public CObject { int _flags; int _field_38; int _field_3C; - double _distance; + double _z; double _angle; MovGraphReact *_movGraphReact; char *_name; @@ -236,7 +236,7 @@ class MovGraphLink : public CObject { virtual bool load(MfcArchive &file); - void calcNodeDistanceAndAngle(); + void recalcLength(); }; struct MovStep { @@ -290,23 +290,23 @@ public: virtual bool load(MfcArchive &file); - virtual void addObject(StaticANIObject *obj); - virtual int removeObject(StaticANIObject *obj); - virtual void freeItems(); - virtual Common::Array<MovItem *> *method28(StaticANIObject *ani, int x, int y, int flag1, int *rescount); - virtual bool method2C(StaticANIObject *obj, int x, int y); - virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); - virtual void changeCallback(MovArr *(*_callback1)(StaticANIObject *ani, Common::Array<MovItem *> *items, signed int counter)); - virtual bool method3C(StaticANIObject *ani, int flag); - virtual bool method44(StaticANIObject *ani, int x, int y); + virtual void attachObject(StaticANIObject *obj); + virtual int detachObject(StaticANIObject *obj); + virtual void detachAllObjects(); + virtual Common::Array<MovItem *> *getPaths(StaticANIObject *ani, int x, int y, int flag1, int *rescount); + virtual bool setPosImmediate(StaticANIObject *obj, int x, int y); + virtual MessageQueue *startMove(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); + virtual void setSelFunc(MovArr *(*_callback1)(StaticANIObject *ani, Common::Array<MovItem *> *items, signed int counter)); + virtual bool resetPosition(StaticANIObject *ani, int flag); + virtual bool canDropInventory(StaticANIObject *ani, int x, int y); virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); virtual MessageQueue *method50(StaticANIObject *ani, MovArr *movarr, int staticsId); double calcDistance(Common::Point *point, MovGraphLink *link, int fuzzyMatch); - void calcNodeDistancesAndAngles(); - bool findClosestLink(int unusedArg, Common::Point *p, MovArr *movarr); + void recalcLinkParams(); + bool getNearestPoint(int unusedArg, Common::Point *p, MovArr *movarr); MovGraphNode *calcOffset(int ox, int oy); - int getItemIndexByStaticAni(StaticANIObject *ani); + int getObjectIndex(StaticANIObject *ani); Common::Array<MovArr *> *genMovArr(int x, int y, int *arrSize, int flag1, int flag2); void findAllPaths(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &tempObList2); Common::Array<MovItem *> *calcMovItems(MovArr *movarr1, MovArr *movarr2, int *listCount); @@ -374,10 +374,10 @@ public: Common::Array<MovGraph2Item *> _items2; public: - virtual void addObject(StaticANIObject *obj); - virtual int removeObject(StaticANIObject *obj); - virtual void freeItems(); - virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); + virtual void attachObject(StaticANIObject *obj); + virtual int detachObject(StaticANIObject *obj); + virtual void detachAllObjects(); + virtual MessageQueue *startMove(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); int getItemIndexByGameObjectId(int objectId); @@ -404,10 +404,9 @@ class MctlConnectionPoint : public CObject { public: int _connectionX; int _connectionY; - int _field_C; - int _field_10; - int16 _field_14; - int16 _field_16; + int _mctlflags; + int _mctlstatic; + int16 _mctlmirror; MessageQueue *_messageQueueObj; int _motionControllerObj; diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 13c653ad09..32aa955a61 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -583,8 +583,8 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { _aniMan2 = _aniMan; MctlCompound *cmp = getSc2MctlCompoundBySceneId(entrance->_sceneId); cmp->initMovGraph2(); - cmp->addObject(_aniMan); - cmp->setEnabled(); + cmp->attachObject(_aniMan); + cmp->activate(); getGameLoaderInteractionController()->enableFlag24(); setInputDisabled(0); diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp index 4a87ae5b87..c0f0960aba 100644 --- a/engines/fullpipe/scenes/scene04.cpp +++ b/engines/fullpipe/scenes/scene04.cpp @@ -275,7 +275,7 @@ void sceneHandler04_clickButton() { } void sceneHandler04_downLadder(int x, int y) { - g_vars->scene04_ladder->method34(g_fp->_aniMan, x + g_vars->scene04_ladder->_ladder_field_20, y + g_vars->scene04_ladder->_ladder_field_24, 0, 0); + g_vars->scene04_ladder->startMove(g_fp->_aniMan, x + g_vars->scene04_ladder->_ladder_field_20, y + g_vars->scene04_ladder->_ladder_field_24, 0, 0); } void sceneHandler04_walkClimbLadder(ExCommand *ex) { @@ -321,7 +321,7 @@ void sceneHandler04_walkClimbLadder(ExCommand *ex) { g_vars->scene04_ladder->_ladder_field_20 = 0; g_vars->scene04_ladder->_ladder_field_24 = -60; - g_vars->scene04_ladder->addObject(g_fp->_aniMan); + g_vars->scene04_ladder->attachObject(g_fp->_aniMan); if (g_vars->scene04_soundPlaying) { g_vars->scene04_ladder->_ladmovements.front()->movVars->varUpStart = MV_MAN_STARTLADDER2; @@ -337,7 +337,7 @@ void sceneHandler04_walkClimbLadder(ExCommand *ex) { g_fp->_aniMan->_priority = 12; - getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->clearEnabled(); + getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->deactivate(); getGameLoaderInteractionController()->disableFlag24(); } @@ -368,7 +368,7 @@ void sceneHandler04_clickLadder() { } else { if (g_fp->_aniMan->isIdle() && !(g_fp->_aniMan->_flags & 0x100)) { if (abs(1095 - g_vars->scene04_dudePosX) > 1 || abs(434 - g_vars->scene04_dudePosY) > 1) { - MessageQueue *mq = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->method34(g_fp->_aniMan, 1095, 434, 1, ST_MAN_UP); + MessageQueue *mq = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->startMove(g_fp->_aniMan, 1095, 434, 1, ST_MAN_UP); if (mq) { ExCommand *ex = new ExCommand(0, 17, MSG_SC4_CLICKLADDER, 0, 0, 0, 1, 0, 0, 0); @@ -533,7 +533,7 @@ void sceneHandler04_manFromBottle() { g_vars->scene04_ladder = 0; - getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->setEnabled(); + getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->activate(); getGameLoaderInteractionController()->enableFlag24(); } @@ -1120,7 +1120,7 @@ void sceneHandler04_leaveLadder(ExCommand *ex) { ex->_messageKind = 0; - mc->setEnabled(); + mc->activate(); getGameLoaderInteractionController()->enableFlag24(); } else { delete mq; @@ -1275,7 +1275,7 @@ void sceneHandler04_winArcade() { g_vars->scene04_objectIsTaken = false; g_vars->scene04_soundPlaying = false; - getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->setEnabled(); + getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->activate(); getGameLoaderInteractionController()->enableFlag24(); diff --git a/engines/fullpipe/scenes/scene06.cpp b/engines/fullpipe/scenes/scene06.cpp index 06ec20dcb5..e9cecc42f0 100644 --- a/engines/fullpipe/scenes/scene06.cpp +++ b/engines/fullpipe/scenes/scene06.cpp @@ -118,7 +118,7 @@ void sceneHandler06_winArcade() { sceneHandler06_setExits(g_fp->_currentScene); - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); } @@ -300,7 +300,7 @@ void sceneHandler06_startAiming() { if (getCurrSceneSc2MotionController()->_isEnabled) g_fp->_updateScreenCallback = sceneHandler06_updateScreenCallback; - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); g_vars->scene06_ballDrop->queueMessageQueue(0); @@ -313,7 +313,7 @@ void sceneHandler06_takeBall() { || abs(452 - g_fp->_aniMan->_oy) > 1 || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != (0x4000 | ST_MAN_RIGHT)) { - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 1158, 452, 1, (0x4000 | ST_MAN_RIGHT)); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 1158, 452, 1, (0x4000 | ST_MAN_RIGHT)); if (mq) { ExCommand *ex = new ExCommand(0, 17, MSG_SC6_TAKEBALL, 0, 0, 0, 1, 0, 0, 0); @@ -562,7 +562,7 @@ int sceneHandler06(ExCommand *ex) { case MSG_SC6_RESTORESCROLL: g_fp->_aniMan2 = g_fp->_aniMan; - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); sceneHandler06_setExits(g_fp->_currentScene); break; diff --git a/engines/fullpipe/scenes/scene08.cpp b/engines/fullpipe/scenes/scene08.cpp index a5f5a8b389..d64df8688e 100644 --- a/engines/fullpipe/scenes/scene08.cpp +++ b/engines/fullpipe/scenes/scene08.cpp @@ -224,7 +224,7 @@ void sceneHandler08_startArcade() { g_vars->scene08_onBelly = false; getGameLoaderInteractionController()->disableFlag24(); - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); g_vars->scene08_batuta->stopAnim_maybe(); @@ -276,7 +276,7 @@ void sceneHandler08_finishArcade() { g_vars->scene08_inArcade = false; getGameLoaderInteractionController()->enableFlag24(); - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); } void sceneHandler08_jumpOff(ExCommand *cmd) { diff --git a/engines/fullpipe/scenes/scene09.cpp b/engines/fullpipe/scenes/scene09.cpp index 99cf0b20fd..ffe8a1b2de 100644 --- a/engines/fullpipe/scenes/scene09.cpp +++ b/engines/fullpipe/scenes/scene09.cpp @@ -271,7 +271,7 @@ void sceneHandler09_spitterClick() { g_vars->scene09_spitter->setPicAniInfo(&info); if (ABS(x - g_fp->_aniMan->_ox) > 1 || ABS(y - g_fp->_aniMan->_oy) > 1) { - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, x, y, 1, ST_MAN_UP); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, x, y, 1, ST_MAN_UP); if (mq) { ExCommand *ex = new ExCommand(0, 17, MSG_SC9_PLVCLICK, 0, 0, 0, 1, 0, 0, 0); @@ -602,14 +602,14 @@ int sceneHandler09(ExCommand *cmd) { break; case MSG_SC9_FROMLADDER: - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); g_vars->scene09_dudeIsOnLadder = false; break; case MSG_SC9_TOLADDER: - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); g_vars->scene09_dudeIsOnLadder = true; diff --git a/engines/fullpipe/scenes/scene10.cpp b/engines/fullpipe/scenes/scene10.cpp index 8c9e0b67d0..3e2a918b64 100644 --- a/engines/fullpipe/scenes/scene10.cpp +++ b/engines/fullpipe/scenes/scene10.cpp @@ -82,7 +82,7 @@ void sceneHandler10_clickGum() { int y = g_vars->scene10_gum->_oy - 48; if (abs(x - g_fp->_aniMan->_ox) > 1 || abs(y - g_fp->_aniMan->_oy) > 1) { - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, x, y, 1, ST_MAN_RIGHT); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, x, y, 1, ST_MAN_RIGHT); if (mq) { ExCommand *ex = new ExCommand(0, 17, MSG_SC10_CLICKGUM, 0, 0, 0, 1, 0, 0, 0); ex->_excFlags = 2; diff --git a/engines/fullpipe/scenes/scene11.cpp b/engines/fullpipe/scenes/scene11.cpp index 0ce82f5d5f..1fa5cabc15 100644 --- a/engines/fullpipe/scenes/scene11.cpp +++ b/engines/fullpipe/scenes/scene11.cpp @@ -191,7 +191,7 @@ void sceneHandler11_restartMan() { chainObjQueue(0, QU_SC11_RESTARTMAN, 1); getGameLoaderInteractionController()->enableFlag24(); - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); g_vars->scene11_scrollIsEnabled = false; } @@ -234,7 +234,7 @@ int sceneHandler11_updateScreenCallback() { void sceneHandler11_manToSwing() { g_vars->scene11_arcadeIsOn = true; - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); g_fp->_aniMan2->hide(); @@ -271,7 +271,7 @@ void sceneHandler11_putABoot() { void sceneHandler11_putBoot() { if (abs(353 - g_fp->_aniMan->_ox) > 1 || abs(498 - g_fp->_aniMan->_oy) > 1 || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) { - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 353, 498, 1, ST_MAN_RIGHT); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 353, 498, 1, ST_MAN_RIGHT); if (mq) { ExCommand *ex = new ExCommand(0, 17, MSG_SC11_PUTBOOT, 0, 0, 0, 1, 0, 0, 0); @@ -299,7 +299,7 @@ void sceneHandler11_jumpFromSwing() { g_vars->scene11_hint->_flags &= 0xFFFB; g_vars->scene11_scrollIsEnabled = false; - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); g_vars->scene11_swingOldAngle = 0.0; diff --git a/engines/fullpipe/scenes/scene14.cpp b/engines/fullpipe/scenes/scene14.cpp index 446f477133..dc919c6d7f 100644 --- a/engines/fullpipe/scenes/scene14.cpp +++ b/engines/fullpipe/scenes/scene14.cpp @@ -174,7 +174,7 @@ void sceneHandler14_exitScene() { chainQueue(QU_SC14_ENDARCADE, 0); getGameLoaderInteractionController()->disableFlag24(); - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); } void sceneHandler14_showBallMan() { @@ -284,7 +284,7 @@ void sceneHandler14_endArcade() { setInputDisabled(0); getGameLoaderInteractionController()->enableFlag24(); - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); BehaviorEntryInfo *beh = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene14_grandma, ST_GMA_SIT, QU_GMA_BLINK); if (beh) @@ -365,7 +365,7 @@ void sceneHandler14_startArcade() { g_fp->_aniMan->_priority = 25; } - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); g_fp->_aniMan2 = 0; @@ -458,7 +458,7 @@ bool sceneHandler14_arcadeProcessClick(ExCommand *cmd) { if (cmd->_sceneClickX > 1237) return false; - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 1237, 451, 1, 0); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 1237, 451, 1, 0); if (!mq) return false; @@ -473,7 +473,7 @@ bool sceneHandler14_arcadeProcessClick(ExCommand *cmd) { cmd->_messageKind = 0; - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); return true; } diff --git a/engines/fullpipe/scenes/scene16.cpp b/engines/fullpipe/scenes/scene16.cpp index df005950d2..5079863b4e 100644 --- a/engines/fullpipe/scenes/scene16.cpp +++ b/engines/fullpipe/scenes/scene16.cpp @@ -298,7 +298,7 @@ void sceneHandler16_drink() { void sceneHandler16_mugClick() { if (abs(310 - g_fp->_aniMan->_ox) >= 1 || abs(449 - g_fp->_aniMan->_oy) >= 1 || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) { - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 310, 449, 1, ST_MAN_RIGHT); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 310, 449, 1, ST_MAN_RIGHT); if (mq) { ExCommand *ex = new ExCommand(0, 17, MSG_SC16_MUGCLICK, 0, 0, 0, 1, 0, 0, 0); diff --git a/engines/fullpipe/scenes/scene18and19.cpp b/engines/fullpipe/scenes/scene18and19.cpp index 4f6677876b..5af7ef9043 100644 --- a/engines/fullpipe/scenes/scene18and19.cpp +++ b/engines/fullpipe/scenes/scene18and19.cpp @@ -379,7 +379,7 @@ int scene19_updateCursor() { void sceneHandler18_clickBoard() { if (ABS(967 - g_fp->_aniMan->_ox) > 1 || ABS(379 - g_fp->_aniMan->_oy) > 1 || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) { - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 967, 379, 1, ST_MAN_RIGHT); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 967, 379, 1, ST_MAN_RIGHT); ExCommand *ex = new ExCommand(0, 17, MSG_SC18_MANREADY, 0, 0, 0, 1, 0, 0, 0); ex->_excFlags = 2; diff --git a/engines/fullpipe/scenes/scene22.cpp b/engines/fullpipe/scenes/scene22.cpp index 542834b51a..f51469da69 100644 --- a/engines/fullpipe/scenes/scene22.cpp +++ b/engines/fullpipe/scenes/scene22.cpp @@ -191,7 +191,7 @@ void sceneHandler22_stoolLogic(ExCommand *cmd) { xpos = 841; manId = ST_MAN_RIGHT; LABEL_31: - mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, xpos, 449, 1, manId); + mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, xpos, 449, 1, manId); if (!mq) return; @@ -278,7 +278,7 @@ void sceneHandler22_stoolLogic(ExCommand *cmd) { } } - mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 1010, 443, 1, ST_MAN_UP); + mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 1010, 443, 1, ST_MAN_UP); if (mq) { mq->addExCommandToEnd(cmd->createClone()); @@ -318,13 +318,13 @@ int sceneHandler22(ExCommand *cmd) { g_vars->scene22_dudeIsOnStool = false; g_vars->scene22_interactionIsDisabled = false; - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1); break; case MSG_SC22_ONSTOOL: g_vars->scene22_dudeIsOnStool = true; - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0); break; diff --git a/engines/fullpipe/scenes/scene23.cpp b/engines/fullpipe/scenes/scene23.cpp index ded467e438..d6075c271b 100644 --- a/engines/fullpipe/scenes/scene23.cpp +++ b/engines/fullpipe/scenes/scene23.cpp @@ -296,7 +296,7 @@ void sceneHandler23_pushButton(ExCommand *cmd) { if (g_fp->_msgX == 276 && g_fp->_msgY == 438 ) return; - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 276, 438, 1, ST_MAN_RIGHT); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 276, 438, 1, ST_MAN_RIGHT); if (mq) { mq->addExCommandToEnd(cmd->createClone()); @@ -424,7 +424,7 @@ int sceneHandler23(ExCommand *cmd) { case MSG_SC23_FROMSTOOL: g_vars->scene23_isOnStool = false; - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1); @@ -438,7 +438,7 @@ int sceneHandler23(ExCommand *cmd) { case MSG_SC23_ONSTOOL: g_vars->scene23_isOnStool = true; - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0); diff --git a/engines/fullpipe/scenes/scene25.cpp b/engines/fullpipe/scenes/scene25.cpp index a07330f057..07eda73cf2 100644 --- a/engines/fullpipe/scenes/scene25.cpp +++ b/engines/fullpipe/scenes/scene25.cpp @@ -153,7 +153,7 @@ void sceneHandler25_enterMan() { if (g_vars->scene25_waterIsPresent) { chainQueue(QU_SC25_ENTERUP_WATER, 1); - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); } else { chainQueue(QU_SC25_ENTERUP_FLOOR, 1); } diff --git a/engines/fullpipe/scenes/scene26.cpp b/engines/fullpipe/scenes/scene26.cpp index b9d9161e7d..baed928d00 100644 --- a/engines/fullpipe/scenes/scene26.cpp +++ b/engines/fullpipe/scenes/scene26.cpp @@ -257,7 +257,7 @@ void sceneHandler26_clickVent(StaticANIObject *ani, ExCommand *cmd) { int y = ani->_oy + 61; if (abs(x - g_fp->_aniMan->_ox) > 1 || abs(y - g_fp->_aniMan->_oy) > 1 || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_UP) { - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, x, y, 1, ST_MAN_UP); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, x, y, 1, ST_MAN_UP); if (mq) { ExCommand *ex = new ExCommand(0, 17, MSG_SC26_CLICKVENT, 0, 0, 0, 1, 0, 0, 0); diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp index 8ec05caaff..9570d30913 100644 --- a/engines/fullpipe/scenes/scene27.cpp +++ b/engines/fullpipe/scenes/scene27.cpp @@ -159,7 +159,7 @@ void sceneHandler27_driverGiveVent() { g_vars->scene27_driverHasVent = false; - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1); @@ -226,7 +226,7 @@ void sceneHandler27_throwBat() { g_fp->_aniMan->startAnim(MV_MAN27_THROWBET, 0, -1); - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0); @@ -247,7 +247,7 @@ void sceneHandler27_clickBat(ExCommand *cmd) { if (ABS(bx - g_fp->_aniMan->_ox) > 1 || ABS(by - g_fp->_aniMan->_oy) > 1 || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) { - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, bx, by, 1, ST_MAN_RIGHT); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, bx, by, 1, ST_MAN_RIGHT); if (mq) { mq->addExCommandToEnd(cmd->createClone()); @@ -501,7 +501,7 @@ void sceneHandler27_batLogic() { default: chainQueue(QU_SC27_RESTARTBETS, 1); - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1); diff --git a/engines/fullpipe/scenes/scene28.cpp b/engines/fullpipe/scenes/scene28.cpp index de5a96e70d..75ba2567b2 100644 --- a/engines/fullpipe/scenes/scene28.cpp +++ b/engines/fullpipe/scenes/scene28.cpp @@ -258,7 +258,7 @@ void sceneHandler28_clickLift(int keycode) { if (abs(x - g_fp->_aniMan->_ox) > 1 || abs(472 - g_fp->_aniMan->_oy) > 1 || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_UP) { - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, x, 472, 1, ST_MAN_UP); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, x, 472, 1, ST_MAN_UP); if (mq) { ExCommand *ex = new ExCommand(0, 17, MSG_SC28_CLICKLIFT, 0, 0, 0, 1, 0, 0, 0); ex->_excFlags |= 3; diff --git a/engines/fullpipe/scenes/scene29.cpp b/engines/fullpipe/scenes/scene29.cpp index 222a541554..a03671a4d0 100644 --- a/engines/fullpipe/scenes/scene29.cpp +++ b/engines/fullpipe/scenes/scene29.cpp @@ -687,7 +687,7 @@ void sceneHandler29_ballHitCheck() { void sceneHandler29_manFromL() { if (g_vars->scene29_manX < 497 && !g_vars->scene29_scrollingDisabled) { - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT | 0x4000); @@ -700,7 +700,7 @@ void sceneHandler29_manFromL() { } void sceneHandler29_manFromR() { - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); chainQueue(QU_SC29_MANFROM_R, 1); @@ -721,7 +721,7 @@ int sceneHandler29_updateScreenCallback() { } void sceneHandler29_manToL() { - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); chainQueue(QU_SC29_MANTO_L, 1); @@ -737,7 +737,7 @@ void sceneHandler29_manToL() { } void sceneHandler29_manToR() { - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); chainQueue(QU_SC29_MANTO_R, 1); @@ -763,7 +763,7 @@ void sceneHandler29_clickPorter(ExCommand *cmd) { if (ABS(351 - g_vars->scene29_manX) > 1 || ABS(443 - g_vars->scene29_manY) > 1 || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) { if (g_fp->_msgX != 351 || g_fp->_msgY != 443) { - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 351, 443, 1, ST_MAN_RIGHT); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 351, 443, 1, ST_MAN_RIGHT); if (mq) { mq->addExCommandToEnd(cmd->createClone()); @@ -781,7 +781,7 @@ void sceneHandler29_clickPorter(ExCommand *cmd) { if (ABS(1582 - g_vars->scene29_manX) > 1 || ABS(445 - g_fp->_aniMan->_oy) > 1 || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != (0x4000 | ST_MAN_RIGHT)) { if (g_fp->_msgX != 1582 || g_fp->_msgY != 445) { - MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 1582, 445, 1, (0x4000 | ST_MAN_RIGHT)); + MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 1582, 445, 1, (0x4000 | ST_MAN_RIGHT)); if (mq) { mq->addExCommandToEnd(cmd->createClone()); @@ -1001,7 +1001,7 @@ int sceneHandler29(ExCommand *cmd) { g_vars->scene29_reachedFarRight = false; g_vars->scene29_rideBackEnabled = false; - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); break; diff --git a/engines/fullpipe/scenes/scene32.cpp b/engines/fullpipe/scenes/scene32.cpp index 9279db7513..05b78efb3d 100644 --- a/engines/fullpipe/scenes/scene32.cpp +++ b/engines/fullpipe/scenes/scene32.cpp @@ -189,7 +189,7 @@ void sceneHandler32_trySit(ExCommand *cmd) { g_vars->scene32_dudeIsSitting = true; - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); } } @@ -236,7 +236,7 @@ void sceneHandler32_ladderLogic(ExCommand *cmd) { g_vars->scene32_dudeOnLadder = false; - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); } @@ -258,7 +258,7 @@ void sceneHandler32_potLogic(ExCommand *cmd) { mq->setFlags(mq->getFlags() | 1); mq->chain(0); - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); g_vars->scene32_dudeIsSitting = false; @@ -330,7 +330,7 @@ int sceneHandler32(ExCommand *cmd) { case MSG_SC32_ONLADDER: g_vars->scene32_dudeOnLadder = true; - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); break; diff --git a/engines/fullpipe/scenes/scene34.cpp b/engines/fullpipe/scenes/scene34.cpp index 1c8c8b4855..32fb192756 100644 --- a/engines/fullpipe/scenes/scene34.cpp +++ b/engines/fullpipe/scenes/scene34.cpp @@ -115,7 +115,7 @@ int scene34_updateCursor() { } void sceneHandler34_leaveBoard() { - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1); @@ -124,7 +124,7 @@ void sceneHandler34_leaveBoard() { } void sceneHandler34_onBoard() { - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0); @@ -149,7 +149,7 @@ void sceneHandler34_hideStool() { } void sceneHandler34_climb() { - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0); @@ -287,7 +287,7 @@ void sceneHandler34_showStool() { } void sceneHandler34_unclimb() { - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1); @@ -323,7 +323,7 @@ int sceneHandler34(ExCommand *cmd) { case MSG_SC34_FROMCACTUS: g_vars->scene34_dudeOnCactus = false; - getCurrSceneSc2MotionController()->setEnabled(); + getCurrSceneSc2MotionController()->activate(); getGameLoaderInteractionController()->enableFlag24(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1); @@ -381,7 +381,7 @@ int sceneHandler34(ExCommand *cmd) { case MSG_SC34_ONCACTUS: g_vars->scene34_dudeOnCactus = true; - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0); diff --git a/engines/fullpipe/scenes/sceneFinal.cpp b/engines/fullpipe/scenes/sceneFinal.cpp index d0040463ef..8b3ecb1025 100644 --- a/engines/fullpipe/scenes/sceneFinal.cpp +++ b/engines/fullpipe/scenes/sceneFinal.cpp @@ -97,7 +97,7 @@ void sceneHandlerFinal_goto2() { void sceneHandlerFinal_startFinal() { g_vars->sceneFinal_var01 = 1; - getCurrSceneSc2MotionController()->clearEnabled(); + getCurrSceneSc2MotionController()->deactivate(); getGameLoaderInteractionController()->disableFlag24(); g_fp->_aniMan2 = 0; diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp index 6911041e58..826f175d47 100644 --- a/engines/neverhood/menumodule.cpp +++ b/engines/neverhood/menumodule.cpp @@ -93,6 +93,10 @@ void MenuModule::setLoadgameInfo(uint index) { _savegameSlot = (*_savegameList)[index].slotNum; } +void MenuModule::setLoadgameSlot(int slot) { + _savegameSlot = slot; +} + void MenuModule::setSavegameInfo(const Common::String &description, uint index, bool newSavegame) { _savegameDescription = description; _savegameSlot = newSavegame ? -1 : (*_savegameList)[index].slotNum; @@ -912,7 +916,7 @@ GameStateMenu::GameStateMenu(NeverhoodEngine *vm, Module *parentModule, Savegame if (slot >= 0) { if (!isSave) { - ((MenuModule*)_parentModule)->setLoadgameInfo(slot); + ((MenuModule*)_parentModule)->setLoadgameSlot(slot); } else { ((MenuModule*)_parentModule)->setSavegameInfo(saveDesc, slot, slot >= saveCount); diff --git a/engines/neverhood/menumodule.h b/engines/neverhood/menumodule.h index 6508ccbdf2..1c4ade2369 100644 --- a/engines/neverhood/menumodule.h +++ b/engines/neverhood/menumodule.h @@ -43,6 +43,7 @@ public: MenuModule(NeverhoodEngine *vm, Module *parentModule, int which); virtual ~MenuModule(); void setLoadgameInfo(uint index); + void setLoadgameSlot(int slot); void setSavegameInfo(const Common::String &description, uint index, bool newSavegame); void setDeletegameInfo(uint index); void refreshSaveGameList(); diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 55305c4b42..ffbe3aecaf 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -4185,7 +4185,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { FANMADE_L("Grostesteing: Plus Mechant que Jamais", "ec9a97ccb134f69249f6ea8b16c13d8e", 1500, "b869f5f11bfe2ab5f67f4f0c618f2ce1", 464657, Common::FR_FRA), // FIXME: Accent FANMADE("Humanoid Demo", "97d8331293a6d57e8bad58c1efc89a63", 624, "fb354b9abe64011b12159e45d724633f", 452320), FANMADE("Island of Secrets Demo 0.3", "61279176c3e4530fec9b578877aecda7", 504, "7f4ed7a81b86bea22c62bc98e6d9ec39", 197790), - FANMADE("Jim’s Quest 1: The Phantom Thesis", "0af50be1d3f0cb77a09137709a76ef4f", 960, "9c042c136548b20d9183495668e03526", 496446), + FANMADE("Jim's Quest 1: The Phantom Thesis", "0af50be1d3f0cb77a09137709a76ef4f", 960, "9c042c136548b20d9183495668e03526", 496446), FANMADE("King's Quest II SCI Pre-Alpha Version", "cdea1c081022e7697a1afffb1d2f9f6a", 2646, "fb2ce39002c3e05f3d83533638dea105", 2310356), FANMADE("Knight's Quest Demo 1.0", "5e816edf993956752ed06fccfeeae6d9", 1260, "959321f88a22905fa1f8c6d897874744", 703836), FANMADE("LockerGnome Quest", "3eeff9130206cad0c4e1551e2b9dd2c5", 420, "ae05ca90806fd90cc43f147c82d3547c", 158906), diff --git a/engines/scumm/POTFILES b/engines/scumm/POTFILES index 6d10537d3c..246f14d3f0 100644 --- a/engines/scumm/POTFILES +++ b/engines/scumm/POTFILES @@ -1,5 +1,6 @@ engines/scumm/dialogs.cpp engines/scumm/help.cpp +engines/scumm/input.cpp engines/scumm/scumm.cpp engines/scumm/players/player_v3m.cpp engines/scumm/players/player_v5m.cpp diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index 86048af57c..3ce053f6bc 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -23,6 +23,7 @@ #include "common/config-manager.h" #include "common/events.h" #include "common/system.h" +#include "common/translation.h" #include "gui/message.h" #include "gui/gui-manager.h" @@ -568,9 +569,9 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) { lastKeyHit.hasFlags(Common::KBD_CTRL)) { _snapScroll ^= 1; if (_snapScroll) { - messageDialog("Snap scroll on"); + messageDialog(_("Snap scroll on")); } else { - messageDialog("Snap scroll off"); + messageDialog(_("Snap scroll off")); } if (VAR_CAMERA_FAST_X != 0xFF) @@ -583,7 +584,7 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) { vol--; // Display the music volume - ValueDisplayDialog dlg("Music volume: ", 0, 16, vol, ']', '['); + ValueDisplayDialog dlg(_("Music volume: "), 0, 16, vol, ']', '['); vol = runDialog(dlg); vol *= 16; @@ -600,7 +601,7 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) { _defaultTalkDelay++; // Display the talk speed - ValueDisplayDialog dlg("Subtitle speed: ", 0, 9, 9 - _defaultTalkDelay, '+', '-'); + ValueDisplayDialog dlg(_("Subtitle speed: "), 0, 9, 9 - _defaultTalkDelay, '+', '-'); _defaultTalkDelay = 9 - runDialog(dlg); // Save the new talkspeed value to ConfMan diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h index a836cf12bc..c85073b877 100644 --- a/engines/scumm/scumm-md5.h +++ b/engines/scumm/scumm-md5.h @@ -1,5 +1,5 @@ /* - This file was generated by the md5table tool on Sun Jun 28 03:19:52 2015 + This file was generated by the md5table tool on Thu Aug 27 23:44:49 2015 DO NOT EDIT MANUALLY! */ @@ -288,6 +288,7 @@ static const MD5Table md5table[] = { { "62b8c16b6db226ba95aaa8be73f9885c", "indy3", "EGA", "EGA", -1, Common::ES_ESP, Common::kPlatformAmiga }, { "632d2fddb8ba97723fa15334763ae857", "thinker1", "", "", 33270, Common::EN_ANY, Common::kPlatformWindows }, { "63fdcdc95cdeea00060883aed38e5504", "PuttTime", "HE 85", "", -1, Common::EN_ANY, Common::kPlatformUnknown }, + { "64a22be96d679018696e5c8d3ca8b71d", "freddi", "HE 73", "", 26375, Common::JA_JPN, Common::kPlatformWindows }, { "6508fd55530e6915507e1cc37f7f045d", "indy3", "EGA", "EGA", -1, Common::EN_ANY, Common::kPlatformDOS }, { "65563295c3a06493351870f20a1630cf", "spyozon", "HE CUP", "Preview", 5235008, Common::UNK_LANG, Common::kPlatformUnknown }, { "659942b9a6b519f123a13cca3c333a13", "jungle", "", "", -1, Common::EN_ANY, Common::kPlatformMacintosh }, diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp index c6a223b6d9..4b0b7dfb3f 100644 --- a/engines/sherlock/events.cpp +++ b/engines/sherlock/events.cpp @@ -263,6 +263,10 @@ void Events::setFrameRate(int newRate) { _frameRate = newRate; } +void Events::toggleSpeed() { + _frameRate = (_frameRate == GAME_FRAME_RATE) ? GAME_FRAME_RATE * 2 : GAME_FRAME_RATE; +} + bool Events::checkForNextFrameCounter() { // Check for next game frame uint32 milli = g_system->getMillis(); @@ -346,7 +350,8 @@ bool Events::delay(uint32 time, bool interruptable) { g_system->delayMillis(time); bool result = !(interruptable && (kbHit() || _pressed || _vm->shouldQuit())); - clearEvents(); + if (interruptable) + clearEvents(); return result; } else { // For long periods go into a loop where we delay by 10ms at a time and then diff --git a/engines/sherlock/events.h b/engines/sherlock/events.h index e13ef18822..711804dfdf 100644 --- a/engines/sherlock/events.h +++ b/engines/sherlock/events.h @@ -149,6 +149,11 @@ public: void setFrameRate(int newRate); /** + * Toggle between standard game speed and an "extra fast" mode + */ + void toggleSpeed(); + + /** * Return the current game frame number */ uint32 getFrameCounter() const { return _frameCounter; } diff --git a/engines/sherlock/image_file.cpp b/engines/sherlock/image_file.cpp index 1a1f295c5c..971980a2ac 100644 --- a/engines/sherlock/image_file.cpp +++ b/engines/sherlock/image_file.cpp @@ -1049,10 +1049,12 @@ void StreamingImageFile::close() { _stream = nullptr; _frameNumber = -1; _active = false; + _imageFrame._frame.free(); } bool StreamingImageFile::getNextFrame() { // Don't proceed if we're already at the end of the stream + assert(_stream); if (_stream->pos() >= _stream->size()) { _active = false; return false; @@ -1079,6 +1081,9 @@ bool StreamingImageFile::getNextFrame() { _imageFrame._size = frameStream->readUint16LE() - 11; _imageFrame._rleMarker = frameStream->readByte(); + // Free the previous frame + _imageFrame._frame.free(); + // Decode the frame if (_compressed) { delete frameStream; diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp index 7ab5cd4b4f..8b8f359de3 100644 --- a/engines/sherlock/music.cpp +++ b/engines/sherlock/music.cpp @@ -225,6 +225,7 @@ Music::Music(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) { _musicOn = false; _midiOption = false; _musicVolume = 0; + _midiMusicData = nullptr; if (IS_3DO) { // 3DO - uses digital samples for music @@ -470,8 +471,8 @@ bool Music::playMusic(const Common::String &name) { } } + _midiMusicData = midiMusicData; _midiParser->loadMusic(midiMusicData, midiMusicDataSize); - } else { // 3DO: sample based Audio::AudioStream *musicStream; @@ -517,6 +518,8 @@ void Music::freeSong() { _midiParser->unloadMusic(); } + delete[] _midiMusicData; + _midiMusicData = nullptr; _musicPlaying = false; } diff --git a/engines/sherlock/music.h b/engines/sherlock/music.h index 72a5f48833..186e2aa2dc 100644 --- a/engines/sherlock/music.h +++ b/engines/sherlock/music.h @@ -68,6 +68,7 @@ private: MidiDriver *_midiDriver; Audio::SoundHandle _digitalMusicHandle; MusicType _musicType; + byte *_midiMusicData; /** * Play the specified music resource diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp index 093f666a46..0856c226f1 100644 --- a/engines/sherlock/objects.cpp +++ b/engines/sherlock/objects.cpp @@ -539,7 +539,7 @@ int BaseObject::checkNameForCodes(const Common::String &name, FixedTextActionId // G: Have object go somewhere // A: Add onto existing co-ordinates Common::String sx(name.c_str() + 2, name.c_str() + 5); - Common::String sy(name.c_str() + 6, name.c_str() + 9); + Common::String sy(name.c_str() + 5, name.c_str() + 8); if (ch == 'G') _position = Common::Point(atoi(sx.c_str()), atoi(sy.c_str())); diff --git a/engines/sherlock/scalpel/scalpel_scene.cpp b/engines/sherlock/scalpel/scalpel_scene.cpp index 48203d3d6a..b62703e0fb 100644 --- a/engines/sherlock/scalpel/scalpel_scene.cpp +++ b/engines/sherlock/scalpel/scalpel_scene.cpp @@ -40,6 +40,11 @@ const int FS_TRANS[8] = { /*----------------------------------------------------------------*/ +ScalpelScene::~ScalpelScene() { + for (uint idx = 0; idx < _canimShapes.size(); ++idx) + delete _canimShapes[idx]; +} + bool ScalpelScene::loadScene(const Common::String &filename) { ScalpelMap &map = *(ScalpelMap *)_vm->_map; bool result = Scene::loadScene(filename); @@ -454,12 +459,14 @@ void ScalpelScene::doBgAnim() { if (o._type == INVALID) { // Anim shape was invalidated by checkEndOfSequence, so at this point we can remove it + delete _canimShapes[idx]; _canimShapes.remove_at(idx); } else if (o._type == REMOVE) { if (_goToScene == -1) screen.slamArea(o._position.x, o._position.y, o._delta.x, o._delta.y); // Shape for an animation is no longer needed, so remove it completely + delete _canimShapes[idx]; _canimShapes.remove_at(idx); } else if (o._type == ACTIVE_BG_SHAPE) { screen.flushImage(o._imageFrame, o._position, @@ -496,7 +503,7 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) { int tpDir, walkDir; int tFrames = 0; int gotoCode = -1; - Object cObj; + Object *cObj; // Validation if (cAnimNum >= (int)_cAnim.size()) @@ -534,32 +541,33 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) { return 1; // Add new anim shape entry for displaying the animation - _canimShapes.push_back(&cObj); + cObj = new Object(); + _canimShapes.push_back(cObj); // Copy the canimation into the bgShapes type canimation structure so it can be played - cObj._allow = cAnimNum + 1; // Keep track of the parent structure - cObj._name = _cAnim[cAnimNum]._name; // Copy name + cObj->_allow = cAnimNum + 1; // Keep track of the parent structure + cObj->_name = _cAnim[cAnimNum]._name; // Copy name // Remove any attempt to draw object frame if (cAnim._type == NO_SHAPE && cAnim._sequences[0] < 100) cAnim._sequences[0] = 0; - cObj._sequences = cAnim._sequences; - cObj._images = nullptr; - cObj._position = cAnim._position; - cObj._delta = Common::Point(0, 0); - cObj._type = cAnim._type; - cObj._flags = cAnim._flags; - - cObj._maxFrames = 0; - cObj._frameNumber = -1; - cObj._sequenceNumber = cAnimNum; - cObj._oldPosition = Common::Point(0, 0); - cObj._oldSize = Common::Point(0, 0); - cObj._goto = Common::Point(0, 0); - cObj._status = 0; - cObj._misc = 0; - cObj._imageFrame = nullptr; + cObj->_sequences = cAnim._sequences; + cObj->_images = nullptr; + cObj->_position = cAnim._position; + cObj->_delta = Common::Point(0, 0); + cObj->_type = cAnim._type; + cObj->_flags = cAnim._flags; + + cObj->_maxFrames = 0; + cObj->_frameNumber = -1; + cObj->_sequenceNumber = cAnimNum; + cObj->_oldPosition = Common::Point(0, 0); + cObj->_oldSize = Common::Point(0, 0); + cObj->_goto = Common::Point(0, 0); + cObj->_status = 0; + cObj->_misc = 0; + cObj->_imageFrame = nullptr; if (cAnim._name.size() > 0 && cAnim._type != NO_SHAPE) { if (tpPos.x != -1) @@ -584,25 +592,25 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) { // Now load the resource as an image if (!IS_3DO) { - cObj._images = new ImageFile(fname); + cObj->_images = new ImageFile(fname); } else { - cObj._images = new ImageFile3DO(fname, kImageFile3DOType_RoomFormat); + cObj->_images = new ImageFile3DO(fname, kImageFile3DOType_RoomFormat); } - cObj._imageFrame = &(*cObj._images)[0]; - cObj._maxFrames = cObj._images->size(); + cObj->_imageFrame = &(*cObj->_images)[0]; + cObj->_maxFrames = cObj->_images->size(); int frames = 0; if (playRate < 0) { // Reverse direction // Count number of frames - while (frames < MAX_FRAME && cObj._sequences[frames]) + while (frames < MAX_FRAME && cObj->_sequences[frames]) ++frames; } else { // Forward direction BaseObject::_countCAnimFrames = true; - while (cObj._type == ACTIVE_BG_SHAPE) { - cObj.checkObject(); + while (cObj->_type == ACTIVE_BG_SHAPE) { + cObj->checkObject(); ++frames; if (frames >= 1000) @@ -614,10 +622,10 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) { BaseObject::_countCAnimFrames = false; - cObj._type = cAnim._type; - cObj._frameNumber = -1; - cObj._position = cAnim._position; - cObj._delta = Common::Point(0, 0); + cObj->_type = cAnim._type; + cObj->_frameNumber = -1; + cObj->_position = cAnim._position; + cObj->_delta = Common::Point(0, 0); } // Return if animation has no frames in it @@ -631,7 +639,7 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) { if (playRate < 0) { // Play in reverse dir = -2; - cObj._frameNumber = frames - 3; + cObj->_frameNumber = frames - 3; } else { dir = 0; } @@ -648,14 +656,14 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) { // Repeat same frame int temp = repeat; while (--temp > 0) { - cObj._frameNumber--; + cObj->_frameNumber--; doBgAnim(); if (_vm->shouldQuit()) return 0; } - cObj._frameNumber += dir; + cObj->_frameNumber += dir; } people[HOLMES]._type = CHARACTER; @@ -670,15 +678,15 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) { if (playRate < 0) // Reverse direction - set to end sequence - cObj._frameNumber = tFrames - 1; + cObj->_frameNumber = tFrames - 1; - if (cObj._frameNumber <= 26) - gotoCode = cObj._sequences[cObj._frameNumber + 3]; + if (cObj->_frameNumber <= 26) + gotoCode = cObj->_sequences[cObj->_frameNumber + 3]; - // Unless anim shape has already been removed, set it to REMOVE + // Unless anim shape has already been removed, do a final check to allow it to become REMOVEd for (uint idx = 0; idx < _canimShapes.size(); ++idx) { - if (_canimShapes[idx] == &cObj) { - cObj.checkObject(); + if (_canimShapes[idx] == cObj) { + cObj->checkObject(); break; } } diff --git a/engines/sherlock/scalpel/scalpel_scene.h b/engines/sherlock/scalpel/scalpel_scene.h index 8fe3b66b38..8711fea2d0 100644 --- a/engines/sherlock/scalpel/scalpel_scene.h +++ b/engines/sherlock/scalpel/scalpel_scene.h @@ -75,6 +75,8 @@ protected: public: ScalpelScene(SherlockEngine *vm) : Scene(vm) {} + virtual ~ScalpelScene(); + /** * Draw all objects and characters. */ diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp index 375b27bfad..2c447b09ab 100644 --- a/engines/sherlock/scalpel/scalpel_talk.cpp +++ b/engines/sherlock/scalpel/scalpel_talk.cpp @@ -715,7 +715,8 @@ void ScalpelTalk::drawInterface() { screen.makeButton(Common::Rect(46, CONTROLS_Y, 273, CONTROLS_Y + 10), 160 - fixedText_PressKeyToContinueLen / 2, fixedText_PressKeyToContinue); - screen.gPrint(Common::Point(160 - fixedText_PressKeyToContinueLen / 2, CONTROLS_Y), COMMAND_FOREGROUND, fixedText_PressKeyToContinueHotkey.c_str()); + screen.gPrint(Common::Point(160 - fixedText_PressKeyToContinueLen / 2, CONTROLS_Y), COMMAND_FOREGROUND, + "%s", fixedText_PressKeyToContinueHotkey.c_str()); } } diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp index 8baf4fe7da..79d74ba999 100644 --- a/engines/sherlock/scalpel/scalpel_user_interface.cpp +++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp @@ -1946,9 +1946,8 @@ void ScalpelUserInterface::printObjectDesc(const Common::String &str, bool first screen.makeButton(Common::Rect(46, CONTROLS_Y, 272, CONTROLS_Y + 10), (SHERLOCK_SCREEN_WIDTH - fixedText_PressKeyForMoreLen) / 2, fixedText_PressKeyForMore); - screen.gPrint(Common::Point((SHERLOCK_SCREEN_WIDTH - - fixedText_PressKeyForMoreLen) / 2, CONTROLS_Y), - COMMAND_FOREGROUND, fixedText_PressKeyForMoreHotkey.c_str()); + screen.gPrint(Common::Point((SHERLOCK_SCREEN_WIDTH - fixedText_PressKeyForMoreLen) / 2, CONTROLS_Y), + COMMAND_FOREGROUND, "%s", fixedText_PressKeyForMoreHotkey.c_str()); _descStr = msgP; } else { Common::String fixedText_PressKeyToContinue = fixedText.getText(kFixedText_PressKey_ToContinue); @@ -1958,9 +1957,8 @@ void ScalpelUserInterface::printObjectDesc(const Common::String &str, bool first screen.makeButton(Common::Rect(46, CONTROLS_Y, 272, CONTROLS_Y + 10), (SHERLOCK_SCREEN_WIDTH - fixedText_PressKeyToContinueLen) / 2, fixedText_PressKeyToContinue); - screen.gPrint(Common::Point((SHERLOCK_SCREEN_WIDTH - - fixedText_PressKeyToContinueLen) / 2, CONTROLS_Y), - COMMAND_FOREGROUND, fixedText_PressKeyToContinueHotkey.c_str()); + screen.gPrint(Common::Point((SHERLOCK_SCREEN_WIDTH - fixedText_PressKeyToContinueLen) / 2, CONTROLS_Y), + COMMAND_FOREGROUND, "%s", fixedText_PressKeyToContinueHotkey.c_str()); _descStr = ""; } diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp index c86282fe0e..6f9ef179a3 100644 --- a/engines/sherlock/scene.cpp +++ b/engines/sherlock/scene.cpp @@ -216,7 +216,6 @@ Scene::Scene(SherlockEngine *vm): _vm(vm) { _currentScene = -1; _goToScene = -1; - _loadingSavedGame = false; _walkedInScene = false; _version = 0; _compressed = false; @@ -274,6 +273,8 @@ void Scene::selectScene() { } void Scene::freeScene() { + SaveManager &saves = *_vm->_saves; + if (_currentScene == -1) return; @@ -284,10 +285,8 @@ void Scene::freeScene() { _vm->_music->freeSong(); _vm->_sound->freeLoadedSounds(); - if (!_loadingSavedGame) + if (!saves._justLoaded) saveSceneStatus(); - else - _loadingSavedGame = false; _sequenceBuffer.clear(); _descText.clear(); @@ -1390,7 +1389,6 @@ void Scene::synchronize(Serializer &s) { s.syncAsSint16LE(_currentScene); } else { s.syncAsSint16LE(_goToScene); - _loadingSavedGame = true; } for (int sceneNum = 1; sceneNum < SCENES_COUNT; ++sceneNum) { diff --git a/engines/sherlock/scene.h b/engines/sherlock/scene.h index 3e3bed6f96..f7aa39fd41 100644 --- a/engines/sherlock/scene.h +++ b/engines/sherlock/scene.h @@ -145,8 +145,6 @@ public: class Scene { private: - bool _loadingSavedGame; - /** * Loads sounds for the scene */ diff --git a/engines/sherlock/sound.cpp b/engines/sherlock/sound.cpp index 36ca67b323..56ac2a5d9a 100644 --- a/engines/sherlock/sound.cpp +++ b/engines/sherlock/sound.cpp @@ -251,7 +251,7 @@ void Sound::playSpeech(const Common::String &name) { if (IS_SERRATED_SCALPEL) { Common::String filename = formFilename(name); - if (playSoundResource(filename, nullptr, Audio::Mixer::kSFXSoundType, _speechHandle)) + if (playSoundResource(filename, Common::String(), Audio::Mixer::kSFXSoundType, _speechHandle)) _speechPlaying = true; } else { // Figure out which speech library to use diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index 795c4eb9c7..e9c52276f6 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -575,6 +575,7 @@ void Talk::loadTalkFile(const Common::String &filename) { _converseNum = res.resourceIndex(); talkStream->skip(2); // Skip talk file version num + _statements.clear(); _statements.resize(talkStream->readByte()); for (uint idx = 0; idx < _statements.size(); ++idx) _statements[idx].load(*talkStream, IS_ROSE_TATTOO); @@ -1195,7 +1196,7 @@ void Talk::talkWait(const byte *&str) { _endStr = true; // If a key was pressed to finish the window, see if further voice files should be skipped - if (_wait >= 0 && _wait < 254) { + if (IS_SERRATED_SCALPEL && _wait >= 0 && _wait < 254) { if (str[0] == _opcodes[OP_SFX_COMMAND]) str += 9; } diff --git a/engines/sherlock/tattoo/tattoo_darts.cpp b/engines/sherlock/tattoo/tattoo_darts.cpp index 6d6c74dcf6..274d80e3e1 100644 --- a/engines/sherlock/tattoo/tattoo_darts.cpp +++ b/engines/sherlock/tattoo/tattoo_darts.cpp @@ -30,7 +30,8 @@ namespace Tattoo { enum { DART_COLOR_FORE = 5, - PLAYER_COLOR = 11 + PLAYER_COLOR = 11, + DART_BAR_FORE = 208 }; static const int STATUS_INFO_X = 430; @@ -89,6 +90,7 @@ void Darts::playDarts(GameType gameType) { // Load dart graphics and initialize values loadDarts(); initDarts(); + events.hideCursor(); while (!done && !_vm->shouldQuit()) { int roundStart, score; @@ -415,7 +417,7 @@ void Darts::erasePowerBars() { bool Darts::dartHit() { Events &events = *_vm->_events; - events.pollEventsAndWait(); + events.pollEvents(); events.setButtonState(); // Keyboard check @@ -440,10 +442,7 @@ int Darts::doPowerBar(const Common::Point &pt, byte color, int goToPower, int or events.clearEvents(); events.delay(100); - while (!_vm->shouldQuit()) { - if (idx >= DART_BAR_SIZE) - break; - + while (!_vm->shouldQuit() && idx < DART_BAR_SIZE) { if ((goToPower - 1) == idx) break; else if (goToPower == 0) { @@ -491,11 +490,8 @@ int Darts::drawHand(int goToPower, int computer) { Common::Point pt(DARTBOARD_LEFT - HAND_OFFSET[hand], SHERLOCK_SCREEN_HEIGHT - _handSize.y); int x = 0; - while (!_vm->shouldQuit()) { - if (x >= DARTBOARD_WIDTH) - break; - - if ((goToPower - 1) == x) + while (!_vm->shouldQuit() && x < DARTBOARD_WIDTH) { + if (computer && x >= (goToPower - 1)) break; else if (goToPower == 0) { if (dartHit()) @@ -560,7 +556,6 @@ void Darts::drawDartThrow(const Common::Point &dartPos, int computer) { Events &events = *_vm->_events; Screen &screen = *_vm->_screen; int cx, cy; - int drawX = 0, drawY = 0, oldDrawX = 0, oldDrawY = 0; int xSize = 0, ySize = 0, oldxSize = 0, oldySize = 0; int handOCx = 0, handOCy = 0; int ocx = 0, ocy = 0; @@ -568,6 +563,7 @@ void Darts::drawDartThrow(const Common::Point &dartPos, int computer) { int delta = 9; int dartNum; int hddy; + Common::Point drawPos, oldDrawPos; // Draw the animation of the hand throwing the dart first // See which hand animation to use @@ -607,37 +603,37 @@ void Darts::drawDartThrow(const Common::Point &dartPos, int computer) { xSize = (*_dartGraphics)[dartNum]._width; ySize = (*_dartGraphics)[dartNum]._height; - ocx = drawX = cx - (*_dartGraphics)[dartNum]._width / 2; - ocy = drawY = cy - (*_dartGraphics)[dartNum]._height; + ocx = drawPos.x = cx - (*_dartGraphics)[dartNum]._width / 2; + ocy = drawPos.y = cy - (*_dartGraphics)[dartNum]._height; // Draw dart - screen._backBuffer1.transBlitFrom((*_dartGraphics)[dartNum], dartPos); + screen._backBuffer1.transBlitFrom((*_dartGraphics)[dartNum], drawPos); - if (drawX < 0) { - xSize += drawX; + if (drawPos.x < 0) { + xSize += drawPos.x; if (xSize < 0) xSize = 1; - drawX = 0; + drawPos.x = 0; } - if (drawY < 0) { - ySize += drawY; + if (drawPos.y < 0) { + ySize += drawPos.y; if (ySize < 0) ySize = 1; - drawY = 0; + drawPos.y = 0; } // Flush the drawn dart to the screen - screen.slamArea(drawX, drawY, xSize, ySize); - if (oldDrawX != -1) + screen.slamArea(drawPos.x, drawPos.y, xSize, ySize); + if (oldDrawPos.x != -1) // Flush the erased dart area - screen.slamArea(oldDrawX, oldDrawY, oldxSize, oldySize); + screen.slamArea(oldDrawPos.x, oldDrawPos.y, oldxSize, oldySize); - screen._backBuffer1.blitFrom(screen._backBuffer2, Common::Point(drawX, drawY), - Common::Rect(drawX, drawY, drawX + xSize, drawY + ySize)); + screen._backBuffer1.blitFrom(screen._backBuffer2, Common::Point(drawPos.x, drawPos.y), + Common::Rect(drawPos.x, drawPos.y, drawPos.x + xSize, drawPos.y + ySize)); - oldDrawX = drawX; - oldDrawY = drawY; + oldDrawPos.x = drawPos.x; + oldDrawPos.y = drawPos.y; oldxSize = xSize; oldySize = ySize; @@ -651,15 +647,15 @@ void Darts::drawDartThrow(const Common::Point &dartPos, int computer) { screen.slamArea(handOCx, handOCy, handOldxSize, handOldySize); // Erase the old dart - if (oldDrawX != -1) - screen.slamArea(oldDrawX, oldDrawY, oldxSize, oldySize); + if (oldDrawPos.x != -1) + screen.slamArea(oldDrawPos.x, oldDrawPos.y, oldxSize, oldySize); - screen._backBuffer1.blitFrom(screen._backBuffer2, Common::Point(drawX, drawY), - Common::Rect(drawX, drawY, drawX + xSize, drawY + ySize)); + screen._backBuffer1.blitFrom(screen._backBuffer2, Common::Point(drawPos.x, drawPos.y), + Common::Rect(drawPos.x, drawPos.y, drawPos.x + xSize, drawPos.y + ySize)); cx = dartPos.x; cy = dartPos.y + 2; - oldDrawX = oldDrawY = -1; + oldDrawPos.x = oldDrawPos.y = -1; for (int idx = 5; idx <= 23; ++idx) { dartNum = idx - 4; @@ -677,38 +673,37 @@ void Darts::drawDartThrow(const Common::Point &dartPos, int computer) { xSize = (*_dartGraphics)[dartNum]._width; ySize = (*_dartGraphics)[dartNum]._height; - ocx = drawX = cx - (*_dartGraphics)[dartNum]._width / 2; - ocy = drawY = cy - (*_dartGraphics)[dartNum]._height; + ocx = drawPos.x = cx - (*_dartGraphics)[dartNum]._width / 2; + ocy = drawPos.y = cy - (*_dartGraphics)[dartNum]._height; - screen._backBuffer1.transBlitFrom((*_dartGraphics)[dartNum], Common::Point(drawX, drawY)); + screen._backBuffer1.transBlitFrom((*_dartGraphics)[dartNum], Common::Point(drawPos.x, drawPos.y)); - if (drawX < 0) { - xSize += drawX; + if (drawPos.x < 0) { + xSize += drawPos.x; if (xSize < 0) xSize = 1; - drawX = 0; + drawPos.x = 0; } - if (drawY < 0) { - ySize += drawY; + if (drawPos.y < 0) { + ySize += drawPos.y; if (ySize < 0) ySize = 1; - drawY = 0; + drawPos.y = 0; } // flush the dart - screen.slamArea(drawX, drawY, xSize, ySize); - if (oldDrawX != -1) - screen.slamArea(oldDrawX, oldDrawY, oldxSize, oldySize); + screen.slamArea(drawPos.x, drawPos.y, xSize, ySize); + if (oldDrawPos.x != -1) + screen.slamArea(oldDrawPos.x, oldDrawPos.y, oldxSize, oldySize); if (idx != 23) - screen._backBuffer1.blitFrom(screen._backBuffer2, Common::Point(drawX, drawY), - Common::Rect(drawX, drawY, drawX + xSize, drawY + ySize)); // erase dart + screen._backBuffer1.blitFrom(screen._backBuffer2, drawPos, + Common::Rect(drawPos.x, drawPos.y, drawPos.x + xSize, drawPos.y + ySize)); // erase dart events.wait(1); - oldDrawX = drawX; - oldDrawY = drawY; + oldDrawPos = drawPos; oldxSize = xSize; oldySize = ySize; } @@ -903,7 +898,7 @@ int Darts::throwDart(int dartNum, int computer) { if (!computer) { // Wait for a hit while (!dartHit() && !_vm->shouldQuit()) - ; + events.wait(1); if (_escapePressed) return 0; } else { @@ -927,7 +922,7 @@ int Darts::throwDart(int dartNum, int computer) { if (_escapePressed) return 0; - height = doPowerBar(Common::Point(DART_BAR_VX, DART_HEIGHT_Y), DART_COLOR_FORE, targetPos.y, 1); + height = doPowerBar(Common::Point(DART_BAR_VX, DART_HEIGHT_Y), DART_BAR_FORE, targetPos.y, 1); if (_escapePressed) return 0; diff --git a/engines/sherlock/tattoo/tattoo_fixed_text.cpp b/engines/sherlock/tattoo/tattoo_fixed_text.cpp index 571a697153..8475870b19 100644 --- a/engines/sherlock/tattoo/tattoo_fixed_text.cpp +++ b/engines/sherlock/tattoo/tattoo_fixed_text.cpp @@ -70,9 +70,9 @@ static const char *const fixedTextEN[] = { "Holmes", "Jock", "Bull", - "Round: %d", - "Turn Total: %d", - "Dart # %d", + "Round", + "Turn Total", + "Dart", "to start", "Hit a key", "Press a key", @@ -80,8 +80,8 @@ static const char *const fixedTextEN[] = { "GAME OVER", "BUSTED", "Wins", - "Scored %d points", - "points", // ?? + "Scored", + "points", "Hit %s %d", "Double", "Triple", @@ -571,10 +571,194 @@ static const char *const fixedTextFR[] = { "Wagon Driver" }; +// small a w/ accent bottom to top : 0xA0 / octal 240 +// small i w/ accent bottom to top : 0xA1 / octal 241 +// small o w/ accent bottom to top : 0xA2 / octal 242 +// small u w/ accent bottom to top : 0xA3 / octal 243 +// small n w/ wavy line : 0xA4 / octal 244 +// inverted question mark : 0xA8 / octal 250 +static const char *const fixedTextES[] = { + "Dinero", + "Dinero", + "Tarjeta", + "Tarjeta", + "Tabaco", + "Tabaco", + "Horarios", + "Horarios", + "Mensaje", + "Mensaje", + "Papel", + "Papel", + "Papel", + "Papel", + "Linterna", + "Linterna", + + "Abrir", + "Mirar", + "Hablar", + "Usar", + "Diario", + "Inventario", + "Opciones", + "Resolver", + "con", + "Sin Efecto...", + "Esta persona no tiene nada que decir en este momento", + "Picked up", // <-- ?? + + "P\240gina %d", + "Cerrar Diario", + "Lessen", // <-- not included?!?! + "Salvar en Archivo", + "Detener B\243squeda", + "Buscar Hacia Atr\240s", + "Buscar Hacia Delante", + "Texto No Encontrado !", + + "Holmes", // + "Jock", + "Bull", + "Vuelta: %d", + "Total del Turno: %d", + "Dardo # %d", + "para empezar", + "Pulsa una tecla", + "Pulsa una tecla", + "Golpe %s ojo de buey", // ?? + "FIN DE LA PARTIDA!", + "ROTO!", + "Gana!", // "Holmes Gana!", "%s Gana!" + "Puntuado %d puntos", + "puntos", // ?? + "Golpe %s %d", + "doble", + "triple", + + "aplicar", + "Agua", + "Calentar", + "Cargar Partida", + "Salvar Partida", + "M\243sica", + "Efectos de Sonido", + "Voces", + "Ventanas de Texto", + "Men\243s Transparentes", + "Cambiar Tipo de Letra", + "Off", // ??? + "On", // ??? + "Salir", + "quieres salir?", + "\250Est s seguro de que", + "Si", + "Non", + "Introducir Palabra Clave", + "Vas al Este", // correct password, was translated in Spanish version (???) + // SH2: People names + "Sherlock Holmes", + "Dr. Watson", + "Sta. Hudson", + "Stanley Forbes", + "Mycroft Holmes", + "Wiggins", + "Agente de Polic\241a Burns", + "Augustus Trimble", + "Agente de Polic\241a Daley", + "Enfermera", + "Hermana Grace", + "Preston McCabe", + "Bob Colleran", + "Jonas Rigby", + "Agente de Polic\241a Roach", + "James Dewar", + "Sargento Jeremy Duncan", + "Inspector Gregson", + "Inspector Lestrade", + "Jesse Needhem", + "Arthur Fleming", + "Sr. Thomas Pratt", + "Mathilda (Tillie) Mason", + "Adrian Russell", + "Eldridge Whitney", + "Hepplethwaite", + "Horace Silverbridge", + "Old Sherman", + "Maxwell Verner", + "Millicent Redding", + "Virgil Silverbridge", + "George O'Keeffe", + "Lord Denys Lawton", + "Jenkins", + "Jock Mahoney", + "Camarero", + "Lady Cordelia Lockridge", + "Pettigrew", + "Sir Avery Fanshawe", + "Hodgkins", + "Wilbur \"Birdy\" Heywood", + "Jacob Farthington", + "Philip Bledsoe", + "Sidney Fowler", + "Profesor Theodore Totman", + "Rose Hinchem", + "Tallboy", + "Ethlebert \"Stitch\" Rumsey", + "Charles Freedman", + "Nigel Hemmings", + "Fairfax Carter", + "Guillermo II", + "Wachthund", + "Jonathan Wilson", + "David Lloyd-Jones", + "Edward Hargrove", + "Misteray", + "The Lascar", + "Loro", + "Vincent Scarrett", + "Alexandra", + "Reina Victoria", + "John Brown", + "Un Paciente", + "Un Paciente", + "Cliente", + "Reina Victoria", + "Paciente de blanco", + "Exuberante", + "Borracho", + "Prostituta", + "Mudlark", + "Grinder", + "Mat\242n", // sic? means block in Spanish and not bouncer?! + "Agnes Ratchet", + "Aloysius Ratchet", + "Agente de Bienes Ra\241ces", + "Candy Clerk", + "Beadle", + "Prusiano", + "Sta. Rowbottom", + "Sra. Lloyd-Jones", + "Parroquiano", + "Usuario", + "Toby", + "Papelero", + "Secretario de Justicia", + "Secreatrio del Ministerio", + "Ba\244ista", + "Criada", + "Lady Fanshawe", + "Sidney Ratchet", + "Chico", + "Patron", // ??? not found?? + "Agente Brit", + "Cochero" +}; + // TODO: There also was a Spanish version of Sherlock Holmes 2 static const FixedTextLanguageEntry fixedTextLanguages[] = { { Common::DE_DEU, fixedTextDE }, - // { Common::ES_ESP, fixedTextES }, + { Common::ES_ESP, fixedTextES }, { Common::EN_ANY, fixedTextEN }, { Common::FR_FRA, fixedTextFR }, { Common::UNK_LANG, fixedTextEN } diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp index 46d91cead8..0af8deff9f 100644 --- a/engines/sherlock/tattoo/tattoo_people.cpp +++ b/engines/sherlock/tattoo/tattoo_people.cpp @@ -121,12 +121,13 @@ TattooPerson::TattooPerson() : Person() { _lookHolmes = false; } -void TattooPerson::freeAltGraphics() { - if (_altImages != nullptr) { - delete _altImages; - _altImages = nullptr; - } +TattooPerson::~TattooPerson() { + delete _altImages; +} +void TattooPerson::freeAltGraphics() { + delete _altImages; + _altImages = nullptr; _altSeq = 0; } diff --git a/engines/sherlock/tattoo/tattoo_people.h b/engines/sherlock/tattoo/tattoo_people.h index 722c4a9aaa..e0d53c67dd 100644 --- a/engines/sherlock/tattoo/tattoo_people.h +++ b/engines/sherlock/tattoo/tattoo_people.h @@ -128,7 +128,7 @@ public: bool _lookHolmes; public: TattooPerson(); - virtual ~TattooPerson() {} + virtual ~TattooPerson(); /** * Clear the NPC related data diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp index ca536f3e64..27f37665dc 100644 --- a/engines/sherlock/tattoo/tattoo_scene.cpp +++ b/engines/sherlock/tattoo/tattoo_scene.cpp @@ -90,20 +90,25 @@ bool TattooScene::loadScene(const Common::String &filename) { } } + // Handle loading music for the scene + if (talk._scriptMoreFlag != 1 && talk._scriptMoreFlag != 3) + music._nextSongName = Common::String::format("res%02d", _currentScene); + // Set the NPC paths for the scene setNPCPath(WATSON); - // Handle loading music for the scene - if (music._musicOn) { - if (talk._scriptMoreFlag != 1 && talk._scriptMoreFlag != 3) - music._nextSongName = Common::String::format("res%02d", _currentScene); - - // If it's a new song, then start it up - if (music._currentSongName.compareToIgnoreCase(music._nextSongName)) { - if (music.loadSong(music._nextSongName)) { - if (music._musicOn) - music.startSong(); - } + // If it's a new song, then start it up + if (music._currentSongName.compareToIgnoreCase(music._nextSongName)) { + // WORKAROUND: Stop playing music after Diogenes fire scene in the intro, + // since it overlaps slightly into the next scene + if (talk._scriptName == "prol80p" && _currentScene == 80) { + music.stopMusic(); + events.wait(5); + } + + if (music.loadSong(music._nextSongName)) { + if (music._musicOn) + music.startSong(); } } @@ -655,8 +660,6 @@ int TattooScene::startCAnim(int cAnimNum, int playRate) { if (ui._windowOpen) ui.banishWindow(); - //_activeCAnim._filesize = cAnim._size; - // Open up the room resource file and get the data for the animation Common::SeekableReadStream *stream = res.load(_roomFilename); stream->seek(44 + cAnimNum * 4); @@ -692,6 +695,7 @@ int TattooScene::startCAnim(int cAnimNum, int playRate) { _goToScene = STARTING_GAME_SCENE; talk._talkToAbort = true; _activeCAnim.close(); + break; } } } @@ -718,6 +722,7 @@ int TattooScene::startCAnim(int cAnimNum, int playRate) { // Flag the Canimation to be cleared _activeCAnim._zPlacement = REMOVE; _activeCAnim._removeBounds = _activeCAnim._oldBounds; + _vm->_ui->_bgFound = -1; // Free up the animation _activeCAnim.close(); diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp index a4ceca042b..a5ada7b63e 100644 --- a/engines/sherlock/tattoo/tattoo_talk.cpp +++ b/engines/sherlock/tattoo/tattoo_talk.cpp @@ -341,6 +341,10 @@ OpcodeReturn TattooTalk::cmdNextSong(const byte *&str) { music._nextSongName += str[idx]; str += 7; + // WORKAROUND: Original game set wrong music name at the end of the introduction sequence + if (_scriptName == "prol80p" && music._nextSongName == "default") + music._nextSongName = "01cue90"; + return RET_SUCCESS; } diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp index 623fb8dbf5..ee028f89c2 100644 --- a/engines/sherlock/tattoo/tattoo_user_interface.cpp +++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp @@ -277,7 +277,7 @@ void TattooUserInterface::handleInput() { scene._goToScene = STARTING_GAME_SCENE; } else if (_menuMode == STD_MODE) { if (_keyState.keycode == Common::KEYCODE_s && vm._allowFastMode) { - vm._fastMode = !vm._fastMode; + events.toggleSpeed(); } else if (_keyState.keycode == Common::KEYCODE_l && _bgFound != -1) { // Beging used for testing that Look dialogs work @@ -375,6 +375,7 @@ void TattooUserInterface::doStandardControl() { TattooEngine &vm = *(TattooEngine *)_vm; Events &events = *_vm->_events; People &people = *_vm->_people; + SaveManager &saves = *_vm->_saves; TattooScene &scene = *(TattooScene *)_vm->_scene; Talk &talk = *_vm->_talk; Common::Point mousePos = events.mousePos(); @@ -472,6 +473,7 @@ void TattooUserInterface::doStandardControl() { if (events._rightReleased) { // Show the verbs menu for the highlighted object _tooltipWidget.banishWindow(); + saves.createThumbnail(); _verbsWidget.load(!noDesc); _verbsWidget.summonWindow(); diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp index 3555ecdffd..b49e30b30d 100644 --- a/engines/sherlock/tattoo/widget_inventory.cpp +++ b/engines/sherlock/tattoo/widget_inventory.cpp @@ -641,10 +641,12 @@ void WidgetInventory::handleEvents() { bool found = false; if (ui._bgFound != -1) { if (ui._personFound) { + Person &person = people[ui._bgFound - 1000]; + for (int idx = 0; idx < 2; ++idx) { - if (!people[ui._bgFound - 1000]._use[idx]._verb.compareToIgnoreCase(_verb) && - !people[ui._bgFound - 1000]._use[idx]._target.compareToIgnoreCase(_invTarget)) { - ui.checkAction(people[ui._bgFound - 1000]._use[idx], ui._bgFound); + if (!person._use[idx]._verb.compareToIgnoreCase(_verb) && + !person._use[idx]._target.compareToIgnoreCase(_invTarget)) { + ui.checkAction(person._use[idx], ui._bgFound); found = true; } } |