diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/drascula/actors.cpp | 2 | ||||
-rw-r--r-- | engines/drascula/animation.cpp | 174 | ||||
-rw-r--r-- | engines/drascula/drascula.cpp | 17 | ||||
-rw-r--r-- | engines/drascula/drascula.h | 1 | ||||
-rw-r--r-- | engines/drascula/graphics.cpp | 6 | ||||
-rw-r--r-- | engines/drascula/interface.cpp | 4 | ||||
-rw-r--r-- | engines/drascula/objects.cpp | 2 | ||||
-rw-r--r-- | engines/drascula/saveload.cpp | 2 | ||||
-rw-r--r-- | engines/drascula/sound.cpp | 4 |
9 files changed, 106 insertions, 106 deletions
diff --git a/engines/drascula/actors.cpp b/engines/drascula/actors.cpp index 8523b5b158..c0b0b7c98b 100644 --- a/engines/drascula/actors.cpp +++ b/engines/drascula/actors.cpp @@ -450,7 +450,7 @@ void DrasculaEngine::placeVonBraun(int pointX) { trackVonBraun = (pointX < vonBraunX) ? 0 : 1; vonBraunHasMoved = 1; - for (;;) { + while (!shouldQuit()) { updateEvents(); updateRoom(); updateScreen(); diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp index 10f1bf4651..f939a033d3 100644 --- a/engines/drascula/animation.cpp +++ b/engines/drascula/animation.cpp @@ -52,54 +52,54 @@ void DrasculaEngine::animation_1_1() { int l, l2, p; //int pixelPos[6]; - while (term_int == 0) { + while (term_int == 0 && !shouldQuit()) { playMusic(29); playFLI("logoddm.bin", 9); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; delay(600); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; clearRoom(); delay(340); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; playMusic(26); delay(500); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; playFLI("logoalc.bin", 8); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; clearRoom(); loadPic("cielo.alg", screenSurface, COMPLETE_PAL); black(); updateScreen(); fadeFromBlack(2); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; delay(900); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; color_abc(kColorRed); centerText(_textmisc[1], 160, 100); updateScreen(); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; delay(1000); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; delay(1200); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; playFLI("scrollb.bin", 9); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; clearRoom(); playSound(5); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; if (animate("scr2.bin", 17)) break; @@ -108,10 +108,10 @@ void DrasculaEngine::animation_1_1() { break; loadPic("cielo2.alg", screenSurface, COMPLETE_PAL); updateScreen(); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; fadeToBlack(1); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; clearRoom(); @@ -121,10 +121,10 @@ void DrasculaEngine::animation_1_1() { loadPic("aux104.alg", drawSurface2); playMusic(4); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; delay(400); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; for (l2 = 0; l2 < 3; l2++) @@ -132,13 +132,13 @@ void DrasculaEngine::animation_1_1() { copyBackground(); copyBackground(interf_x[l], interf_y[l], 156, 45, 63, 31, drawSurface2, screenSurface); updateScreen(); - if (getScan() == Common::KEYCODE_ESCAPE) { + if (getScan() == Common::KEYCODE_ESCAPE || shouldQuit()) { term_int = 1; break; } pause(3); } - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; l2 = 0; p = 0; @@ -157,17 +157,17 @@ void DrasculaEngine::animation_1_1() { } if (l2 == 7) l2 = 0; - if (getScan() == Common::KEYCODE_ESCAPE) { + if (getScan() == Common::KEYCODE_ESCAPE || shouldQuit()) { term_int = 1; break; } } - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; copyBackground(0, 0, 0, 0, 320, 200, screenSurface, bgSurface); talk_drascula_big(1); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; clearRoom(); @@ -187,17 +187,17 @@ void DrasculaEngine::animation_1_1() { placeDrascula(); updateScreen(); talk_igor(8, kIgorDch); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; copyBackground(); placeIgor(); placeDrascula(); updateScreen(); talk_drascula(2); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_drascula(3); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; if (animate("lib.bin", 16)) break; @@ -209,12 +209,12 @@ void DrasculaEngine::animation_1_1() { updateScreen(); pause(10); talk_solo(_textd[4],"d4.als"); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; loadPic("plan1.alg", screenSurface, HALF_PAL); updateScreen(); talk_solo(_textd[5], "d5.als"); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; if (animate("lib2.bin", 16)) break; @@ -223,7 +223,7 @@ void DrasculaEngine::animation_1_1() { updateScreen(); pause(20); talk_solo(_textd[6], "d6.als"); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; if (animate("lib2.bin", 16)) break; @@ -231,34 +231,34 @@ void DrasculaEngine::animation_1_1() { loadPic("plan3.alg", screenSurface, HALF_PAL); updateScreen(); pause(20); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_solo(_textd[7], "d7.als"); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; loadPic("plan3.alg", screenSurface, HALF_PAL); updateScreen(); talk_solo(_textd[8], "d8.als"); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; clearRoom(); loadPic(100, bgSurface, HALF_PAL); MusicFadeout(); stopMusic(); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_igor(9, kIgorDch); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_drascula(9); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_igor(10, kIgorDch); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; playMusic(11); talk_drascula(10); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; if (animate("rayo1.bin", 16)) break; @@ -276,14 +276,14 @@ void DrasculaEngine::animation_1_1() { black(); playMusic(23); fadeFromBlack(0); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; trackDrascula = 1; talk_igor(1, kIgorDch); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_drascula(11, 1); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; trackDrascula = 3; copyBackground(); @@ -297,7 +297,7 @@ void DrasculaEngine::animation_1_1() { placeDrascula(); updateScreen(); talk_drascula(12); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; trackDrascula = 3; copyBackground(); @@ -311,11 +311,11 @@ void DrasculaEngine::animation_1_1() { placeDrascula(); updateScreen(); talk_igor(2, kIgorDch); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; pause(13); talk_drascula(13, 1); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; trackDrascula = 3; copyBackground(); @@ -329,35 +329,35 @@ void DrasculaEngine::animation_1_1() { placeDrascula(); updateScreen(); talk_drascula(14); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_igor(3, kIgorDch); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_drascula(15); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_igor(4, kIgorDch); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_drascula(16); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_igor(5, kIgorDch); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; trackIgor = 3; talk_drascula(17); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; pause(18); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_igor(6, kIgorFront); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; fadeToBlack(0); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; clearRoom(); @@ -386,30 +386,30 @@ void DrasculaEngine::animation_2_1() { term_int = 0; - for (;;) { - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + while (!shouldQuit()) { + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; if (animate("ag.bin", 14)) break; loadPic("an11y13.alg", extraSurface); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_bartender(22); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; loadPic(97, extraSurface); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; pause(4); playSound(1); hiccup(18); finishSound(); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; clearRoom(); @@ -419,36 +419,36 @@ void DrasculaEngine::animation_2_1() { color_solo = kColorWhite; pause(80); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_solo(_textbj[1], "BJ1.als"); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; clearRoom(); loadPic("bj.alg", screenSurface, HALF_PAL); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; black(); updateScreen(); fadeFromBlack(1); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; color_solo = kColorYellow; talk_solo(_text[214], "214.als"); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; clearRoom(); loadPic(16, bgSurface, HALF_PAL); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; loadPic("auxbj.alg", drawSurface3); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; roomNumber = 16; - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; for (l = 0; l < 200; l++) factor_red[l] = 99; @@ -459,18 +459,18 @@ void DrasculaEngine::animation_2_1() { curY = 95; trackProtagonist = 1; hare_se_ve = 1; - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; loadPic("97g.alg", extraSurface); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; if (animate("lev.bin", 15)) break; gotoObject(100 + curWidth / 2, 99 + curHeight); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; trackProtagonist = 1; curX = 100; @@ -484,46 +484,46 @@ void DrasculaEngine::animation_2_1() { break; playMusic(9); loadPic(97, extraSurface); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; updateRoom(); updateScreen(); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; pause(120); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_solo(_text[223], "223.als"); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; color_solo = kColorWhite; updateRoom(); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; updateScreen(); pause(110); talk_solo(_textbj[11], "BJ11.als"); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; updateRoom(); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; updateScreen(); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; pause(118); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; gotoObject(132, 97 + curHeight); pause(60); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk(224); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk_bj(12); gotoObject(157, 98 + curHeight); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; if (animate("bes.bin", 16)) break; @@ -540,25 +540,25 @@ void DrasculaEngine::animation_2_1() { // Also check animation_9_6(), where the same hack was used by // the original roomNumber = -1; - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; pause(8); updateRoom(); updateScreen(); talk(225); pause(76); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; trackProtagonist = 1; updateRoom(); updateScreen(); talk(226); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; updateRoom(); updateScreen(); pause(30); - if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) + if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit()) break; talk(227); fadeToBlack(0); @@ -1259,7 +1259,7 @@ void DrasculaEngine::animation_1_5() { startWalking(); talk_bj(21); - for (;;) { + while (!shouldQuit()) { if (characterMoved == 0) break; updateRoom(); @@ -1496,7 +1496,7 @@ void DrasculaEngine::animation_13_5() { playMusic(18); - for (;;) { + while (!shouldQuit()) { updateRoom(); copyRect(frus_x[frame], frus_y[frame], frank_x, 81, 44, 87, backSurface, screenSurface); updateScreen(); diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 3ed8af3649..b931eb191c 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -156,6 +156,11 @@ DrasculaEngine::~DrasculaEngine() { freeTexts(_textd1); } +bool DrasculaEngine::hasFeature(EngineFeature f) const { + return + (f == kSupportsRTL); +} + Common::Error DrasculaEngine::run() { // Initialize backend initGraphics(320, 200, false); @@ -198,7 +203,7 @@ Common::Error DrasculaEngine::run() { checkCD(); - for (;;) { + while (!shouldQuit()) { int i; takeObject = 0; _menuBar = false; @@ -452,7 +457,7 @@ bool DrasculaEngine::runCurrentChapter() { showCursor(); - while (1) { + while (!shouldQuit()) { if (characterMoved == 0) { stepX = STEP_X; stepY = STEP_Y; @@ -636,8 +641,9 @@ bool DrasculaEngine::runCurrentChapter() { if (currentChapter != 3) framesWithoutAction++; - } + + return false; } @@ -772,11 +778,6 @@ void DrasculaEngine::updateEvents() { case Common::EVENT_RBUTTONUP: rightMouseButton = 1; break; - case Common::EVENT_QUIT: - // TODO - endChapter(); - _system->quit(); - break; default: break; } diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index 1bc8176b69..4608624614 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -325,6 +325,7 @@ protected: public: DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gameDesc); virtual ~DrasculaEngine(); + virtual bool hasFeature(EngineFeature f) const; Common::RandomSource *_rnd; const DrasculaGameDescription *_gameDescription; diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 70085b99af..9c5f3dc12a 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -417,7 +417,7 @@ void DrasculaEngine::screenSaver() { xr = mouseX; yr = mouseY; - for (;;) { + while (!shouldQuit()) { // efecto(bgSurface); memcpy(copia, bgSurface, 64000); @@ -497,7 +497,7 @@ void DrasculaEngine::playFLI(const char *filefli, int vel) { Common::SeekableReadStream *stream = _archives.open(filefli); LastFrame = _system->getMillis(); - while (playFrameSSN(stream) && (!term_int)) { + while (playFrameSSN(stream) && (!term_int) && !shouldQuit()) { if (getScan() == Common::KEYCODE_ESCAPE) term_int = 1; } @@ -651,6 +651,4 @@ bool DrasculaEngine::animate(const char *animationFile, int FPS) { return ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)); } - - } // End of namespace Drascula diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp index 1d17c77f83..04d9eb370d 100644 --- a/engines/drascula/interface.cpp +++ b/engines/drascula/interface.cpp @@ -99,7 +99,7 @@ bool DrasculaEngine::confirmExit() { updateScreen(); delay(100); - for (;;) { + while (!shouldQuit()) { key = getScan(); if (key != 0) break; @@ -153,7 +153,7 @@ void DrasculaEngine::enterName() { int v = 0, h = 0; char select2[23]; strcpy(select2, " "); - for (;;) { + while (!shouldQuit()) { select2[v] = '-'; copyBackground(115, 14, 115, 14, 176, 9, bgSurface, screenSurface); print_abc(select2, 117, 15); diff --git a/engines/drascula/objects.cpp b/engines/drascula/objects.cpp index 2bd1014083..6b507abc65 100644 --- a/engines/drascula/objects.cpp +++ b/engines/drascula/objects.cpp @@ -75,7 +75,7 @@ void DrasculaEngine::gotoObject(int pointX, int pointY) { roomY = pointY; startWalking(); - for (;;) { + while (!shouldQuit()) { updateRoom(); updateScreen(); updateEvents(); diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp index 4c288553a2..db67409890 100644 --- a/engines/drascula/saveload.cpp +++ b/engines/drascula/saveload.cpp @@ -64,7 +64,7 @@ bool DrasculaEngine::saveLoadScreen() { _system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true); setCursor(kCursorCrosshair); - for (;;) { + while (!shouldQuit()) { y = 27; copyBackground(); for (n = 0; n < NUM_SAVES; n++) { diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index b73874ef80..094f9ba817 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -55,7 +55,7 @@ void DrasculaEngine::volumeControls() { setCursor(kCursorCrosshair); showCursor(); - for (;;) { + while (!shouldQuit()) { int masterVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16), 0, 15); int voiceVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType) / 16), 0, 15); int musicVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16), 0, 15); @@ -146,7 +146,7 @@ void DrasculaEngine::stopSound() { void DrasculaEngine::MusicFadeout() { int org_vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType); - for (;;) { + while (!shouldQuit()) { int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType); vol -= 10; if (vol < 0) |