From 7c0b2cfd277569fdbd2b3a99faa8ed05dc794f5a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 30 Sep 2008 09:12:02 +0000 Subject: Added multiple new open() methods to Common::File, which make it possible to use this class as a generic convenience wrapper around all kinds of SeekableReadStream; also renamed the name() method to the less confusing getName() svn-id: r34696 --- engines/saga/music.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engines/saga') diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index 5bf0c0ec03..5d0c75d0ce 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -96,7 +96,12 @@ DigitalMusicInputStream::DigitalMusicInputStream(SagaEngine *vm, ResourceContext _compressedStream = NULL; - if (scumm_stricmp(_file->name(), "music.cmp") == 0 || scumm_stricmp(_file->name(), "musicd.cmp") == 0) { + // FIXME: It is a bad idea to use the File::getName() method to distinguish + // files here (note that it is for debugging purposes only, though that was + // not correctly documented in the past). + // A better way is to keep track of this via some flag, which indicates + // whether the music file contains compressed data. + if (scumm_stricmp(_file->getName(), "music.cmp") == 0 || scumm_stricmp(_file->getName(), "musicd.cmp") == 0) { // Read compressed header to determine compression type _file->seek((long)resourceData->offset, SEEK_SET); _file->read(compressedHeader, 9); -- cgit v1.2.3