From 0be985ce833d03e4458bb4512d5bed377c13d9c7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 29 Jul 2008 16:09:10 +0000 Subject: Changed class File (and derived classes) to only support read-only access; added a new class DumpFile for writing svn-id: r33412 --- engines/sword2/resman.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'engines/sword2') diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp index d6b8025cda..8cddddff78 100644 --- a/engines/sword2/resman.cpp +++ b/engines/sword2/resman.cpp @@ -234,7 +234,6 @@ bool ResourceManager::init() { /** * Returns the address of a resource. Loads if not in memory. Retains a count. */ - byte *ResourceManager::openResource(uint32 res, bool dump) { assert(res < _totalResFiles); @@ -287,7 +286,6 @@ byte *ResourceManager::openResource(uint32 res, bool dump) { if (dump) { char buf[256]; const char *tag; - Common::File out; switch (fetchType(_resList[res].ptr)) { case ANIMATION_FILE: @@ -337,7 +335,8 @@ byte *ResourceManager::openResource(uint32 res, bool dump) { sprintf(buf, "dumps/%s-%d.dmp", tag, res); if (!Common::File::exists(buf)) { - if (out.open(buf, Common::File::kFileWriteMode)) + Common::DumpFile out; + if (out.open(buf)) out.write(_resList[res].ptr, len); } } -- cgit v1.2.3