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

cpage88 at users.sourceforge.net cpage88 at users.sourceforge.net
Sun Jul 13 22:41:40 CEST 2008


Revision: 33041
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33041&view=rev
Author:   cpage88
Date:     2008-07-13 13:41:39 -0700 (Sun, 13 Jul 2008)

Log Message:
-----------
SKY works with the new GMM implementation, also updated gui/newgui.cpp and prevented pushEvent from pushing more than one EVENT_QUIT into the artificialEventQueue

Modified Paths:
--------------
    scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp
    scummvm/branches/gsoc2008-rtl/engines/sky/control.cpp
    scummvm/branches/gsoc2008-rtl/engines/sky/logic.cpp
    scummvm/branches/gsoc2008-rtl/engines/sky/mouse.cpp
    scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp
    scummvm/branches/gsoc2008-rtl/gui/newgui.cpp

Modified: scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp	2008-07-13 17:08:44 UTC (rev 33040)
+++ scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp	2008-07-13 20:41:39 UTC (rev 33041)
@@ -478,7 +478,13 @@
 }
 
 void DefaultEventManager::pushEvent(Common::Event event) {
-	artificialEventQueue.push(event);
+
+	// If already received an EVENT_QUIT, don't add another one
+	if (event.type == Common::EVENT_QUIT) {
+		if (!_shouldQuit)
+			artificialEventQueue.push(event);
+	} else 
+		artificialEventQueue.push(event);	
 }
 
 #endif // !defined(DISABLE_DEFAULT_EVENTMANAGER)

Modified: scummvm/branches/gsoc2008-rtl/engines/sky/control.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/control.cpp	2008-07-13 17:08:44 UTC (rev 33040)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/control.cpp	2008-07-13 20:41:39 UTC (rev 33041)
@@ -492,7 +492,7 @@
 	_curButtonText = 0;
 	uint16 clickRes = 0;
 
-	while (!quitPanel && !g_engine->_quit) {
+	while (!quitPanel && !g_engine->quit()) {
 		_text->drawToScreen(WITH_MASK);
 		_system->updateScreen();
 		_mouseClicked = false;
@@ -524,7 +524,7 @@
 	}
 	memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
 	_system->copyRectToScreen(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
-	if (!g_engine->_quit)
+	if (!g_engine->quit())
 		_system->updateScreen();
 	_skyScreen->forceRefresh();
 	_skyScreen->setPaletteEndian((uint8 *)_skyCompact->fetchCpt(SkyEngine::_systemVars.currentPalette));
@@ -603,7 +603,7 @@
 	case QUIT_TO_DOS:
 		animClick(pButton);
 		if (getYesNo(quitDos))
-			g_engine->_quit = true;
+			g_engine->quitGame();
 		return 0;
 	default:
 		error("Control::handleClick: unknown routine: %X",pButton->_onClick);
@@ -875,7 +875,7 @@
 	bool refreshNames = true;
 	bool refreshAll = true;
 	uint16 clickRes = 0;
-	while (!quitPanel && !g_engine->_quit) {
+	while (!quitPanel && !g_engine->quit()) {
 		clickRes = 0;
 		if (refreshNames || refreshAll) {
 			if (refreshAll) {
@@ -1546,9 +1546,6 @@
 			case Common::EVENT_WHEELDOWN:
 				_mouseWheel = 1;
 				break;
-			case Common::EVENT_QUIT:
-				g_engine->_quit = true;
-				break;
 			default:
 				break;
 			}

Modified: scummvm/branches/gsoc2008-rtl/engines/sky/logic.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/logic.cpp	2008-07-13 17:08:44 UTC (rev 33040)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/logic.cpp	2008-07-13 20:41:39 UTC (rev 33041)
@@ -2489,7 +2489,7 @@
 }
 
 bool Logic::fnQuitToDos(uint32 a, uint32 b, uint32 c) {
-	g_engine->_quit = true;
+	g_engine->quitGame();
 	return false;
 }
 

Modified: scummvm/branches/gsoc2008-rtl/engines/sky/mouse.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/mouse.cpp	2008-07-13 17:08:44 UTC (rev 33040)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/mouse.cpp	2008-07-13 20:41:39 UTC (rev 33041)
@@ -180,7 +180,6 @@
 	while (mousePressed || _system->getMillis() < now + minDelay) {
 
 		if (eventMan->shouldQuit()) {
-			g_engine->_quit = true;
 			minDelay = 0;
 			mousePressed = false;
 		}

Modified: scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp	2008-07-13 17:08:44 UTC (rev 33040)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp	2008-07-13 20:41:39 UTC (rev 33041)
@@ -353,7 +353,7 @@
 			introSkipped = !_skyIntro->doIntro(_floppyIntro);
 		}
 
-		if (!_quit) {
+		if (!quit()) {
 			_skyLogic->initScreen0();
 			if (introSkipped)
 				_skyControl->restartGame();
@@ -363,7 +363,7 @@
 	_lastSaveTime = _system->getMillis();
 
 	uint32 delayCount = _system->getMillis();
-	while (!_quit) {
+	while (!quit()) {
 		if (_debugger->isAttached())
 			_debugger->onFrame();
 
@@ -414,7 +414,7 @@
 	_skyMusic->stopMusic();
 	ConfMan.flushToDisk();
 	delay(1500);
-	return _rtl;
+	return _eventMan->shouldRTL();
 }
 
 int SkyEngine::init() {
@@ -610,9 +610,6 @@
 					_skyMouse->mouseMoved(event.mouse.x, event.mouse.y);
 				_skyMouse->buttonPressed(1);
 				break;
-			case Common::EVENT_QUIT:
-				_quit = true;
-				break;
 			default:
 				break;
 			}

Modified: scummvm/branches/gsoc2008-rtl/gui/newgui.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/gui/newgui.cpp	2008-07-13 17:08:44 UTC (rev 33040)
+++ scummvm/branches/gsoc2008-rtl/gui/newgui.cpp	2008-07-13 20:41:39 UTC (rev 33041)
@@ -256,7 +256,7 @@
 		Common::Event event;
 
 		while (eventMan->pollEvent(event)) {
-			if (activeDialog != getTopDialog() && event.type != Common::EVENT_QUIT && event.type != Common::EVENT_SCREEN_CHANGED)
+			if (activeDialog != getTopDialog() && event.type != Common::EVENT_SCREEN_CHANGED)
 				continue;
 
 			Common::Point mouse(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y);


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