diff options
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/he/resource_he.cpp | 15 | ||||
-rw-r--r-- | engines/scumm/he/resource_he.h | 2 | ||||
-rw-r--r-- | engines/scumm/he/script_v60he.cpp | 8 |
3 files changed, 9 insertions, 16 deletions
diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp index 4f74a74b89..ece2b9d7f3 100644 --- a/engines/scumm/he/resource_he.cpp +++ b/engines/scumm/he/resource_he.cpp @@ -159,15 +159,16 @@ int Win32ResExtractor::extractResource_(const char *resType, char *resName, byte /* initiate stuff */ fi.memory = NULL; - fi.file = new Common::File; + fi.file = NULL; if (_fileName.empty()) { // We are running for the first time _fileName = _vm->generateFilename(-3); } /* get file size */ - fi.file->open(_fileName); - if (!fi.file->isOpen()) { + Common::FilesystemNode node(_fileName); + fi.file = node.openForReading(); + if (!fi.file) { error("Cannot open file %s", _fileName.c_str()); } @@ -199,12 +200,8 @@ int Win32ResExtractor::extractResource_(const char *resType, char *resName, byte /* free stuff and close file */ cleanup: - if (fi.file != NULL) { - fi.file->close(); - delete fi.file; - } - if (fi.memory != NULL) - free(fi.memory); + delete fi.file; + free(fi.memory); return ressize; } diff --git a/engines/scumm/he/resource_he.h b/engines/scumm/he/resource_he.h index 9f4b423d3d..cbe19a4fdf 100644 --- a/engines/scumm/he/resource_he.h +++ b/engines/scumm/he/resource_he.h @@ -168,7 +168,7 @@ class Win32ResExtractor : public ResExtractor { #include "common/pack-start.h" // START STRUCT PACKING struct WinLibrary { - Common::File *file; + Common::SeekableReadStream *file; byte *memory; byte *first_resource; int total_size; diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp index 7f36d53791..4af2138cad 100644 --- a/engines/scumm/he/script_v60he.cpp +++ b/engines/scumm/he/script_v60he.cpp @@ -1010,12 +1010,8 @@ void ScummEngine_v60he::o60_openFile() { // TODO / FIXME: Consider using listSavefiles to avoid unneccessary openForLoading calls _hInFileTable[slot] = _saveFileMan->openForLoading(filename); if (_hInFileTable[slot] == 0) { - Common::File *f = new Common::File(); - f->open(filename); - if (!f->isOpen()) - delete f; - else - _hInFileTable[slot] = f; + Common::FilesystemNode node(filename); + _hInFileTable[slot] = node.openForReading(); } break; case 2: |