[Scummvm-cvs-logs] CVS: scummvm/queen defs.h,1.22,1.23 input.cpp,1.7,1.8 input.h,1.5,1.6 queen.cpp,1.27,1.28

David Eriksson twogood at users.sourceforge.net
Sun Nov 2 12:43:19 CET 2003


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv20993/queen

Modified Files:
	defs.h input.cpp input.h queen.cpp 
Log Message:
Enable keys for panel commands.


Index: defs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/defs.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- defs.h	31 Oct 2003 13:47:27 -0000	1.22
+++ defs.h	2 Nov 2003 20:42:36 -0000	1.23
@@ -86,6 +86,7 @@
 	ENGLISH  = 'E',
 	FRENCH   = 'F',
 	GERMAN   = 'G',
+	HEBREW   = 'H',
 	ITALIAN  = 'I',
 	SPANISH  = 'S'
 };

Index: input.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/input.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- input.cpp	31 Oct 2003 20:59:55 -0000	1.7
+++ input.cpp	2 Nov 2003 20:42:36 -0000	1.8
@@ -26,11 +26,43 @@
 
 namespace Queen {
 
+const char* Input::_commandKeys[LANGUAGE_COUNT] = {
+	{ "ocmglptu" }, // English
+	{ "osbgpnre" }, // German
+	{ "ofdnepau" }, // French
+	{ "acsdgpqu" }, // Italian
+	{ "ocmglptu" }, // Hebrew
+	{ "acodmthu" }  // Spanish
+};  
 
-Input::Input(OSystem *system) : 
+Input::Input(Language language, OSystem *system) : 
 	_system(system), _fastMode(false), _keyVerb(VERB_NONE), 
 	_cutawayRunning(false), _cutawayQuit(false), _talkQuit(false),
 	_inKey(0), _mouse_x(0), _mouse_y(0), _mouseButton(0) {
+
+	switch (language) {
+		case ENGLISH:
+			_currentCommandKeys = _commandKeys[0];
+			break;
+		case GERMAN:
+			_currentCommandKeys = _commandKeys[1];
+			break;
+		case FRENCH:
+			_currentCommandKeys = _commandKeys[2];
+			break;
+		case ITALIAN:
+			_currentCommandKeys = _commandKeys[3];
+			break;
+		case HEBREW:
+			_currentCommandKeys = _commandKeys[4];
+			break;
+		case SPANISH:
+			_currentCommandKeys = _commandKeys[5];
+			break;
+		default:
+			error("Unknown language");
+			break;
+	}
 }
 
 void Input::delay() {
@@ -155,6 +187,22 @@
 			break;
 
 		default:
+			if(_inKey == _currentCommandKeys[0])
+				_keyVerb = Verb(VERB_OPEN);
+			else if(_inKey == _currentCommandKeys[1])
+				_keyVerb = Verb(VERB_CLOSE);
+			else if(_inKey == _currentCommandKeys[2])
+				_keyVerb = Verb(VERB_MOVE);
+			else if(_inKey == _currentCommandKeys[3])
+				_keyVerb = Verb(VERB_GIVE);
+			else if(_inKey == _currentCommandKeys[4])
+				_keyVerb = Verb(VERB_LOOK_AT);
+			else if(_inKey == _currentCommandKeys[5])
+				_keyVerb = Verb(VERB_PICK_UP);
+			else if(_inKey == _currentCommandKeys[6])
+				_keyVerb = Verb(VERB_TALK_TO);
+			else if(_inKey == _currentCommandKeys[7])
+				_keyVerb = Verb(VERB_USE);
 			break;
 	}
 	

Index: input.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/input.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- input.h	30 Oct 2003 10:56:38 -0000	1.5
+++ input.h	2 Nov 2003 20:42:36 -0000	1.6
@@ -45,7 +45,7 @@
 			MOUSE_RBUTTON = 2
 		};
 
-		Input(OSystem *system);
+		Input(Language language, OSystem *system);
 
 		//! calls the other delay() with a value adjusted depending on _fastMode
 		void delay();
@@ -96,6 +96,11 @@
 			
 			KEY_F1 = 282
 		};
+
+		enum 
+		{
+			LANGUAGE_COUNT = 6
+		};
 		
 		//! Used to get keyboard and mouse events
 		OSystem *_system;
@@ -127,6 +132,11 @@
 		//! Set by delay();
 		int _mouseButton;
 
+		//! Command keys for current language
+		const char* _currentCommandKeys;
+
+		//! Command keys for all languages
+		static const char* _commandKeys[LANGUAGE_COUNT];
 };
 
 } // End of namespace Queen

Index: queen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/queen.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- queen.cpp	1 Nov 2003 21:20:36 -0000	1.27
+++ queen.cpp	2 Nov 2003 20:42:36 -0000	1.28
@@ -211,7 +211,7 @@
 
 void QueenEngine::initialise(void) {
 	_resource = new Resource(_gameDataPath, _detector->_game.detectname);
-	_input = new Input(_system);
+	_input = new Input(_resource->getLanguage(), _system);
 	_display = new Display(_system, _input);
 	_graphics = new Graphics(_display, _input, _resource);
 	_sound = Sound::giveSound(_mixer, _input, _resource, _resource->compression());





More information about the Scummvm-git-logs mailing list