diff options
-rw-r--r-- | engines/mohawk/detection_tables.h | 17 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 10 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes3.cpp | 106 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes3.h | 12 | ||||
-rw-r--r-- | engines/tsage/core.cpp | 10 | ||||
-rw-r--r-- | engines/tsage/globals.cpp | 4 | ||||
-rw-r--r-- | engines/tsage/globals.h | 2 |
7 files changed, 97 insertions, 64 deletions
diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index a587d06760..b2c15cc4ed 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -1977,6 +1977,23 @@ static const MohawkGameDescription gameDescriptions[] = { "FIGHT.EXE" }, + // The Berenstain Bears Get in a Fight (English and Spanish) Version 1.0 1995 + // From jacecen in bug #3413119 + { + { + "bearfight", + "", + AD_ENTRY1("FIGHT.512", "e313242a4cba2fffcd8cded5ca23c68a"), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + GType_LIVINGBOOKSV1, + 0, + "FIGHT.EXE" + }, + { { "bearfight", diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index d4cff7614c..e73df69375 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -130,8 +130,14 @@ reg_t SoundCommandParser::kDoSoundPlay(int argc, reg_t *argv, reg_t acc) { void SoundCommandParser::processPlaySound(reg_t obj) { MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { - warning("kDoSound(play): Slot not found (%04x:%04x)", PRINT_REG(obj)); - return; + warning("kDoSound(play): Slot not found (%04x:%04x), initializing it manually", PRINT_REG(obj)); + // The sound hasn't been initialized for some reason, so initialize it here. + // Happens in KQ6, room 460, when giving the creature to the bookwork (the + // bookworm's child). Fixes bug #3413301. + processInitSound(obj); + musicSlot = _music->getSlot(obj); + if (!musicSlot) + error("Failed to initialize uninitialized sound slot"); } int resourceId = getSoundResourceId(obj); diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp index d204434ea3..2472d7e103 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.cpp +++ b/engines/tsage/blue_force/blueforce_scenes3.cpp @@ -1579,7 +1579,7 @@ bool Scene340::Child::startAction(CursorType action, Event &event) { SceneItem::display2(340, 14); return true; case CURSOR_TALK: - if (!BF_GLOBALS.getFlag(fBackupArrived340) || (BF_GLOBALS._v4CEB4 < 3) || !BF_GLOBALS.getFlag(fGotAllSkip340)) + if (!BF_GLOBALS.getFlag(fBackupArrived340) || (BF_GLOBALS._marinaWomanCtr < 3) || !BF_GLOBALS.getFlag(fGotAllSkip340)) scene->setAction(&scene->_action3); else scene->setAction(&scene->_action2); @@ -1604,7 +1604,7 @@ bool Scene340::Woman::startAction(CursorType action, Event &event) { SceneItem::display2(340, 13); return true; case CURSOR_TALK: - if (!BF_GLOBALS.getFlag(fBackupArrived340) || (BF_GLOBALS._v4CEB4 < 3) || !BF_GLOBALS.getFlag(fGotAllSkip340)) + if (!BF_GLOBALS.getFlag(fBackupArrived340) || (BF_GLOBALS._marinaWomanCtr < 3) || !BF_GLOBALS.getFlag(fGotAllSkip340)) scene->setAction(&scene->_action1); else scene->setAction(&scene->_action2); @@ -1618,7 +1618,7 @@ bool Scene340::Woman::startAction(CursorType action, Event &event) { } } -bool Scene340::Lyle::startAction(CursorType action, Event &event) { +bool Scene340::Harrison::startAction(CursorType action, Event &event) { Scene340 *scene = (Scene340 *)BF_GLOBALS._sceneManager._scene; switch (action) { @@ -1697,16 +1697,16 @@ void Scene340::Action1::signal() { setDelay(3); break; case 2: - if (!BF_GLOBALS._v4CEB4) { + if (!BF_GLOBALS._marinaWomanCtr) { setAction(&scene->_action8, this); } else if (!_action) { BF_GLOBALS._player.setAction(&scene->_sequenceManager1, this, - MIN(BF_GLOBALS._v4CEB4, 3) + 2340, &scene->_woman, &scene->_child, + MIN(BF_GLOBALS._marinaWomanCtr, 3) + 2340, &scene->_woman, &scene->_child, &scene->_object4, NULL); } break; case 3: - if ((BF_GLOBALS._v4CEB4 != 1) || BF_GLOBALS.getFlag(fCalledBackup)) { + if ((BF_GLOBALS._marinaWomanCtr != 1) || BF_GLOBALS.getFlag(fCalledBackup)) { setDelay(3); } else { scene->_sound1.play(8); @@ -1714,16 +1714,20 @@ void Scene340::Action1::signal() { } break; case 4: - if (BF_GLOBALS._v4CEB4 == 1) - ++BF_GLOBALS._v4CEB4; + if (BF_GLOBALS._marinaWomanCtr == 1) + ++BF_GLOBALS._marinaWomanCtr; if (BF_GLOBALS.getFlag(fBackupArrived340)) { scene->_field2654 = 1; - scene->_lyle.setPosition(Common::Point(46, 154)); + scene->_harrison.setPosition(Common::Point(46, 154)); BF_GLOBALS._walkRegions.proc1(19); } else if (BF_GLOBALS.getFlag(fCalledBackup)) { - scene->_timer1.set(40, &scene->_lyle, &scene->_action4); + scene->_timer1.set(40, &scene->_harrison, &scene->_action4); } + + ++BF_GLOBALS._marinaWomanCtr; + BF_GLOBALS._player.enableControl(); + remove(); break; } } @@ -1790,7 +1794,7 @@ void Scene340::Action4::signal() { BF_GLOBALS._player.disableControl(); setDelay(3); } else { - scene->_timer1.set(30, &scene->_lyle, &scene->_action4); + scene->_timer1.set(30, &scene->_harrison, &scene->_action4); remove(); } break; @@ -1800,7 +1804,7 @@ void Scene340::Action4::signal() { setDelay(3); break; case 2: - BF_GLOBALS._player.setAction(&scene->_sequenceManager3, this, 1347, &scene->_lyle, NULL); + BF_GLOBALS._player.setAction(&scene->_sequenceManager3, this, 1347, &scene->_harrison, NULL); break; case 3: BF_GLOBALS._walkRegions.proc1(19); @@ -1824,7 +1828,7 @@ void Scene340::Action5::signal() { } break; case 1: - BF_GLOBALS._player.updateAngle(scene->_lyle._position); + BF_GLOBALS._player.updateAngle(scene->_harrison._position); setDelay(3); break; case 2: @@ -1854,8 +1858,8 @@ void Scene340::Action6::signal() { ADD_PLAYER_MOVER(10, 110); break; case 1: - BF_GLOBALS._player.updateAngle(scene->_lyle._position); - scene->_lyle.updateAngle(BF_GLOBALS._player._position); + BF_GLOBALS._player.updateAngle(scene->_harrison._position); + scene->_harrison.updateAngle(BF_GLOBALS._player._position); scene->_stripManager.start(3415, this); break; case 2: { @@ -1879,7 +1883,7 @@ void Scene340::Action7::signal() { ADD_PLAYER_MOVER(254, 121); break; case 1: - BF_GLOBALS._player.updateAngle(scene->_lyle._position); + BF_GLOBALS._player.updateAngle(scene->_harrison._position); scene->_stripManager.start(BF_GLOBALS.getFlag(fBriefedBackup) ? 3414 : 3417, this); break; case 2: @@ -2018,7 +2022,7 @@ void Scene340::postInit(SceneObjectList *OwnerList) { _woman.setVisage(344); _woman.setStrip(3); _woman.setFrame(1); - _woman.fixPriority(120); + _woman.fixPriority(123); _woman.setPosition(Common::Point(88, 143)); _object4.postInit(); @@ -2041,29 +2045,29 @@ void Scene340::postInit(SceneObjectList *OwnerList) { } if (BF_GLOBALS.getFlag(fCalledBackup)) { - _lyle.postInit(); - _lyle.setVisage(326); - _lyle.setObjectWrapper(new SceneObjectWrapper()); - _lyle.animate(ANIM_MODE_1, NULL); - _lyle.setPosition(Common::Point(-30, 219)); - BF_GLOBALS._sceneItems.push_back(&_lyle); + _harrison.postInit(); + _harrison.setVisage(326); + _harrison.setObjectWrapper(new SceneObjectWrapper()); + _harrison.animate(ANIM_MODE_1, NULL); + _harrison.setPosition(Common::Point(-30, 219)); + BF_GLOBALS._sceneItems.push_back(&_harrison); _stripManager.addSpeaker(&_harrisonSpeaker); if (BF_GLOBALS.getFlag(fBackupIn350)) { _field2654 = 0; - _lyle.setVisage(1355); - _lyle.setPosition(Common::Point(289, 112)); - _lyle.changeAngle(225); - _lyle.setFrame(1); - _lyle.fixPriority(75); + _harrison.setVisage(1355); + _harrison.setPosition(Common::Point(289, 112)); + _harrison.changeAngle(225); + _harrison.setFrame(1); + _harrison.fixPriority(75); BF_GLOBALS._walkRegions.proc1(23); } else if (BF_GLOBALS.getFlag(fBackupArrived340)) { _field2654 = 1; - _lyle.setPosition(Common::Point(46, 154)); + _harrison.setPosition(Common::Point(46, 154)); BF_GLOBALS._walkRegions.proc1(19); - } else if (BF_GLOBALS.getFlag(fCalledBackup) && (BF_GLOBALS._v4CEB4 > 0)) { - _timer1.set(900, &_lyle, &_action4); + } else if (BF_GLOBALS.getFlag(fCalledBackup) && (BF_GLOBALS._marinaWomanCtr > 0)) { + _timer1.set(900, &_harrison, &_action4); } } @@ -2498,12 +2502,12 @@ bool Scene350::Item5::startAction(CursorType action, Event &event) { } } -void Scene350::Item6::synchronize(Serializer &s) { +void Scene350::Yacht::synchronize(Serializer &s) { NamedHotspot::synchronize(s); s.syncAsSint16LE(_flag); } -bool Scene350::Item6::startAction(CursorType action, Event &event) { +bool Scene350::Yacht::startAction(CursorType action, Event &event) { Scene350 *scene = (Scene350 *)BF_GLOBALS._sceneManager._scene; switch (action) { @@ -2538,7 +2542,7 @@ bool Scene350::SouthWestExit::startAction(CursorType action, Event &event) { scene->_sceneMode = 2; if (BF_GLOBALS.getFlag(fBackupIn350)) - scene->setAction(&scene->_sequenceManager1, scene, 3507, &BF_GLOBALS._player, &scene->_lyle, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 3507, &BF_GLOBALS._player, &scene->_harrison, NULL); else scene->setAction(&scene->_sequenceManager1, scene, 3510, &BF_GLOBALS._player, NULL); return true; @@ -2630,11 +2634,11 @@ void Scene350::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._player.animate(ANIM_MODE_1, NULL); BF_GLOBALS._player._moveDiff = Common::Point(3, 1); - _item6._flag = false; + _yacht._flag = false; _swExit.setDetails(Rect(0, 160, SCREEN_WIDTH, BF_INTERFACE_Y - 1), 350, -1, -1, -1, 1, NULL); if ((BF_GLOBALS._dayNumber != 1) && (BF_GLOBALS._dayNumber != 4)) { - _item6.setDetails(28, 350, 15, 16, 17, 1); + _yacht.setDetails(28, 350, 15, 16, 17, 1); } else { _boat.postInit(); _boat.setVisage(350); @@ -2643,32 +2647,32 @@ void Scene350::postInit(SceneObjectList *OwnerList) { _boat.fixPriority(72); _boat.setPosition(Common::Point(40, 74)); - _object3.setup(350, 1, 1, 129, 142, -1); + _yachtBody.setup(350, 1, 1, 129, 142, -1); if (BF_GLOBALS.getFlag(fBackupIn350)) { - _lyle.postInit(); - _lyle.setVisage(1355); - _lyle.setObjectWrapper(new SceneObjectWrapper()); - _lyle.animate(ANIM_MODE_1, NULL); - _lyle.changeZoom(-1); - _lyle.setDetails(350, 12, 13, 14, 1, NULL); - _lyle._moveDiff = Common::Point(2, 1); + _harrison.postInit(); + _harrison.setVisage(1355); + _harrison.setObjectWrapper(new SceneObjectWrapper()); + _harrison.animate(ANIM_MODE_1, NULL); + _harrison.changeZoom(-1); + _harrison.setDetails(350, 12, 13, 14, 1, NULL); + _harrison._moveDiff = Common::Point(2, 1); _stripManager.addSpeaker(&_harrisonSpeaker); } if (BF_GLOBALS._bookmark < bStartOfGame) { // Setup scene in debug mode - _item6.setDetails(28, 350, 6, 18, 19, 1); + _yacht.setDetails(28, 350, 6, 18, 19, 1); } else { - _item6.setDetails(28, 350, 6, BF_GLOBALS.getFlag(bStartOfGame) ? 7 : 18, 8, 1); + _yacht.setDetails(28, 350, 6, BF_GLOBALS.getFlag(bStartOfGame) ? 7 : 18, 8, 1); } } _item5._sceneRegionId = 5; BF_GLOBALS._sceneItems.push_back(&_item5); _item4.setDetails(15, 350, 0, 1, 2, 1); - BF_GLOBALS._sceneItems.push_back(&_item6); + BF_GLOBALS._sceneItems.push_back(&_yacht); _item3.setDetails(7, 350, 23, 24, 25, 1); _item2.setDetails(Rect(0, 0, SCREEN_WIDTH - 1, 31), 350, 3, 4, 5, 1, NULL); @@ -2694,7 +2698,7 @@ void Scene350::postInit(SceneObjectList *OwnerList) { BF_GLOBALS.getFlag(fBackupIn350)) { BF_GLOBALS._player.disableControl(); _sceneMode = 0; - setAction(&_sequenceManager1, this, 3509, &_lyle, NULL); + setAction(&_sequenceManager1, this, 3509, &_harrison, NULL); BF_GLOBALS._player.setAction(&_sequenceManager2, NULL, 3508, &BF_GLOBALS._player, NULL); } else { BF_GLOBALS._player.disableControl(); @@ -2743,7 +2747,7 @@ void Scene350::signal() { break; default: if (BF_GLOBALS.getFlag(fBackupIn350)) { - _lyle.updateAngle(BF_GLOBALS._player._position); + _harrison.updateAngle(BF_GLOBALS._player._position); BF_GLOBALS._walkRegions.proc1(19); } @@ -2769,7 +2773,7 @@ void Scene350::process(Event &event) { setAction(&_sequenceManager1, this, 3501, &BF_GLOBALS._player, NULL); if (BF_GLOBALS.getFlag(fBackupIn350)) - _lyle.setAction(&_sequenceManager3, NULL, 3503, &_lyle, NULL); + _harrison.setAction(&_sequenceManager3, NULL, 3503, &_harrison, NULL); } else { // Drawn the gun BF_GLOBALS._player.disableControl(); @@ -2777,7 +2781,7 @@ void Scene350::process(Event &event) { setAction(&_sequenceManager1, this, 3500, &BF_GLOBALS._player, NULL); if (BF_GLOBALS.getFlag(fBackupIn350)) - _lyle.setAction(&_sequenceManager3, NULL, 3502, &_lyle, NULL); + _harrison.setAction(&_sequenceManager3, NULL, 3502, &_harrison, NULL); BF_GLOBALS.setFlag(gunDrawn); } diff --git a/engines/tsage/blue_force/blueforce_scenes3.h b/engines/tsage/blue_force/blueforce_scenes3.h index 98c78bec91..2d3cc7a14f 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.h +++ b/engines/tsage/blue_force/blueforce_scenes3.h @@ -326,7 +326,7 @@ class Scene340: public PalettedScene { public: virtual bool startAction(CursorType action, Event &event); }; - class Lyle: public NamedObject { + class Harrison: public NamedObject { public: virtual bool startAction(CursorType action, Event &event); }; @@ -340,7 +340,7 @@ public: SequenceManager _sequenceManager1, _sequenceManager2, _sequenceManager3; Child _child; Woman _woman; - Lyle _lyle; + Harrison _harrison; SceneObject _object4, _object5; Item1 _item1; NamedHotspot _item2, _item3; @@ -436,7 +436,7 @@ class Scene350: public SceneExt { public: virtual bool startAction(CursorType action, Event &event); }; - class Item6: public NamedHotspot { + class Yacht: public NamedHotspot { public: bool _flag; @@ -466,14 +466,14 @@ class Scene350: public SceneExt { }; public: SequenceManager _sequenceManager1, _sequenceManager2, _sequenceManager3; - NamedObject _lyle; + NamedObject _harrison; SceneObject _boat; - SceneObject _object3; + SceneObject _yachtBody; Hook _hook; Object5 _object5; NamedHotspot _item1, _item2, _item3, _item4; Item5 _item5; - Item6 _item6; + Yacht _yacht; SouthWestExit _swExit; SpeakerGameText _gameTextSpeaker; SpeakerJakeUniform _jakeUniformSpeaker; diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index b81b710d8e..b8d1c8d5c4 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2227,10 +2227,13 @@ void SceneObject::checkAngle(const SceneObject *obj) { void SceneObject::checkAngle(const Common::Point &pt) { int angleAmount = GfxManager::getAngle(_position, pt); - if ((_vm->getGameID() == GType_Ringworld) || - ((angleAmount != -1) && (_animateMode == ANIM_MODE_9))) + if (angleAmount != -1) { _angle = angleAmount; + if (_animateMode == ANIM_MODE_9) + _angle = (angleAmount + 180) % 360; + } + if (_objectWrapper && (_vm->getGameID() == GType_Ringworld)) _objectWrapper->dispatch(); } @@ -3012,6 +3015,9 @@ void Player::enableControl() { } void Player::process(Event &event) { + if ((_vm->getGameID() != GType_Ringworld) && _action) + _action->process(event); + if (!event.handled && (event.eventType == EVENT_BUTTON_DOWN) && (_globals->_events.getCursor() == CURSOR_WALK) && _globals->_player._canWalk && (_position != event.mousePos) && _globals->_sceneObjects->contains(this)) { diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 5e2c51eb9a..2b37380976 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -191,7 +191,7 @@ void BlueForceGlobals::synchronize(Serializer &s) { s.syncAsSint16LE(_dayNumber); s.syncAsSint16LE(_v4CEA4); - s.syncAsSint16LE(_v4CEB4); + s.syncAsSint16LE(_marinaWomanCtr); s.syncAsSint16LE(_v4CEB6); s.syncAsSint16LE(_v4CEC2); s.syncAsSint16LE(_deziTopic); @@ -230,7 +230,7 @@ void BlueForceGlobals::reset() { _interfaceY = BF_INTERFACE_Y; _dayNumber = 0; _v4CEA4 = 0; - _v4CEB4 = 0; + _marinaWomanCtr = 0; _v4CEB6 = 0; _v4CEC2 = 0; _deziTopic = 0; diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index dc650bcec0..2c4072b042 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -169,7 +169,7 @@ public: StripProxy _stripProxy; int _dayNumber; int _v4CEA4; - int _v4CEB4; + int _marinaWomanCtr; int _v4CEB6; int _v4CEC2; int _deziTopic; |