aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/sound/entry.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2011-07-05 15:32:42 +0300
committerEugene Sandulenko2011-07-06 14:40:22 +0300
commitc4b2800145d3f6a2896c619165a73054677f138f (patch)
treee6fca42e706ee4b6e0288b1e26b0377787efd1c3 /engines/lastexpress/sound/entry.cpp
parentd4696e6a1837b5d6204d077563edf78e15775fba (diff)
downloadscummvm-rg350-c4b2800145d3f6a2896c619165a73054677f138f.tar.gz
scummvm-rg350-c4b2800145d3f6a2896c619165a73054677f138f.tar.bz2
scummvm-rg350-c4b2800145d3f6a2896c619165a73054677f138f.zip
LASTEXPRESS: implement Sound::updateQueue() and all dependent functions
Diffstat (limited to 'engines/lastexpress/sound/entry.cpp')
-rw-r--r--engines/lastexpress/sound/entry.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp
index 1ba1862875..87d8ccdb30 100644
--- a/engines/lastexpress/sound/entry.cpp
+++ b/engines/lastexpress/sound/entry.cpp
@@ -262,6 +262,56 @@ void SoundEntry::update(uint val) {
}
}
+bool SoundEntry::updateSound() {
+ bool result;
+ char sub[16];
+
+ if (_status.status2 & 4) {
+ result = false;
+ } else {
+ if (_status.status2 & 0x80) {
+ if (_field_48 <= getSound()->getData2()) {
+ _status.status |= 0x20;
+ _status.status &= ~0x8000;
+ strcpy(sub, _name2.c_str());
+
+ int l = strlen(sub) + 1;
+ if (l - 1 > 4)
+ sub[l - 1 - 4] = 0;
+ showSubtitle(sub);
+ }
+ } else {
+ if (!(getSoundQueue()->getFlag() & 0x20)) {
+ if (!(_status.status3 & 8)) {
+ if (_entity) {
+ if (_entity < 0x80) {
+ updateEntryFlag(getSound()->getSoundFlag(_entity));
+ }
+ }
+ }
+ }
+ //if (status.status2 & 0x40 && !((uint32)_status.status & 0x180) && v1->soundBuffer)
+ // Sound_FillSoundBuffer(v1);
+ }
+ result = true;
+ }
+
+ return result;
+}
+
+void SoundEntry::updateEntryFlag(SoundFlag flag) {
+ if (flag) {
+ if (getSoundQueue()->getFlag() & 0x20 && _type != kSoundType9 && _type != kSoundType7)
+ update(flag);
+ else
+ _status.status = flag + (_status.status & ~0x1F);
+ } else {
+ _variant = 0;
+ _status.status |= 0x80u;
+ _status.status &= ~0x10001F;
+ }
+}
+
void SoundEntry::updateState() {
if (getSoundQueue()->getFlag() & 32) {
if (_type != kSoundType9 && _type != kSoundType7 && _type != kSoundType5) {