aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-22 23:26:18 +0200
committerEinar Johan Trøan Sømåen2012-07-22 23:26:18 +0200
commita249b096c03d1cc3437f4e16abe92758f584947d (patch)
treecab75e1bb6e5327e051fad0a42ca12b68dd451ab /engines/wintermute/base
parent8c378f794e0398e646eb3598c9e27c09b4d68dfc (diff)
downloadscummvm-rg350-a249b096c03d1cc3437f4e16abe92758f584947d.tar.gz
scummvm-rg350-a249b096c03d1cc3437f4e16abe92758f584947d.tar.bz2
scummvm-rg350-a249b096c03d1cc3437f4e16abe92758f584947d.zip
WINTERMUTE: Remove Base as superclass for base_package.
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r--engines/wintermute/base/base_file_manager.cpp2
-rw-r--r--engines/wintermute/base/file/base_package.cpp9
-rw-r--r--engines/wintermute/base/file/base_package.h13
3 files changed, 12 insertions, 12 deletions
diff --git a/engines/wintermute/base/base_file_manager.cpp b/engines/wintermute/base/base_file_manager.cpp
index 0a59a3b134..2fd5521e37 100644
--- a/engines/wintermute/base/base_file_manager.cpp
+++ b/engines/wintermute/base/base_file_manager.cpp
@@ -439,7 +439,7 @@ bool BaseFileManager::registerPackage(Common::SeekableReadStream *package, const
}
for (uint32 i = 0; i < hdr._numDirs; i++) {
- BasePackage *pkg = new BasePackage(_gameRef);
+ BasePackage *pkg = new BasePackage(this);
if (!pkg) return STATUS_FAILED;
pkg->_boundToExe = boundToExe;
diff --git a/engines/wintermute/base/file/base_package.cpp b/engines/wintermute/base/file/base_package.cpp
index 24f7c23422..a95be25a81 100644
--- a/engines/wintermute/base/file/base_package.cpp
+++ b/engines/wintermute/base/file/base_package.cpp
@@ -40,12 +40,13 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-BasePackage::BasePackage(BaseGame *inGame): BaseClass(inGame) {
+BasePackage::BasePackage(BaseFileManager *fileMan)/*: BaseClass(inGame) */{
_file = NULL;
_name = NULL;
_cd = 0;
_priority = 0;
_boundToExe = false;
+ _fileManager = fileMan;
}
@@ -87,10 +88,10 @@ bool BasePackage::read(Common::SeekableReadStream *file, uint32 offset, byte *bu
//////////////////////////////////////////////////////////////////////////
Common::SeekableReadStream *BasePackage::getFilePointer() {
- Common::File *file = _gameRef->_fileManager->openPackage(_name);
+ Common::File *file = _fileManager->openPackage(_name);
if (!file) {
- _gameRef->_fileManager->requestCD(_cd, _name, "");
- file = _gameRef->_fileManager->openPackage(_name);
+ _fileManager->requestCD(_cd, _name, "");
+ file = _fileManager->openPackage(_name);
}
return file;
}
diff --git a/engines/wintermute/base/file/base_package.h b/engines/wintermute/base/file/base_package.h
index 2f305ea049..af180ac7bf 100644
--- a/engines/wintermute/base/file/base_package.h
+++ b/engines/wintermute/base/file/base_package.h
@@ -29,16 +29,16 @@
#ifndef WINTERMUTE_BPACKAGE_H
#define WINTERMUTE_BPACKAGE_H
-
-#include "engines/wintermute/base/base.h"
+#include "common/stream.h"
namespace Common {
class SeekableReadStream;
}
namespace WinterMute {
-
-class BasePackage : public BaseClass {
+class BaseFileManager;
+class BasePackage {
+ BaseFileManager *_fileManager;
public:
Common::SeekableReadStream *getFilePointer();
void closeFilePointer(Common::SeekableReadStream *&file);
@@ -51,9 +51,8 @@ public:
char *_name;
int _cd;
Common::SeekableReadStream *_file;
- BasePackage(BaseGame *inGame);
- virtual ~BasePackage();
-
+ BasePackage(BaseFileManager *fileMan);
+ ~BasePackage();
};
} // end of namespace WinterMute