From 54e0390752b299d739daaf211e6b84b485738ada Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 23 Nov 2010 22:25:10 +0000 Subject: SCUMM: Replace Common::File uses by SeekableReadStream and SearchMan svn-id: r54434 --- engines/scumm/he/animation_he.h | 2 -- engines/scumm/he/script_v72he.cpp | 7 +------ engines/scumm/he/script_v80he.cpp | 10 +++------- engines/scumm/he/wiz_he.cpp | 8 ++------ 4 files changed, 6 insertions(+), 21 deletions(-) (limited to 'engines/scumm/he') diff --git a/engines/scumm/he/animation_he.h b/engines/scumm/he/animation_he.h index 34794b35ac..af4ec2041d 100644 --- a/engines/scumm/he/animation_he.h +++ b/engines/scumm/he/animation_he.h @@ -26,8 +26,6 @@ #if !defined(SCUMM_HE_ANIMATION_H) && defined(ENABLE_HE) #define SCUMM_HE_ANIMATION_H -#include "common/file.h" - #include "graphics/video/smk_decoder.h" #include "sound/mixer.h" diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp index 76daacbd54..32c15abcba 100644 --- a/engines/scumm/he/script_v72he.cpp +++ b/engines/scumm/he/script_v72he.cpp @@ -1412,12 +1412,7 @@ void ScummEngine_v72he::o72_openFile() { if (!_saveFileMan->listSavefiles(filename).empty()) { _hInFileTable[slot] = _saveFileMan->openForLoading(filename); } else { - Common::File *f = new Common::File(); - f->open(filename); - if (!f->isOpen()) - delete f; - else - _hInFileTable[slot] = f; + _hInFileTable[slot] = SearchMan.createReadStreamForMember(filename); } break; case 2: diff --git a/engines/scumm/he/script_v80he.cpp b/engines/scumm/he/script_v80he.cpp index b06dc712d9..c225be4b6c 100644 --- a/engines/scumm/he/script_v80he.cpp +++ b/engines/scumm/he/script_v80he.cpp @@ -25,6 +25,7 @@ #ifdef ENABLE_HE +#include "common/archive.h" #include "common/config-file.h" #include "common/config-manager.h" #include "common/savefile.h" @@ -94,14 +95,9 @@ void ScummEngine_v80he::o80_getFileSize() { Common::SeekableReadStream *f = 0; if (!_saveFileMan->listSavefiles(filename).empty()) { - f = _saveFileMan->openForLoading((const char *)filename); + f = _saveFileMan->openForLoading(filename); } else { - Common::File *file = new Common::File(); - file->open((const char *)filename); - if (!file->isOpen()) - delete file; - else - f = file; + f = SearchMan.createReadStreamForMember(filename); } if (!f) { diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index ddbbb2101f..807380272d 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -25,6 +25,7 @@ #ifdef ENABLE_HE +#include "common/archive.h" #include "common/system.h" #include "graphics/cursorman.h" #include "graphics/primitives.h" @@ -2374,12 +2375,7 @@ void Wiz::processWizImage(const WizParameters *params) { if (!_vm->_saveFileMan->listSavefiles(filename).empty()) { f = _vm->_saveFileMan->openForLoading(filename); } else { - Common::File *nf = new Common::File(); - nf->open(filename); - if (!nf->isOpen()) - delete nf; - else - f = nf; + f = SearchMan.createReadStreamForMember(filename); } if (f) { -- cgit v1.2.3