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

cpage88 at users.sourceforge.net cpage88 at users.sourceforge.net
Wed Jul 2 02:30:49 CEST 2008


Revision: 32872
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32872&view=rev
Author:   cpage88
Date:     2008-07-01 17:30:49 -0700 (Tue, 01 Jul 2008)

Log Message:
-----------
Changes to implementation of the GMM

Modified Paths:
--------------
    scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp
    scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.h
    scummvm/branches/gsoc2008-rtl/common/events.h
    scummvm/branches/gsoc2008-rtl/engines/dialogs.cpp
    scummvm/branches/gsoc2008-rtl/engines/dialogs.h

Modified: scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp	2008-07-01 23:56:02 UTC (rev 32871)
+++ scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp	2008-07-02 00:30:49 UTC (rev 32872)
@@ -93,7 +93,8 @@
 	_boss(boss),
 	_buttonState(0),
 	_modifierState(0),
-	_shouldQuit(false) {
+	_shouldQuit(false),
+	_shouldRTL(false) {
 
 	assert(_boss);
 
@@ -383,16 +384,15 @@
 			_currentKeyDown.flags = event.kbd.flags;
 			_keyRepeatTime = time + kKeyRepeatInitialDelay;
 #endif
-
 			// Global Main Menu
 			if (event.kbd.keycode == Common::KEYCODE_F11)
 				if (g_engine && !g_engine->isPaused())
 					g_engine->mainMenuDialog();
-			
-			if (!g_engine->_quit)
+
+			if (g_engine->_quit)
+				event.type = Common::EVENT_QUIT;
+			else
 				break;
-			else
-				event.type = Common::EVENT_QUIT;
 
 		case Common::EVENT_KEYUP:
 			_modifierState = event.kbd.flags;
@@ -429,8 +429,12 @@
 		case Common::EVENT_MAINMENU:
 			if (g_engine && !g_engine->isPaused())
 				g_engine->mainMenuDialog();
-			break;
 
+			if (g_engine->_quit)
+				event.type = Common::EVENT_QUIT;
+			else 
+				break;
+
 		case Common::EVENT_QUIT:
 			if (ConfMan.getBool("confirm_exit")) {
 				if (g_engine)
@@ -441,6 +445,8 @@
 					g_engine->pauseEngine(false);
 			} else
 				_shouldQuit = true;
+
+			g_engine->_quit = true;
 			break;
 
 		default:

Modified: scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.h	2008-07-01 23:56:02 UTC (rev 32871)
+++ scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.h	2008-07-02 00:30:49 UTC (rev 32872)
@@ -48,6 +48,7 @@
 	int _buttonState;
 	int _modifierState;
 	bool _shouldQuit;
+	bool _shouldRTL;
 
 	class RandomSourceRecord {
 	public:
@@ -114,6 +115,10 @@
 	virtual int getButtonState() const { return _buttonState; }
 	virtual int getModifierState() const { return _modifierState; }
 	virtual int shouldQuit() const { return _shouldQuit; }
+	virtual int shouldRTL() const { return _shouldRTL; }
+	virtual void setQuit() { _shouldQuit = true; }
+	virtual void setRTL() { _shouldRTL = true; }
+	virtual void resetRTL() { _shouldRTL = false; }
 };
 
 #endif

Modified: scummvm/branches/gsoc2008-rtl/common/events.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/common/events.h	2008-07-01 23:56:02 UTC (rev 32871)
+++ scummvm/branches/gsoc2008-rtl/common/events.h	2008-07-02 00:30:49 UTC (rev 32872)
@@ -168,6 +168,26 @@
 	 */
 	virtual int shouldQuit() const = 0;
 
+	/**
+	 * Should we return to the launcher?
+	 */
+	virtual int shouldRTL() const = 0;
+
+	/** 
+	 * Sets the quit variable to true
+	 */
+	virtual void setQuit() = 0;
+
+	/**
+	 * Set the RTL flag, we should return to the launcher
+	 */
+	virtual void setRTL() = 0;
+
+	/**
+	 * We have returned to the launcher, and the RTL should be reset to false
+	 */
+	virtual void resetRTL() = 0;
+
 	// Optional: check whether a given key is currently pressed ????
 	//virtual bool isKeyPressed(int keycode) = 0;
 

Modified: scummvm/branches/gsoc2008-rtl/engines/dialogs.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/dialogs.cpp	2008-07-01 23:56:02 UTC (rev 32871)
+++ scummvm/branches/gsoc2008-rtl/engines/dialogs.cpp	2008-07-02 00:30:49 UTC (rev 32872)
@@ -108,11 +108,14 @@
 		_aboutDialog->runModal();
 		break;
 	case kRTLCmd:
+		//g_system->getEventManager()->setQuit();
+		//g_system->getEventManager()->setRTL();
 		_engine->_quit = true;
 		_engine->_rtl = true;
 		close();
 		break;
 	case kQuitCmd:
+		//g_system->getEventManager()->setQuit();
 		_engine->_quit = true;
 		close();
 		break;

Modified: scummvm/branches/gsoc2008-rtl/engines/dialogs.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/dialogs.h	2008-07-01 23:56:02 UTC (rev 32871)
+++ scummvm/branches/gsoc2008-rtl/engines/dialogs.h	2008-07-02 00:30:49 UTC (rev 32872)
@@ -46,6 +46,7 @@
 public:
 	MainMenuDialog(Engine *engine);
 	~MainMenuDialog();
+
 	virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
 
 protected:


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