diff options
author | Filippos Karapetis | 2015-12-03 14:30:32 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:33:49 +0100 |
commit | 914bd262955c9da140d89dc6cf3fa03940a13c62 (patch) | |
tree | 1569a5709ca61b94f946576c2e1cc81a1437d68f | |
parent | f7fe91c8d23af3628f5df3c553ac4a0f0538d6c2 (diff) | |
download | scummvm-rg350-914bd262955c9da140d89dc6cf3fa03940a13c62.tar.gz scummvm-rg350-914bd262955c9da140d89dc6cf3fa03940a13c62.tar.bz2 scummvm-rg350-914bd262955c9da140d89dc6cf3fa03940a13c62.zip |
LAB: Cleanup of roomCords()
-rw-r--r-- | engines/lab/map.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp index 7471b1f0ea..a2a4ed3af7 100644 --- a/engines/lab/map.cpp +++ b/engines/lab/map.cpp @@ -252,34 +252,29 @@ void fade(bool fadein, uint16 res) { /* Figures out what a room's coordinates should be. */ /*****************************************************************************/ static void roomCords(uint16 CurRoom, uint16 *x1, uint16 *y1, uint16 *x2, uint16 *y2) { - *x1 = mapScaleX(Maps[CurRoom].x); - *y1 = mapScaleY(Maps[CurRoom].y); - *x2 = *x1; - *y2 = *y1; + Image *curRoomImg = NULL; switch (Maps[CurRoom].SpecialID) { case NORMAL: case UPARROWROOM: case DOWNARROWROOM: - (*x2) += Room->_width; - (*y2) += Room->_height; + curRoomImg = Room; break; - case BRIDGEROOM: - (*x2) += Bridge->_width; - (*y2) += Bridge->_height; + curRoomImg = Bridge; break; - case VCORRIDOR: - (*x2) += VRoom->_width; - (*y2) += VRoom->_height; + curRoomImg = VRoom; break; - case HCORRIDOR: - (*x2) += HRoom->_width; - (*y2) += HRoom->_height; + curRoomImg = HRoom; break; } + + *x1 = mapScaleX(Maps[CurRoom].x); + *y1 = mapScaleY(Maps[CurRoom].y); + *x2 = *x1 + curRoomImg->_width; + *y2 = *y1 + curRoomImg->_height; } /*****************************************************************************/ |