aboutsummaryrefslogtreecommitdiff
path: root/engines/lab
diff options
context:
space:
mode:
authorFilippos Karapetis2015-12-03 13:54:19 +0200
committerWillem Jan Palenstijn2015-12-23 21:33:48 +0100
commitf76f0d957a3945a6a503ab0c26da0f08ed4842a3 (patch)
treefe403c573712b8c16b77de042835f2481e7d3c57 /engines/lab
parent3b40199ab64382f7422abeb5bf6def43588496a8 (diff)
downloadscummvm-rg350-f76f0d957a3945a6a503ab0c26da0f08ed4842a3.tar.gz
scummvm-rg350-f76f0d957a3945a6a503ab0c26da0f08ed4842a3.tar.bz2
scummvm-rg350-f76f0d957a3945a6a503ab0c26da0f08ed4842a3.zip
LAB: Merge room views into an array
Diffstat (limited to 'engines/lab')
-rw-r--r--engines/lab/parsetypes.h2
-rw-r--r--engines/lab/processroom.cpp9
-rw-r--r--engines/lab/resource.cpp16
3 files changed, 10 insertions, 17 deletions
diff --git a/engines/lab/parsetypes.h b/engines/lab/parsetypes.h
index 82174b80f4..6be1ba2482 100644
--- a/engines/lab/parsetypes.h
+++ b/engines/lab/parsetypes.h
@@ -140,7 +140,7 @@ struct RoomData {
byte _wipeType;
- ViewData *_northView, *_southView, *_eastView, *_westView;
+ ViewData *_view[4];
RuleList *_rules;
char *_roomMsg;
};
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp
index e6217959dc..1858aebbd1 100644
--- a/engines/lab/processroom.cpp
+++ b/engines/lab/processroom.cpp
@@ -93,14 +93,7 @@ ViewData *getViewData(uint16 roomNum, uint16 direction) {
if (!_rooms[roomNum]._roomMsg)
g_lab->_resource->readViews(roomNum);
- if (direction == NORTH)
- view = _rooms[roomNum]._northView;
- else if (direction == SOUTH)
- view = _rooms[roomNum]._southView;
- else if (direction == EAST)
- view = _rooms[roomNum]._eastView;
- else if (direction == WEST)
- view = _rooms[roomNum]._westView;
+ view = _rooms[roomNum]._view[direction];
do {
if (checkConditions(view->Condition))
diff --git a/engines/lab/resource.cpp b/engines/lab/resource.cpp
index 70233dedd4..b1507fedf3 100644
--- a/engines/lab/resource.cpp
+++ b/engines/lab/resource.cpp
@@ -115,10 +115,10 @@ bool Resource::readRoomData(const char *fileName) {
_rooms[i]._westDoor = dataFile->readUint16LE();
_rooms[i]._wipeType = dataFile->readByte();
- _rooms[i]._northView = nullptr;
- _rooms[i]._southView = nullptr;
- _rooms[i]._eastView = nullptr;
- _rooms[i]._westView = nullptr;
+ _rooms[i]._view[NORTH] = nullptr;
+ _rooms[i]._view[SOUTH] = nullptr;
+ _rooms[i]._view[EAST] = nullptr;
+ _rooms[i]._view[WEST] = nullptr;
_rooms[i]._rules = nullptr;
_rooms[i]._roomMsg = nullptr;
}
@@ -154,10 +154,10 @@ bool Resource::readViews(uint16 roomNum) {
allocroom = roomNum;
_rooms[roomNum]._roomMsg = readString(dataFile);
- _rooms[roomNum]._northView = readView(dataFile);
- _rooms[roomNum]._southView = readView(dataFile);
- _rooms[roomNum]._eastView = readView(dataFile);
- _rooms[roomNum]._westView = readView(dataFile);
+ _rooms[roomNum]._view[NORTH] = readView(dataFile);
+ _rooms[roomNum]._view[SOUTH] = readView(dataFile);
+ _rooms[roomNum]._view[EAST] = readView(dataFile);
+ _rooms[roomNum]._view[WEST] = readView(dataFile);
_rooms[roomNum]._rules = readRule(dataFile);
_vm->_music->updateMusic();