[Scummvm-cvs-logs] SF.net SVN: scummvm: [27807] scummvm/branches/branch-0-10-0/engines/agi

agent-q at users.sourceforge.net agent-q at users.sourceforge.net
Sun Jul 1 02:57:39 CEST 2007


Revision: 27807
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27807&view=rev
Author:   agent-q
Date:     2007-06-30 17:57:39 -0700 (Sat, 30 Jun 2007)

Log Message:
-----------
Adding hooks to allow DS port to implement word completion in AGI engine.

Modified Paths:
--------------
    scummvm/branches/branch-0-10-0/engines/agi/agi.h
    scummvm/branches/branch-0-10-0/engines/agi/keyboard.cpp
    scummvm/branches/branch-0-10-0/engines/agi/words.cpp

Modified: scummvm/branches/branch-0-10-0/engines/agi/agi.h
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agi/agi.h	2007-07-01 00:55:46 UTC (rev 27806)
+++ scummvm/branches/branch-0-10-0/engines/agi/agi.h	2007-07-01 00:57:39 UTC (rev 27807)
@@ -707,6 +707,9 @@
 	int findWord(char *word, int *flen);
 	void dictionaryWords(char *);
 
+	static uint8* getWordsData();
+	static uint32 getWordsDataSize();
+
 	// Motion
 private:
 	int checkStep(int delta, int step);

Modified: scummvm/branches/branch-0-10-0/engines/agi/keyboard.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agi/keyboard.cpp	2007-07-01 00:55:46 UTC (rev 27806)
+++ scummvm/branches/branch-0-10-0/engines/agi/keyboard.cpp	2007-07-01 00:57:39 UTC (rev 27807)
@@ -29,6 +29,9 @@
 #include "agi/graphics.h"
 #include "agi/keyboard.h"
 #include "agi/menu.h"
+#ifdef __DS__
+#include "wordcompletion.h"
+#endif
 
 namespace Agi {
 
@@ -308,6 +311,9 @@
 		debugC(3, kDebugLevelInput, "clear lines");
 		clearLines(l, l + 1, bg);
 		flushLines(l, l + 1);
+#ifdef __DS__
+		DS::findWordCompletions((char *) _game.inputBuffer);
+#endif
 
 		break;
 	case KEY_ESCAPE:
@@ -324,6 +330,10 @@
 		_game.inputBuffer[--_game.cursorPos] = 0;
 		/* Print cursor */
 		_gfx->printCharacter(_game.cursorPos + 1, l, _game.cursorChar, fg, bg);
+
+#ifdef __DS__
+		DS::findWordCompletions((char *) _game.inputBuffer);
+#endif
 		break;
 	default:
 		/* Ignore invalid keystrokes */
@@ -337,6 +347,10 @@
 		_game.inputBuffer[_game.cursorPos++] = key;
 		_game.inputBuffer[_game.cursorPos] = 0;
 
+#ifdef __DS__
+		DS::findWordCompletions((char *) _game.inputBuffer);
+#endif
+
 		/* echo */
 		_gfx->printCharacter(_game.cursorPos, l, _game.inputBuffer[_game.cursorPos - 1], fg, bg);
 

Modified: scummvm/branches/branch-0-10-0/engines/agi/words.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agi/words.cpp	2007-07-01 00:55:46 UTC (rev 27806)
+++ scummvm/branches/branch-0-10-0/engines/agi/words.cpp	2007-07-01 00:57:39 UTC (rev 27807)
@@ -45,6 +45,16 @@
 	return tmp;
 }
 
+uint8* AgiEngine::getWordsData() {
+	// Returns a pointer to Agi's words data
+	return words;
+}
+
+uint32 AgiEngine::getWordsDataSize() {
+	// Returns the length in bytes of Agi's words data
+	return wordsFlen;
+}
+
 int AgiEngine::loadWords(const char *fname) {
 	Common::File fp;
 	uint32 flen;
@@ -88,7 +98,7 @@
  * Uses an algorithm hopefully like the one Sierra used. Returns the ID
  * of the word and the length in flen. Returns -1 if not found.
  *
- * Thomas \xC5kesson, November 2001
+ * Thomas �kesson, November 2001
  */
 int AgiEngine::findWord(char *word, int *flen) {
 	int mchr = 0;		/* matched chars */


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