aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/ringworld2
diff options
context:
space:
mode:
authorPaul Gilbert2013-10-19 10:45:31 -0400
committerPaul Gilbert2013-10-19 10:45:31 -0400
commit33e75a8718136ede0b182099f045b08ede19bd5d (patch)
tree5a1eaaf4c22c19e79ac8d645ec94c502333fbc28 /engines/tsage/ringworld2
parenta9aaca460875c6d7a244e3f36a1cad62ec09411d (diff)
downloadscummvm-rg350-33e75a8718136ede0b182099f045b08ede19bd5d.tar.gz
scummvm-rg350-33e75a8718136ede0b182099f045b08ede19bd5d.tar.bz2
scummvm-rg350-33e75a8718136ede0b182099f045b08ede19bd5d.zip
TSAGE: Bugfixes for voice playback to work in conversations
Diffstat (limited to 'engines/tsage/ringworld2')
-rw-r--r--engines/tsage/ringworld2/ringworld2_speakers.cpp30
-rw-r--r--engines/tsage/ringworld2/ringworld2_speakers.h6
2 files changed, 18 insertions, 18 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp
index a43938230e..4be3212e77 100644
--- a/engines/tsage/ringworld2/ringworld2_speakers.cpp
+++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp
@@ -36,6 +36,7 @@ namespace Ringworld2 {
VisualSpeaker::VisualSpeaker(): Speaker() {
_delayAmount = 0;
+ _voiceDelayAmount = 0;
_frameNumber = R2_GLOBALS._events.getFrameNumber();
_color1 = 8;
_color2 = 0;
@@ -79,8 +80,7 @@ void VisualSpeaker::signal() {
_sceneText.show();
if ((R2_GLOBALS._speechSubtitles & SPEECH_VOICE) && _soundId) {
- // TODO: Check global that is passed
- setFrame2(/* word_55F90 */ 1);
+ setVoiceFrame(1);
}
} else if (_action && _object2) {
_action->setDelay(1);
@@ -108,14 +108,14 @@ void VisualSpeaker::dispatch() {
}
// Delay check for voice
- if (_delayAmount2) {
- if (frameNumber >= _frameNumber2) {
- _delayAmount2 = _delayAmount2 - (_frameNumber2 - frameNumber);
- _frameNumber2 = frameNumber;
-
- if (_delayAmount2 <= 0) {
- _delayAmount2 = 0;
- if (R2_GLOBALS._playStream.play(0, NULL)) {
+ if (_voiceDelayAmount) {
+ if (frameNumber >= _voiceFrameNumber) {
+ _voiceDelayAmount = _voiceDelayAmount - (frameNumber - _voiceFrameNumber);
+ _voiceFrameNumber = frameNumber;
+
+ if (_voiceDelayAmount <= 0) {
+ _voiceDelayAmount = 0;
+ if (R2_GLOBALS._playStream.play(_soundId, NULL)) {
_numFrames = 2;
_soundId = 0;
} else {
@@ -149,8 +149,8 @@ void VisualSpeaker::synchronize(Serializer &s) {
s.syncAsSint16LE(_numFrames);
s.syncAsSint16LE(_delayAmount);
s.syncAsUint32LE(_frameNumber);
- s.syncAsSint16LE(_delayAmount2);
- s.syncAsUint32LE(_frameNumber2);
+ s.syncAsSint16LE(_voiceDelayAmount);
+ s.syncAsUint32LE(_voiceFrameNumber);
}
void VisualSpeaker::setText(const Common::String &msg) {
@@ -266,9 +266,9 @@ void VisualSpeaker::setFrame(int numFrames) {
_frameNumber = R2_GLOBALS._events.getFrameNumber();
}
-void VisualSpeaker::setFrame2(int numFrames) {
- _delayAmount2 = numFrames;
- _frameNumber2 = R2_GLOBALS._events.getFrameNumber();
+void VisualSpeaker::setVoiceFrame(int numFrames) {
+ _voiceDelayAmount = numFrames;
+ _voiceFrameNumber = R2_GLOBALS._events.getFrameNumber();
}
void VisualSpeaker::setDelay(int delay) {
diff --git a/engines/tsage/ringworld2/ringworld2_speakers.h b/engines/tsage/ringworld2/ringworld2_speakers.h
index 1b87606381..a49bb1d3e5 100644
--- a/engines/tsage/ringworld2/ringworld2_speakers.h
+++ b/engines/tsage/ringworld2/ringworld2_speakers.h
@@ -49,11 +49,11 @@ public:
bool _removeObject;
uint32 _frameNumber;
int _numFrames;
- int _delayAmount2;
- uint32 _frameNumber2;
+ int _voiceDelayAmount;
+ uint32 _voiceFrameNumber;
private:
void setFrame(int numFrames);
- void setFrame2(int numFrames);
+ void setVoiceFrame(int numFrames);
public:
VisualSpeaker();