diff options
Diffstat (limited to 'engines/scumm/he')
-rw-r--r-- | engines/scumm/he/moonbase/moonbase.cpp | 3 | ||||
-rw-r--r-- | engines/scumm/he/moonbase/moonbase.h | 2 | ||||
-rw-r--r-- | engines/scumm/he/moonbase/moonbase_fow.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/he/resource_he.cpp | 7 | ||||
-rw-r--r-- | engines/scumm/he/resource_he.h | 4 |
5 files changed, 14 insertions, 6 deletions
diff --git a/engines/scumm/he/moonbase/moonbase.cpp b/engines/scumm/he/moonbase/moonbase.cpp index cb76c3f273..9b7ec9970e 100644 --- a/engines/scumm/he/moonbase/moonbase.cpp +++ b/engines/scumm/he/moonbase/moonbase.cpp @@ -30,6 +30,8 @@ namespace Scumm { Moonbase::Moonbase(ScummEngine_v100he *vm) : _vm(vm) { + _exe = new Common::PEResources(); + initFOW(); _ai = new AI(_vm); @@ -39,6 +41,7 @@ Moonbase::Moonbase(ScummEngine_v100he *vm) : _vm(vm) { } Moonbase::~Moonbase() { + delete _exe; delete _ai; #ifdef USE_LIBCURL delete _net; diff --git a/engines/scumm/he/moonbase/moonbase.h b/engines/scumm/he/moonbase/moonbase.h index d5fa4550ac..97ad6b7095 100644 --- a/engines/scumm/he/moonbase/moonbase.h +++ b/engines/scumm/he/moonbase/moonbase.h @@ -106,7 +106,7 @@ private: int32 _fowRenderTable[32768]; - Common::PEResources _exe; + Common::PEResources *_exe; Common::String _fileName; }; diff --git a/engines/scumm/he/moonbase/moonbase_fow.cpp b/engines/scumm/he/moonbase/moonbase_fow.cpp index 2e1265aff2..28d7e0cd55 100644 --- a/engines/scumm/he/moonbase/moonbase_fow.cpp +++ b/engines/scumm/he/moonbase/moonbase_fow.cpp @@ -99,11 +99,11 @@ bool Moonbase::setFOWImage(int image) { if (_fileName.empty()) { // We are running for the first time _fileName = _vm->generateFilename(-3); - if (!_exe.loadFromEXE(_fileName)) + if (!_exe->loadFromEXE(_fileName)) error("Cannot open file %s", _fileName.c_str()); } - Common::SeekableReadStream *stream = _exe.getResource(Common::kWinRCData, resId); + Common::SeekableReadStream *stream = _exe->getResource(Common::kWinRCData, resId); if (stream->size()) { _fowImage = (uint8 *)malloc(stream->size()); diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp index ddde352686..3de890f41b 100644 --- a/engines/scumm/he/resource_he.cpp +++ b/engines/scumm/he/resource_he.cpp @@ -114,13 +114,18 @@ void ResExtractor::setCursor(int id) { Win32ResExtractor::Win32ResExtractor(ScummEngine_v70he *scumm) : ResExtractor(scumm) { + _exe = new Common::PEResources(); +} + +Win32ResExtractor::~Win32ResExtractor() { + delete _exe; } bool Win32ResExtractor::extractResource(int id, CachedCursor *cc) { if (_fileName.empty()) { // We are running for the first time _fileName = _vm->generateFilename(-3); - if (!_exe.loadFromEXE(_fileName)) + if (!_exe->loadFromEXE(_fileName)) error("Cannot open file %s", _fileName.c_str()); } diff --git a/engines/scumm/he/resource_he.h b/engines/scumm/he/resource_he.h index 49175db8d4..617ed1f446 100644 --- a/engines/scumm/he/resource_he.h +++ b/engines/scumm/he/resource_he.h @@ -68,10 +68,10 @@ private: class Win32ResExtractor : public ResExtractor { public: Win32ResExtractor(ScummEngine_v70he *scumm); - ~Win32ResExtractor() {} + ~Win32ResExtractor(); private: - Common::PEResources _exe; + Common::PEResources *_exe; bool extractResource(int id, CachedCursor *cc); }; |