diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/resource.h | 4 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 22 |
2 files changed, 12 insertions, 14 deletions
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index 81cf762d42..576f683014 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -40,10 +40,6 @@ #include "kyra/kyra_v1.h" #include "kyra/kyra_hof.h" -namespace Common { -class ArchiveMember; -} // end of namespace Common - namespace Kyra { class Resource; diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 5cfd682b9c..543a5c8162 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -145,20 +145,22 @@ bool StaticResource::loadStaticResourceFile() { bool foundWorkingKyraDat = false; for (Common::ArchiveMemberList::iterator i = kyraDatFiles.begin(); i != kyraDatFiles.end(); ++i) { Common::SeekableReadStream *file = (*i)->open(); - if (checkKyraDat(file)) { - file->seek(0, SEEK_SET); - - Common::ArchivePtr archive = res->loadArchive(staticDataFilename(), *i); - if (archive) { - res->_archiveFiles->add(staticDataFilename(), archive, 0); - foundWorkingKyraDat = tryKyraDatLoad(); - } + if (!checkKyraDat(file)) { + delete file; + continue; } - delete file; + delete file; file = 0; - if (foundWorkingKyraDat) + Common::ArchivePtr archive = res->loadArchive(staticDataFilename(), *i); + if (!archive) + continue; + + res->_archiveFiles->add(staticDataFilename(), archive, 0); + if (tryKyraDatLoad()) { + foundWorkingKyraDat = true; break; + } res->_archiveCache.erase(staticDataFilename()); res->_archiveFiles->remove(staticDataFilename()); |