diff options
author | Johannes Schickel | 2006-10-24 00:56:10 +0000 |
---|---|---|
committer | Johannes Schickel | 2006-10-24 00:56:10 +0000 |
commit | 3197cb6a2389000ec47bf9d27056403b98ceb0b8 (patch) | |
tree | cfc4b5f61408e600d3d7707347ac980714955bb4 /engines | |
parent | 0d357aab4d7add6011ee1fbc99c502820daf0278 (diff) | |
download | scummvm-rg350-3197cb6a2389000ec47bf9d27056403b98ceb0b8.tar.gz scummvm-rg350-3197cb6a2389000ec47bf9d27056403b98ceb0b8.tar.bz2 scummvm-rg350-3197cb6a2389000ec47bf9d27056403b98ceb0b8.zip |
Never unload files loat on startup like "CAVE.APK" and "LAGOON.APK".
svn-id: r24485
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/resource.cpp | 5 | ||||
-rw-r--r-- | engines/kyra/resource.h | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index 444345d980..829c969394 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -81,6 +81,11 @@ Resource::Resource(KyraEngine *engine) { if (!loadPakFile(list[i])) error("couldn't open pakfile '%s'", list[i]); } + + Common::List<ResourceFile*>::iterator start = _pakfiles.begin(); + for (;start != _pakfiles.end(); ++start) { + (*start)->protect(); + } } else { for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { Common::String filename = file->name(); diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index 34c9a16986..6d0f725184 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -35,7 +35,7 @@ namespace Kyra { class ResourceFile { public: - ResourceFile() : _open(false), _filename() {} + ResourceFile() : _open(false), _protected(false), _filename() {} virtual ~ResourceFile() {} virtual uint8 *getFile(uint file) = 0; @@ -47,10 +47,12 @@ public: virtual bool isValid(void) const { return (_filename != 0); } bool isOpen(void) const { return _open; } - virtual void close() { _open = false; } + virtual void close() { if (!_protected) _open = false; } + virtual void protect(const bool prot = true) { _protected = prot; } virtual void open() { _open = true; } protected: bool _open; + bool _protected; uint _filename; }; |