diff options
author | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
commit | 75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (patch) | |
tree | f29541d55309487a94bd1d38e8b53bb3dde9aec6 /engines/lure | |
parent | 48ee83b88957dab86bc763e9ef21a70179fa8679 (diff) | |
parent | e9f50882ea5b6beeefa994040be9d3bab6a1f107 (diff) | |
download | scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.gz scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.bz2 scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.zip |
OPENGL: Merged from trunk, from rev 52105 to 53396.
This includes an rather hacky attempt to merge all the recent gp2x backend
changes into the branch. I suppose the gp2x backend and probably all new
backends, i.e. gph, dingux etc., might not compile anymore.
Since I have no way of testing those it would be nice if porters could look
into getting those up to speed in this branch.
svn-id: r53399
Diffstat (limited to 'engines/lure')
-rw-r--r-- | engines/lure/hotspots.cpp | 16 | ||||
-rw-r--r-- | engines/lure/hotspots.h | 2 | ||||
-rw-r--r-- | engines/lure/res.cpp | 6 | ||||
-rw-r--r-- | engines/lure/scripts.cpp | 15 | ||||
-rw-r--r-- | engines/lure/sound.cpp | 6 |
5 files changed, 38 insertions, 7 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index a84a84b51f..30b6f840fc 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -3133,8 +3133,14 @@ void HotspotTickHandlers::followerAnimHandler(Hotspot &h) { const RoomTranslationRecord *p = &roomTranslations[0]; while ((p->srcRoom != 0) && (p->srcRoom != player->roomNumber())) ++p; - h.currentActions().addFront(DISPATCH_ACTION, - (p->srcRoom != 0) ? p->destRoom : player->roomNumber()); + + if (p->destRoom == h.roomNumber()) + // Character is already in destination room, so set a random dest + h.setRandomDest(); + else + // Move character to either the player's room, or found alternate destination + h.currentActions().addFront(DISPATCH_ACTION, + (p->srcRoom != 0) ? p->destRoom : player->roomNumber()); } } } @@ -4032,12 +4038,14 @@ void HotspotTickHandlers::npcRoomChange(Hotspot &h) { if (!h.currentActions().isEmpty()) { if (h.startRoomNumber() != 0) { - // If character isn't already returning to starting room, start them doing so + // If character isn't already returning to starting room, redirect them to the + // player's current room if (!h.currentActions().bottom().hasSupportData() || (h.currentActions().bottom().supportData().action() != RETURN)) { // Start follower returning + Hotspot *playerHotspot = res.getActiveHotspot(PLAYER_ID); h.currentActions().clear(); - h.currentActions().addFront(RETURN, h.startRoomNumber(), 0, 0); + h.currentActions().addFront(RETURN, playerHotspot->roomNumber(), 0, 0); } } diff --git a/engines/lure/hotspots.h b/engines/lure/hotspots.h index 83c2e76c0e..5ff0ec563f 100644 --- a/engines/lure/hotspots.h +++ b/engines/lure/hotspots.h @@ -236,7 +236,6 @@ private: BarPlaceResult getBarPlace(); bool findClearBarPlace(); bool characterWalkingCheck(uint16 id); - bool doorCloseCheck(uint16 doorId); void resetDirection(); // Action set @@ -450,6 +449,7 @@ public: void updateMovement(); void updateMovement2(CharacterMode value); void resetPosition(); + bool doorCloseCheck(uint16 doorId); void doAction(); void doAction(Action action, HotspotData *hotspot); diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp index f8b29d4dd6..4342a1d6ad 100644 --- a/engines/lure/res.cpp +++ b/engines/lure/res.cpp @@ -625,12 +625,16 @@ Hotspot *Resources::activateHotspot(uint16 hotspotId) { CharacterScheduleEntry *entry = resources.charSchedules().getEntry(res->npcScheduleId); res->npcSchedule.addFront(DISPATCH_ACTION, entry, res->roomNumber); } - if ((hotspotId == GOEWIN_ID) && (hotspot->roomNumber() == 39)) + if ((hotspotId == GOEWIN_ID) && (hotspot->roomNumber() == 39)) { // WORKAROUND: When you re-join Goewin in the caves, clear her schedule. This may prevent a // situation where you could close the left door, and she'd be permanently stuck trying to go // the next room on the left, since her old schedule still had her following your old path hotspot->currentActions().clear(); + // Since she's no longer a follower, clear her start room field + hotspot->setStartRoomNumber(0); + } + // TODO: Figure out why there's a room set in the animation decode for a range of characters, // particularly since it doesn't seem to match what happens in-game /* diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp index 41a09e0d1d..20cbd328ce 100644 --- a/engines/lure/scripts.cpp +++ b/engines/lure/scripts.cpp @@ -901,6 +901,16 @@ uint16 Script::execute(uint16 startOffset) { uint16 offset = startOffset; bool breakFlag = false; + // WORKAROUND: Prevents the Weregate door closing prematurely + if (startOffset == 3941) { + Hotspot *goewinHotspot = r.getActiveHotspot(GOEWIN_ID); + if (!goewinHotspot->doorCloseCheck(10025)) { + // Goewin is still blocking the door, so reschedule the closing + r.delayList().add(1, startOffset, false); + return 0; + } + } + param = 0; fields.setField(SEQUENCE_RESULT, 0); @@ -1297,6 +1307,11 @@ bool HotspotScript::execute(Hotspot *h) { default: // Set the animation frame number + + // WORKAROUND: In Lure English EGA, the apparatus in room #30 can be set with an invalid frame number + if ((h->hotspotId() == 1059) && (opcode >= h->numFrames())) + opcode = h->numFrames() - 1; + debugC(ERROR_DETAILED, kLureDebugScripts, "SET FRAME NUMBER = %d", opcode); h->setFrameNumber(opcode); diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp index a75545c330..ca15ad8287 100644 --- a/engines/lure/sound.cpp +++ b/engines/lure/sound.cpp @@ -63,8 +63,12 @@ SoundManager::SoundManager() { _driver = NULL; } else { - if (_nativeMT32) + if (_nativeMT32) { _driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); + _driver->sendMT32Reset(); + } else { + _driver->sendGMReset(); + } for (index = 0; index < NUM_CHANNELS; ++index) { _channelsInner[index].midiChannel = _driver->allocateChannel(); |