aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2008-05-24 23:05:01 +0000
committerJohannes Schickel2008-05-24 23:05:01 +0000
commit64910f8c5fb3a9e39e356fc2856d311d8ad77bd6 (patch)
treea5995aa6f6533d0a299b68c5731bd3359b30b06e /engines/kyra
parentaf7bc93c461bd5b7dbd4eeed01b87ad8dbc4e1a1 (diff)
downloadscummvm-rg350-64910f8c5fb3a9e39e356fc2856d311d8ad77bd6.tar.gz
scummvm-rg350-64910f8c5fb3a9e39e356fc2856d311d8ad77bd6.tar.bz2
scummvm-rg350-64910f8c5fb3a9e39e356fc2856d311d8ad77bd6.zip
Little cleanup.
svn-id: r32262
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/kyra_lok.h1
-rw-r--r--engines/kyra/script_lok.cpp9
-rw-r--r--engines/kyra/sound.cpp2
-rw-r--r--engines/kyra/sound_lok.cpp7
4 files changed, 12 insertions, 7 deletions
diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h
index fa884750e5..cb3062847e 100644
--- a/engines/kyra/kyra_lok.h
+++ b/engines/kyra/kyra_lok.h
@@ -209,6 +209,7 @@ public:
void snd_playWanderScoreViaMap(int command, int restart);
virtual void snd_playVoiceFile(int id);
void snd_voiceWaitForFinish(bool ingame = true);
+ uint32 snd_getVoicePlayTime();
protected:
int32 _speechPlayTime;
diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp
index d4825387d9..efa0f8e48f 100644
--- a/engines/kyra/script_lok.cpp
+++ b/engines/kyra/script_lok.cpp
@@ -727,8 +727,8 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
if (_flags.isTalkie) {
int specialTime = stackPos(7);
if (specialTime) {
- int32 voiceTime = _speechPlayTime;
- if (voiceTime && voiceTime != -1) {
+ uint32 voiceTime = snd_getVoicePlayTime();
+ if (voiceTime) {
int displayFrames = ABS(endFrame-startFrame)+1;
displayFrames *= maxTime;
assert(displayFrames != 0);
@@ -745,13 +745,10 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
if (voiceSync) {
uint32 voicePlayedTime = _sound->voicePlayedTime(_speechFile.c_str());
- if (voicePlayedTime >= (uint32)voiceTime)
+ if (voicePlayedTime >= voiceTime)
voiceTime = 0;
else
voiceTime -= voicePlayedTime;
-
- if (!snd_voiceIsPlaying())
- voiceTime = 0;
}
waitTime = voiceTime / displayFrames;
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp
index 137956196f..f8e2e1f1e0 100644
--- a/engines/kyra/sound.cpp
+++ b/engines/kyra/sound.cpp
@@ -95,7 +95,7 @@ int32 Sound::voicePlay(const char *file, bool isSfx) {
uint32 fileSize = 0;
byte *fileData = _vm->resource()->fileData(filenamebuffer, &fileSize);
if (!fileData)
- return false;
+ return 0;
Common::MemoryReadStream vocStream(fileData, fileSize);
audioStream = Audio::makeVOCStream(vocStream);
diff --git a/engines/kyra/sound_lok.cpp b/engines/kyra/sound_lok.cpp
index b12b1fa800..8a1d16a6b1 100644
--- a/engines/kyra/sound_lok.cpp
+++ b/engines/kyra/sound_lok.cpp
@@ -80,4 +80,11 @@ void KyraEngine_LoK::snd_voiceWaitForFinish(bool ingame) {
}
}
+uint32 KyraEngine_LoK::snd_getVoicePlayTime() {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_LoK::snd_getVoicePlayTime()");
+ if (!snd_voiceIsPlaying())
+ return 0;
+ return (_speechPlayTime != -1 ? _speechPlayTime : 0);
+}
+
} // end of namespace Kyra