From ae31469a9aa7163c4ed42414fbb2c6c95e2d7e8a Mon Sep 17 00:00:00 2001 From: D G Turner Date: Wed, 30 May 2012 04:23:34 +0100 Subject: DREAMWEB: Replaced vsync() function with waitForVSync(). As a call to waitForVSync() was the only contents of vsync(), there should be no functional change. --- engines/dreamweb/titles.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'engines/dreamweb/titles.cpp') diff --git a/engines/dreamweb/titles.cpp b/engines/dreamweb/titles.cpp index f7486ce687..3ed31fe13a 100644 --- a/engines/dreamweb/titles.cpp +++ b/engines/dreamweb/titles.cpp @@ -134,7 +134,7 @@ void DreamWebEngine::bibleQuote() { void DreamWebEngine::hangOne(uint16 delay) { do { - vSync(); + waitForVSync(); if (_lastHardKey == 1) return; // "hangonearly" } while (--delay); @@ -200,13 +200,13 @@ void DreamWebEngine::runIntroSeq() { _getBack = 0; do { - vSync(); + waitForVSync(); if (_lastHardKey == 1) break; spriteUpdate(); - vSync(); + waitForVSync(); if (_lastHardKey == 1) break; @@ -216,14 +216,14 @@ void DreamWebEngine::runIntroSeq() { reelsOnScreen(); afterIntroRoom(); useTimedText(); - vSync(); + waitForVSync(); if (_lastHardKey == 1) break; dumpMap(); dumpTimedText(); - vSync(); + waitForVSync(); if (_lastHardKey == 1) break; @@ -247,18 +247,18 @@ void DreamWebEngine::runEndSeq() { _getBack = 0; do { - vSync(); + waitForVSync(); spriteUpdate(); - vSync(); + waitForVSync(); delEverything(); printSprites(); reelsOnScreen(); afterIntroRoom(); useTimedText(); - vSync(); + waitForVSync(); dumpMap(); dumpTimedText(); - vSync(); + waitForVSync(); } while (_getBack != 1 && !_quitRequested); } -- cgit v1.2.3 From 628cfa3d47fb7ebad8dd26cb59f485e5c70dacb5 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 31 May 2012 05:16:10 +0100 Subject: DREAMWEB: Objectify Sound functions & data into DreamWebSound class. This change should have no functional change, but makes the sound code more decoupled, modular and readable, prior to attempting a fix for bug #3528164 - "DREAMWEB: missing sound effects/music cues during main title". --- engines/dreamweb/titles.cpp | 50 +++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 27 deletions(-) (limited to 'engines/dreamweb/titles.cpp') diff --git a/engines/dreamweb/titles.cpp b/engines/dreamweb/titles.cpp index 3ed31fe13a..fa6b1060fb 100644 --- a/engines/dreamweb/titles.cpp +++ b/engines/dreamweb/titles.cpp @@ -20,6 +20,7 @@ * */ +#include "dreamweb/sound.h" #include "dreamweb/dreamweb.h" #include "engines/util.h" @@ -32,38 +33,36 @@ void DreamWebEngine::endGame() { return; gettingShot(); getRidOfTempText(); - _volumeTo = 7; - _volumeDirection = 1; + _sound->volumeChange(7, 1); hangOn(200); } void DreamWebEngine::monkSpeaking() { _roomsSample = 35; - loadRoomsSample(); + _sound->loadRoomsSample(_roomsSample); GraphicsFile graphics; loadGraphicsFile(graphics, "G15"); clearWork(); showFrame(graphics, 160, 72, 0, 128); // show monk workToScreen(); - _volume = 7; - _volumeDirection = -1; - _volumeTo = hasSpeech() ? 5 : 0; - playChannel0(12, 255); + _sound->volumeSet(7); + _sound->volumeChange(hasSpeech() ? 5 : 0, -1); + _sound->playChannel0(12, 255); fadeScreenUps(); hangOn(300); // TODO: Subtitles+speech mode if (hasSpeech()) { for (int i = 40; i < 48; i++) { - loadSpeech('T', 83, 'T', i); + _speechLoaded = _sound->loadSpeech('T', 83, 'T', i); - playChannel1(50 + 12); + _sound->playChannel1(50 + 12); do { waitForVSync(); if (_quitRequested) return; - } while (_channel1Playing != 255); + } while (_sound->isChannel1Playing()); } } else { for (int i = 40; i <= 44; i++) { @@ -83,8 +82,7 @@ void DreamWebEngine::monkSpeaking() { } } - _volumeDirection = 1; - _volumeTo = 7; + _sound->volumeChange(7, 1); fadeScreenDowns(); hangOn(300); graphics.clear(); @@ -95,8 +93,7 @@ void DreamWebEngine::gettingShot() { clearPalette(); loadIntroRoom(); fadeScreenUps(); - _volumeTo = 0; - _volumeDirection = -1; + _sound->volumeChange(0, -1); runEndSeq(); clearBeforeLoad(); } @@ -127,7 +124,7 @@ void DreamWebEngine::bibleQuote() { return; // "biblequotearly" } - cancelCh0(); + _sound->cancelCh0(); _lastHardKey = 0; } @@ -147,10 +144,9 @@ void DreamWebEngine::intro() { _newLocation = 50; clearPalette(); loadIntroRoom(); - _volume = 7; - _volumeDirection = -1; - _volumeTo = hasSpeech() ? 4 : 0; - playChannel0(12, 255); + _sound->volumeSet(7); + _sound->volumeChange(hasSpeech() ? 4 : 0, -1); + _sound->playChannel0(12, 255); fadeScreenUps(); runIntroSeq(); @@ -286,14 +282,14 @@ void DreamWebEngine::set16ColPalette() { void DreamWebEngine::realCredits() { _roomsSample = 33; - loadRoomsSample(); - _volume = 0; + _sound->loadRoomsSample(_roomsSample); + _sound->volumeSet(0); initGraphics(640, 480, true); hangOn(35); showPCX("I01"); - playChannel0(12, 0); + _sound->playChannel0(12, 0); hangOne(2); @@ -319,7 +315,7 @@ void DreamWebEngine::realCredits() { } showPCX("I02"); - playChannel0(12, 0); + _sound->playChannel0(12, 0); hangOne(2); if (_lastHardKey == 1) { @@ -344,7 +340,7 @@ void DreamWebEngine::realCredits() { } showPCX("I03"); - playChannel0(12, 0); + _sound->playChannel0(12, 0); hangOne(2); if (_lastHardKey == 1) { @@ -369,7 +365,7 @@ void DreamWebEngine::realCredits() { } showPCX("I04"); - playChannel0(12, 0); + _sound->playChannel0(12, 0); hangOne(2); if (_lastHardKey == 1) { @@ -394,7 +390,7 @@ void DreamWebEngine::realCredits() { } showPCX("I05"); - playChannel0(12, 0); + _sound->playChannel0(12, 0); hangOne(2); if (_lastHardKey == 1) { @@ -427,7 +423,7 @@ void DreamWebEngine::realCredits() { return; // "realcreditsearly" } - playChannel0(13, 0); + _sound->playChannel0(13, 0); hangOne(350); if (_lastHardKey == 1) { -- cgit v1.2.3 From 6691424397bd9db6e022e64ca0b5c91e24d8d35d Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 31 May 2012 05:39:08 +0100 Subject: DREAMWEB: Remove irrelevant additions in SFX id 62 usage. --- engines/dreamweb/titles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/titles.cpp') diff --git a/engines/dreamweb/titles.cpp b/engines/dreamweb/titles.cpp index fa6b1060fb..f005279ba0 100644 --- a/engines/dreamweb/titles.cpp +++ b/engines/dreamweb/titles.cpp @@ -56,7 +56,7 @@ void DreamWebEngine::monkSpeaking() { for (int i = 40; i < 48; i++) { _speechLoaded = _sound->loadSpeech('T', 83, 'T', i); - _sound->playChannel1(50 + 12); + _sound->playChannel1(62); do { waitForVSync(); -- cgit v1.2.3