diff options
Diffstat (limited to 'sword2/driver')
-rw-r--r-- | sword2/driver/animation.cpp | 18 | ||||
-rw-r--r-- | sword2/driver/animation.h | 2 | ||||
-rw-r--r-- | sword2/driver/d_sound.cpp | 10 |
3 files changed, 15 insertions, 15 deletions
diff --git a/sword2/driver/animation.cpp b/sword2/driver/animation.cpp index 90da608e69..4dd939be5b 100644 --- a/sword2/driver/animation.cpp +++ b/sword2/driver/animation.cpp @@ -167,7 +167,7 @@ void MoviePlayer::drawTextObject(AnimationState *anim, MovieTextObject *obj) { */ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], int32 leadInRes, int32 leadOutRes) { - PlayingSoundHandle leadInHandle; + SoundHandle leadInHandle; // This happens if the user quits during the "eye" smacker if (_vm->_quit) @@ -205,10 +205,10 @@ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], int32 lea playDummy(filename, text, leadOut, leadOutLen); #endif - _vm->_mixer->stopHandle(leadInHandle); + _snd->stopHandle(leadInHandle); // Wait for the lead-out to stop, if there is any. - while (_leadOutHandle.isActive()) { + while (_vm->_mixer->isSoundHandleActive(_leadOutHandle)) { _vm->_screen->updateDisplay(); _vm->_system->delayMillis(30); } @@ -224,7 +224,7 @@ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], int32 lea void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte *leadOut, uint32 leadOutLen) { uint frameCounter = 0, textCounter = 0; - PlayingSoundHandle handle; + SoundHandle handle; bool skipCutscene = false, textVisible = false; uint32 flags = SoundMixer::FLAG_16BITS; bool startNextText = false; @@ -282,7 +282,7 @@ void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte * } } - if (startNextText && !handle.isActive()) { + if (startNextText && !_snd->isSoundHandleActive(handle)) { _snd->playRaw(&handle, text[textCounter]->speech, text[textCounter]->speechBufferSize, 22050, flags); startNextText = false; } @@ -339,7 +339,7 @@ void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte * // If the speech is still playing, redraw the subtitles. At least in // the English version this is most noticeable in the "carib" cutscene. - if (textVisible && handle.isActive()) + if (textVisible && _snd->isSoundHandleActive(handle)) drawTextObject(anim, text[textCounter]); if (text) @@ -354,7 +354,7 @@ void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte * if (skipCutscene) _snd->stopHandle(handle); - while (handle.isActive()) { + while (_snd->isSoundHandleActive(handle)) { _vm->_screen->updateDisplay(false); _sys->delayMillis(100); } @@ -441,7 +441,7 @@ void MoviePlayer::playDummy(const char *filename, MovieTextObject *text[], byte tmpPal[255 * 4 + 2] = 255; _vm->_screen->setPalette(0, 256, tmpPal, RDPAL_INSTANT); - PlayingSoundHandle handle; + SoundHandle handle; bool skipCutscene = false; @@ -493,7 +493,7 @@ void MoviePlayer::playDummy(const char *filename, MovieTextObject *text[], byte // don't cut off the speech in mid-sentence, and - even more // importantly - that we don't free the sound buffer while it's in use. - while (handle.isActive()) { + while (_snd->isSoundHandleActive(handle)) { _vm->_screen->updateDisplay(false); _sys->delayMillis(100); } diff --git a/sword2/driver/animation.h b/sword2/driver/animation.h index 0dcac3fc81..c9d75da66e 100644 --- a/sword2/driver/animation.h +++ b/sword2/driver/animation.h @@ -77,7 +77,7 @@ private: byte *_textSurface; - PlayingSoundHandle _leadOutHandle; + SoundHandle _leadOutHandle; static struct MovieInfo _movies[]; diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp index 755aa1d73c..774f33c5cf 100644 --- a/sword2/driver/d_sound.cpp +++ b/sword2/driver/d_sound.cpp @@ -642,7 +642,7 @@ int32 Sound::musicTimeRemaining(void) { void Sound::muteSpeech(bool mute) { _speechMuted = mute; - if (_soundHandleSpeech.isActive()) { + if (_vm->_mixer->isSoundHandleActive(_soundHandleSpeech)) { uint volume = mute ? 0 : SoundMixer::kMaxChannelVolume; _vm->_mixer->setChannelVolume(_soundHandleSpeech, volume); @@ -672,7 +672,7 @@ void Sound::unpauseSpeech(void) { */ int32 Sound::stopSpeech() { - if (_soundHandleSpeech.isActive()) { + if (_vm->_mixer->isSoundHandleActive(_soundHandleSpeech)) { _vm->_mixer->stopHandle(_soundHandleSpeech); return RD_OK; } @@ -685,7 +685,7 @@ int32 Sound::stopSpeech() { */ int32 Sound::getSpeechStatus() { - return _soundHandleSpeech.isActive() ? RDSE_SAMPLEPLAYING : RDSE_SAMPLEFINISHED; + return _vm->_mixer->isSoundHandleActive(_soundHandleSpeech) ? RDSE_SAMPLEPLAYING : RDSE_SAMPLEFINISHED; } /** @@ -693,7 +693,7 @@ int32 Sound::getSpeechStatus() { */ int32 Sound::amISpeaking() { - if (!_speechMuted && !_speechPaused && _soundHandleSpeech.isActive()) + if (!_speechMuted && !_speechPaused && _vm->_mixer->isSoundHandleActive(_soundHandleSpeech)) return RDSE_SPEAKING; return RDSE_QUIET; @@ -818,7 +818,7 @@ int32 Sound::setFxIdVolumePan(int32 i, int vol, int pan) { _fxQueue[i].pan = (pan * 127) / 16; } - if (!_fxMuted && _fxQueue[i].handle.isActive()) { + if (!_fxMuted && _vm->_mixer->isSoundHandleActive(_fxQueue[i].handle)) { _vm->_mixer->setChannelVolume(_fxQueue[i].handle, _fxQueue[i].volume); if (pan != -1) _vm->_mixer->setChannelBalance(_fxQueue[i].handle, _fxQueue[i].pan); |