aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress
diff options
context:
space:
mode:
authorLittleboy2011-06-29 15:22:43 -0400
committerLittleboy2011-07-01 01:17:08 -0400
commita5398bd663064d3ebca61c3e49eeb7773eadd612 (patch)
treee9502f2b5c11bc90e483e446bf60670c0b50f812 /engines/lastexpress
parenta5d001fdef730b61453cc4786f7c4ee45827549e (diff)
downloadscummvm-rg350-a5398bd663064d3ebca61c3e49eeb7773eadd612.tar.gz
scummvm-rg350-a5398bd663064d3ebca61c3e49eeb7773eadd612.tar.bz2
scummvm-rg350-a5398bd663064d3ebca61c3e49eeb7773eadd612.zip
LASTEXPRESS: Fix loading of subtitles from sound name
Diffstat (limited to 'engines/lastexpress')
-rw-r--r--engines/lastexpress/sound/entry.cpp10
-rw-r--r--engines/lastexpress/sound/sound.cpp3
2 files changed, 7 insertions, 6 deletions
diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp
index 4bdb9f7f96..2840d85ca7 100644
--- a/engines/lastexpress/sound/entry.cpp
+++ b/engines/lastexpress/sound/entry.cpp
@@ -752,7 +752,7 @@ void SubtitleEntry::load(Common::String filename, SoundEntry *soundEntry) {
_sound = soundEntry;
// Load subtitle data
- if (_engine->getResourceManager()->hasFile(filename)) {
+ if (_engine->getResourceManager()->hasFile(_filename)) {
if (getSoundQueue()->getSubtitleFlag() & 2)
return;
@@ -786,6 +786,8 @@ void SubtitleEntry::setupAndDraw() {
}
getSoundQueue()->setCurrentSubtitle(this);
+
+ // TODO Missing code
}
void SubtitleEntry::draw() {
@@ -801,13 +803,11 @@ void SubtitleEntry::draw() {
}
void SubtitleEntry::drawOnScreen() {
- getSoundQueue()->setSubtitleFlag(getSoundQueue()->getSubtitleFlag() & -1);
-
if (_data == NULL)
return;
- if (getSoundQueue()->getSubtitleFlag() & 1)
- _engine->getGraphicsManager()->draw(_data, GraphicsManager::kBackgroundOverlay);
+ getSoundQueue()->setSubtitleFlag(getSoundQueue()->getSubtitleFlag() & -2);
+ _engine->getGraphicsManager()->draw(_data, GraphicsManager::kBackgroundOverlay);
}
} // End of namespace LastExpress
diff --git a/engines/lastexpress/sound/sound.cpp b/engines/lastexpress/sound/sound.cpp
index ff9e7e5aac..c04b6d361f 100644
--- a/engines/lastexpress/sound/sound.cpp
+++ b/engines/lastexpress/sound/sound.cpp
@@ -162,7 +162,8 @@ bool SoundManager::playSoundWithSubtitles(Common::String filename, SoundFlag fla
entry->setStatus(entry->getStatus().status | kSoundStatus_8000);
} else {
// Get subtitles name
- while (filename.size() > 4)
+ uint32 size = filename.size();
+ while (filename.size() > size - 4)
filename.deleteLastChar();
entry->showSubtitle(filename);