From 53cd6616c958e4a50644254688aea222177f2ae2 Mon Sep 17 00:00:00 2001 From: Evgeny Grechnikov Date: Sun, 14 Oct 2018 20:05:54 +0300 Subject: LASTEXPRESS: refactor sound flags Merge SoundFlag and SoundStatus into a single enum; SoundEntry::setupStatus just casts one to another. Keep only definitions of bits in SoundFlag; drop compound flags like kFlagSteam = kSoundTypeAmbient | kSoundFlagLooped | kVolume7, use ORed simple flags in calls; change the signature of SoundManager::playSoundWithSubtitles to use uint32 instead of SoundFlag to avoid excess casting. Add meaningful names to flags; add some comments. Get rid of endian-unsafe SoundStatusUnion. Fixes an issue with big-endian hosts. No changes in behaviour on little-endian hosts. --- engines/lastexpress/menu/menu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/lastexpress/menu') diff --git a/engines/lastexpress/menu/menu.cpp b/engines/lastexpress/menu/menu.cpp index 3a17cec6df..65680b3964 100644 --- a/engines/lastexpress/menu/menu.cpp +++ b/engines/lastexpress/menu/menu.cpp @@ -315,7 +315,7 @@ void Menu::show(bool doSavegame, SavegameType type, uint32 value) { getFlags()->mouseRightClick = false; // Play intro music - getSound()->playSoundWithSubtitles("MUS001.SND", kFlagMusic, kEntityPlayer); + getSound()->playSoundWithSubtitles("MUS001.SND", kSoundTypeIntro | kVolumeFull, kEntityPlayer); // Show The Smoking Car logo if (animation.load(getArchive("1931.nis"))) @@ -326,7 +326,7 @@ void Menu::show(bool doSavegame, SavegameType type, uint32 value) { } else { // Only show the quick intro if (!_hasShownStartScreen) { - getSound()->playSoundWithSubtitles("MUS018.SND", kFlagMusic, kEntityPlayer); + getSound()->playSoundWithSubtitles("MUS018.SND", kSoundTypeIntro | kVolumeFull, kEntityPlayer); getScenes()->loadScene(kSceneStartScreen); // Original game waits 60 frames and loops Sound::unknownFunction1 unless the right button is pressed @@ -1121,7 +1121,7 @@ void Menu::updateTime(uint32 time) { if (getSoundQueue()->isBuffered(kEntityChapters)) getSoundQueue()->removeFromQueue(kEntityChapters); - getSound()->playSoundWithSubtitles((_currentTime >= _time) ? "LIB042" : "LIB041", kFlagMenuClock, kEntityChapters); + getSound()->playSoundWithSubtitles((_currentTime >= _time) ? "LIB042" : "LIB041", kSoundTypeMenu | kSoundFlagFixedVolume | kVolumeFull, kEntityChapters); adjustIndex(_currentTime, _time, false); } } -- cgit v1.2.3