LASTEXPRESS: Fix loading of subtitles from sound name

This commit is contained in:
Littleboy 2011-06-29 15:22:43 -04:00
parent a5d001fdef
commit a5398bd663
2 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -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);