From c23f597f50fdb0c4ee81a4f9de6e915b362afdc2 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 24 Aug 2010 15:48:43 +0000 Subject: KYRA: Cleanup. svn-id: r52348 --- engines/kyra/resource.cpp | 4 ++-- engines/kyra/resource.h | 4 ++-- engines/kyra/resource_intern.cpp | 10 +++++----- engines/kyra/resource_intern.h | 16 ++++++++-------- 4 files changed, 17 insertions(+), 17 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index 31a49a0af9..63b8072654 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -153,7 +153,7 @@ bool Resource::loadPakFile(Common::String filename) { return loadPakFile(filename, file); } -bool Resource::loadPakFile(Common::String name, Common::SharedPtr file) { +bool Resource::loadPakFile(Common::String name, Common::ArchiveMemberPtr file) { name.toUppercase(); if (_archiveFiles.hasArchive(name) || _protectedFiles.hasArchive(name)) @@ -319,7 +319,7 @@ Common::SeekableReadStream *Resource::createReadStream(const Common::String &fil return _files.createReadStreamForMember(file); } -Common::Archive *Resource::loadArchive(const Common::String &name, Common::SharedPtr member) { +Common::Archive *Resource::loadArchive(const Common::String &name, Common::ArchiveMemberPtr member) { ArchiveMap::iterator cachedArchive = _archiveCache.find(name); if (cachedArchive != _archiveCache.end()) return cachedArchive->_value; diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index d572c1ac54..8372bf9ad1 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -55,7 +55,7 @@ public: bool reset(); bool loadPakFile(Common::String filename); - bool loadPakFile(Common::String name, Common::SharedPtr file); + bool loadPakFile(Common::String name, Common::ArchiveMemberPtr file); void unloadPakFile(Common::String filename, bool remFromCache = false); @@ -86,7 +86,7 @@ protected: Common::SearchSet _archiveFiles; Common::SearchSet _protectedFiles; - Common::Archive *loadArchive(const Common::String &name, Common::SharedPtr member); + Common::Archive *loadArchive(const Common::String &name, Common::ArchiveMemberPtr member); Common::Archive *loadInstallerArchive(const Common::String &file, const Common::String &ext, const uint8 offset); bool loadProtectedFiles(const char * const * list); diff --git a/engines/kyra/resource_intern.cpp b/engines/kyra/resource_intern.cpp index 85d47f1fd4..0d968de9ff 100644 --- a/engines/kyra/resource_intern.cpp +++ b/engines/kyra/resource_intern.cpp @@ -35,7 +35,7 @@ namespace Kyra { // -> PlainArchive implementation -PlainArchive::PlainArchive(Common::SharedPtr file) +PlainArchive::PlainArchive(Common::ArchiveMemberPtr file) : _file(file), _files() { } @@ -86,7 +86,7 @@ PlainArchive::Entry PlainArchive::getFileEntry(const Common::String &name) const // -> TlkArchive implementation -TlkArchive::TlkArchive(Common::SharedPtr file, uint16 entryCount, const uint32 *fileEntries) +TlkArchive::TlkArchive(Common::ArchiveMemberPtr file, uint16 entryCount, const uint32 *fileEntries) : _file(file), _entryCount(entryCount), _fileEntries(fileEntries) { } @@ -285,7 +285,7 @@ bool ResLoaderPak::isLoadable(const Common::String &filename, Common::SeekableRe return true; } -Common::Archive *ResLoaderPak::load(Common::SharedPtr memberFile, Common::SeekableReadStream &stream) const { +Common::Archive *ResLoaderPak::load(Common::ArchiveMemberPtr memberFile, Common::SeekableReadStream &stream) const { int32 filesize = stream.size(); if (filesize < 0) return 0; @@ -400,7 +400,7 @@ bool ResLoaderInsMalcolm::isLoadable(const Common::String &filename, Common::See return (buffer[0] == 0x0D && buffer[1] == 0x0A); } -Common::Archive *ResLoaderInsMalcolm::load(Common::SharedPtr memberFile, Common::SeekableReadStream &stream) const { +Common::Archive *ResLoaderInsMalcolm::load(Common::ArchiveMemberPtr memberFile, Common::SeekableReadStream &stream) const { Common::List filenames; Common::ScopedPtr result(new PlainArchive(memberFile)); if (!result) @@ -468,7 +468,7 @@ bool ResLoaderTlk::isLoadable(const Common::String &filename, Common::SeekableRe return true; } -Common::Archive *ResLoaderTlk::load(Common::SharedPtr file, Common::SeekableReadStream &stream) const { +Common::Archive *ResLoaderTlk::load(Common::ArchiveMemberPtr file, Common::SeekableReadStream &stream) const { const uint16 entryCount = stream.readUint16LE(); uint32 *fileEntries = new uint32[entryCount * 2]; diff --git a/engines/kyra/resource_intern.h b/engines/kyra/resource_intern.h index ad4ee0eb1d..16f3a1fe91 100644 --- a/engines/kyra/resource_intern.h +++ b/engines/kyra/resource_intern.h @@ -46,7 +46,7 @@ public: uint32 size; }; - PlainArchive(Common::SharedPtr file); + PlainArchive(Common::ArchiveMemberPtr file); void addFileEntry(const Common::String &name, const Entry entry); Entry getFileEntry(const Common::String &name) const; @@ -59,13 +59,13 @@ public: private: typedef Common::HashMap FileMap; - Common::SharedPtr _file; + Common::ArchiveMemberPtr _file; FileMap _files; }; class TlkArchive : public Common::Archive { public: - TlkArchive(Common::SharedPtr file, uint16 entryCount, const uint32 *fileEntries); + TlkArchive(Common::ArchiveMemberPtr file, uint16 entryCount, const uint32 *fileEntries); ~TlkArchive(); bool hasFile(const Common::String &name); @@ -73,7 +73,7 @@ public: Common::ArchiveMemberPtr getMember(const Common::String &name); Common::SeekableReadStream *createReadStreamForMember(const Common::String &name) const; private: - Common::SharedPtr _file; + Common::ArchiveMemberPtr _file; const uint32 *findFile(const Common::String &name) const; @@ -115,28 +115,28 @@ public: virtual ~ResArchiveLoader() {} virtual bool checkFilename(Common::String filename) const = 0; virtual bool isLoadable(const Common::String &filename, Common::SeekableReadStream &stream) const = 0; - virtual Common::Archive *load(Common::SharedPtr file, Common::SeekableReadStream &stream) const = 0; + virtual Common::Archive *load(Common::ArchiveMemberPtr file, Common::SeekableReadStream &stream) const = 0; }; class ResLoaderPak : public ResArchiveLoader { public: bool checkFilename(Common::String filename) const; bool isLoadable(const Common::String &filename, Common::SeekableReadStream &stream) const; - Common::Archive *load(Common::SharedPtr file, Common::SeekableReadStream &stream) const; + Common::Archive *load(Common::ArchiveMemberPtr file, Common::SeekableReadStream &stream) const; }; class ResLoaderInsMalcolm : public ResArchiveLoader { public: bool checkFilename(Common::String filename) const; bool isLoadable(const Common::String &filename, Common::SeekableReadStream &stream) const; - Common::Archive *load(Common::SharedPtr file, Common::SeekableReadStream &stream) const; + Common::Archive *load(Common::ArchiveMemberPtr file, Common::SeekableReadStream &stream) const; }; class ResLoaderTlk : public ResArchiveLoader { public: bool checkFilename(Common::String filename) const; bool isLoadable(const Common::String &filename, Common::SeekableReadStream &stream) const; - Common::Archive *load(Common::SharedPtr file, Common::SeekableReadStream &stream) const; + Common::Archive *load(Common::ArchiveMemberPtr file, Common::SeekableReadStream &stream) const; }; class InstallerLoader { -- cgit v1.2.3