[Scummvm-cvs-logs] SF.net SVN: scummvm: [32262] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun May 25 01:05:02 CEST 2008
Revision: 32262
http://scummvm.svn.sourceforge.net/scummvm/?rev=32262&view=rev
Author: lordhoto
Date: 2008-05-24 16:05:01 -0700 (Sat, 24 May 2008)
Log Message:
-----------
Little cleanup.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/kyra_lok.h
scummvm/trunk/engines/kyra/script_lok.cpp
scummvm/trunk/engines/kyra/sound.cpp
scummvm/trunk/engines/kyra/sound_lok.cpp
Modified: scummvm/trunk/engines/kyra/kyra_lok.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_lok.h 2008-05-24 22:59:20 UTC (rev 32261)
+++ scummvm/trunk/engines/kyra/kyra_lok.h 2008-05-24 23:05:01 UTC (rev 32262)
@@ -209,6 +209,7 @@
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;
Modified: scummvm/trunk/engines/kyra/script_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_lok.cpp 2008-05-24 22:59:20 UTC (rev 32261)
+++ scummvm/trunk/engines/kyra/script_lok.cpp 2008-05-24 23:05:01 UTC (rev 32262)
@@ -727,8 +727,8 @@
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 @@
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;
Modified: scummvm/trunk/engines/kyra/sound.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound.cpp 2008-05-24 22:59:20 UTC (rev 32261)
+++ scummvm/trunk/engines/kyra/sound.cpp 2008-05-24 23:05:01 UTC (rev 32262)
@@ -95,7 +95,7 @@
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);
Modified: scummvm/trunk/engines/kyra/sound_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_lok.cpp 2008-05-24 22:59:20 UTC (rev 32261)
+++ scummvm/trunk/engines/kyra/sound_lok.cpp 2008-05-24 23:05:01 UTC (rev 32262)
@@ -80,4 +80,11 @@
}
}
+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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list