[Scummvm-cvs-logs] scummvm master -> 6dd0a81fdfa1b39a77d845a970606d2a00004ffe

Strangerke Strangerke at scummvm.org
Thu Feb 27 08:11:37 CET 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6dd0a81fdf VOYEUR: Remove setVm from FilesManager


Commit: 6dd0a81fdfa1b39a77d845a970606d2a00004ffe
    https://github.com/scummvm/scummvm/commit/6dd0a81fdfa1b39a77d845a970606d2a00004ffe
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-02-26T23:09:57-08:00

Commit Message:
VOYEUR: Remove setVm from FilesManager

Changed paths:
    engines/voyeur/files.cpp
    engines/voyeur/files.h
    engines/voyeur/voyeur.cpp
    engines/voyeur/voyeur.h
    engines/voyeur/voyeur_game.cpp



diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp
index f788e66..4841ff7 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 c445afd..72fad52 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 5112445..d0cfb05 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 16999d8..76f8b5e 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 be60c55..75dd5b6 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;






More information about the Scummvm-git-logs mailing list