diff -ur --exclude=CVS ScummVM/scummvm/simon/simon.cpp ScummVM+hack/scummvm/simon/simon.cpp
old
|
new
|
|
4746 | 4746 | |
4747 | 4747 | _rnd.getRandomNumber(2); |
4748 | 4748 | |
| 4749 | _sound->pollVoice(); |
| 4750 | |
4749 | 4751 | do { |
4750 | 4752 | while (!_in_callback && cur >= _last_vga_tick + vga_period) { |
4751 | 4753 | _last_vga_tick += vga_period; |
diff -ur --exclude=CVS ScummVM/scummvm/simon/sound.cpp ScummVM+hack/scummvm/simon/sound.cpp
old
|
new
|
|
399 | 399 | _voice = new RawSound(_mixer, file, 0, SOUND_BIG_ENDIAN); |
400 | 400 | } |
401 | 401 | |
| 402 | #define VOICE_QUEUE_ENTRIES 10 |
| 403 | |
| 404 | static int pendingVoices = 0; |
| 405 | static uint voiceQueue[VOICE_QUEUE_ENTRIES]; |
| 406 | |
402 | 407 | void SimonSound::playVoice(uint sound) { |
| 408 | if (pendingVoices >= VOICE_QUEUE_ENTRIES) { |
| 409 | warning("Voice queue overflow"); |
| 410 | return; |
| 411 | } |
| 412 | |
| 413 | voiceQueue[pendingVoices++] = sound; |
| 414 | } |
| 415 | |
| 416 | void SimonSound::pollVoice() { |
| 417 | if (_voice_handle || pendingVoices == 0) |
| 418 | return; |
| 419 | |
| 420 | uint sound = voiceQueue[0]; |
| 421 | pendingVoices--; |
| 422 | |
| 423 | for (int i = 0; i < pendingVoices; i++) |
| 424 | voiceQueue[i] = voiceQueue[i + 1]; |
| 425 | |
403 | 426 | if (_game == GAME_SIMON2MAC && _filenums) { |
404 | 427 | stopAll(); |
405 | 428 | |
diff -ur --exclude=CVS ScummVM/scummvm/simon/sound.h ScummVM+hack/scummvm/simon/sound.h
old
|
new
|
|
63 | 63 | void readVoiceFile(const char *filename, const Common::String &gameDataPath); |
64 | 64 | |
65 | 65 | void playVoice(uint sound); |
| 66 | void pollVoice(); |
66 | 67 | void playEffects(uint sound); |
67 | 68 | void playAmbient(uint sound); |
68 | 69 | |