From d7335d69e351e910f33dbcc3b80a9a5d52bfd4e1 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 26 Dec 2011 13:59:20 +0200 Subject: DREAMWEB: Move the roomsCanGo array out of the data blob --- engines/dreamweb/newplace.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'engines/dreamweb/newplace.cpp') diff --git a/engines/dreamweb/newplace.cpp b/engines/dreamweb/newplace.cpp index 03824aa706..efcffef82a 100644 --- a/engines/dreamweb/newplace.cpp +++ b/engines/dreamweb/newplace.cpp @@ -177,7 +177,7 @@ void DreamBase::nextDest() { data.byte(kDestpos)++; if (data.byte(kDestpos) == 15) data.byte(kDestpos) = 0; // last destination - } while (!data.byte(kRoomscango + data.byte(kDestpos))); + } while (!getLocation(data.byte(kDestpos))); data.byte(kNewtextline) = 1; delTextLine(); @@ -206,7 +206,7 @@ void DreamBase::lastDest() { data.byte(kDestpos)--; if (data.byte(kDestpos) == 0xFF) data.byte(kDestpos) = 15; // first destination - } while (!data.byte(kRoomscango + data.byte(kDestpos))); + } while (!getLocation(data.byte(kDestpos))); data.byte(kNewtextline) = 1; delTextLine(); @@ -235,11 +235,15 @@ void DreamBase::destSelect() { } uint8 DreamBase::getLocation(uint8 index) { - return data.byte(kRoomscango + index); + return _roomsCanGo[index]; } void DreamBase::setLocation(uint8 index) { - data.byte(kRoomscango + index) = 1; + _roomsCanGo[index] = 1; +} + +void DreamBase::clearLocation(uint8 index) { + _roomsCanGo[index] = 0; } void DreamBase::resetLocation(uint8 index) { @@ -264,7 +268,7 @@ void DreamBase::resetLocation(uint8 index) { purgeALocation(29); } - data.byte(kRoomscango + index) = 0; + clearLocation(index); } void DreamBase::readDestIcon() { -- cgit v1.2.3