diff options
author | Max Horn | 2007-02-17 01:21:00 +0000 |
---|---|---|
committer | Max Horn | 2007-02-17 01:21:00 +0000 |
commit | 7b7c27bc0c586da6ca504e0e039a2a3bd892cc57 (patch) | |
tree | aba7b44f33382b63912f2d9555a46ed2ce80daf2 /engines/scumm/sound.cpp | |
parent | 369474bec62af58ab4102949c98d29200f6a9dd2 (diff) | |
download | scummvm-rg350-7b7c27bc0c586da6ca504e0e039a2a3bd892cc57.tar.gz scummvm-rg350-7b7c27bc0c586da6ca504e0e039a2a3bd892cc57.tar.bz2 scummvm-rg350-7b7c27bc0c586da6ca504e0e039a2a3bd892cc57.zip |
SCUMM: Fix opening of *.tlk files
svn-id: r25643
Diffstat (limited to 'engines/scumm/sound.cpp')
-rw-r--r-- | engines/scumm/sound.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 0dfa99a82e..2042933643 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -905,7 +905,6 @@ BaseScummFile *Sound::openSfxFile() { { 0, kVOCMode } }; - char buf[256]; ScummFile *file = new ScummFile(); _offsetTable = NULL; @@ -914,6 +913,7 @@ BaseScummFile *Sound::openSfxFile() { * same directory */ Common::String basename[2]; + Common::String tmp; const char *ptr = strchr(_vm->_filenamePattern.pattern, '.'); if (ptr) { @@ -926,8 +926,7 @@ BaseScummFile *Sound::openSfxFile() { for (uint j = 0; j < 2 && !file->isOpen(); ++j) { for (int i = 0; extensions[i].ext; ++i) { - Common::String tmp(basename[j]); - tmp += extensions[i].ext; + tmp = basename[j] + extensions[i].ext; if (_vm->openFile(*file, tmp)) { _soundMode = extensions[i].mode; break; @@ -937,12 +936,12 @@ BaseScummFile *Sound::openSfxFile() { if (!file->isOpen()) { if ((_vm->_game.heversion <= 61 && _vm->_game.platform == Common::kPlatformMacintosh) || (_vm->_game.heversion >= 70)) { - strncpy(buf, _vm->generateFilename(-2).c_str(), sizeof(buf)); + tmp = _vm->generateFilename(-2); } else { - sprintf(buf, "%s.tlk", _vm->_filenamePattern.pattern); + tmp = basename[0] + "tlk"; } - if (file->open(buf) && _vm->_game.heversion <= 73) + if (file->open(tmp) && _vm->_game.heversion <= 73) file->setEnc(0x69); _soundMode = kVOCMode; } |