mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-11 19:54:03 +00:00
ACCESS: Use loadSoundTable instead of push_back in several places
This commit is contained in:
parent
6a7834a05e
commit
576bab349c
@ -222,14 +222,14 @@ void AccessEngine::speakText(ASurface *s, const Common::String &msg) {
|
||||
_events->clearEvents();
|
||||
while (!shouldQuit()) {
|
||||
_sound->freeSounds();
|
||||
Resource *sound = _sound->loadSound(_narateFile + 99, _sndSubFile);
|
||||
_sound->_soundTable.push_back(SoundEntry(sound, 1));
|
||||
_sound->loadSoundTable(0, _narateFile + 99, _sndSubFile);
|
||||
_sound->playSound(0);
|
||||
_scripts->cmdFreeSound();
|
||||
|
||||
while(_sound->isSFXPlaying() && !shouldQuit())
|
||||
_events->pollEvents();
|
||||
|
||||
_scripts->cmdFreeSound();
|
||||
|
||||
if (_events->isKeyMousePressed()) {
|
||||
_sndSubFile += soundsLeft;
|
||||
break;
|
||||
@ -257,11 +257,12 @@ void AccessEngine::speakText(ASurface *s, const Common::String &msg) {
|
||||
Resource *res = _sound->loadSound(_narateFile + 99, _sndSubFile);
|
||||
_sound->_soundTable.push_back(SoundEntry(res, 1));
|
||||
_sound->playSound(0);
|
||||
_scripts->cmdFreeSound();
|
||||
|
||||
while(_sound->isSFXPlaying() && !shouldQuit())
|
||||
_events->pollEvents();
|
||||
|
||||
_scripts->cmdFreeSound();
|
||||
|
||||
if (_events->_leftButton) {
|
||||
_events->debounceLeft();
|
||||
_sndSubFile += soundsLeft;
|
||||
|
@ -528,8 +528,8 @@ void AmazonEngine::startChapter(int chapter) {
|
||||
_sound->freeSounds();
|
||||
|
||||
if (isCD()) {
|
||||
_sound->_soundTable.push_back(SoundEntry(_sound->loadSound(115, 0), 1));
|
||||
_sound->_soundTable.push_back(SoundEntry(_sound->loadSound(115, 1), 1));
|
||||
_sound->loadSoundTable(0, 115, 0);
|
||||
_sound->loadSoundTable(1, 115, 1);
|
||||
_sound->playSound(0);
|
||||
_sound->playSound(1);
|
||||
|
||||
|
@ -490,12 +490,12 @@ void Opening::doTent() {
|
||||
_vm->_screen->setDisplayScan();
|
||||
_vm->_screen->forceFadeOut();
|
||||
_vm->_events->hideCursor();
|
||||
_vm->_sound->_soundTable.push_back(SoundEntry(_vm->_sound->loadSound(98, 39), 1));
|
||||
_vm->_sound->_soundTable.push_back(SoundEntry(_vm->_sound->loadSound(98, 14), 1));
|
||||
_vm->_sound->_soundTable.push_back(SoundEntry(_vm->_sound->loadSound(98, 15), 1));
|
||||
_vm->_sound->_soundTable.push_back(SoundEntry(_vm->_sound->loadSound(98, 16), 1));
|
||||
_vm->_sound->_soundTable.push_back(SoundEntry(_vm->_sound->loadSound(98, 31), 2));
|
||||
_vm->_sound->_soundTable.push_back(SoundEntry(_vm->_sound->loadSound(98, 52), 2));
|
||||
_vm->_sound->loadSoundTable(0, 98, 39);
|
||||
_vm->_sound->loadSoundTable(1, 98, 14);
|
||||
_vm->_sound->loadSoundTable(2, 98, 15);
|
||||
_vm->_sound->loadSoundTable(3, 98, 16);
|
||||
_vm->_sound->loadSoundTable(4, 98, 31, 2);
|
||||
_vm->_sound->loadSoundTable(5, 98, 52, 2);
|
||||
_vm->_sound->playSound(0);
|
||||
|
||||
_vm->_files->_setPaletteFlag = false;
|
||||
|
@ -56,7 +56,7 @@ void SoundManager::clearSounds() {
|
||||
}
|
||||
}
|
||||
|
||||
void SoundManager::loadSoundTable(int idx, int fileNum, int subfile) {
|
||||
void SoundManager::loadSoundTable(int idx, int fileNum, int subfile, int priority) {
|
||||
debugC(1, kDebugSound, "loadSoundTable(%d, %d, %d)", idx, fileNum, subfile);
|
||||
|
||||
Resource *soundResource;
|
||||
@ -67,7 +67,7 @@ void SoundManager::loadSoundTable(int idx, int fileNum, int subfile) {
|
||||
delete _soundTable[idx]._res;
|
||||
soundResource = _vm->_files->loadFile(fileNum, subfile);
|
||||
_soundTable[idx]._res = soundResource;
|
||||
_soundTable[idx]._priority = 1;
|
||||
_soundTable[idx]._priority = priority;
|
||||
}
|
||||
|
||||
Resource *SoundManager::loadSound(int fileNum, int subfile) {
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
SoundManager(AccessEngine *vm, Audio::Mixer *mixer);
|
||||
~SoundManager();
|
||||
|
||||
void loadSoundTable(int idx, int fileNum, int subfile);
|
||||
void loadSoundTable(int idx, int fileNum, int subfile, int priority = 1);
|
||||
|
||||
void playSound(int soundIndex);
|
||||
void checkSoundQueue();
|
||||
|
Loading…
Reference in New Issue
Block a user