mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 04:28:37 +00:00
Little cleanup.
svn-id: r32262
This commit is contained in:
parent
af7bc93c46
commit
64910f8c5f
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user