aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur
diff options
context:
space:
mode:
authorStrangerke2014-02-27 08:09:57 +0100
committerStrangerke2014-02-27 08:09:57 +0100
commit6dd0a81fdfa1b39a77d845a970606d2a00004ffe (patch)
tree0ab71e3b73b8a6fbc5de5a814a2a8b27c4a04097 /engines/voyeur
parent9f74d13c57033f5cf60b711021f0b0b1e8697f9e (diff)
downloadscummvm-rg350-6dd0a81fdfa1b39a77d845a970606d2a00004ffe.tar.gz
scummvm-rg350-6dd0a81fdfa1b39a77d845a970606d2a00004ffe.tar.bz2
scummvm-rg350-6dd0a81fdfa1b39a77d845a970606d2a00004ffe.zip
VOYEUR: Remove setVm from FilesManager
Diffstat (limited to 'engines/voyeur')
-rw-r--r--engines/voyeur/files.cpp3
-rw-r--r--engines/voyeur/files.h3
-rw-r--r--engines/voyeur/voyeur.cpp26
-rw-r--r--engines/voyeur/voyeur.h2
-rw-r--r--engines/voyeur/voyeur_game.cpp2
5 files changed, 19 insertions, 17 deletions
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp
index f788e66833..4841ff7173 100644
--- a/engines/voyeur/files.cpp
+++ b/engines/voyeur/files.cpp
@@ -172,8 +172,9 @@ void BoltFilesState::nextBlock() {
/*------------------------------------------------------------------------*/
-FilesManager::FilesManager() {
+FilesManager::FilesManager(VoyeurEngine *vm) {
_curLibPtr = nullptr;
+ _boltFilesState._vm = vm;
}
bool FilesManager::openBoltLib(const Common::String &filename, BoltFile *&boltFile) {
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h
index c445afdbb6..72fad52d32 100644
--- a/engines/voyeur/files.h
+++ b/engines/voyeur/files.h
@@ -207,8 +207,7 @@ public:
BoltFilesState _boltFilesState;
BoltFile *_curLibPtr;
public:
- FilesManager();
- void setVm(VoyeurEngine *vm) { _boltFilesState._vm = vm; }
+ FilesManager(VoyeurEngine *vm);
bool openBoltLib(const Common::String &filename, BoltFile *&boltFile);
byte *fload(const Common::String &filename, int *size = NULL);
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index 5112445182..d0cfb05569 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -41,6 +41,7 @@ VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc)
Common::Point(1, 1), 1, 0, 0) {
_debugger = nullptr;
_eventsManager = nullptr;
+ _filesManager = nullptr;
_soundManager = nullptr;
_voy = nullptr;
_bVoy = NULL;
@@ -68,11 +69,21 @@ VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc)
initializeManagers();
}
+void VoyeurEngine::initializeManagers() {
+ _graphicsManager.setVm(this);
+ _debugger = new Debugger(this);
+ _eventsManager = new EventsManager(this);
+ _filesManager = new FilesManager(this);
+ _soundManager = new SoundManager(this, _mixer);
+ _voy = new SVoy(this);
+}
+
VoyeurEngine::~VoyeurEngine() {
delete _bVoy;
delete _voy;
delete _soundManager;
delete _eventsManager;
+ delete _filesManager;
delete _debugger;
}
@@ -99,15 +110,6 @@ int VoyeurEngine::getRandomNumber(int maxNumber) {
return _randomSource.getRandomNumber(maxNumber);
}
-void VoyeurEngine::initializeManagers() {
- _filesManager.setVm(this);
- _graphicsManager.setVm(this);
- _debugger = new Debugger(this);
- _eventsManager = new EventsManager(this);
- _soundManager = new SoundManager(this, _mixer);
- _voy = new SVoy(this);
-}
-
void VoyeurEngine::ESP_Init() {
ThreadResource::init();
@@ -118,7 +120,7 @@ void VoyeurEngine::ESP_Init() {
void VoyeurEngine::globalInitBolt() {
initBolt();
- _filesManager.openBoltLib("bvoy.blt", _bVoy);
+ _filesManager->openBoltLib("bvoy.blt", _bVoy);
_bVoy->getBoltGroup(0x000);
_bVoy->getBoltGroup(0x100);
@@ -233,8 +235,8 @@ void VoyeurEngine::showConversionScreen() {
bool VoyeurEngine::doLock() {
bool result = true;
int buttonVocSize, wrongVocSize;
- byte *buttonVoc = _filesManager.fload("button.voc", &buttonVocSize);
- byte *wrongVoc = _filesManager.fload("wrong.voc", &wrongVocSize);
+ byte *buttonVoc = _filesManager->fload("button.voc", &buttonVocSize);
+ byte *wrongVoc = _filesManager->fload("wrong.voc", &wrongVocSize);
if (_bVoy->getBoltGroup(0x700)) {
_voy->_viewBounds = _bVoy->boltEntry(0x704)._rectResource;
diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h
index 16999d85e9..76f8b5e3c4 100644
--- a/engines/voyeur/voyeur.h
+++ b/engines/voyeur/voyeur.h
@@ -159,7 +159,7 @@ public:
BoltFile *_bVoy;
Debugger *_debugger;
EventsManager *_eventsManager;
- FilesManager _filesManager;
+ FilesManager *_filesManager;
GraphicsManager _graphicsManager;
SoundManager *_soundManager;
SVoy *_voy;
diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp
index be60c557b5..75dd5b603d 100644
--- a/engines/voyeur/voyeur_game.cpp
+++ b/engines/voyeur/voyeur_game.cpp
@@ -28,7 +28,7 @@ namespace Voyeur {
void VoyeurEngine::playStamp() {
_stampLibPtr = NULL;
- _filesManager.openBoltLib("stampblt.blt", _stampLibPtr);
+ _filesManager->openBoltLib("stampblt.blt", _stampLibPtr);
_stampLibPtr->getBoltGroup(0);
_controlPtr->_state = _stampLibPtr->boltEntry(_controlPtr->_stateId >> 16)._stateResource;