aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorPaul Gilbert2006-04-11 10:50:18 +0000
committerPaul Gilbert2006-04-11 10:50:18 +0000
commit4b913261311ba2727f5582e33c90ce5d02d6d680 (patch)
tree0b2647b89f551a1134bbc11f9b578c44f1985fdd /engines/lure
parent169c8d78d11f6e64197b8b2f7e4b616384a3d314 (diff)
downloadscummvm-rg350-4b913261311ba2727f5582e33c90ce5d02d6d680.tar.gz
scummvm-rg350-4b913261311ba2727f5582e33c90ce5d02d6d680.tar.bz2
scummvm-rg350-4b913261311ba2727f5582e33c90ce5d02d6d680.zip
Added a destRoomNumber variable to store which room a highlighted exit goes to, as well as some temporary code used to display pathfinding information onscreen when Toggle Info is turned on
svn-id: r21783
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/room.cpp19
-rw-r--r--engines/lure/room.h3
2 files changed, 21 insertions, 1 deletions
diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp
index 3db3986ef1..dcedde6583 100644
--- a/engines/lure/room.cpp
+++ b/engines/lure/room.cpp
@@ -82,6 +82,7 @@ Room::Room(): _screen(Screen::getReference()) {
_numLayers = 0;
_showInfo = false;
_isExit = false;
+ _destRoomNumber = 0;
}
Room::~Room() {
@@ -198,6 +199,7 @@ void Room::checkRoomHotspots() {
_hotspot = entry;
_hotspotId = entry->hotspotId;
_isExit = false;
+ _destRoomNumber = 0;
}
}
@@ -225,6 +227,7 @@ uint8 Room::checkRoomExits() {
(m.y() >= rec->ys) && (m.y() <= rec->ye)) {
// Cursor is within exit area
uint8 cursorNum = rec->cursorNum;
+ _destRoomNumber = rec->destRoomNumber;
// If it's a hotspotted exit, change arrow to the + arrow
if (rec->hotspotId != 0) {
@@ -433,12 +436,26 @@ void Room::update() {
}
}
- // If show information is turned on, show room and position
+ // If show information is turned on, show extra debugging information
if (_showInfo) {
char buffer[64];
Mouse &m = Mouse::getReference();
sprintf(buffer, "Room %d Pos (%d,%d)", _roomNumber, m.x(), m.y());
s.writeString(FULL_SCREEN_WIDTH / 2, 0, buffer, false, DIALOG_TEXT_COLOUR);
+
+ // Temporary display of pathfinding data
+ for (int yctr = 0; yctr < ROOM_PATHS_HEIGHT; ++yctr) {
+ for (int xctr = 0; xctr < ROOM_PATHS_WIDTH; ++xctr) {
+ uint16 v = tempLayer[(yctr + 1) * DECODED_PATHS_WIDTH + xctr + 1];
+ if ((v != 0) && (v < 100)) {
+ sprintf(buffer, "%d", v % 10);
+ s.writeString(xctr * 8, yctr * 8 + 8, buffer, true);
+ } else if (v == 0xffff) {
+// } else if (_roomData->paths.isOccupied(xctr, yctr)) {
+ s.fillRect(Rect(xctr * 8, yctr * 8 + 8, xctr * 8 + 7, yctr * 8 + 15), 255);
+ }
+ }
+ }
}
}
diff --git a/engines/lure/room.h b/engines/lure/room.h
index 3ba9312f8a..7387bf0972 100644
--- a/engines/lure/room.h
+++ b/engines/lure/room.h
@@ -59,6 +59,7 @@ private:
uint16 _descId;
uint16 _hotspotId;
uint16 _hotspotNameId;
+ uint16 _destRoomNumber;
bool _isExit;
char _hotspotName[MAX_HOTSPOT_NAME_SIZE + MAX_ACTION_NAME_SIZE];
HotspotData *_hotspot;
@@ -78,6 +79,7 @@ private:
void addLayers(Hotspot &h);
void addCell(int16 xp, int16 yp, int layerNum);
public:
+ RoomPathsDecompressedData tempLayer;
Room();
~Room();
static Room &getReference();
@@ -89,6 +91,7 @@ public:
void setRoomNumber(uint16 newRoomNumber, bool showOverlay = false);
void leaveRoom();
uint16 hotspotId() { return _hotspotId; }
+ uint16 destRoomNumber() { return _destRoomNumber; }
uint16 isExit() { return _isExit; }
uint32 hotspotActions() { return _hotspot->actions & 0x10ffffff; }
uint8 hotspotFlags() { return (_hotspot->actions >> 24) & 0xfe; }