diff options
author | Filippos Karapetis | 2008-01-22 21:55:14 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-01-22 21:55:14 +0000 |
commit | c577c0ea81cdbd9e887e503fbaac1e77c7c65605 (patch) | |
tree | 352f6197578ab1e5cbac64a0e8b620480ff1882b /engines/saga | |
parent | dd45b7ad45729b5398646965f4e65e204906c8b4 (diff) | |
download | scummvm-rg350-c577c0ea81cdbd9e887e503fbaac1e77c7c65605.tar.gz scummvm-rg350-c577c0ea81cdbd9e887e503fbaac1e77c7c65605.tar.bz2 scummvm-rg350-c577c0ea81cdbd9e887e503fbaac1e77c7c65605.zip |
Code simplification
svn-id: r30617
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/rscfile.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/engines/saga/rscfile.cpp b/engines/saga/rscfile.cpp index 343df039cb..094e7141f9 100644 --- a/engines/saga/rscfile.cpp +++ b/engines/saga/rscfile.cpp @@ -534,6 +534,7 @@ bool Resource::createContexts() { for (i = 0; i < _contextsCount; i++) { context = &_contexts[i]; context->file = new Common::File(); + context->serial = 0; // For ITE, add the digital music file and sfx file information here if (_vm->getGameType() == GType_ITE && digitalMusic && i == _contextsCount - 1) { @@ -560,20 +561,13 @@ bool Resource::createContexts() { context->fileName = voicesFileName; context->fileType = GAME_VOICEFILE; - } - } - context->serial = 0; - - // IHNM has several different voice files, so we need to allow - // multiple resource contexts of the same type. We tell them - // apart by assigning each of the duplicates a unique serial - // number. The default behaviour when requesting a context will - // be to look for serial number 0. - for (int j = i - 1; j >= 0; j--) { - if (_contexts[j].fileType & context->fileType) { - context->serial = _contexts[j].serial + 1; - break; + // IHNM has several different voice files, so we need to allow + // multiple resource contexts of the same type. We tell them + // apart by assigning each of the duplicates a unique serial + // number. The default behaviour when requesting a context will + // be to look for serial number 0. + context->serial = i - voicesFileIndex + token; } } |