diff options
author | Littleboy | 2011-06-28 22:10:29 -0400 |
---|---|---|
committer | Littleboy | 2011-06-28 22:13:40 -0400 |
commit | 6eace0ca759bc62b6b0b6cf69a4341b4d1bb43e4 (patch) | |
tree | 662f45a755c6ac8bf866276781746867395a74b5 /engines/lastexpress/entities | |
parent | d1341387e3c396aa6b48b39379afc9e201448048 (diff) | |
download | scummvm-rg350-6eace0ca759bc62b6b0b6cf69a4341b4d1bb43e4.tar.gz scummvm-rg350-6eace0ca759bc62b6b0b6cf69a4341b4d1bb43e4.tar.bz2 scummvm-rg350-6eace0ca759bc62b6b0b6cf69a4341b4d1bb43e4.zip |
LASTEXPRESS: Move sound queue related functions to a separate class
- Implement missing queue reset function
- Cleanup SoundManager::playLoopingSound()
Diffstat (limited to 'engines/lastexpress/entities')
23 files changed, 260 insertions, 214 deletions
diff --git a/engines/lastexpress/entities/abbot.cpp b/engines/lastexpress/entities/abbot.cpp index 112edec9af..6fcadcfa54 100644 --- a/engines/lastexpress/entities/abbot.cpp +++ b/engines/lastexpress/entities/abbot.cpp @@ -34,6 +34,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -1409,7 +1411,7 @@ IMPLEMENT_FUNCTION(43, Abbot, function43) setup_playSound("Abb4002"); break; } else { - if (!getEntities()->isDistanceBetweenEntities(kEntityAbbot, kEntityPlayer, 1000) || getSound()->isBuffered(kEntityBoutarel) || !params->param4) + if (!getEntities()->isDistanceBetweenEntities(kEntityAbbot, kEntityPlayer, 1000) || getSoundQueue()->isBuffered(kEntityBoutarel) || !params->param4) params->param4 = (uint)getState()->time + 450; if (params->param4 < getState()->time) { @@ -1754,7 +1756,7 @@ IMPLEMENT_FUNCTION(49, Abbot, pickBomb) break; case kActionKnock: - if (!getSound()->isBuffered("LIB012", true)) + if (!getSoundQueue()->isBuffered("LIB012", true)) getSound()->playSound(kEntityPlayer, "LIB012"); break; diff --git a/engines/lastexpress/entities/anna.cpp b/engines/lastexpress/entities/anna.cpp index d794cc8520..2eb3a9ec85 100644 --- a/engines/lastexpress/entities/anna.cpp +++ b/engines/lastexpress/entities/anna.cpp @@ -34,6 +34,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -312,7 +314,7 @@ IMPLEMENT_FUNCTION(12, Anna, function12) params->param4 = 0; params->param5 = 0; } else { - getSound()->removeFromQueue(kEntityAnna); + getSoundQueue()->removeFromQueue(kEntityAnna); getObjects()->update(kObjectCompartmentF, kEntityAnna, kObjectLocation1, kCursorNormal, kCursorNormal); getObjects()->update(kObject53, kEntityAnna, kObjectLocation1, kCursorNormal, kCursorNormal); @@ -323,7 +325,7 @@ IMPLEMENT_FUNCTION(12, Anna, function12) break; case kActionOpenDoor: - getSound()->removeFromQueue(kEntityAnna); + getSoundQueue()->removeFromQueue(kEntityAnna); setCallback(3); setup_playSound("LIB013"); break; @@ -339,8 +341,8 @@ IMPLEMENT_FUNCTION(12, Anna, function12) getEntities()->drawSequenceLeft(kEntityAnna, "418C"); - if (getSound()->isBuffered(kEntityAnna)) - getSound()->processEntry(kEntityAnna); + if (getSoundQueue()->isBuffered(kEntityAnna)) + getSoundQueue()->processEntry(kEntityAnna); getSound()->playSound(kEntityAnna, "ANN2135A"); break; @@ -379,7 +381,7 @@ IMPLEMENT_FUNCTION(12, Anna, function12) break; case 3: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { setCallback(4); setup_playSound("MAX1120"); break; @@ -503,7 +505,7 @@ IMPLEMENT_FUNCTION_IS(15, Anna, function15, TimeValue) break; case 1: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { setCallback(2); setup_playSound("MAX1120"); break; @@ -1456,7 +1458,7 @@ label_callback_1: case 2: case 3: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { setCallback(4); setup_playSound("MAX1120"); break; @@ -1521,8 +1523,8 @@ IMPLEMENT_FUNCTION(35, Anna, function35) case kActionKnock: case kActionOpenDoor: - if (getSound()->isBuffered(kEntityAnna)) - getSound()->processEntry(kEntityAnna); + if (getSoundQueue()->isBuffered(kEntityAnna)) + getSoundQueue()->processEntry(kEntityAnna); if (savepoint.action == kActionKnock) getSound()->playSound(kEntityPlayer, "LIB012"); @@ -1564,8 +1566,8 @@ IMPLEMENT_FUNCTION(35, Anna, function35) break; case kAction226031488: - if (getSound()->isBuffered(kEntityAnna)) - getSound()->processEntry(kEntityAnna); + if (getSoundQueue()->isBuffered(kEntityAnna)) + getSoundQueue()->processEntry(kEntityAnna); getSavePoints()->push(kEntityAnna, kEntityMax, kAction71277948); break; @@ -1844,7 +1846,7 @@ IMPLEMENT_FUNCTION(41, Anna, function41) case 1: case 2: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { setCallback(3); setup_playSound("MAX1120"); break; @@ -2090,7 +2092,7 @@ IMPLEMENT_FUNCTION(48, Anna, function48) break; if (params->param3 != kTimeInvalid && getState()->time > kTime1969200) { - UPDATE_PARAM_PROC_TIME(kTime1983600, (!getEntities()->isInRestaurant(kEntityPlayer) || getSound()->isBuffered(kEntityBoutarel)), params->param3, 150) + UPDATE_PARAM_PROC_TIME(kTime1983600, (!getEntities()->isInRestaurant(kEntityPlayer) || getSoundQueue()->isBuffered(kEntityBoutarel)), params->param3, 150) setCallback(3); setup_playSound("Aug3007A"); break; @@ -2481,7 +2483,7 @@ IMPLEMENT_FUNCTION(53, Anna, function53) break; case 1: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { setCallback(2); setup_playSound("MAX1120"); break; @@ -2620,7 +2622,7 @@ IMPLEMENT_FUNCTION(54, Anna, function54) break; case 1: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { setCallback(2); setup_playSound("MAX1120"); break; @@ -2789,7 +2791,7 @@ IMPLEMENT_FUNCTION(57, Anna, function57) break; case 4: - if (getSound()->isBuffered(kEntityAugust)) { + if (getSoundQueue()->isBuffered(kEntityAugust)) { setCallback(4); setup_updateFromTime(75); } else { @@ -2817,7 +2819,7 @@ IMPLEMENT_FUNCTION(57, Anna, function57) case kAction123712592: getEntities()->drawSequenceLeft(kEntityAnna, "628Af"); - if (getSound()->isBuffered(kEntityAugust)) { + if (getSoundQueue()->isBuffered(kEntityAugust)) { setCallback(4); setup_updateFromTime(75); } else { @@ -3158,8 +3160,8 @@ IMPLEMENT_FUNCTION(63, Anna, function63) // Anna will get killed... case kAction272177921: - if (getSound()->isBuffered("MUS012")) - getSound()->processEntry("MUS012"); + if (getSoundQueue()->isBuffered("MUS012")) + getSoundQueue()->processEntry("MUS012"); setCallback(1); setup_savegame(kSavegameTypeEvent, kEventAnnaKilled); @@ -3935,8 +3937,8 @@ IMPLEMENT_FUNCTION(80, Anna, function80) break; case 1: - if (getSound()->isBuffered(kEntityAnna)) - getSound()->processEntry(kEntityAnna); + if (getSoundQueue()->isBuffered(kEntityAnna)) + getSoundQueue()->processEntry(kEntityAnna); getAction()->playAnimation(kEventKronosBringFirebird); getScenes()->loadSceneFromItem(kItemFirebird); @@ -3951,8 +3953,8 @@ IMPLEMENT_FUNCTION(80, Anna, function80) case 3: getProgress().isEggOpen = true; - if (getSound()->isBuffered(kEntityAnna)) - getSound()->processEntry(kEntityAnna); + if (getSoundQueue()->isBuffered(kEntityAnna)) + getSoundQueue()->processEntry(kEntityAnna); getAction()->playAnimation(kEventKronosOpenFirebird); getScenes()->loadSceneFromPosition(kCarRestaurant, 3); diff --git a/engines/lastexpress/entities/august.cpp b/engines/lastexpress/entities/august.cpp index fbd50d64fb..44dd3eb579 100644 --- a/engines/lastexpress/entities/august.cpp +++ b/engines/lastexpress/entities/august.cpp @@ -36,6 +36,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -1427,7 +1429,7 @@ IMPLEMENT_FUNCTION(29, August, function29) if (getState()->time < kTime1134000) { if (!getEntities()->isInRestaurant(kEntityPlayer) - || getSound()->isBuffered("MRB1076") || getSound()->isBuffered("MRB1078") || getSound()->isBuffered("MRB1078A")) + || getSoundQueue()->isBuffered("MRB1076") || getSoundQueue()->isBuffered("MRB1078") || getSoundQueue()->isBuffered("MRB1078A")) params->param3 = (uint)getState()->time + 225; if (params->param3 > getState()->time) @@ -1762,7 +1764,7 @@ IMPLEMENT_FUNCTION(34, August, function34) break; case kActionNone: - if (!getSound()->isBuffered(kEntityAugust) && getProgress().field_18 != 4) + if (!getSoundQueue()->isBuffered(kEntityAugust) && getProgress().field_18 != 4) getSound()->playSound(kEntityAugust, "AUG1057"); // August snoring break; @@ -2183,7 +2185,7 @@ IMPLEMENT_FUNCTION_III(42, August, function42, CarIndex, EntityPosition, bool) break; case kActionExcuseMe: - if (!getSound()->isBuffered(kEntityAugust)) + if (!getSoundQueue()->isBuffered(kEntityAugust)) getSound()->excuseMe(kEntityAugust); break; @@ -3343,7 +3345,7 @@ IMPLEMENT_FUNCTION(65, August, function65) getObjects()->update(kObjectCompartment3, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand); - if (!getSound()->isBuffered(kEntityAugust)) + if (!getSoundQueue()->isBuffered(kEntityAugust)) getSound()->playSound(kEntityAugust, "AUG1057"); // August snoring break; } @@ -3504,9 +3506,9 @@ IMPLEMENT_FUNCTION(69, August, unhookCars) break; case kActionDefault: - getSound()->processEntries(); - if (getSound()->isBuffered("ARRIVE")) - getSound()->removeFromQueue("ARRIVE"); + getSoundQueue()->processEntries(); + if (getSoundQueue()->isBuffered("ARRIVE")) + getSoundQueue()->removeFromQueue("ARRIVE"); setCallback(1); setup_savegame(kSavegameTypeEvent, kEventAugustUnhookCarsBetrayal); @@ -3516,7 +3518,7 @@ IMPLEMENT_FUNCTION(69, August, unhookCars) if (getCallback() == 1) { getAction()->playAnimation(getProgress().field_C ? kEventAugustUnhookCarsBetrayal : kEventAugustUnhookCars); getEntities()->clearSequences(kEntityAugust); - getSound()->resetState(); + getSoundQueue()->resetState(); getSound()->playSound(kEntityPlayer, "MUS050"); getScenes()->loadSceneFromPosition(kCarRestaurant, 85, 1); getSavePoints()->pushAll(kEntityAugust, kActionProceedChapter5); diff --git a/engines/lastexpress/entities/boutarel.cpp b/engines/lastexpress/entities/boutarel.cpp index db7761784f..cf5d286d64 100644 --- a/engines/lastexpress/entities/boutarel.cpp +++ b/engines/lastexpress/entities/boutarel.cpp @@ -32,6 +32,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -941,7 +943,7 @@ IMPLEMENT_FUNCTION(29, Boutarel, function29) if (getEntities()->isInRestaurant(kEntityAnna) && getEntities()->isInRestaurant(kEntityAugust) - && !getSound()->isBuffered(kEntityBoutarel) + && !getSoundQueue()->isBuffered(kEntityBoutarel) && params->param3 != kTimeInvalid) { if (getState()->time <= kTime1998000) diff --git a/engines/lastexpress/entities/chapters.cpp b/engines/lastexpress/entities/chapters.cpp index d4425ada43..53d89e9699 100644 --- a/engines/lastexpress/entities/chapters.cpp +++ b/engines/lastexpress/entities/chapters.cpp @@ -65,6 +65,8 @@ #include "lastexpress/menu/menu.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" @@ -164,16 +166,16 @@ IMPLEMENT_FUNCTION(6, Chapters, chapter1End) break; case kActionKnock: - if (!getSound()->isBuffered("LIB012", true)) + if (!getSoundQueue()->isBuffered("LIB012", true)) getSound()->playSound(kEntityPlayer, "LIB012"); break; case kActionOpenDoor: if (params->param1) { getEntities()->clearSequences(kEntityChapters); - getSound()->processEntry(kEntityChapters); + getSoundQueue()->processEntry(kEntityChapters); getSound()->playSound(kEntityPlayer, "LIB014"); - getSound()->resetState(); + getSoundQueue()->resetState(); ENTITY_PARAM(0, 4) = 7; @@ -194,7 +196,7 @@ IMPLEMENT_FUNCTION(6, Chapters, chapter1End) getSound()->playSound(kEntityPlayer, "LIB014"); getSound()->playSound(kEntityPlayer, "LIB015", kFlagDefault, 15); - if (!getSound()->isBuffered(kEntityChapters)) + if (!getSoundQueue()->isBuffered(kEntityChapters)) getSound()->playSound(kEntityChapters, "MUS009", kFlagDefault); getScenes()->loadSceneFromPosition(kCarLocomotive, 38); @@ -241,42 +243,42 @@ IMPLEMENT_FUNCTION(6, Chapters, chapter1End) RESET_ENTITY_STATE(kEntityHadija, Alouan, setup_function12); if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; } - getSound()->processEntries(); + getSoundQueue()->processEntries(); - if (getSound()->isBuffered("CON1505")) - getSound()->processEntry("CON1505"); + if (getSoundQueue()->isBuffered("CON1505")) + getSoundQueue()->processEntry("CON1505"); - if (getSound()->isBuffered("AUG1057")) - getSound()->processEntry("AUG1057"); + if (getSoundQueue()->isBuffered("AUG1057")) + getSoundQueue()->processEntry("AUG1057"); - if (getSound()->isBuffered("ZFX1005")) - getSound()->processEntry("ZFX1005"); + if (getSoundQueue()->isBuffered("ZFX1005")) + getSoundQueue()->processEntry("ZFX1005"); - if (getSound()->isBuffered("ZFX1006")) - getSound()->processEntry("ZFX1006"); + if (getSoundQueue()->isBuffered("ZFX1006")) + getSoundQueue()->processEntry("ZFX1006"); - if (getSound()->isBuffered("ZFX1007")) - getSound()->processEntry("ZFX1007"); + if (getSoundQueue()->isBuffered("ZFX1007")) + getSoundQueue()->processEntry("ZFX1007"); - if (getSound()->isBuffered("ZFX1007A")) - getSound()->processEntry("ZFX1007A"); + if (getSoundQueue()->isBuffered("ZFX1007A")) + getSoundQueue()->processEntry("ZFX1007A"); - if (getSound()->isBuffered("ZFX1007B")) - getSound()->processEntry("ZFX1007B"); + if (getSoundQueue()->isBuffered("ZFX1007B")) + getSoundQueue()->processEntry("ZFX1007B"); getSound()->playSound(kEntityPlayer, "MUS008", kFlagDefault); getInventory()->unselectItem(); // FIXME add event pump ? - while (getSound()->isBuffered("MUS008")) - getSound()->updateQueue(); + while (getSoundQueue()->isBuffered("MUS008")) + getSoundQueue()->updateQueue(); getProgress().field_84 = true; @@ -301,7 +303,7 @@ IMPLEMENT_FUNCTION(6, Chapters, chapter1End) if (params->param2 >= 3) { - if (!getSound()->isBuffered("LIB031", true)) + if (!getSoundQueue()->isBuffered("LIB031", true)) getSound()->playSound(kEntityPlayer, "LIB031"); if (params->param2 == 3) { @@ -319,7 +321,7 @@ IMPLEMENT_FUNCTION(7, Chapters, chapter1Init) return; getProgress().chapter = kChapter1; - getSound()->resetState(); + getSoundQueue()->resetState(); getState()->time = kTimeChapter1; getState()->timeDelta = 0; @@ -385,7 +387,7 @@ IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// #define PLAY_STEAM() { \ - getSound()->resetState(); \ + getSoundQueue()->resetState(); \ getSound()->playSteam((CityIndex)ENTITY_PARAM(0, 4)); \ ENTITY_PARAM(0, 2) = 0; \ } @@ -563,7 +565,7 @@ label_chapter1_next: } if (ENTITY_PARAM(0, 3)) { - getSound()->resetState(); + getSoundQueue()->resetState(); ENTITY_PARAM(0, 3) = 0; if (params->param4) { @@ -694,7 +696,7 @@ IMPLEMENT_FUNCTION(9, Chapters, chapter1Next) if (savepoint.action == kActionDefault) { // Reset sound cache if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; } @@ -702,8 +704,8 @@ IMPLEMENT_FUNCTION(9, Chapters, chapter1Next) getSound()->playSound(kEntityPlayer, "MUS008", kFlagDefault); getInventory()->unselectItem(); - while (getSound()->isBuffered("MUS008")) - getSound()->updateQueue(); + while (getSoundQueue()->isBuffered("MUS008")) + getSoundQueue()->updateQueue(); setup_chapter2(); } @@ -790,7 +792,7 @@ IMPLEMENT_FUNCTION(11, Chapters, chapter2Init) // Reset sound cache if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; } @@ -874,7 +876,7 @@ IMPLEMENT_FUNCTION(14, Chapters, chapter3Init) getObjects()->update(kObject107, kEntityPlayer, kObjectLocation3, kCursorKeepValue, kCursorKeepValue); if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; } @@ -987,7 +989,7 @@ label_callback_8: } } - getSound()->resetState(); + getSoundQueue()->resetState(); getSound()->playSteam((CityIndex)ENTITY_PARAM(0, 4)); ENTITY_PARAM(0, 2) = 0; @@ -998,7 +1000,7 @@ label_callback_8: } if (ENTITY_PARAM(0, 3)) { - getSound()->resetState(); + getSoundQueue()->resetState(); ENTITY_PARAM(0, 3) = 0; } break; @@ -1150,8 +1152,8 @@ IMPLEMENT_FUNCTION(18, Chapters, chapter4Init) if (savepoint.action != kActionDefault) return; - getSound()->processEntries(); - getSound()->resetState(); + getSoundQueue()->processEntries(); + getSoundQueue()->resetState(); getProgress().isTrainRunning = true; @@ -1177,7 +1179,7 @@ IMPLEMENT_FUNCTION(18, Chapters, chapter4Init) getObjects()->update(kObject107, kEntityPlayer, kObjectLocation3, kCursorKeepValue, kCursorKeepValue); if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; } @@ -1319,7 +1321,7 @@ label_callback_4: } if (ENTITY_PARAM(0, 3)) { - getSound()->resetState(); + getSoundQueue()->resetState(); ENTITY_PARAM(0, 3) = 0; } else if (!params->param2 && !params->param3) { getSound()->playSound(kEntityChapters, "ZFX1001"); @@ -1356,17 +1358,17 @@ label_callback_4: goto label_callback_4; case 5: - if (getSound()->isBuffered(kEntityChapters)) - getSound()->removeFromQueue(kEntityChapters); + if (getSoundQueue()->isBuffered(kEntityChapters)) + getSoundQueue()->removeFromQueue(kEntityChapters); getAction()->playAnimation(kEventTrainExplosionBridge); getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneNone, true); break; case 6: - getSound()->processEntries(); + getSoundQueue()->processEntries(); getAction()->playAnimation(kEventTylerCastleDream); - getSound()->resetState(); + getSoundQueue()->resetState(); getProgress().field_18 = 1; @@ -1465,7 +1467,7 @@ label_callback_4: params->param1 = 1; if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; @@ -1474,8 +1476,8 @@ label_callback_4: getSound()->playSound(kEntityPlayer, "MUS008", kFlagDefault); getInventory()->unselectItem(); - while (getSound()->isBuffered("MUS008")) - getSound()->updateQueue(); + while (getSoundQueue()->isBuffered("MUS008")) + getSoundQueue()->updateQueue(); if (getInventory()->hasItem(kItemBomb)) { RESET_ENTITY_STATE(kEntityAlexei, Alexei, setup_function47); @@ -1522,8 +1524,8 @@ label_callback_4: case kAction191001984: getState()->time = kTime2520000; - if (getSound()->isBuffered(kEntityChapters)) - getSound()->removeFromQueue(kEntityChapters); + if (getSoundQueue()->isBuffered(kEntityChapters)) + getSoundQueue()->removeFromQueue(kEntityChapters); getEntities()->clearSequences(kEntityChapters); getInventory()->removeItem(kItemTelegram); @@ -1535,8 +1537,8 @@ label_callback_4: break; case kAction201959744: - if (getSound()->isBuffered(kEntityChapters)) - getSound()->removeFromQueue(kEntityChapters); + if (getSoundQueue()->isBuffered(kEntityChapters)) + getSoundQueue()->removeFromQueue(kEntityChapters); getSound()->playSound(kEntityTrain, "ZFX4001", kFlagDefault); @@ -1644,7 +1646,7 @@ IMPLEMENT_FUNCTION(21, Chapters, chapter5Init) getObjects()->updateLocation2(kObjectRestaurantCar, kObjectLocation2); if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; } @@ -1675,7 +1677,7 @@ IMPLEMENT_FUNCTION(22, Chapters, chapter5Handler) if (!getProgress().isNightTime) { getSound()->playSound(kEntityChapters, "ARRIVE", kFlag8); - getSound()->processEntries(); + getSoundQueue()->processEntries(); } } @@ -1684,7 +1686,7 @@ IMPLEMENT_FUNCTION(22, Chapters, chapter5Handler) if (!getEvent(kEventLocomotiveMilosDay) && !getEvent(kEventLocomotiveMilosNight)) { getSound()->playSound(kEntityChapters, "ARRIVE", kFlag8); - getSound()->processEntries(); + getSoundQueue()->processEntries(); } } break; @@ -1713,8 +1715,8 @@ IMPLEMENT_FUNCTION(22, Chapters, chapter5Handler) getProgress().isNightTime = true; getState()->time = kTime2916000; - if (getSound()->isBuffered(kEntityChapters)) - getSound()->removeFromQueue(kEntityChapters); + if (getSoundQueue()->isBuffered(kEntityChapters)) + getSoundQueue()->removeFromQueue(kEntityChapters); break; } IMPLEMENT_FUNCTION_END @@ -1730,7 +1732,7 @@ void Chapters::enterExitStation(const SavePoint &savepoint, bool isEnteringStati return; } - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); if (!ENTITY_PARAM(0, 2)) { if (ENTITY_PARAM(0, 3)) @@ -1798,7 +1800,7 @@ void Chapters::enterExitHelper(bool isEnteringStation) { EXPOSE_PARAMS(EntityData::EntityParametersSIIS); getSound()->playSound(kEntityChapters, isEnteringStation ? "ARRIVE" : "DEPART", kFlag8); - getSound()->processEntries(); + getSoundQueue()->processEntries(); getObjects()->update(kObjectHandleOutsideLeft, kEntityPlayer, kObjectLocation1, kCursorNormal, isEnteringStation ? kCursorNormal : kCursorHand); getObjects()->update(kObjectHandleOutsideRight, kEntityPlayer, kObjectLocation1, kCursorNormal, isEnteringStation ? kCursorNormal : kCursorHand); diff --git a/engines/lastexpress/entities/cooks.cpp b/engines/lastexpress/entities/cooks.cpp index 336f911800..cd8fbfd8ff 100644 --- a/engines/lastexpress/entities/cooks.cpp +++ b/engines/lastexpress/entities/cooks.cpp @@ -29,6 +29,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -101,7 +103,7 @@ IMPLEMENT_FUNCTION(3, Cooks, function3) if (getEntities()->isPlayerPosition(kCarRestaurant, 46)) { getEntities()->drawSequenceLeft(kEntityCooks, "308D"); - if (!getSound()->isBuffered(kEntityCooks)) { + if (!getSoundQueue()->isBuffered(kEntityCooks)) { if (params->param1) { if (!getEntities()->hasValidFrame(kEntityCooks)) { getSound()->playSound(kEntityCooks, "LIB015"); @@ -187,7 +189,7 @@ IMPLEMENT_FUNCTION(4, Cooks, function4) if (getEntities()->isPlayerPosition(kCarRestaurant, 80)) { getEntities()->drawSequenceLeft(kEntityCooks, "308D"); - if (!getSound()->isBuffered(kEntityCooks)) { + if (!getSoundQueue()->isBuffered(kEntityCooks)) { if (params->param1) { if (!getEntities()->hasValidFrame(kEntityCooks)) { getSound()->playSound(kEntityCooks, "LIB015"); diff --git a/engines/lastexpress/entities/coudert.cpp b/engines/lastexpress/entities/coudert.cpp index 0733a4c984..fea08f4611 100644 --- a/engines/lastexpress/entities/coudert.cpp +++ b/engines/lastexpress/entities/coudert.cpp @@ -32,6 +32,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -314,7 +316,7 @@ IMPLEMENT_FUNCTION_II(9, Coudert, updateEntity, CarIndex, EntityPosition) case kActionExcuseMeCath: if (getData()->clothes == kClothes1) getSound()->playSound(kEntityPlayer, "ZFX1003", getSound()->getSoundFlag(kEntityCoudert)); - else if (!getSound()->isBuffered(kEntityCoudert)) + else if (!getSoundQueue()->isBuffered(kEntityCoudert)) getSound()->playSound(kEntityPlayer, "JAC1112", getSound()->getSoundFlag(kEntityCoudert)); break; @@ -409,7 +411,7 @@ IMPLEMENT_FUNCTION_I(12, Coudert, excuseMe, EntityIndex) if (savepoint.action != kActionDefault) return; - if (getSound()->isBuffered(kEntityCoudert)) { + if (getSoundQueue()->isBuffered(kEntityCoudert)) { CALLBACK_ACTION(); return; } @@ -823,7 +825,7 @@ IMPLEMENT_FUNCTION(18, Coudert, function18) getScenes()->loadSceneFromItemPosition(kItem5); if (getEntities()->isPlayerPosition(kCarRedSleeping, 68)) { - if (!getSound()->isBuffered(kEntityCoudert)) + if (!getSoundQueue()->isBuffered(kEntityCoudert)) getSound()->playSound(kEntityCoudert, "JAC1111"); getScenes()->loadSceneFromPosition(kCarRedSleeping, 25); @@ -1642,7 +1644,7 @@ IMPLEMENT_FUNCTION_I(31, Coudert, function31, uint32) break; case 1: - if (getSound()->isBuffered(kEntityCoudert)) { + if (getSoundQueue()->isBuffered(kEntityCoudert)) { getEntities()->drawSequenceLeft(kEntityCoudert, "627K"); } else { setCallback(2); @@ -1929,7 +1931,7 @@ IMPLEMENT_FUNCTION_I(35, Coudert, function35, bool) break; case 1: - if (!getSound()->isBuffered(kEntityCoudert)) + if (!getSoundQueue()->isBuffered(kEntityCoudert)) getSound()->playSound(kEntityCoudert, "Ann3124"); if (params->param1) @@ -2008,8 +2010,8 @@ IMPLEMENT_FUNCTION(37, Coudert, function37) break; case kActionDefault: - if (getSound()->isBuffered(kEntityCoudert)) - getSound()->processEntry(kEntityCoudert); + if (getSoundQueue()->isBuffered(kEntityCoudert)) + getSoundQueue()->processEntry(kEntityCoudert); if (ENTITY_PARAM(0, 7)) { getData()->entityPosition = kPosition_8200; @@ -2268,7 +2270,7 @@ label_callback_8: } label_callback_9: - if (ENTITY_PARAM(0, 1) && !getSound()->isBuffered(kEntityCoudert)) + if (ENTITY_PARAM(0, 1) && !getSoundQueue()->isBuffered(kEntityCoudert)) getSound()->playSound(kEntityCoudert, rnd(2) ? "JAC1065" : "JAC1065A"); if (getState()->time > kTime1107000 && !ENTITY_PARAM(0, 1) && !getEvent(kEventVassiliSeizure)) { @@ -3019,7 +3021,7 @@ IMPLEMENT_FUNCTION(46, Coudert, function46) // Fallback to next case case 7: - if (getSound()->isBuffered(kEntityCoudert)) { + if (getSoundQueue()->isBuffered(kEntityCoudert)) { setCallback(7); setup_updateFromTime(75); } else { @@ -3088,7 +3090,7 @@ IMPLEMENT_FUNCTION_I(47, Coudert, function47, bool) // Fallback to next case case 4: - if (getSound()->isBuffered(kEntityCoudert)) { + if (getSoundQueue()->isBuffered(kEntityCoudert)) { setCallback(4); setup_updateFromTime(225); } else { diff --git a/engines/lastexpress/entities/francois.cpp b/engines/lastexpress/entities/francois.cpp index 86b6820499..6bbe740730 100644 --- a/engines/lastexpress/entities/francois.cpp +++ b/engines/lastexpress/entities/francois.cpp @@ -30,6 +30,8 @@ #include "lastexpress/game/savepoint.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -275,7 +277,7 @@ IMPLEMENT_FUNCTION_I(11, Francois, function11, TimeValue) break; case kActionNone: - if (!getSound()->isBuffered(kEntityFrancois)) { + if (!getSoundQueue()->isBuffered(kEntityFrancois)) { UPDATE_PARAM_PROC(CURRENT_PARAM(1, 1), getState()->timeTicks, params->param6) switch (rnd(7)) { @@ -370,8 +372,8 @@ label_callback: getData()->field_4A3 = 30; getData()->inventoryItem = kItemNone; - if (getSound()->isBuffered(kEntityFrancois)) - getSound()->processEntry(kEntityFrancois); + if (getSoundQueue()->isBuffered(kEntityFrancois)) + getSoundQueue()->processEntry(kEntityFrancois); setCallback(4); setup_updateEntity(kCarRedSleeping, kPosition_5790); @@ -381,8 +383,8 @@ label_callback: case kAction1: getData()->inventoryItem = kItemNone; - if (getSound()->isBuffered(kEntityFrancois)) - getSound()->processEntry(kEntityFrancois); + if (getSoundQueue()->isBuffered(kEntityFrancois)) + getSoundQueue()->processEntry(kEntityFrancois); setCallback(6); setup_savegame(kSavegameTypeEvent, kEventFrancoisWhistle); diff --git a/engines/lastexpress/entities/kahina.cpp b/engines/lastexpress/entities/kahina.cpp index db71981b60..6c73784b21 100644 --- a/engines/lastexpress/entities/kahina.cpp +++ b/engines/lastexpress/entities/kahina.cpp @@ -32,6 +32,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -607,8 +609,8 @@ label_callback_3: break; if (getEvent(kEventKahinaAskSpeakFirebird)) { - if (getSound()->isBuffered(kEntityKahina)) - getSound()->processEntry(kEntityKahina); + if (getSoundQueue()->isBuffered(kEntityKahina)) + getSoundQueue()->processEntry(kEntityKahina); if (savepoint.action == kActionKnock) getSound()->playSound(kEntityPlayer, "LIB012"); @@ -1163,8 +1165,8 @@ IMPLEMENT_FUNCTION(24, Kahina, function24) case 1: if (ENTITY_PARAM(0, 2)) { getEntities()->clearSequences(kEntityKahina); - if (getSound()->isBuffered(kEntityKahina)) - getSound()->processEntry(kEntityKahina); + if (getSoundQueue()->isBuffered(kEntityKahina)) + getSoundQueue()->processEntry(kEntityKahina); getProgress().field_44 = 0; @@ -1198,8 +1200,8 @@ IMPLEMENT_FUNCTION(24, Kahina, function24) case kAction137503360: getEntities()->clearSequences(kEntityKahina); - if (getSound()->isBuffered(kEntityKahina)) - getSound()->processEntry(kEntityKahina); + if (getSoundQueue()->isBuffered(kEntityKahina)) + getSoundQueue()->processEntry(kEntityKahina); getProgress().field_44 = 0; diff --git a/engines/lastexpress/entities/kronos.cpp b/engines/lastexpress/entities/kronos.cpp index 5afc52fe3d..06ebd54694 100644 --- a/engines/lastexpress/entities/kronos.cpp +++ b/engines/lastexpress/entities/kronos.cpp @@ -39,6 +39,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -216,7 +218,7 @@ IMPLEMENT_FUNCTION(11, Kronos, function11) case kActionDefault: getData()->entityPosition = kPosition_7000; - if (!getSound()->isBuffered(kEntityKronos)) + if (!getSoundQueue()->isBuffered(kEntityKronos)) getSound()->playSound(kEntityKronos, "KRO1001"); break; } @@ -457,7 +459,7 @@ IMPLEMENT_FUNCTION(19, Kronos, function19) case 2: getAction()->playAnimation(kEventConcertStart); - getSound()->setupEntry(kSoundType7, kEntityKronos); + getSoundQueue()->setupEntry(kSoundType7, kEntityKronos); getScenes()->loadSceneFromPosition(kCarKronos, 83); RESET_ENTITY_STATE(kEntityRebecca, Rebecca, setup_function39); @@ -480,7 +482,7 @@ IMPLEMENT_FUNCTION(20, Kronos, function20) break; case kActionNone: - params->param5 = getSound()->getEntryTime(kEntityKronos)* 2; + params->param5 = getSoundQueue()->getEntryTime(kEntityKronos)* 2; if (params->param6 < ARRAYSIZE(concertData) && params->param5 > concertData[params->param6].time) { @@ -560,8 +562,8 @@ IMPLEMENT_FUNCTION(20, Kronos, function20) case 3: getAction()->playAnimation(kEventCathFallingAsleep); - while (getSound()->isBuffered("1919.LNK")) - getSound()->updateQueue(); + while (getSoundQueue()->isBuffered("1919.LNK")) + getSoundQueue()->updateQueue(); getAction()->playAnimation(kEventCathWakingUp); getScenes()->processScene(); @@ -746,7 +748,7 @@ IMPLEMENT_FUNCTION(22, Kronos, function22) case kActionKnock: case kActionOpenDoor: - if (!getSound()->isBuffered(savepoint.action == kActionKnock ? "LIB012" : "LIB013", true)) + if (!getSoundQueue()->isBuffered(savepoint.action == kActionKnock ? "LIB012" : "LIB013", true)) getSound()->playSound(kEntityPlayer, savepoint.action == kActionKnock ? "LIB012" : "LIB013"); if (getEvent(kEventConcertLeaveWithBriefcase)) diff --git a/engines/lastexpress/entities/mahmud.cpp b/engines/lastexpress/entities/mahmud.cpp index f9ae741d0e..cb782854af 100644 --- a/engines/lastexpress/entities/mahmud.cpp +++ b/engines/lastexpress/entities/mahmud.cpp @@ -34,6 +34,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -157,7 +159,7 @@ IMPLEMENT_FUNCTION_II(10, Mahmud, function10, ObjectIndex, bool) case kActionEndSound: case kActionDrawScene: - if (!getSound()->isBuffered(kEntityMahmud)) { + if (!getSoundQueue()->isBuffered(kEntityMahmud)) { EntityPosition position = getEntityData(kEntityPlayer)->entityPosition; if (position < kPosition_1500 || position >= kPosition_5790 || (position > kPosition_4455 && params->param5 != 5)) { getObjects()->update(kObjectCompartment5, kEntityTrain, kObjectLocation3, kCursorHandKnock, kCursorHand); @@ -173,12 +175,12 @@ IMPLEMENT_FUNCTION_II(10, Mahmud, function10, ObjectIndex, bool) case kActionKnock: case kActionOpenDoor: - if (!getSound()->isBuffered((savepoint.action == kActionKnock) ? "LIB012" : "LIB013", true)) + if (!getSoundQueue()->isBuffered((savepoint.action == kActionKnock) ? "LIB012" : "LIB013", true)) getSound()->playSound(kEntityPlayer, (savepoint.action == kActionKnock) ? "LIB012" : "LIB013"); params->param5 = savepoint.param.intValue; - if (!getSound()->isBuffered(kEntityMahmud)) { + if (!getSoundQueue()->isBuffered(kEntityMahmud)) { params->param3++; switch(params->param3) { @@ -282,7 +284,7 @@ IMPLEMENT_FUNCTION(11, Mahmud, function11) case kActionOpenDoor: { getSound()->playSound(kEntityPlayer, (savepoint.action == kActionKnock ? "LIB012" : "LIB013")); - if (!getSound()->isBuffered(kEntityMahmud)) { + if (!getSoundQueue()->isBuffered(kEntityMahmud)) { params->param1++; getSound()->playSound(kEntityMahmud, (params->param1 == 1 ? "MAH1170E" : (params->param1 == 2 ? "MAH1173B" : "MAH1174"))); @@ -396,8 +398,8 @@ IMPLEMENT_FUNCTION(11, Mahmud, function11) break; case kAction123852928: - if (getSound()->isBuffered(kEntityMahmud)) - getSound()->processEntry(kEntityMahmud); + if (getSoundQueue()->isBuffered(kEntityMahmud)) + getSoundQueue()->processEntry(kEntityMahmud); getObjects()->update(kObjectCompartment5, kEntityTrain, kObjectLocation3, kCursorHandKnock, kCursorHand); getObjects()->update(kObjectCompartment6, kEntityTrain, kObjectLocation3, kCursorHandKnock, kCursorHand); @@ -560,7 +562,7 @@ IMPLEMENT_FUNCTION(14, Mahmud, chaptersHandler) TIME_CHECK_CALLBACK(kTime1098000, params->param6, 1, setup_function13); - if (!getSound()->isBuffered("HAR1104") && getState()->time > kTime1167300 && !params->param7) { + if (!getSoundQueue()->isBuffered("HAR1104") && getState()->time > kTime1167300 && !params->param7) { params->param7 = 1; setCallback(2); @@ -636,7 +638,7 @@ IMPLEMENT_FUNCTION(14, Mahmud, chaptersHandler) params->param4 = 0; params->param5 = 0; - if (!getSound()->isBuffered("HAR1104") && getState()->time > kTime1167300 && !params->param7) { + if (!getSoundQueue()->isBuffered("HAR1104") && getState()->time > kTime1167300 && !params->param7) { params->param7 = 1; setCallback(2); setup_function12(); diff --git a/engines/lastexpress/entities/max.cpp b/engines/lastexpress/entities/max.cpp index 12123ed04a..924f8f77aa 100644 --- a/engines/lastexpress/entities/max.cpp +++ b/engines/lastexpress/entities/max.cpp @@ -31,6 +31,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -91,7 +93,7 @@ IMPLEMENT_FUNCTION(6, Max, chapter12_handler) case kActionNone: UPDATE_PARAM(params->param2, getState()->time, params->param1); - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max1122"); params->param1 = 255 * (4 * rnd(20) + 40); @@ -108,7 +110,7 @@ IMPLEMENT_FUNCTION(6, Max, chapter12_handler) break; case kAction158007856: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { getSound()->playSound(kEntityMax, "Max1122"); params->param1 = 255 * (4 * rnd(20) + 40); } @@ -125,7 +127,7 @@ IMPLEMENT_FUNCTION(7, Max, function7) case kActionNone: UPDATE_PARAM(params->param2, getState()->time, params->param1) - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max1122"); params->param1 = 255 * (4 * rnd(20) + 40); @@ -137,8 +139,8 @@ IMPLEMENT_FUNCTION(7, Max, function7) getObjects()->update(kObjectCompartmentF, kEntityMax, kObjectLocation1, kCursorNormal, kCursorNormal); getObjects()->update(kObject53, kEntityMax, kObjectLocation1, kCursorNormal, kCursorNormal); - if (getSound()->isBuffered(kEntityMax)) - getSound()->processEntry(kEntityMax); + if (getSoundQueue()->isBuffered(kEntityMax)) + getSoundQueue()->processEntry(kEntityMax); setCallback((savepoint.action == kActionKnock) ? 1 : 2); setup_playSound((savepoint.action == kActionKnock) ? "LIB012" : "LIB013"); @@ -156,7 +158,7 @@ IMPLEMENT_FUNCTION(7, Max, function7) break; case kActionDrawScene: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { if (getEntities()->isPlayerPosition(kCarRedSleeping, 56) || getEntities()->isPlayerPosition(kCarRedSleeping, 78)) getSound()->playSound(kEntityMax, "Max1120"); } @@ -197,7 +199,7 @@ IMPLEMENT_FUNCTION(7, Max, function7) break; case kAction158007856: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { getSound()->playSound(kEntityMax, "Max1122"); params->param1 = 255 * (4 * rnd(20) + 40); } @@ -214,7 +216,7 @@ IMPLEMENT_FUNCTION(8, Max, chapter4Handler) case kActionNone: UPDATE_PARAM(params->param3, getState()->time, params->param2); - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max3101"); params->param2 = 255 * (4 * rnd(20) + 40); @@ -228,8 +230,8 @@ IMPLEMENT_FUNCTION(8, Max, chapter4Handler) break; } - if (getSound()->isBuffered(kEntityMax)) - getSound()->processEntry(kEntityMax); + if (getSoundQueue()->isBuffered(kEntityMax)) + getSoundQueue()->processEntry(kEntityMax); getAction()->playAnimation(kEventCathMaxLickHand); getScenes()->processScene(); @@ -247,7 +249,7 @@ IMPLEMENT_FUNCTION(8, Max, chapter4Handler) getData()->location = kLocationInsideCompartment; getData()->car = kCarBaggage; - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max3101"); break; @@ -255,8 +257,8 @@ IMPLEMENT_FUNCTION(8, Max, chapter4Handler) if (getCallback() != 1) break; - if (getSound()->isBuffered(kEntityMax)) - getSound()->processEntry(kEntityMax); + if (getSoundQueue()->isBuffered(kEntityMax)) + getSoundQueue()->processEntry(kEntityMax); getSound()->playSound(kEntityPlayer, "LIB026"); getAction()->playAnimation(kEventCathMaxFree); @@ -392,7 +394,7 @@ IMPLEMENT_FUNCTION(13, Max, chapter3Handler) UPDATE_PARAM(params->param3, getState()->time, params->param1); - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max1122"); params->param1 = 255 * (4 * rnd(20) + 40); @@ -424,7 +426,7 @@ IMPLEMENT_FUNCTION(13, Max, chapter3Handler) if (params->param2) break; - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { getSound()->playSound(kEntityMax, "Max1122"); params->param1 = 255 * (4 * rnd(20) + 40); } @@ -464,7 +466,7 @@ IMPLEMENT_FUNCTION(14, Max, freeFromCage) getData()->location = kLocationInsideCompartment; getData()->car = kCarBaggage; - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max1122"); break; @@ -476,17 +478,17 @@ IMPLEMENT_FUNCTION(14, Max, freeFromCage) break; case 1: - if (getSound()->isBuffered(kEntityMax)) - getSound()->removeFromQueue(kEntityMax); + if (getSoundQueue()->isBuffered(kEntityMax)) + getSoundQueue()->removeFromQueue(kEntityMax); getAction()->playAnimation(kEventCathMaxCage); - getSound()->setupEntry(kSoundType7, kEntityMax); + getSoundQueue()->setupEntry(kSoundType7, kEntityMax); getScenes()->processScene(); break; case 2: - if (getSound()->isBuffered(kEntityMax)) - getSound()->processEntry(kEntityMax); + if (getSoundQueue()->isBuffered(kEntityMax)) + getSoundQueue()->processEntry(kEntityMax); getSound()->playSound(kEntityPlayer, "LIB026"); getAction()->playAnimation(kEventCathMaxFree); @@ -523,7 +525,7 @@ IMPLEMENT_FUNCTION(15, Max, function15) getData()->location = kLocationOutsideCompartment; getData()->car = kCarRedSleeping; - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max3010"); setCallback(1); diff --git a/engines/lastexpress/entities/mertens.cpp b/engines/lastexpress/entities/mertens.cpp index b99e344b20..464cc343bb 100644 --- a/engines/lastexpress/entities/mertens.cpp +++ b/engines/lastexpress/entities/mertens.cpp @@ -32,6 +32,8 @@ #include "lastexpress/game/state.h" #include "lastexpress/game/sound.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -503,7 +505,7 @@ IMPLEMENT_FUNCTION_I(12, Mertens, bonsoir, EntityIndex) if (savepoint.action == kActionDefault) return; - if (getSound()->isBuffered(kEntityMertens)) { + if (getSoundQueue()->isBuffered(kEntityMertens)) { CALLBACK_ACTION(); return; } @@ -589,7 +591,7 @@ IMPLEMENT_FUNCTION_II(13, Mertens, function13, bool, bool) if (params->param2) params->param3 = 1; - if (!getSound()->isBuffered(kEntityMertens)) { + if (!getSoundQueue()->isBuffered(kEntityMertens)) { } @@ -1188,7 +1190,7 @@ IMPLEMENT_FUNCTION(22, Mertens, function22) break; case 5: - if (!getSound()->isBuffered(kEntityMertens)) + if (!getSoundQueue()->isBuffered(kEntityMertens)) getSound()->playSound(kEntityMertens, "MAH1170I"); setCallback(6); @@ -1198,7 +1200,7 @@ IMPLEMENT_FUNCTION(22, Mertens, function22) case 6: getData()->location = kLocationInsideCompartment; getEntities()->clearSequences(kEntityMertens); - if (!getSound()->isBuffered(kEntityMertens)) + if (!getSoundQueue()->isBuffered(kEntityMertens)) getSound()->playSound(kEntityMertens, "MAH1172", kFlagInvalid, 225); setCallback(7); @@ -2300,7 +2302,7 @@ IMPLEMENT_FUNCTION_I(31, Mertens, function31, MertensActionType) break; case 1: - if (getSound()->isBuffered(kEntityMertens)) { + if (getSoundQueue()->isBuffered(kEntityMertens)) { getEntities()->drawSequenceLeft(kEntityMertens, "601J"); } else { setCallback(2); @@ -3017,7 +3019,7 @@ IMPLEMENT_FUNCTION(42, Mertens, function42) if (getState()->time <= kTime1188000) { if ((!getEntities()->isPlayerInCar(kCarGreenSleeping) && !getEntities()->isPlayerInCar(kCarRedSleeping)) - || getSound()->isBuffered("REB1205") + || getSoundQueue()->isBuffered("REB1205") || !getEntities()->isInsideCompartment(kEntityMmeBoutarel, kCarRedSleeping, kPosition_5790) || !params->param4) { params->param4 = (uint)getState()->time; @@ -3138,7 +3140,7 @@ label_callback_18: } label_callback_19: - if (ENTITY_PARAM(0, 1) && !getSound()->isBuffered(kEntityMertens)) { + if (ENTITY_PARAM(0, 1) && !getSoundQueue()->isBuffered(kEntityMertens)) { if (getProgress().field_18 != 4) getSound()->playSound(kEntityMertens, "CON1505"); } diff --git a/engines/lastexpress/entities/milos.cpp b/engines/lastexpress/entities/milos.cpp index 68030b3be3..1526c281b2 100644 --- a/engines/lastexpress/entities/milos.cpp +++ b/engines/lastexpress/entities/milos.cpp @@ -36,6 +36,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -1577,8 +1579,8 @@ IMPLEMENT_FUNCTION(29, Milos, chapter4Handler) break; case kAction221683008: - if (getSound()->isBuffered(kEntityMilos)) - getSound()->processEntry(kEntityMilos); + if (getSoundQueue()->isBuffered(kEntityMilos)) + getSoundQueue()->processEntry(kEntityMilos); params->param1 = 1; getSavePoints()->push(kEntityMilos, kEntityCoudert, kAction123199584); @@ -1720,15 +1722,15 @@ IMPLEMENT_FUNCTION(34, Milos, chapter5Handler) break; case 2: - if (getSound()->isBuffered("MUS050")) - getSound()->processEntry("MUS050"); + if (getSoundQueue()->isBuffered("MUS050")) + getSoundQueue()->processEntry("MUS050"); - if (getSound()->isBuffered("ARRIVE")) - getSound()->removeFromQueue("ARRIVE"); + if (getSoundQueue()->isBuffered("ARRIVE")) + getSoundQueue()->removeFromQueue("ARRIVE"); - getSound()->processEntries(); + getSoundQueue()->processEntries(); getAction()->playAnimation(isNight() ? kEventLocomotiveMilosNight : kEventLocomotiveMilosDay); - getSound()->setupEntry(kSoundType7, kEntityMilos); + getSoundQueue()->setupEntry(kSoundType7, kEntityMilos); getScenes()->loadSceneFromPosition(kCarCoalTender, 1); break; @@ -1740,7 +1742,7 @@ IMPLEMENT_FUNCTION(34, Milos, chapter5Handler) case 4: getAction()->playAnimation(kEventLocomotiveRestartTrain); getAction()->playAnimation(kEventLocomotiveOldBridge); - getSound()->resetState(); + getSoundQueue()->resetState(); getState()->time = kTime2983500; setCallback(5); @@ -1783,7 +1785,7 @@ IMPLEMENT_FUNCTION(34, Milos, chapter5Handler) setup_savegame(kSavegameTypeEvent, kEventLocomotiveAnnaStopsTrain); } - getSound()->processEntry(kEntityMilos); + getSoundQueue()->processEntry(kEntityMilos); if (getState()->time < kTimeTrainStopped2) getState()->time = kTimeTrainStopped2; diff --git a/engines/lastexpress/entities/mmeboutarel.cpp b/engines/lastexpress/entities/mmeboutarel.cpp index 78f2d2fb4b..1d4c52ca09 100644 --- a/engines/lastexpress/entities/mmeboutarel.cpp +++ b/engines/lastexpress/entities/mmeboutarel.cpp @@ -31,6 +31,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -399,7 +401,7 @@ IMPLEMENT_FUNCTION(13, MmeBoutarel, function13) break; case kActionNone: - if (!getSound()->isBuffered(kEntityMmeBoutarel) && params->param6 != kTimeInvalid) { + if (!getSoundQueue()->isBuffered(kEntityMmeBoutarel) && params->param6 != kTimeInvalid) { UPDATE_PARAM_PROC_TIME(params->param1, !getEntities()->isDistanceBetweenEntities(kEntityMmeBoutarel, kEntityPlayer, 2000), params->param6, 0) getObjects()->update(kObjectCompartmentD, kEntityPlayer, kObjectLocation1, kCursorNormal, kCursorNormal); getObjects()->update(kObject51, kEntityPlayer, kObjectLocation1, kCursorNormal, kCursorNormal); @@ -883,8 +885,8 @@ IMPLEMENT_FUNCTION(21, MmeBoutarel, chapter3Handler) if (getState()->time <= kTime2038500) { if (!getEntities()->isPlayerInCar(kCarRedSleeping) || !params->param1 - || getSound()->isBuffered("FRA2012") - || getSound()->isBuffered("FRA2010") + || getSoundQueue()->isBuffered("FRA2012") + || getSoundQueue()->isBuffered("FRA2010") ||!params->param2) params->param2 = (uint)getState()->time; diff --git a/engines/lastexpress/entities/pascale.cpp b/engines/lastexpress/entities/pascale.cpp index d4a7359511..8bbcf64e84 100644 --- a/engines/lastexpress/entities/pascale.cpp +++ b/engines/lastexpress/entities/pascale.cpp @@ -30,6 +30,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -201,7 +203,7 @@ IMPLEMENT_FUNCTION(10, Pascale, welcomeCath) break; case kActionNone: - if (params->param1 && !getSound()->isBuffered(kEntityPascale)) + if (params->param1 && !getSoundQueue()->isBuffered(kEntityPascale)) getEntities()->updatePositionExit(kEntityPascale, kCarRestaurant, 64); break; @@ -462,10 +464,10 @@ IMPLEMENT_FUNCTION(16, Pascale, serveTatianaVassili) getEntities()->drawSequenceLeft(kEntityPascale, "014B"); getEntities()->updatePositionEnter(kEntityPascale, kCarRestaurant, 67); - if (getSound()->isBuffered("TAT1069A")) - getSound()->processEntry("TAT1069A"); - else if (getSound()->isBuffered("TAT1069B")) - getSound()->processEntry("TAT1069B"); + if (getSoundQueue()->isBuffered("TAT1069A")) + getSoundQueue()->processEntry("TAT1069A"); + else if (getSoundQueue()->isBuffered("TAT1069B")) + getSoundQueue()->processEntry("TAT1069B"); setCallback(2); setup_playSound("TAT1066"); @@ -1213,7 +1215,7 @@ label_callback1: break; case kAction169750080: - if (getSound()->isBuffered(kEntityPascale)) { + if (getSoundQueue()->isBuffered(kEntityPascale)) { params->param4 = 1; } else { setCallback(7); diff --git a/engines/lastexpress/entities/rebecca.cpp b/engines/lastexpress/entities/rebecca.cpp index 68a37b368d..6d1c5244f2 100644 --- a/engines/lastexpress/entities/rebecca.cpp +++ b/engines/lastexpress/entities/rebecca.cpp @@ -30,6 +30,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -511,7 +513,7 @@ IMPLEMENT_FUNCTION_I(20, Rebecca, function20, TimeValue) if (getProgress().chapter == kChapter1 && !ENTITY_PARAM(0, 3)) { if (params->param7 != kTimeInvalid && getState()->time > kTime1174500) { if (getState()->time <= kTime1183500) { - if (!getEntities()->isDistanceBetweenEntities(kEntityRebecca, kEntityPlayer, 2000) || getSound()->isBuffered("CON1210") || !params->param7) + if (!getEntities()->isDistanceBetweenEntities(kEntityRebecca, kEntityPlayer, 2000) || getSoundQueue()->isBuffered("CON1210") || !params->param7) params->param7 = (uint)(getState()->time); if (params->param7 >= getState()->time) diff --git a/engines/lastexpress/entities/salko.cpp b/engines/lastexpress/entities/salko.cpp index bbaff5f1d9..6dcab7121e 100644 --- a/engines/lastexpress/entities/salko.cpp +++ b/engines/lastexpress/entities/salko.cpp @@ -33,6 +33,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -596,8 +598,8 @@ IMPLEMENT_FUNCTION(24, Salko, chapter5Handler) break; case 1: - if (getSound()->isBuffered("MUS050")) - getSound()->processEntry("MUS050"); + if (getSoundQueue()->isBuffered("MUS050")) + getSoundQueue()->processEntry("MUS050"); getAction()->playAnimation(kEventCathSalkoTrainTopFight); diff --git a/engines/lastexpress/entities/tables.cpp b/engines/lastexpress/entities/tables.cpp index da053c5871..702b636c31 100644 --- a/engines/lastexpress/entities/tables.cpp +++ b/engines/lastexpress/entities/tables.cpp @@ -29,6 +29,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -88,8 +90,8 @@ IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// IMPLEMENT_FUNCTION(5, Tables, chapter5) if (savepoint.action == kActionDefault) { - if (_id == kEntityTables2 && getSound()->isBuffered(kEntityTables2)) - getSound()->processEntry(kEntityTables2); + if (_id == kEntityTables2 && getSoundQueue()->isBuffered(kEntityTables2)) + getSoundQueue()->processEntry(kEntityTables2); setup_draw(); } @@ -113,21 +115,21 @@ IMPLEMENT_FUNCTION(6, Tables, draw) case kChapter1: if (getState()->time > kTime1165500 && !params->param1) { params->param1 = 1; - getSound()->processEntry(kEntityTables2); + getSoundQueue()->processEntry(kEntityTables2); } break; case kChapter3: if (getState()->time > kTime2052000 && !params->param2) { params->param2 = 1; - getSound()->processEntry(kEntityTables2); + getSoundQueue()->processEntry(kEntityTables2); } break; case kChapter4: if (getState()->time > kTime2488500 && !params->param3) { params->param3 = 1; - getSound()->processEntry(kEntityTables2); + getSoundQueue()->processEntry(kEntityTables2); } break; diff --git a/engines/lastexpress/entities/tatiana.cpp b/engines/lastexpress/entities/tatiana.cpp index db5c413dc9..2f60b448ba 100644 --- a/engines/lastexpress/entities/tatiana.cpp +++ b/engines/lastexpress/entities/tatiana.cpp @@ -35,6 +35,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -420,7 +422,7 @@ IMPLEMENT_FUNCTION(19, Tatiana, chapter1Handler) break; case kActionNone: - if (getSound()->isBuffered(kEntityTatiana) || !params->param4 || params->param3 == 2 || getSound()->isBuffered("TAT1066")) + if (getSoundQueue()->isBuffered(kEntityTatiana) || !params->param4 || params->param3 == 2 || getSoundQueue()->isBuffered("TAT1066")) goto label_tatiana_chapter1_2; UPDATE_PARAM_PROC(params->param5, getState()->timeTicks, 450) @@ -568,7 +570,7 @@ IMPLEMENT_FUNCTION(21, Tatiana, function21) // Fallback to next case case 3: - if (getSound()->isBuffered(kEntityTatiana)) { + if (getSoundQueue()->isBuffered(kEntityTatiana)) { setCallback(3); setup_updateFromTime(75); } else { @@ -1858,7 +1860,7 @@ IMPLEMENT_FUNCTION(46, Tatiana, function46) parameters->param3 = 1; if (parameters->param2) { - getSound()->removeFromQueue(kEntityTatiana); + getSoundQueue()->removeFromQueue(kEntityTatiana); getSavePoints()->call(kEntityTatiana, kEntityTatiana, kActionEndSound); } } else { @@ -1947,7 +1949,7 @@ IMPLEMENT_FUNCTION(48, Tatiana, function48) params->param1 = 0; } - if (!params->param1 || getSound()->isBuffered(kEntityTatiana)) + if (!params->param1 || getSoundQueue()->isBuffered(kEntityTatiana)) goto label_end; UPDATE_PARAM_GOTO(params->param2, getState()->timeTicks, 5 * (3 * rnd(5) + 30), label_end); @@ -2086,7 +2088,7 @@ IMPLEMENT_FUNCTION(50, Tatiana, function50) break; case kActionKnock: - if (!getSound()->isBuffered("LIB012", true)) + if (!getSoundQueue()->isBuffered("LIB012", true)) getSound()->playSound(kEntityPlayer, "LIB012"); break; @@ -2107,14 +2109,14 @@ IMPLEMENT_FUNCTION(50, Tatiana, function50) getObjects()->update(kObject48, kEntityTatiana, kObjectLocationNone, kCursorHandKnock, kCursorHand); getObjects()->update(kObjectCompartmentA, kEntityTatiana, kObjectLocationNone, kCursorHandKnock, kCursorHand); - if (!getSound()->isBuffered(kEntityTatiana)) + if (!getSoundQueue()->isBuffered(kEntityTatiana)) getSound()->playSound(kEntityTatiana, "Tat4166"); break; case kActionCallback: if (getCallback() == 1) { - if (getSound()->isBuffered("MUS013")) - getSound()->processEntry("MUS013"); + if (getSoundQueue()->isBuffered("MUS013")) + getSoundQueue()->processEntry("MUS013"); getAction()->playAnimation(kEventVassiliDeadAlexei); getSavePoints()->push(kEntityTatiana, kEntityAbbot, kAction104060776); @@ -2223,11 +2225,11 @@ IMPLEMENT_FUNCTION(54, Tatiana, function54) case kActionCallback: if (getCallback() == 1) { - if (getSound()->isBuffered("MUS050")) - getSound()->processEntry("MUS050"); + if (getSoundQueue()->isBuffered("MUS050")) + getSoundQueue()->processEntry("MUS050"); - if (getSound()->isBuffered(kEntityTatiana)) - getSound()->processEntry(kEntityTatiana); + if (getSoundQueue()->isBuffered(kEntityTatiana)) + getSoundQueue()->processEntry(kEntityTatiana); getAction()->playAnimation(isNight() ? kEventTatianaVassiliTalkNight : kEventTatianaVassiliTalk); getScenes()->processScene(); diff --git a/engines/lastexpress/entities/train.cpp b/engines/lastexpress/entities/train.cpp index 1a5c6f4f64..74eed63bbf 100644 --- a/engines/lastexpress/entities/train.cpp +++ b/engines/lastexpress/entities/train.cpp @@ -32,6 +32,8 @@ #include "lastexpress/game/state.h" #include "lastexpress/game/sound.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -300,13 +302,13 @@ label_process: } // Update object - if (ENTITY_PARAM(0, 8) && !getSound()->isBuffered(kEntityTables5)) { + if (ENTITY_PARAM(0, 8) && !getSoundQueue()->isBuffered(kEntityTables5)) { getObjects()->update((ObjectIndex)ENTITY_PARAM(0, 8), getObjects()->get((ObjectIndex)ENTITY_PARAM(0, 8)).entity, kObjectLocation3, kCursorHandKnock, kCursorHand); ENTITY_PARAM(0, 8) = 0; } // Play clock sound - if (params->param6 && !getSound()->isBuffered("ZFX1001", true)) + if (params->param6 && !getSoundQueue()->isBuffered("ZFX1001", true)) getSound()->playSound(kEntityPlayer, "ZFX1001"); break; @@ -339,12 +341,12 @@ label_process: // Play clock sound if (getEntities()->isPlayerPosition(kCarRestaurant, 81)) { params->param6 = 1; - if (!getSound()->isBuffered("ZFX1001")) + if (!getSoundQueue()->isBuffered("ZFX1001")) getSound()->playSound(kEntityPlayer, "ZFX1001"); } else { params->param6 = 0; - if (getSound()->isBuffered("ZFX1001", true)) - getSound()->removeFromQueue("ZFX1001"); + if (getSoundQueue()->isBuffered("ZFX1001", true)) + getSoundQueue()->removeFromQueue("ZFX1001"); } // Draw moving background behind windows @@ -562,8 +564,8 @@ void Train::resetParam8() { && !getEntities()->isInsideCompartment(kEntityPlayer, (CarIndex)params1->param1, (EntityPosition)params1->param2) && !getEntities()->isInsideCompartment(kEntityPlayer, (CarIndex)params1->param1, (EntityPosition)params1->param3)) { - if (getSound()->isBuffered((const char *)¶ms1->seq)) - getSound()->processEntry((const char *)¶ms1->seq); + if (getSoundQueue()->isBuffered((const char *)¶ms1->seq)) + getSoundQueue()->processEntry((const char *)¶ms1->seq); params->param8 = 0; } diff --git a/engines/lastexpress/entities/vassili.cpp b/engines/lastexpress/entities/vassili.cpp index a1daf3e524..a7fbc7cf32 100644 --- a/engines/lastexpress/entities/vassili.cpp +++ b/engines/lastexpress/entities/vassili.cpp @@ -35,6 +35,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -295,7 +297,7 @@ IMPLEMENT_FUNCTION(9, Vassili, function9) || getEntities()->isPlayerPosition(kCarRedSleeping, 41)) { if (savepoint.action == kActionDrawScene) - getSound()->processEntry(kEntityVassili); + getSoundQueue()->processEntry(kEntityVassili); setup_seizure(); } else { diff --git a/engines/lastexpress/entities/verges.cpp b/engines/lastexpress/entities/verges.cpp index c0a00b8c05..c18137c835 100644 --- a/engines/lastexpress/entities/verges.cpp +++ b/engines/lastexpress/entities/verges.cpp @@ -32,6 +32,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -139,7 +141,7 @@ IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// IMPLEMENT_FUNCTION_II(8, Verges, updateEntity, CarIndex, EntityPosition) if (savepoint.action == kActionExcuseMeCath) { - if (!getSound()->isBuffered(kEntityVerges)) + if (!getSoundQueue()->isBuffered(kEntityVerges)) getSound()->playSound(kEntityPlayer, "TRA1113", getSound()->getSoundFlag(kEntityVerges)); return; @@ -187,7 +189,7 @@ switch (savepoint.action) { break; case 2: - if (!getSound()->isBuffered(kEntityVerges)) + if (!getSoundQueue()->isBuffered(kEntityVerges)) getSound()->playSound(kEntityVerges, (char *)¶ms->seq1); getEntities()->drawSequenceRight(kEntityVerges, "813DS"); @@ -232,7 +234,7 @@ IMPLEMENT_FUNCTION_IIS(10, Verges, function10, CarIndex, EntityPosition) case kActionNone: if (!params->param7) { - if (!getSound()->isBuffered(kEntityVerges)) { + if (!getSoundQueue()->isBuffered(kEntityVerges)) { getSound()->playSound(kEntityVerges, (char *)¶ms->seq); params->param7 = 1; } @@ -258,7 +260,7 @@ IMPLEMENT_FUNCTION_IIS(10, Verges, function10, CarIndex, EntityPosition) break; case kActionDefault: - if (!getSound()->isBuffered(kEntityVerges)) { + if (!getSoundQueue()->isBuffered(kEntityVerges)) { getSound()->playSound(kEntityVerges, (char *)¶ms->seq); params->param7 = 1; } @@ -704,7 +706,7 @@ IMPLEMENT_FUNCTION(24, Verges, policeGettingOffTrain) case kActionCallback: if (getCallback() == 1) { - getSound()->processEntry(kEntityVerges); + getSoundQueue()->processEntry(kEntityVerges); getAction()->playAnimation(kEventGendarmesArrestation); getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverPolice1, true); } @@ -1314,7 +1316,7 @@ IMPLEMENT_FUNCTION(32, Verges, function32) break; case 2: - if (!getSound()->isBuffered(kEntityVerges)) + if (!getSoundQueue()->isBuffered(kEntityVerges)) getSound()->playSound(kEntityVerges, "TRA3004"); getEntities()->drawSequenceRight(kEntityVerges, "813DS"); @@ -1752,16 +1754,16 @@ IMPLEMENT_FUNCTION(40, Verges, chapter5Handler) break; case kActionNone: - if (getEntities()->isInSalon(kEntityPlayer) && !getSound()->isBuffered(kEntityVerges)) + if (getEntities()->isInSalon(kEntityPlayer) && !getSoundQueue()->isBuffered(kEntityVerges)) getSound()->playSound(kEntityVerges, "WAT5000"); break; case kActionOpenDoor: - if (getSound()->isBuffered(kEntityVerges)) - getSound()->processEntry(kEntityVerges); + if (getSoundQueue()->isBuffered(kEntityVerges)) + getSoundQueue()->processEntry(kEntityVerges); - if (getSound()->isBuffered("MUS050")) - getSound()->processEntry("MUS050"); + if (getSoundQueue()->isBuffered("MUS050")) + getSoundQueue()->processEntry("MUS050"); getObjects()->update(kObject65, kEntityPlayer, kObjectLocationNone, kCursorNormal, kCursorForward); @@ -1811,7 +1813,7 @@ IMPLEMENT_FUNCTION(41, Verges, function41) // Fallback to next case case 2: - if (getSound()->isBuffered(kEntityVerges)) { + if (getSoundQueue()->isBuffered(kEntityVerges)) { setCallback(2); setup_updateFromTime(225); } else { |