[Scummvm-cvs-logs] scummvm master -> 8215f598612a61e472ec56db0f93fb43908a1348

Strangerke Strangerke at scummvm.org
Wed Feb 26 22:55:53 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:
8215f59861 VOYEUR: Remove setVm from Debugger


Commit: 8215f598612a61e472ec56db0f93fb43908a1348
    https://github.com/scummvm/scummvm/commit/8215f598612a61e472ec56db0f93fb43908a1348
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-02-26T13:54:13-08:00

Commit Message:
VOYEUR: Remove setVm from Debugger

Changed paths:
    engines/voyeur/debugger.cpp
    engines/voyeur/debugger.h
    engines/voyeur/events.cpp
    engines/voyeur/files_threads.cpp
    engines/voyeur/voyeur.cpp
    engines/voyeur/voyeur.h



diff --git a/engines/voyeur/debugger.cpp b/engines/voyeur/debugger.cpp
index f545321..fdd0825 100644
--- a/engines/voyeur/debugger.cpp
+++ b/engines/voyeur/debugger.cpp
@@ -27,7 +27,7 @@
 
 namespace Voyeur {
 
-Debugger::Debugger() : GUI::Debugger() {
+Debugger::Debugger(VoyeurEngine *vm) : GUI::Debugger(), _vm(vm) {
 	// Register methods
 	DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
 	DCmd_Register("exit", WRAP_METHOD(Debugger, Cmd_Exit));
diff --git a/engines/voyeur/debugger.h b/engines/voyeur/debugger.h
index 0edf04e..12d62c5 100644
--- a/engines/voyeur/debugger.h
+++ b/engines/voyeur/debugger.h
@@ -61,10 +61,8 @@ protected:
 	 */
 	bool Cmd_Mouse(int argc, const char **argv);
 public:
-	Debugger();
+	Debugger(VoyeurEngine *vm);
 	virtual ~Debugger() {}
-	void setVm(VoyeurEngine *vm) { _vm = vm; }
-
 };
 
 } // End of namespace Voyeur
diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp
index c438883..ea726ac 100644
--- a/engines/voyeur/events.cpp
+++ b/engines/voyeur/events.cpp
@@ -96,7 +96,7 @@ void EventsManager::mainVoyeurIntFunc() {
 	if (!(_vm->_voy->_eventFlags & EVTFLAG_TIME_DISABLED)) {
 		++_vm->_voy->_switchBGNum;
 
-		if (_vm->_debugger._isTimeActive) {
+		if (_vm->_debugger->_isTimeActive) {
 			// Increase camera discharge
 			++_vm->_voy->_RTVNum;
 
@@ -149,10 +149,10 @@ void EventsManager::checkForNextFrameCounter() {
 			mainVoyeurIntFunc();
 
 		// Give time to the debugger
-		_vm->_debugger.onFrame();
+		_vm->_debugger->onFrame();
 
 		// If mouse position display is on, display the position
-		if (_vm->_debugger._showMousePosition)
+		if (_vm->_debugger->_showMousePosition)
 			showMousePosition();
 
 		// Display the frame
@@ -161,7 +161,7 @@ void EventsManager::checkForNextFrameCounter() {
 		g_system->updateScreen();
 
 		// Signal the ScummVM debugger
-		_vm->_debugger.onFrame();
+		_vm->_debugger->onFrame();
 	}
 }
 
@@ -263,8 +263,8 @@ void EventsManager::pollEvents() {
 			// Check for debugger
 			if (event.kbd.keycode == Common::KEYCODE_d && (event.kbd.flags & Common::KBD_CTRL)) {
 				// Attach to the debugger
-				_vm->_debugger.attach();
-				_vm->_debugger.onFrame();
+				_vm->_debugger->attach();
+				_vm->_debugger->onFrame();
 			}
 			return;
 		case Common::EVENT_LBUTTONDOWN:
diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp
index 2c3b5f2..7e776ce 100644
--- a/engines/voyeur/files_threads.cpp
+++ b/engines/voyeur/files_threads.cpp
@@ -1299,7 +1299,7 @@ int ThreadResource::doInterface() {
 	if (_vm->_voy->_RTVNum >= _vm->_voy->_RTVLimit || _vm->_voy->_RTVNum < 0)
 		_vm->_voy->_RTVNum = _vm->_voy->_RTVLimit - 1;
 
-	if (_vm->_voy->_transitionId < 15 && _vm->_debugger._isTimeActive &&
+	if (_vm->_voy->_transitionId < 15 && _vm->_debugger->_isTimeActive &&
 			(_vm->_voy->_RTVLimit - 3) < _vm->_voy->_RTVNum) {
 		_vm->_voy->_RTVNum = _vm->_voy->_RTVLimit;
 		_vm->makeViewFinder();
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index abb539f..b1ead5a 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -40,6 +40,7 @@ VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc)
 		_defaultFontInfo(3, 0xff, 0xff, 0, 0, ALIGN_LEFT, 0, Common::Point(), 1, 1, 
 			Common::Point(1, 1), 1, 0, 0) {
 	_voy = nullptr;
+	_debugger = nullptr;
 	_bVoy = NULL;
 
 	_iForceDeath = ConfMan.getInt("boot_param");
@@ -68,6 +69,7 @@ VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc)
 VoyeurEngine::~VoyeurEngine() {
 	delete _bVoy;
 	delete _voy;
+	delete _debugger;
 }
 
 Common::Error VoyeurEngine::run() {
@@ -94,11 +96,11 @@ int VoyeurEngine::getRandomNumber(int maxNumber) {
 }
 
 void VoyeurEngine::initializeManagers() {
-	_debugger.setVm(this);
 	_eventsManager.setVm(this);
 	_filesManager.setVm(this);
 	_graphicsManager.setVm(this);
 	_soundManager.setVm(this);
+	_debugger = new Debugger(this);
 	_voy = new SVoy(this);
 }
 
diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h
index 032ef24..b7fcad4 100644
--- a/engines/voyeur/voyeur.h
+++ b/engines/voyeur/voyeur.h
@@ -157,7 +157,7 @@ protected:
 	virtual bool hasFeature(EngineFeature f) const;
 public:
 	BoltFile *_bVoy;
-	Debugger _debugger;
+	Debugger *_debugger;
 	EventsManager _eventsManager;
 	FilesManager _filesManager;
 	GraphicsManager _graphicsManager;






More information about the Scummvm-git-logs mailing list