aboutsummaryrefslogtreecommitdiff
path: root/engines/drascula
diff options
context:
space:
mode:
authorFilippos Karapetis2008-09-16 11:49:40 +0000
committerFilippos Karapetis2008-09-16 11:49:40 +0000
commit6a4d96649ebacbd6dfc5fe38080013bc14294bcf (patch)
tree6ce239aba3404df86f9e20780bbb9e094cbd4392 /engines/drascula
parent706fb37061d96fdf5c8d1a202d6dcc9a799c8d2b (diff)
downloadscummvm-rg350-6a4d96649ebacbd6dfc5fe38080013bc14294bcf.tar.gz
scummvm-rg350-6a4d96649ebacbd6dfc5fe38080013bc14294bcf.tar.bz2
scummvm-rg350-6a4d96649ebacbd6dfc5fe38080013bc14294bcf.zip
- Moved some includes away from drascula.h
- Moved grr() to talk.cpp - Removed the unnecessary parameter length from isTalkFinished() svn-id: r34577
Diffstat (limited to 'engines/drascula')
-rw-r--r--engines/drascula/drascula.cpp2
-rw-r--r--engines/drascula/drascula.h6
-rw-r--r--engines/drascula/interface.cpp21
-rw-r--r--engines/drascula/sound.cpp8
-rw-r--r--engines/drascula/talk.cpp59
5 files changed, 51 insertions, 45 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 4c825fbdcf..c1449ea2c9 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -709,7 +709,7 @@ void DrasculaEngine::updateEvents() {
Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
- AudioCD.updateCD();
+ updateMusic();
#ifdef _WIN32_WCE
if (eventMan->pollEvent(event)) {
diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h
index 83b99292f7..3b499f27a0 100644
--- a/engines/drascula/drascula.h
+++ b/engines/drascula/drascula.h
@@ -37,10 +37,7 @@
#include "common/keyboard.h"
#include "common/unarj.h"
-#include "sound/audiostream.h"
#include "sound/mixer.h"
-#include "sound/voc.h"
-#include "sound/audiocd.h"
#include "engines/engine.h"
@@ -477,7 +474,7 @@ public:
void placeDrascula();
void talkInit(const char *filename);
- bool isTalkFinished(int* length);
+ bool isTalkFinished();
void talk_igor(int, int);
void talk_drascula(int index, int talkerType = 0);
void talk_solo(const char *, const char *);
@@ -505,6 +502,7 @@ public:
void stopSound();
void playMusic(int p);
void stopMusic();
+ void updateMusic();
int musicStatus();
void updateRoom();
bool loadGame(const char *);
diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp
index 06c5f3dc87..32f07fce73 100644
--- a/engines/drascula/interface.cpp
+++ b/engines/drascula/interface.cpp
@@ -226,25 +226,4 @@ void DrasculaEngine::showMap() {
}
}
-void DrasculaEngine::grr() {
- int length = 30;
-
- color_abc(kColorDarkGreen);
-
- playFile("s10.als");
-
- updateRoom();
- copyBackground(253, 110, 150, 65, 20, 30, drawSurface3, screenSurface);
-
- if (withVoices == 0)
- centerText("groaaarrrrgghhhh!", 153, 65);
-
- updateScreen();
-
- while (!isTalkFinished(&length));
-
- updateRoom();
- updateScreen();
-}
-
} // End of namespace Drascula
diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp
index cacf725fa8..6a3d83cae6 100644
--- a/engines/drascula/sound.cpp
+++ b/engines/drascula/sound.cpp
@@ -23,6 +23,10 @@
*
*/
+#include "sound/mixer.h"
+#include "sound/voc.h"
+#include "sound/audiocd.h"
+
#include "drascula/drascula.h"
namespace Drascula {
@@ -119,6 +123,10 @@ void DrasculaEngine::stopMusic() {
AudioCD.stop();
}
+void DrasculaEngine::updateMusic() {
+ AudioCD.updateCD();
+}
+
int DrasculaEngine::musicStatus() {
return AudioCD.isPlaying();
}
diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp
index e91bdadadc..1e5b587929 100644
--- a/engines/drascula/talk.cpp
+++ b/engines/drascula/talk.cpp
@@ -36,9 +36,8 @@ void DrasculaEngine::talkInit(const char *filename) {
playFile(filename);
}
-bool DrasculaEngine::isTalkFinished(int* length) {
- byte key = getScan();
- if (key != 0)
+bool DrasculaEngine::isTalkFinished() {
+ if (getScan() != 0)
stopSound();
if (soundIsActive())
return false;
@@ -119,7 +118,7 @@ void DrasculaEngine::talk_igor(int index, int talkerType) {
updateScreen();
pause(3);
}
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
if ((talkerType == kIgorFront && currentChapter == 6) ||
talkerType == kIgorDoor || talkerType == kIgorSeated || talkerType == kIgorWig) {
@@ -176,7 +175,7 @@ void DrasculaEngine::talk_drascula(int index, int talkerType) {
pause(3);
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
if (talkerType == 0)
copyBackground();
@@ -225,7 +224,7 @@ void DrasculaEngine::talk_drascula_big(int index) {
byte key = getScan();
if (key == Common::KEYCODE_ESCAPE)
term_int = 1;
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
}
void DrasculaEngine::talk_solo(const char *said, const char *filename) {
@@ -251,7 +250,7 @@ void DrasculaEngine::talk_solo(const char *said, const char *filename) {
centerText(said, 173, 92);
}
updateScreen();
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
if (currentChapter == 6) {
copyBackground();
@@ -312,7 +311,7 @@ void DrasculaEngine::talk_bartender(int index, int talkerType) {
updateScreen();
pause(3);
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
updateRoom();
updateScreen();
@@ -360,7 +359,7 @@ void DrasculaEngine::talk_bj(int index) {
updateScreen();
}
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
updateRoom();
updateScreen();
@@ -477,7 +476,7 @@ void DrasculaEngine::talk(const char *said, const char *filename) {
updateScreen();
pause(3);
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
updateRoom();
updateScreen();
@@ -577,7 +576,7 @@ void DrasculaEngine::talk_vonBraun(int index, int talkerType) {
updateScreen();
}
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
updateRoom();
updateScreen();
@@ -633,7 +632,7 @@ void DrasculaEngine::talk_blind(int index) {
updateScreen();
pause(2);
p++;
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
}
void DrasculaEngine::talk_hacker(int index) {
@@ -653,7 +652,7 @@ void DrasculaEngine::talk_hacker(int index) {
if (withVoices == 0)
centerText(said, 156, 170);
updateScreen();
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
}
void DrasculaEngine::talk_werewolf(int index) {
@@ -722,7 +721,7 @@ void DrasculaEngine::talk_pen(const char *said, const char *filename, int talker
updateScreen();
pause(3);
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
flags[1] = 0;
copyBackground();
@@ -760,7 +759,7 @@ void DrasculaEngine::talk_bj_bed(int index) {
updateScreen();
pause(3);
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
updateRoom();
updateScreen();
@@ -796,7 +795,7 @@ void DrasculaEngine::talk_htel(int index) {
updateScreen();
pause(3);
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
copyBackground();
updateScreen();
@@ -879,7 +878,7 @@ void DrasculaEngine::talk_sync(const char *said, const char *filename, const cha
p++;
pause(3);
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
if (currentChapter == 1 && musicStatus() == 0 && flags[11] == 0)
playMusic(roomMusic);
@@ -912,7 +911,7 @@ void DrasculaEngine::talk_trunk(int index) {
updateScreen();
pause(4);
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
flags[19] = cara_antes;
updateRoom();
@@ -940,7 +939,29 @@ void DrasculaEngine::talk_generic(const char* said, const char* filename, int* f
updateScreen();
pause(3);
- } while (!isTalkFinished(&length));
+ } while (!isTalkFinished());
+
+ updateRoom();
+ updateScreen();
+}
+
+
+void DrasculaEngine::grr() {
+ int length = 30;
+
+ color_abc(kColorDarkGreen);
+
+ playFile("s10.als");
+
+ updateRoom();
+ copyBackground(253, 110, 150, 65, 20, 30, drawSurface3, screenSurface);
+
+ if (withVoices == 0)
+ centerText("groaaarrrrgghhhh!", 153, 65);
+
+ updateScreen();
+
+ while (!isTalkFinished());
updateRoom();
updateScreen();