diff options
-rw-r--r-- | engines/lab/processroom.cpp | 12 | ||||
-rw-r--r-- | engines/lab/processroom.h | 5 | ||||
-rw-r--r-- | engines/lab/resource.cpp | 8 |
3 files changed, 6 insertions, 19 deletions
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp index 7b9e4132c9..c754d288b7 100644 --- a/engines/lab/processroom.cpp +++ b/engines/lab/processroom.cpp @@ -180,17 +180,7 @@ void LabEngine::drawDirection(CloseDataPtr closePtr) { */ uint16 LabEngine::processArrow(uint16 curDirection, uint16 arrow) { if (arrow == 1) { // Forward - uint16 room = 1; - - if (curDirection == NORTH) - room = _rooms[_roomNum]._northDoor; - else if (curDirection == SOUTH) - room = _rooms[_roomNum]._southDoor; - else if (curDirection == EAST) - room = _rooms[_roomNum]._eastDoor; - else if (curDirection == WEST) - room = _rooms[_roomNum]._westDoor; - + uint16 room = _rooms[_roomNum]._doors[curDirection]; if (room != 0) _roomNum = room; diff --git a/engines/lab/processroom.h b/engines/lab/processroom.h index 97c7cdce4f..1d3316ed7e 100644 --- a/engines/lab/processroom.h +++ b/engines/lab/processroom.h @@ -127,10 +127,7 @@ struct Rule { }; struct RoomData { - uint16 _northDoor; - uint16 _southDoor; - uint16 _eastDoor; - uint16 _westDoor; + uint16 _doors[4]; byte _transitionType; ViewData *_view[4]; RuleList *_rules; diff --git a/engines/lab/resource.cpp b/engines/lab/resource.cpp index 3f615c7a7a..cb29bc6407 100644 --- a/engines/lab/resource.cpp +++ b/engines/lab/resource.cpp @@ -98,10 +98,10 @@ bool Resource::readRoomData(const char *fileName) { memset(_vm->_rooms, 0, (_vm->_manyRooms + 1) * sizeof(RoomData)); for (uint16 i = 1; i <= _vm->_manyRooms; i++) { - _vm->_rooms[i]._northDoor = dataFile->readUint16LE(); - _vm->_rooms[i]._southDoor = dataFile->readUint16LE(); - _vm->_rooms[i]._eastDoor = dataFile->readUint16LE(); - _vm->_rooms[i]._westDoor = dataFile->readUint16LE(); + _vm->_rooms[i]._doors[NORTH] = dataFile->readUint16LE(); + _vm->_rooms[i]._doors[SOUTH] = dataFile->readUint16LE(); + _vm->_rooms[i]._doors[EAST] = dataFile->readUint16LE(); + _vm->_rooms[i]._doors[WEST] = dataFile->readUint16LE(); _vm->_rooms[i]._transitionType = dataFile->readByte(); _vm->_rooms[i]._view[NORTH] = nullptr; |