aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter van Niftrik2016-03-10 20:47:30 +0100
committerWalter van Niftrik2016-06-06 20:35:49 +0200
commitc44f18a818c36bf714cf59b1a56589b138842503 (patch)
tree9835e6bb8935f072a682164cc831adf32770d448
parentfe384e0ae09ec3e72d653cd9fd34ab047231e249 (diff)
downloadscummvm-rg350-c44f18a818c36bf714cf59b1a56589b138842503.tar.gz
scummvm-rg350-c44f18a818c36bf714cf59b1a56589b138842503.tar.bz2
scummvm-rg350-c44f18a818c36bf714cf59b1a56589b138842503.zip
ADL: Load hires2 room data
-rw-r--r--engines/adl/adl.h3
-rw-r--r--engines/adl/hires1.cpp2
-rw-r--r--engines/adl/hires2.cpp21
-rw-r--r--engines/adl/hires2.h2
4 files changed, 27 insertions, 1 deletions
diff --git a/engines/adl/adl.h b/engines/adl/adl.h
index df917b1868..abdbaff28a 100644
--- a/engines/adl/adl.h
+++ b/engines/adl/adl.h
@@ -80,6 +80,9 @@ struct AdlGameDescription;
struct Room {
byte description;
byte connections[6];
+ byte track;
+ byte sector;
+ byte offset;
byte picture;
byte curPicture;
};
diff --git a/engines/adl/hires1.cpp b/engines/adl/hires1.cpp
index c77504497e..4bdf47a1a6 100644
--- a/engines/adl/hires1.cpp
+++ b/engines/adl/hires1.cpp
@@ -242,7 +242,7 @@ void HiRes1Engine::initState() {
_roomDesc.clear();
f.seek(IDI_HR1_OFS_ROOMS);
for (uint i = 0; i < IDI_HR1_NUM_ROOMS; ++i) {
- Room room;
+ Room room = { };
f.readByte();
_roomDesc.push_back(f.readByte());
for (uint j = 0; j < 6; ++j)
diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp
index 44abc22bca..4f8ba48837 100644
--- a/engines/adl/hires2.cpp
+++ b/engines/adl/hires2.cpp
@@ -64,6 +64,27 @@ void HiRes2Engine::loadData() {
}
void HiRes2Engine::initState() {
+ Common::File f;
+
+ if (!f.open(IDS_HR2_DISK_IMAGE))
+ error("Failed to open file '" IDS_HR2_DISK_IMAGE "'");
+
+ _state.rooms.clear();
+ f.seek(IDI_HR2_OFS_ROOMS);
+ for (uint i = 0; i < IDI_HR2_NUM_ROOMS; ++i) {
+ Room room = { };
+ f.readByte(); // number
+ for (uint j = 0; j < 6; ++j)
+ room.connections[j] = f.readByte();
+ room.track = f.readByte();
+ room.sector = f.readByte();
+ room.offset = f.readByte();
+ f.readByte(); // always 1, possibly disk?
+ room.picture = f.readByte();
+ room.curPicture = f.readByte();
+ f.readByte(); // always 1, possibly disk?
+ _state.rooms.push_back(room);
+ }
}
void HiRes2Engine::restartGame() {
diff --git a/engines/adl/hires2.h b/engines/adl/hires2.h
index e37af5a4b2..01bb29f2e5 100644
--- a/engines/adl/hires2.h
+++ b/engines/adl/hires2.h
@@ -44,6 +44,8 @@ namespace Adl {
#define IDI_HR2_OFS_INTRO_TEXT TSO(0x00, 0xd, 0x17)
#define IDI_HR2_OFS_VERBS T(0x19)
#define IDI_HR2_OFS_NOUNS TS(0x22, 0x2)
+#define IDI_HR2_OFS_ROOMS TSO(0x21, 0x5, 0x0e) // Skip bogus room 0
+#define IDI_HR2_NUM_ROOMS 135
class HiRes2Engine : public AdlEngine {
public: