aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorPaul Gilbert2006-04-11 10:45:22 +0000
committerPaul Gilbert2006-04-11 10:45:22 +0000
commit9b87224036004668aa74f764553cc05381c79f97 (patch)
treef0b3388af19fbfa9f10f11d5a6149d866ff011b0 /engines/lure
parentf6b2cf2c6dcc37c54913ad2209545002727ee6fd (diff)
downloadscummvm-rg350-9b87224036004668aa74f764553cc05381c79f97.tar.gz
scummvm-rg350-9b87224036004668aa74f764553cc05381c79f97.tar.bz2
scummvm-rg350-9b87224036004668aa74f764553cc05381c79f97.zip
Resource loader enhanced to load hotspot proximity data and room walkable areas
svn-id: r21780
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/res.cpp30
-rw-r--r--engines/lure/res.h7
2 files changed, 35 insertions, 2 deletions
diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp
index c1a8fa82f1..c14ec35655 100644
--- a/engines/lure/res.cpp
+++ b/engines/lure/res.cpp
@@ -68,7 +68,7 @@ struct AnimRecordTemp {
void Resources::reloadData() {
Disk &d = Disk::getReference();
- MemoryBlock *mb;
+ MemoryBlock *mb, *paths;
uint16 *offset, offsetVal;
uint16 recordId;
int ctr;
@@ -78,13 +78,17 @@ void Resources::reloadData() {
// Load room data
mb = d.getEntry(ROOM_DATA_RESOURCE_ID);
+ paths = d.getEntry(ROOM_PATHS_RESOURCE_ID);
+
offset = (uint16 *) mb->data();
for (ctr = 0; READ_LE_UINT16(offset) != 0xffff; ++ctr, ++offset) {
offsetVal = READ_LE_UINT16(offset);
+
if (offsetVal != 0) {
// Get room resource
RoomResource *rec = (RoomResource *) (mb->data() + offsetVal);
- RoomData *newEntry = new RoomData(rec);
+
+ RoomData *newEntry = new RoomData(rec, paths);
_roomData.push_back(newEntry);
if (rec->numExits > 0) {
@@ -99,6 +103,7 @@ void Resources::reloadData() {
}
}
delete mb;
+ delete paths;
// Load room exits
mb = d.getEntry(ROOM_EXITS_RESOURCE_ID);
@@ -249,6 +254,27 @@ void Resources::reloadData() {
}
delete mb;
+ // Load a list of hotspot proximities
+ mb = d.getEntry(HOTSPOT_PROXIMITY_RESOURCE_ID);
+ HotspotProximityResource *proxRec = (HotspotProximityResource *) mb->data();
+ while (FROM_LE_16(proxRec->hotspotId) != 0xffff) {
+ HotspotProximityData *newEntry = new HotspotProximityData(proxRec);
+ _proximityList.push_back(newEntry);
+ ++joinRec;
+ ++proxRec;
+ }
+ delete mb;
+
+ // Load in the list of room exit coordinates
+ mb = d.getEntry(EXIT_COORDINATES_RESOURCE_ID);
+ RoomExitCoordinateEntryResource *coordRec = (RoomExitCoordinateEntryResource *) mb->data();
+ while (*((uint16 *) coordRec) != 0xffff) {
+ RoomExitCoordinates *newEntry = new RoomExitCoordinates(coordRec);
+ _coordinateList.push_back(newEntry);
+ ++coordRec;
+ }
+ delete mb;
+
// Initialise delay list
_delayList.clear();
diff --git a/engines/lure/res.h b/engines/lure/res.h
index 2a74d94dcf..3d5a2abba4 100644
--- a/engines/lure/res.h
+++ b/engines/lure/res.h
@@ -60,6 +60,8 @@ private:
SequenceDelayList _delayList;
Action _currentAction;
MemoryBlock *_talkDialogData;
+ HotspotProximityList _proximityList;
+ RoomExitCoordinatesList _coordinateList;
TalkData *_activeTalkData;
TalkState _talkState;
@@ -105,6 +107,11 @@ public:
ValueTableData &fieldList() { return _fieldList; }
SequenceDelayList &delayList() { return _delayList; }
MemoryBlock &getTalkDialogData() { return *_talkDialogData; }
+ HotspotProximityList &proximityList() { return _proximityList; }
+ HotspotProximityData *getHotspotProximity(uint16 hotspotId) {
+ return _proximityList.getHotspot(hotspotId);
+ }
+ RoomExitCoordinatesList &coordinateList() { return _coordinateList; }
void copyCursorTo(Surface *s, uint8 cursorNum, int16 x, int16 y);
uint16 numInventoryItems();