diff options
author | Filippos Karapetis | 2017-11-19 20:49:44 +0200 |
---|---|---|
committer | Filippos Karapetis | 2017-11-19 20:50:13 +0200 |
commit | 2a8e624bfe56375f96837b95fe3ccf5bb5f49d76 (patch) | |
tree | 7dcad7fbb0ac40a30ba5d37addcd5cc41f0c93ce /engines/drascula | |
parent | 33cb29d5587af609bb747d1cef68dfffc60c6127 (diff) | |
download | scummvm-rg350-2a8e624bfe56375f96837b95fe3ccf5bb5f49d76.tar.gz scummvm-rg350-2a8e624bfe56375f96837b95fe3ccf5bb5f49d76.tar.bz2 scummvm-rg350-2a8e624bfe56375f96837b95fe3ccf5bb5f49d76.zip |
DRASCULA: Clean up logic in enterRoom()
Diffstat (limited to 'engines/drascula')
-rw-r--r-- | engines/drascula/rooms.cpp | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index e1a0bdd766..8263483666 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -1665,9 +1665,9 @@ void DrasculaEngine::enterRoom(int roomIndex) { char fileName[20]; sprintf(fileName, "%d.ald", roomIndex); - int soc, l, martin = 0, objIsExit = 0; + int soc, l, overridenWidth = 0, objIsExit = 0; float chiquez = 0, pequegnez = 0; - char pant1[20], pant2[20], pant3[20], pant4[20]; + char surfaceName[20]; int palLevel = 0; _hasName = false; @@ -1685,22 +1685,42 @@ void DrasculaEngine::enterRoom(int roomIndex) { p.parseString(roomDisk); p.parseInt(palLevel); - if (currentChapter == 2) - p.parseInt(martin); + if (currentChapter == 2) { + p.parseInt(overridenWidth); + + if (overridenWidth != 0) { + curWidth = overridenWidth; + p.parseInt(curHeight); + p.parseInt(feetHeight); + p.parseInt(stepX); + p.parseInt(stepY); + + p.parseString(surfaceName); + loadPic(surfaceName, frontSurface); + + p.parseString(surfaceName); + loadPic(surfaceName, extraSurface); - if (currentChapter == 2 && martin != 0) { - curWidth = martin; - p.parseInt(curHeight); - p.parseInt(feetHeight); - p.parseInt(stepX); - p.parseInt(stepY); + p.parseString(surfaceName); + // unused - p.parseString(pant1); - p.parseString(pant2); - p.parseString(pant3); - p.parseString(pant4); + p.parseString(surfaceName); + loadPic(surfaceName, backSurface); - strcpy(menuBackground, pant4); + strcpy(menuBackground, surfaceName); + } else { + curWidth = CHARACTER_WIDTH; + curHeight = CHARACTER_HEIGHT; + feetHeight = FEET_HEIGHT; + stepX = STEP_X; + stepY = STEP_Y; + + loadPic(97, extraSurface); + loadPic(96, frontSurface); + loadPic(99, backSurface); + + strcpy(menuBackground, "99.alg"); + } } p.parseInt(numRoomObjs); @@ -1745,27 +1765,6 @@ void DrasculaEngine::enterRoom(int roomIndex) { // no need to delete the stream, since TextResourceParser takes ownership // delete stream; - if (currentChapter == 2 && martin != 0) { - loadPic(pant2, extraSurface); - loadPic(pant1, frontSurface); - loadPic(pant4, backSurface); - } - - if (currentChapter == 2) { - if (martin == 0) { - stepX = STEP_X; - stepY = STEP_Y; - curHeight = CHARACTER_HEIGHT; - curWidth = CHARACTER_WIDTH; - feetHeight = FEET_HEIGHT; - loadPic(97, extraSurface); - loadPic(96, frontSurface); - loadPic(99, backSurface); - - strcpy(menuBackground, "99.alg"); - } - } - for (l = 0; l < numRoomObjs; l++) { if (objectNum[l] == objExit) objIsExit = l; |