aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter van Niftrik2016-08-28 20:29:11 +0200
committerWalter van Niftrik2016-08-28 21:01:12 +0200
commit9250bf58fe00ab5a0265b9a4ca32726abab83c37 (patch)
tree74f481a531f1e93500311993a2e71d93194bf84b
parent4933b59e8e039ae346f650c044e5fe0ba6310ead (diff)
downloadscummvm-rg350-9250bf58fe00ab5a0265b9a4ca32726abab83c37.tar.gz
scummvm-rg350-9250bf58fe00ab5a0265b9a4ca32726abab83c37.tar.bz2
scummvm-rg350-9250bf58fe00ab5a0265b9a4ca32726abab83c37.zip
ADL: Load hires4 dropped-item offsets
-rw-r--r--engines/adl/adl.cpp9
-rw-r--r--engines/adl/adl.h1
-rw-r--r--engines/adl/hires0.cpp7
-rw-r--r--engines/adl/hires1.cpp7
-rw-r--r--engines/adl/hires2.cpp7
-rw-r--r--engines/adl/hires4.cpp3
-rw-r--r--engines/adl/hires4.h3
-rw-r--r--engines/adl/hires6.cpp7
8 files changed, 19 insertions, 25 deletions
diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp
index 8135d401b3..9afb2c6700 100644
--- a/engines/adl/adl.cpp
+++ b/engines/adl/adl.cpp
@@ -402,6 +402,15 @@ byte AdlEngine::roomArg(byte room) const {
return room;
}
+void AdlEngine::loadDroppedItemOffsets(Common::ReadStream &stream, byte count) {
+ for (uint i = 0; i < count; ++i) {
+ Common::Point p;
+ p.x = stream.readByte();
+ p.y = stream.readByte();
+ _itemOffsets.push_back(p);
+ }
+}
+
void AdlEngine::clearScreen() const {
_display->setMode(DISPLAY_MODE_MIXED);
_display->clear(0x00);
diff --git a/engines/adl/adl.h b/engines/adl/adl.h
index 89cdabe384..971336ef50 100644
--- a/engines/adl/adl.h
+++ b/engines/adl/adl.h
@@ -247,6 +247,7 @@ protected:
virtual void initState();
virtual byte roomArg(byte room) const;
virtual void advanceClock() { }
+ void loadDroppedItemOffsets(Common::ReadStream &stream, byte count);
// Opcodes
int o1_isItemInRoom(ScriptEnv &e);
diff --git a/engines/adl/hires0.cpp b/engines/adl/hires0.cpp
index d5f7ab552e..658132231e 100644
--- a/engines/adl/hires0.cpp
+++ b/engines/adl/hires0.cpp
@@ -88,12 +88,7 @@ void HiRes0Engine::init() {
// Load dropped item offsets
stream.reset(_disk->createReadStream(0x1b, 0x4, 0x15));
- for (uint i = 0; i < IDI_HR0_NUM_ITEM_OFFSETS; ++i) {
- Common::Point p;
- p.x = stream->readByte();
- p.y = stream->readByte();
- _itemOffsets.push_back(p);
- }
+ loadDroppedItemOffsets(*stream, IDI_HR0_NUM_ITEM_OFFSETS);
// Load verbs
stream.reset(_disk->createReadStream(0x19, 0x0, 0x00, 3));
diff --git a/engines/adl/hires1.cpp b/engines/adl/hires1.cpp
index 26565c03c3..50fe25422c 100644
--- a/engines/adl/hires1.cpp
+++ b/engines/adl/hires1.cpp
@@ -183,12 +183,7 @@ void HiRes1Engine::init() {
// Load dropped item offsets
stream->seek(IDI_HR1_OFS_ITEM_OFFSETS);
- for (uint i = 0; i < IDI_HR1_NUM_ITEM_OFFSETS; ++i) {
- Common::Point p;
- p.x = stream->readByte();
- p.y = stream->readByte();
- _itemOffsets.push_back(p);
- }
+ loadDroppedItemOffsets(*stream, IDI_HR1_NUM_ITEM_OFFSETS);
// Load right-angle line art
stream->seek(IDI_HR1_OFS_CORNERS);
diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp
index 25a3bbacf2..ec340c10d9 100644
--- a/engines/adl/hires2.cpp
+++ b/engines/adl/hires2.cpp
@@ -111,12 +111,7 @@ void HiRes2Engine::init() {
// Load dropped item offsets
stream.reset(_disk->createReadStream(0x1b, 0x4, 0x15));
- for (uint i = 0; i < IDI_HR2_NUM_ITEM_OFFSETS; ++i) {
- Common::Point p;
- p.x = stream->readByte();
- p.y = stream->readByte();
- _itemOffsets.push_back(p);
- }
+ loadDroppedItemOffsets(*stream, IDI_HR2_NUM_ITEM_OFFSETS);
// Load verbs
stream.reset(_disk->createReadStream(0x19, 0x0, 0x00, 3));
diff --git a/engines/adl/hires4.cpp b/engines/adl/hires4.cpp
index ae04a66f94..5c6f2d6d84 100644
--- a/engines/adl/hires4.cpp
+++ b/engines/adl/hires4.cpp
@@ -63,6 +63,9 @@ void HiRes4Engine::init() {
stream.reset(createReadStream(_boot, 0x06, 0xd, 0x12, 2));
loadItemDescriptions(*stream, IDI_HR4_NUM_ITEM_DESCS);
+ stream.reset(createReadStream(_boot, 0x07, 0x1, 0xf4));
+ loadDroppedItemOffsets(*stream, IDI_HR4_NUM_ITEM_OFFSETS);
+
stream.reset(createReadStream(_boot, 0x08, 0xe, 0xa5, 5));
readCommands(*stream, _roomCommands);
diff --git a/engines/adl/hires4.h b/engines/adl/hires4.h
index fd682cb13d..14671d71ec 100644
--- a/engines/adl/hires4.h
+++ b/engines/adl/hires4.h
@@ -32,8 +32,9 @@ namespace Adl {
#define IDI_HR4_NUM_ROOMS 164
#define IDI_HR4_NUM_MESSAGES 255
#define IDI_HR4_NUM_VARS 40
-#define IDI_HR4_NUM_ITEM_PICS 41
#define IDI_HR4_NUM_ITEM_DESCS 44
+#define IDI_HR4_NUM_ITEM_PICS 41
+#define IDI_HR4_NUM_ITEM_OFFSETS 40
// Messages used outside of scripts
#define IDI_HR4_MSG_CANT_GO_THERE 110
diff --git a/engines/adl/hires6.cpp b/engines/adl/hires6.cpp
index 314d8174b4..d44a2e4872 100644
--- a/engines/adl/hires6.cpp
+++ b/engines/adl/hires6.cpp
@@ -146,12 +146,7 @@ void HiRes6Engine::init() {
// Load dropped item offsets
stream.reset(_boot->createReadStream(0x8, 0x9, 0x16));
- for (uint i = 0; i < IDI_HR6_NUM_ITEM_OFFSETS; ++i) {
- Common::Point p;
- p.x = stream->readByte();
- p.y = stream->readByte();
- _itemOffsets.push_back(p);
- }
+ loadDroppedItemOffsets(*stream, IDI_HR6_NUM_ITEM_OFFSETS);
// Location of game data for each disc
stream.reset(_boot->createReadStream(0x5, 0xa, 0x03));