aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorYotam Barnoy2010-10-31 11:08:43 +0000
committerYotam Barnoy2010-10-31 11:08:43 +0000
commit94c8d0a14df429a1b25bd9f5c5d75497fd0ddbd1 (patch)
tree3df2a4ae7967c56d464729669fc06ce4e93dff36 /engines/lure
parent8df4278ba8cfbf71228e1927f9db635a9a30a57f (diff)
parentdca3c8d8bfc6c4db38cf8e8291818dd472041d4e (diff)
downloadscummvm-rg350-94c8d0a14df429a1b25bd9f5c5d75497fd0ddbd1.tar.gz
scummvm-rg350-94c8d0a14df429a1b25bd9f5c5d75497fd0ddbd1.tar.bz2
scummvm-rg350-94c8d0a14df429a1b25bd9f5c5d75497fd0ddbd1.zip
Updated with latest from trunk
svn-id: r53976
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/debugger.cpp2
-rw-r--r--engines/lure/hotspots.cpp23
-rw-r--r--engines/lure/hotspots.h2
-rw-r--r--engines/lure/lure.h6
-rw-r--r--engines/lure/res.cpp6
-rw-r--r--engines/lure/res_struct.cpp2
-rw-r--r--engines/lure/scripts.cpp10
-rw-r--r--engines/lure/sound.cpp6
8 files changed, 44 insertions, 13 deletions
diff --git a/engines/lure/debugger.cpp b/engines/lure/debugger.cpp
index 1cfe0804e4..5fbe124919 100644
--- a/engines/lure/debugger.cpp
+++ b/engines/lure/debugger.cpp
@@ -323,7 +323,7 @@ bool Debugger::cmd_hotspot(int argc, const char **argv) {
if (h != NULL) {
DebugPrintf("Frame Number = %d of %d\n", h->frameNumber(), h->numFrames());
- DebugPrintf("Persistant = %s\n", h->persistant() ? "true" : "false");
+ DebugPrintf("Persistent = %s\n", h->persistant() ? "true" : "false");
}
} else if (strcmp(argv[2], "actions") == 0) {
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index a84a84b51f..64e5035ee9 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);
}
}
@@ -4162,6 +4170,7 @@ PathFinderResult PathFinder::process() {
_inProgress = true;
initVars();
+ Common::Point diff(_destX - _xCurrent, _destY - _yCurrent);
_xCurrent >>= 3; _yCurrent >>= 3;
_xDestCurrent >>= 3; _yDestCurrent >>= 3;
if ((_xCurrent == _xDestCurrent) && (_yCurrent == _yDestCurrent)) {
@@ -4170,6 +4179,10 @@ PathFinderResult PathFinder::process() {
add(RIGHT, _xDestPos);
else if (_xDestPos < 0)
add(LEFT, -_xDestPos);
+ else if (diff.y > 0)
+ add(DOWN, diff.y);
+ else
+ add(UP, -diff.y);
_inProgress = false;
result = PF_OK;
@@ -4345,7 +4358,7 @@ PathFinderResult PathFinder::process() {
break;
}
- // Add a final move if necessary
+ // Add final movement if necessary
if (result == PF_OK) {
if (_xDestPos < 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/lure.h b/engines/lure/lure.h
index 15336a3507..297fb20f59 100644
--- a/engines/lure/lure.h
+++ b/engines/lure/lure.h
@@ -46,10 +46,10 @@
/**
* This is the namespace of the Lure engine.
*
- * Status of this engine: ???
+ * Status of this engine: Complete
*
- * Supported games:
- * - ???
+ * Games using this engine:
+ * - Lure of the Temptress
*/
namespace Lure {
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/res_struct.cpp b/engines/lure/res_struct.cpp
index a75ba6eac8..9ef595b30f 100644
--- a/engines/lure/res_struct.cpp
+++ b/engines/lure/res_struct.cpp
@@ -875,7 +875,7 @@ CharacterScheduleEntry::CharacterScheduleEntry(CharacterScheduleEntry *src) {
_parent = src->_parent;
_action = src->_action;
_numParams = src->_numParams;
- Common::copy(src->_params, src->_params + MAX_TELL_COMMANDS * 3 * sizeof(uint16), _params);
+ Common::copy(src->_params, src->_params + MAX_TELL_COMMANDS * 3, _params);
}
uint16 CharacterScheduleEntry::param(int index) {
diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp
index 20758466ad..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);
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();