aboutsummaryrefslogtreecommitdiff
path: root/engines/adl
diff options
context:
space:
mode:
authorWalter van Niftrik2017-07-25 13:49:29 +0200
committerWalter van Niftrik2017-07-25 14:08:35 +0200
commit06b9cd195f1cec8d7464c0179d90bc9b92db14cb (patch)
treec840634408199e35b1748b0930d56d895e04ba67 /engines/adl
parent90a453a53434dc16dfa07ca97c925e437ea9e785 (diff)
downloadscummvm-rg350-06b9cd195f1cec8d7464c0179d90bc9b92db14cb.tar.gz
scummvm-rg350-06b9cd195f1cec8d7464c0179d90bc9b92db14cb.tar.bz2
scummvm-rg350-06b9cd195f1cec8d7464c0179d90bc9b92db14cb.zip
ADL: Move broken-room handling into ADL v2
Diffstat (limited to 'engines/adl')
-rw-r--r--engines/adl/adl_v2.cpp8
-rw-r--r--engines/adl/adl_v2.h1
-rw-r--r--engines/adl/hires4.cpp28
3 files changed, 11 insertions, 26 deletions
diff --git a/engines/adl/adl_v2.cpp b/engines/adl/adl_v2.cpp
index 6eb26c515e..075c2ef3f4 100644
--- a/engines/adl/adl_v2.cpp
+++ b/engines/adl/adl_v2.cpp
@@ -245,6 +245,14 @@ void AdlEngine_v2::drawItem(Item &item, const Common::Point &pos) {
}
void AdlEngine_v2::loadRoom(byte roomNr) {
+ if (Common::find(_brokenRooms.begin(), _brokenRooms.end(), roomNr) != _brokenRooms.end()) {
+ debug("Warning: attempt to load non-existent room %d", roomNr);
+ _roomData.description.clear();
+ _roomData.pictures.clear();
+ _roomData.commands.clear();
+ return;
+ }
+
Room &room = getRoom(roomNr);
StreamPtr stream(room.data->createReadStream());
diff --git a/engines/adl/adl_v2.h b/engines/adl/adl_v2.h
index 889b03c90f..fc22c31701 100644
--- a/engines/adl/adl_v2.h
+++ b/engines/adl/adl_v2.h
@@ -97,6 +97,7 @@ protected:
Common::Array<DataBlockPtr> _itemPics;
bool _itemRemoved;
byte _roomOnScreen, _picOnScreen, _itemsOnScreen;
+ Common::Array<byte> _brokenRooms;
private:
Common::RandomSource *_random;
diff --git a/engines/adl/hires4.cpp b/engines/adl/hires4.cpp
index ce774ed867..2aa9763883 100644
--- a/engines/adl/hires4.cpp
+++ b/engines/adl/hires4.cpp
@@ -54,7 +54,7 @@ class HiRes4Engine : public AdlEngine_v3 {
public:
HiRes4Engine(OSystem *syst, const AdlGameDescription *gd) :
AdlEngine_v3(syst, gd),
- _boot(nullptr) { }
+ _boot(nullptr) { _brokenRooms.push_back(121); }
~HiRes4Engine();
private:
@@ -62,7 +62,6 @@ private:
void runIntro();
void init();
void initGameState();
- void loadRoom(byte roomNr);
void putSpace(uint x, uint y) const;
void drawChar(byte c, Common::SeekableReadStream &shapeTable, Common::Point &pos) const;
@@ -539,26 +538,12 @@ void HiRes4Engine::initGameState() {
loadItems(*stream);
}
-void HiRes4Engine::loadRoom(byte roomNr) {
- if (roomNr == 121) {
- // Room 121 is missing. This causes problems when we're dumping
- // scripts with the debugger, so we intercept this room load here.
- debug("Warning: attempt to load non-existent room 121");
- _roomData.description.clear();
- _roomData.pictures.clear();
- _roomData.commands.clear();
- return;
- }
-
- AdlEngine_v3::loadRoom(roomNr);
-}
-
class HiRes4Engine_Atari : public AdlEngine_v3 {
public:
HiRes4Engine_Atari(OSystem *syst, const AdlGameDescription *gd) :
AdlEngine_v3(syst, gd),
_boot(nullptr),
- _curDisk(0) { }
+ _curDisk(0) { _brokenRooms.push_back(121); }
~HiRes4Engine_Atari();
private:
@@ -649,15 +634,6 @@ void HiRes4Engine_Atari::loadRoom(byte roomNr) {
rebindDisk();
}
- if (roomNr == 121) {
- // Room 121 is missing, see Apple II version
- debug("Warning: attempt to load non-existent room 121");
- _roomData.description.clear();
- _roomData.pictures.clear();
- _roomData.commands.clear();
- return;
- }
-
AdlEngine_v3::loadRoom(roomNr);
}