From d89ff31450c728ebae3892ef3ea7f83cacda0e2f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 3 Oct 2008 18:23:57 +0000 Subject: Cleanup. svn-id: r34736 --- engines/kyra/resource.h | 4 ---- engines/kyra/staticres.cpp | 22 ++++++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) (limited to 'engines') 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()); -- cgit v1.2.3