[Scummvm-cvs-logs] SF.net SVN: scummvm: [32773] scummvm/branches/gsoc2008-rtl/engines/ parallaction

cpage88 at users.sourceforge.net cpage88 at users.sourceforge.net
Wed Jun 25 03:41:40 CEST 2008


Revision: 32773
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32773&view=rev
Author:   cpage88
Date:     2008-06-24 18:41:40 -0700 (Tue, 24 Jun 2008)

Log Message:
-----------
Parallaction now uses the new _quit flag

Modified Paths:
--------------
    scummvm/branches/gsoc2008-rtl/engines/parallaction/dialogue.cpp
    scummvm/branches/gsoc2008-rtl/engines/parallaction/exec_ns.cpp
    scummvm/branches/gsoc2008-rtl/engines/parallaction/gui_br.cpp
    scummvm/branches/gsoc2008-rtl/engines/parallaction/input.cpp
    scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.cpp
    scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.h
    scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction_br.cpp
    scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction_ns.cpp
    scummvm/branches/gsoc2008-rtl/engines/parallaction/saveload.cpp

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/dialogue.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/dialogue.cpp	2008-06-25 00:55:18 UTC (rev 32772)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/dialogue.cpp	2008-06-25 01:41:40 UTC (rev 32773)
@@ -105,7 +105,7 @@
 
 		if (g_system->getEventManager()->pollEvent(e)) {
 			if (e.type == Common::EVENT_QUIT) {
-				_engineFlags |= kEngineQuit;
+				_vm->_quit = true;
 				break;
 			}
 
@@ -230,7 +230,7 @@
 
 		displayQuestion();
 		
-		if (_engineFlags & kEngineQuit)
+		if (_vm->_quit)
 			return;
 
 		if (_q->_answers[0] == NULL) break;
@@ -239,7 +239,7 @@
 			if (!displayAnswers()) break;
 			answer = getAnswer();
 
-			if (_engineFlags & kEngineQuit)
+			if (_vm->_quit)
 				return;
 
 			cmdlist = &_q->_answers[answer]->_commands;
@@ -272,7 +272,7 @@
 
 	uint32 event;
 	Common::Point p;
-	while (_engineFlags & kEngineQuit == 0) {
+	while (!_vm->_quit) {
 
 		_vm->_input->readInput();
 		_vm->_input->getCursorPos(p);

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/exec_ns.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/exec_ns.cpp	2008-06-25 00:55:18 UTC (rev 32772)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/exec_ns.cpp	2008-06-25 01:41:40 UTC (rev 32773)
@@ -297,7 +297,7 @@
 
 
 DECLARE_COMMAND_OPCODE(quit) {
-	_engineFlags |= kEngineQuit;
+	_vm->_quit = true;
 }
 
 
@@ -427,7 +427,7 @@
 		CommandPtr cmd = *it;
 		uint32 v8 = getLocationFlags();
 
-		if (_engineFlags & kEngineQuit)
+		if (_vm->_quit)
 			break;
 
 		if (cmd->_flagsOn & kFlagsGlobal) {
@@ -519,7 +519,7 @@
 
 	case kZoneSpeak:
 		runDialogue(z->u.speak);
-		if (_engineFlags & kEngineQuit)
+		if (_vm->_quit)
 			return 0;
 		break;
 

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/gui_br.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/gui_br.cpp	2008-06-25 00:55:18 UTC (rev 32772)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/gui_br.cpp	2008-06-25 01:41:40 UTC (rev 32773)
@@ -50,7 +50,7 @@
 	int option = guiShowMenu();
 	switch (option) {
 	case kMenuQuit:
-		_engineFlags |= kEngineQuit;
+		_vm->_quit = true;
 		break;
 
 	case kMenuLoadGame:

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/input.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/input.cpp	2008-06-25 00:55:18 UTC (rev 32772)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/input.cpp	2008-06-25 01:41:40 UTC (rev 32773)
@@ -80,7 +80,7 @@
 			break;
 
 		case Common::EVENT_QUIT:
-			_engineFlags |= kEngineQuit;
+			_vm->_quit = true;
 			return KeyDown;
 
 		default:

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.cpp	2008-06-25 00:55:18 UTC (rev 32772)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.cpp	2008-06-25 01:41:40 UTC (rev 32773)
@@ -331,7 +331,7 @@
 		break;
 
 	case kEvQuitGame:
-		_engineFlags |= kEngineQuit;
+		_vm->_quit = true;
 		break;
 
 	case kEvSaveGame:
@@ -358,19 +358,19 @@
 		processInput(data);
 	}
 
-	if (_engineFlags & kEngineQuit)
+	if (_vm->_quit)
 		return;
 
 	runPendingZones();
 
-	if (_engineFlags & kEngineQuit)
+	if (_vm->_quit)
 		return;
 
 	if (_engineFlags & kEngineChangeLocation) {
 		changeLocation(_location._name);
 	}
 
-	if (_engineFlags & kEngineQuit)
+	if (_vm->_quit)
 		return;
 
 	_gfx->beginFrame();
@@ -466,7 +466,7 @@
 
 
 void Parallaction::freeZones() {
-	debugC(2, kDebugExec, "freeZones: kEngineQuit = %i", _engineFlags & kEngineQuit);
+	debugC(2, kDebugExec, "freeZones: _vm->_quit = %i", _vm->_quit);
 
 	ZoneList::iterator it = _location._zones.begin();
 
@@ -475,7 +475,7 @@
 		// NOTE : this condition has been relaxed compared to the original, to allow the engine
 		// to retain special - needed - zones that were lost across location switches.
 		ZonePtr z = *it;
-		if (((z->_top == -1) || (z->_left == -2)) && ((_engineFlags & kEngineQuit) == 0)) {
+		if (((z->_top == -1) || (z->_left == -2)) && ((_vm->_quit) == 0)) {
 			debugC(2, kDebugExec, "freeZones preserving zone '%s'", z->_name);
 			it++;
 		} else {

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.h	2008-06-25 00:55:18 UTC (rev 32772)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.h	2008-06-25 01:41:40 UTC (rev 32773)
@@ -98,7 +98,6 @@
 };
 
 enum EngineFlags {
-	kEngineQuit			= (1 << 0),
 	kEnginePauseJobs	= (1 << 1),
 	kEngineInventory	= (1 << 2),
 	kEngineWalking		= (1 << 3),

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction_br.cpp	2008-06-25 00:55:18 UTC (rev 32772)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction_br.cpp	2008-06-25 01:41:40 UTC (rev 32773)
@@ -105,17 +105,17 @@
 	guiSplash("dyna");
 	guiSplash("core");
 
-	while ((_engineFlags & kEngineQuit) == 0) {
+	while (_vm->_quit == 0) {
 
 		guiStart();
 
-		if (_engineFlags & kEngineQuit)
-			return 0;
+		if (_vm->_quit)
+			return _rtl;
 
 //		initCharacter();
 
 		_input->_inputMode = Input::kInputModeGame;
-		while ((_engineFlags & (kEngineReturn | kEngineQuit)) == 0) {
+		while (((_engineFlags & kEngineReturn) == 0) && (!_vm->_quit)) {
 			runGame();
 		}
 		_engineFlags &= ~kEngineReturn;
@@ -125,7 +125,7 @@
 
 	}
 
-	return 0;
+	return _rtl;
 }
 
 

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction_ns.cpp	2008-06-25 00:55:18 UTC (rev 32772)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction_ns.cpp	2008-06-25 01:41:40 UTC (rev 32773)
@@ -236,20 +236,20 @@
 
 	guiStart();
 	
-	if (_engineFlags & kEngineQuit)
-		return 0;
+	if (_vm->_quit)
+		return _rtl;
 	
 	changeLocation(_location._name);
 
-	if (_engineFlags & kEngineQuit)
-		return 0;
+	if (_vm->_quit)
+		return _rtl;
 
 	_input->_inputMode = Input::kInputModeGame;
-	while ((_engineFlags & kEngineQuit) == 0) {
+	while (!_vm->_quit) {
 		runGame();
 	}
 
-	return 0;
+	return _rtl;
 }
 
 void Parallaction_ns::switchBackground(const char* background, const char* mask) {
@@ -454,13 +454,13 @@
 	memset(_locationNames, 0, sizeof(_locationNames));
 
 	// this flag tells freeZones to unconditionally remove *all* Zones
-	_engineFlags |= kEngineQuit;
+	_vm->_quit = true;
 
 	freeZones();
 	freeAnimations();
 
 	// this dangerous flag can now be cleared
-	_engineFlags &= ~kEngineQuit;
+	_vm->_quit = false;
 
 	// main character animation is restored
 	_location._animations.push_front(_char._ani);

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/saveload.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/saveload.cpp	2008-06-25 00:55:18 UTC (rev 32772)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/saveload.cpp	2008-06-25 01:41:40 UTC (rev 32773)
@@ -132,12 +132,14 @@
 	// TODO (LIST): unify (and parametrize) calls to freeZones.
 	// We aren't calling freeAnimations because it is not needed, since
 	// kChangeLocation will trigger a complete deletion. Anyway, we still
-	// need to invoke freeZones here with kEngineQuit set, because the
+	// need to invoke freeZones here with _quit set, because the
 	// call in changeLocation preserve certain zones.
-	_engineFlags |= kEngineQuit;
+	_quit = true;
+
 	freeZones();
-	_engineFlags &= ~kEngineQuit;
 
+	_quit = false;
+
 	_numLocations = atoi(s);
 
 	uint16 _si;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list