[Scummvm-cvs-logs] CVS: scummvm/simon items.cpp,1.17,1.18

Oliver Kiehl olki at users.sourceforge.net
Sun Nov 17 07:16:02 CET 2002


Update of /cvsroot/scummvm/scummvm/simon
In directory usw-pr-cvs1:/tmp/cvs-serv6710

Modified Files:
	items.cpp 
Log Message:
implemented quit_if_user_presses_y()


Index: items.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- items.cpp	13 Nov 2002 16:34:22 -0000	1.17
+++ items.cpp	17 Nov 2002 15:15:26 -0000	1.18
@@ -775,7 +775,7 @@
 			break;
 
 		case 135:{
-				warning("Quit if user presses Y unimplemented");
+				o_quit_if_user_presses_y();
 			}
 			break;
 
@@ -1479,6 +1479,20 @@
 	}
 }
 
+void SimonState::o_quit_if_user_presses_y()
+{
+	OSystem::Event event;
+
+	for (;;) {
+		_system->poll_event(&event);
+		if (event.event_code == OSystem::EVENT_KEYDOWN)
+			if (event.kbd.keycode == 'y')
+				_system->quit();
+			else if (event.kbd.keycode == 'n')
+				break;
+		delay(10);
+	}
+}
 
 void SimonState::o_unk_137(uint fcs_index)
 {





More information about the Scummvm-git-logs mailing list