From c577c0ea81cdbd9e887e503fbaac1e77c7c65605 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 22 Jan 2008 21:55:14 +0000 Subject: [PATCH] Code simplification svn-id: r30617 --- engines/saga/rscfile.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/engines/saga/rscfile.cpp b/engines/saga/rscfile.cpp index 343df039cbc..094e7141f9e 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; } }