diff options
author | Evgeny Grechnikov | 2018-10-14 20:05:54 +0300 |
---|---|---|
committer | Evgeny Grechnikov | 2018-10-14 20:08:32 +0300 |
commit | 53cd6616c958e4a50644254688aea222177f2ae2 (patch) | |
tree | b0373918c84cf577268056ef0fe65a97f19f7e58 /engines/lastexpress/entities/train.cpp | |
parent | 46fe0aafd6996841ee9969da7a8988497baf51b6 (diff) | |
download | scummvm-rg350-53cd6616c958e4a50644254688aea222177f2ae2.tar.gz scummvm-rg350-53cd6616c958e4a50644254688aea222177f2ae2.tar.bz2 scummvm-rg350-53cd6616c958e4a50644254688aea222177f2ae2.zip |
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.
Diffstat (limited to 'engines/lastexpress/entities/train.cpp')
-rw-r--r-- | engines/lastexpress/entities/train.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/engines/lastexpress/entities/train.cpp b/engines/lastexpress/entities/train.cpp index c8cfe8cca8..e4ff976cae 100644 --- a/engines/lastexpress/entities/train.cpp +++ b/engines/lastexpress/entities/train.cpp @@ -118,7 +118,7 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) getObjects()->update((ObjectIndex)params->param1, kEntityTrain, kObjectLocation3, kCursorNormal, kCursorNormal); // Knock / closed door sound - getSound()->playSound(kEntityTables5, (params->param2 == 8) ? "LIB012" : "LIB013", kFlagDefault); + getSound()->playSound(kEntityTables5, (params->param2 == 8) ? "LIB012" : "LIB013", kVolumeFull); if (params->param4 && params->param5) { @@ -130,17 +130,17 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) break; case 1: - getSound()->playSound(kEntityTables5, "Har1014", kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1014", kVolumeFull, 15); break; case 2: - getSound()->playSound(kEntityTables5, "Har1013", kFlagDefault, 15); - getSound()->playSound(kEntityTables5, "Har1016", kFlagDefault, 150); + getSound()->playSound(kEntityTables5, "Har1013", kVolumeFull, 15); + getSound()->playSound(kEntityTables5, "Har1016", kVolumeFull, 150); break; case 3: - getSound()->playSound(kEntityTables5, "Har1015A", kFlagDefault, 15); - getSound()->playSound(kEntityTables5, "Har1015", kFlagDefault, 150); + getSound()->playSound(kEntityTables5, "Har1015A", kVolumeFull, 15); + getSound()->playSound(kEntityTables5, "Har1015", kVolumeFull, 150); break; } @@ -164,15 +164,15 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) break; case 1: - getSound()->playSound(kEntityTables5, "Har1014", kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1014", kVolumeFull, 15); break; case 2: - getSound()->playSound(kEntityTables5, "Har1013", kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1013", kVolumeFull, 15); break; case 3: - getSound()->playSound(kEntityTables5, "Har1013A", kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1013A", kVolumeFull, 15); break; } @@ -191,11 +191,11 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) break; case 1: - getSound()->playSound(kEntityTables5, "Har1012", kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1012", kVolumeFull, 15); break; case 2: - getSound()->playSound(kEntityTables5, "Har1012A", kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1012A", kVolumeFull, 15); break; } @@ -207,7 +207,7 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) ENTITY_PARAM(0, 1)++; if (ENTITY_PARAM(0, 1) <= 1) - getSound()->playSound(kEntityTables5, "Har1014", kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1014", kVolumeFull, 15); else params->param8 = 1; @@ -221,7 +221,7 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) ENTITY_PARAM(0, 4)++; if (ENTITY_PARAM(0, 4) <= 1) { - getSound()->playSound(kEntityTables5, "Har1011", kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1011", kVolumeFull, 15); handleCompartmentAction(); return; } @@ -241,11 +241,11 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) break; case 1: - getSound()->playSound(kEntityTables5, "Har1013", kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1013", kVolumeFull, 15); break; case 2: - getSound()->playSound(kEntityTables5, "Har1013A", kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1013A", kVolumeFull, 15); break; } |