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

cpage88 at users.sourceforge.net cpage88 at users.sourceforge.net
Mon Jul 14 00:24:55 CEST 2008


Revision: 33046
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33046&view=rev
Author:   cpage88
Date:     2008-07-13 15:24:55 -0700 (Sun, 13 Jul 2008)

Log Message:
-----------
TOUCHE works with the new GMM implementation

Modified Paths:
--------------
    scummvm/branches/gsoc2008-rtl/engines/touche/menu.cpp
    scummvm/branches/gsoc2008-rtl/engines/touche/opcodes.cpp
    scummvm/branches/gsoc2008-rtl/engines/touche/saveload.cpp
    scummvm/branches/gsoc2008-rtl/engines/touche/touche.cpp

Modified: scummvm/branches/gsoc2008-rtl/engines/touche/menu.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/touche/menu.cpp	2008-07-13 22:08:58 UTC (rev 33045)
+++ scummvm/branches/gsoc2008-rtl/engines/touche/menu.cpp	2008-07-13 22:24:55 UTC (rev 33046)
@@ -297,7 +297,7 @@
 		menuData->quit = true;
 		break;
 	case kActionQuitGame:
-		_quit = 1;
+		quitGame();
 		menuData->quit = true;
 		break;
 	case kActionTextOnly:
@@ -398,7 +398,6 @@
 				case Common::EVENT_QUIT:
 					menuData.quit = true;
 					menuData.exit = true;
-					_quit = 1;
 					break;
 				case Common::EVENT_LBUTTONDOWN:
 					button = menuData.findButtonUnderCursor(event.mouse.x, event.mouse.y);
@@ -433,8 +432,9 @@
 			_system->delayMillis(10);
 		}
 		_fullRedrawCounter = 2;
-		if (!menuData.exit && _quit != 0) {
-			_quit = displayQuitDialog();
+		if (!menuData.exit && quit()) {
+			if (displayQuitDialog())
+				quitGame();
 		}
 	}
 }

Modified: scummvm/branches/gsoc2008-rtl/engines/touche/opcodes.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/touche/opcodes.cpp	2008-07-13 22:08:58 UTC (rev 33045)
+++ scummvm/branches/gsoc2008-rtl/engines/touche/opcodes.cpp	2008-07-13 22:24:55 UTC (rev 33046)
@@ -409,7 +409,8 @@
 		_currentKeyCharNum = val;
 		break;
 	case 611:
-		_quit = val != 0;
+		if (val != 0)
+			quitGame();
 		break;
 	case 612:
 		_flagsTable[613] = getRandomNumber(val);

Modified: scummvm/branches/gsoc2008-rtl/engines/touche/saveload.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/touche/saveload.cpp	2008-07-13 22:08:58 UTC (rev 33045)
+++ scummvm/branches/gsoc2008-rtl/engines/touche/saveload.cpp	2008-07-13 22:24:55 UTC (rev 33046)
@@ -295,7 +295,7 @@
 	if (stream->readUint32LE() != saveLoadEndMarker) {
 		warning("Corrupted gamestate data");
 		// if that ever happens, exit the game
-		_quit = 1;
+		quitGame();
 	}
 	_flagsTable[614] = roomOffsX;
 	_flagsTable[615] = roomOffsY;

Modified: scummvm/branches/gsoc2008-rtl/engines/touche/touche.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/touche/touche.cpp	2008-07-13 22:08:58 UTC (rev 33045)
+++ scummvm/branches/gsoc2008-rtl/engines/touche/touche.cpp	2008-07-13 22:24:55 UTC (rev 33046)
@@ -115,7 +115,7 @@
 
 	res_deallocateTables();
 	res_closeDataFile();
-	return _rtl;
+	return _eventMan->shouldRTL();
 }
 
 void ToucheEngine::restart() {
@@ -269,7 +269,7 @@
 	}
 
 	uint32 frameTimeStamp = _system->getMillis();
-	for (uint32 cycleCounter = 0; _quit == 0; ++cycleCounter) {
+	for (uint32 cycleCounter = 0; !quit(); ++cycleCounter) {
 		if ((cycleCounter % 3) == 0) {
 			runCycle();
 		}
@@ -298,9 +298,6 @@
 	Common::Event event;
 	while (_eventMan->pollEvent(event)) {
 		switch (event.type) {
-		case Common::EVENT_QUIT:
-			_quit = 1;
-			break;
 		case Common::EVENT_KEYDOWN:
 			if (!handleKeyEvents) {
 				break;
@@ -308,7 +305,8 @@
 			_flagsTable[600] = event.kbd.keycode;
 			if (event.kbd.keycode == Common::KEYCODE_ESCAPE) {
 				if (_displayQuitDialog) {
-					_quit = displayQuitDialog();
+					if (displayQuitDialog())
+						quitGame();
 				}
 			} else if (event.kbd.keycode == Common::KEYCODE_F5) {
 				if (_flagsTable[618] == 0 && !_hideInventoryTexts) {
@@ -1839,7 +1837,7 @@
 	_menuRedrawCounter = 2;
 	Common::Rect rect(0, y, kScreenWidth, y + h);
 	i = -1;
-	while (_inp_rightMouseButtonPressed && _quit == 0) {
+	while (_inp_rightMouseButtonPressed && !quit()) {
 		Common::Point mousePos = getMousePos();
 		if (rect.contains(mousePos)) {
 			int c = (mousePos.y - y) / kTextHeight;
@@ -2702,10 +2700,10 @@
 		const int md2 = _programWalkTable[num1].point2;
 		_programPointsTable[md2].order = 0;
 	}
-	bool quit = false;
+	bool quitLoop = false;
 	int order = 1;
-	while (!quit) {
-		quit = true;
+	while (!quitLoop) {
+		quitLoop = true;
 		for (uint i = 0; i < _programWalkTable.size(); ++i) {
 			const int md1 = _programWalkTable[i].point1;
 			const int md2 = _programWalkTable[i].point2;
@@ -2713,11 +2711,11 @@
 				assert((md2 & 0x4000) == 0);
 				if (_programPointsTable[md1].order == order - 1 && _programPointsTable[md2].order > order) {
 					_programPointsTable[md2].order = order;
-					quit = false;
+					quitLoop = false;
 				}
 				if (_programPointsTable[md2].order == order - 1 && _programPointsTable[md1].order > order) {
 					_programPointsTable[md1].order = order;
-					quit = false;
+					quitLoop = false;
 				}
 			}
 		}
@@ -2949,9 +2947,9 @@
 	resetPointsData(0);
 	if (pointsDataNum != -1) {
 		_programPointsTable[pointsDataNum].order = 1;
-		bool quit = false;
-		while (!quit) {
-			quit = true;
+		bool quitLoop = false;
+		while (!quitLoop) {
+			quitLoop = true;
 			for (uint i = 0; i < _programWalkTable.size(); ++i) {
 				int16 md1 = _programWalkTable[i].point1;
 				int16 md2 = _programWalkTable[i].point2;
@@ -2959,11 +2957,11 @@
 					assert((md2 & 0x4000) == 0);
 					if (_programPointsTable[md1].order != 0 && _programPointsTable[md2].order == 0) {
 						_programPointsTable[md2].order = 1;
-						quit = false;
+						quitLoop = false;
 					}
 					if (_programPointsTable[md2].order != 0 && _programPointsTable[md1].order == 0) {
 						_programPointsTable[md1].order = 1;
-						quit = false;
+						quitLoop = false;
 					}
 				}
 			}


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