diff -ur ScummVM-cvs20020908/scummvm/scumm/sound.cpp ScummVM-cvs20020908+hack/scummvm/scumm/sound.cpp
|
old
|
new
|
|
| 371 | 371 | b = isMouthSyncOff(_curSoundPos); |
| 372 | 372 | if (_mouthSyncMode != b) { |
| 373 | 373 | _mouthSyncMode = b; |
| 374 | | a->startAnimActor(b ? a->talkFrame2 : a->talkFrame1); |
| | 374 | if (_talk_sound_frame != -1) { |
| | 375 | a->startAnimActor(_talk_sound_frame); |
| | 376 | _talk_sound_frame = -1; |
| | 377 | } else |
| | 378 | a->startAnimActor(b ? a->talkFrame2 : a->talkFrame1); |
| 375 | 379 | } |
| 376 | 380 | } |
| 377 | 381 | } |
| … |
… |
|
| 582 | 586 | error("Sound que buffer overflow"); |
| 583 | 587 | } |
| 584 | 588 | |
| 585 | | void Sound::talkSound(uint32 a, uint32 b, int mode) { |
| | 589 | void Sound::talkSound(uint32 a, uint32 b, int mode, int frame) { |
| 586 | 590 | _talk_sound_a = a; |
| 587 | 591 | _talk_sound_b = b; |
| 588 | 592 | _talk_sound_mode = mode; |
| | 593 | _talk_sound_frame = frame; |
| 589 | 594 | } |
| 590 | 595 | |
| 591 | 596 | /* The sound code currently only supports General Midi. |
diff -ur ScummVM-cvs20020908/scummvm/scumm/sound.h ScummVM-cvs20020908+hack/scummvm/scumm/sound.h
|
old
|
new
|
|
| 56 | 56 | File *_sfxFile; |
| 57 | 57 | uint32 _talk_sound_a, _talk_sound_b; |
| 58 | 58 | byte _talk_sound_mode; |
| | 59 | int _talk_sound_frame; |
| 59 | 60 | bool _mouthSyncMode; |
| 60 | 61 | bool _endOfMouthSync; |
| 61 | 62 | uint16 _mouthSyncTimes[52]; |
| … |
… |
|
| 107 | 108 | void stopAllSounds(); |
| 108 | 109 | void clearSoundQue(); |
| 109 | 110 | void soundKludge(int16 * list); |
| 110 | | void talkSound(uint32 a, uint32 b, int mode); |
| | 111 | void talkSound(uint32 a, uint32 b, int mode, int frame); |
| 111 | 112 | void setupSound(); |
| 112 | 113 | void pauseSounds(bool pause); |
| 113 | 114 | int startSfxSound(File *file, int file_size); |
diff -ur ScummVM-cvs20020908/scummvm/scumm/string.cpp ScummVM-cvs20020908+hack/scummvm/scumm/string.cpp
|
old
|
new
|
|
| 174 | 174 | a = buffer[2] | (buffer[3] << 8) | (buffer[6] << 16) | (buffer[7] << 24); |
| 175 | 175 | b = buffer[10] | (buffer[11] << 8) | (buffer[14] << 16) | (buffer[15] << 24); |
| 176 | 176 | // if (_saveSound != 1) |
| 177 | | _sound->talkSound(a, b, 1); |
| | 177 | _sound->talkSound(a, b, 1, -1); |
| 178 | 178 | } |
| 179 | 179 | // warning("unkMessage1(\"%s\")", buffer); |
| 180 | 180 | } |
| … |
… |
|
| 196 | 196 | |
| 197 | 197 | void Scumm::CHARSET_1() |
| 198 | 198 | { |
| | 199 | uint32 talk_sound_a = 0; |
| | 200 | uint32 talk_sound_b = 0; |
| 199 | 201 | int s, i, t, c; |
| 200 | | int frme; |
| | 202 | int frme = -1; |
| 201 | 203 | Actor *a; |
| 202 | 204 | byte *buffer; |
| | 205 | bool has_talk_sound = false; |
| | 206 | bool has_anim = false; |
| 203 | 207 | |
| 204 | 208 | if (!_haveMsg) |
| 205 | 209 | return; |
| … |
… |
|
| 290 | 294 | } |
| 291 | 295 | |
| 292 | 296 | if (a && !string[0].no_talk_anim) { |
| 293 | | a->startAnimActor(a->talkFrame1); |
| | 297 | // a->startAnimActor(a->talkFrame1); |
| | 298 | has_anim = true; |
| 294 | 299 | _useTalkAnims = true; |
| 295 | 300 | } |
| 296 | 301 | |
| … |
… |
|
| 397 | 402 | } else if (c == 9) { |
| 398 | 403 | frme = *buffer++; |
| 399 | 404 | frme |= *buffer++ << 8; |
| 400 | | if (a) |
| 401 | | a->startAnimActor(frme); |
| | 405 | has_anim = true; |
| 402 | 406 | } else if (c == 10) { |
| 403 | | uint32 tmpA, tmpB; |
| 404 | | |
| 405 | | tmpA = buffer[0] | (buffer[1] << 8) | (buffer[4] << 16) | (buffer[5] << 24); |
| 406 | | tmpB = buffer[8] | (buffer[9] << 8) | (buffer[12] << 16) | (buffer[13] << 24); |
| 407 | | _sound->talkSound(tmpA, tmpB, 2); |
| | 407 | talk_sound_a = buffer[0] | (buffer[1] << 8) | (buffer[4] << 16) | (buffer[5] << 24); |
| | 408 | talk_sound_b = buffer[8] | (buffer[9] << 8) | (buffer[12] << 16) | (buffer[13] << 24); |
| | 409 | has_talk_sound = true; |
| 408 | 410 | buffer += 14; |
| 409 | 411 | |
| 410 | 412 | // Set flag that speech variant exist of this msg |
| … |
… |
|
| 436 | 438 | } |
| 437 | 439 | } while (1); |
| 438 | 440 | |
| | 441 | // Even if talkSound() is called, we may still have to call |
| | 442 | // startAnimActor() since actorTalk() may already have caused the |
| | 443 | // wrong animation frame to be drawn, and the talkSound() won't be |
| | 444 | // processed until after the next screen update. Bleah. |
| | 445 | |
| | 446 | if (has_talk_sound) |
| | 447 | _sound->talkSound(talk_sound_a, talk_sound_b, 2, frme); |
| | 448 | if (a && has_anim) |
| | 449 | a->startAnimActor(frme != -1 ? frme : a->talkFrame1); |
| | 450 | |
| 439 | 451 | charset._bufPos = buffer - charset._buffer; |
| 440 | 452 | |
| 441 | 453 | gdi._mask_left = charset._strLeft; |