[Scummvm-cvs-logs] SF.net SVN: scummvm: [28125] scummvm/trunk/engines/agi

agent-q at users.sourceforge.net agent-q at users.sourceforge.net
Tue Jul 17 00:55:44 CEST 2007


Revision: 28125
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28125&view=rev
Author:   agent-q
Date:     2007-07-16 15:55:44 -0700 (Mon, 16 Jul 2007)

Log Message:
-----------
Porting DS word completion keyboard changes from branch0-10-0.

Modified Paths:
--------------
    scummvm/trunk/engines/agi/agi.cpp
    scummvm/trunk/engines/agi/predictive.cpp

Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp	2007-07-16 22:46:49 UTC (rev 28124)
+++ scummvm/trunk/engines/agi/agi.cpp	2007-07-16 22:55:44 UTC (rev 28125)
@@ -448,6 +448,12 @@
 		loadGame(saveNameBuffer, false); // Do not check game id
 	}
 
+#ifdef __DS__
+	// Normally, the engine loads the predictive text dictionary when the predictive dialog
+	// is shown.  On the DS version, the word completion feature needs the dictionary too.
+	loadDict();
+#endif
+
 	return ec;
 }
 

Modified: scummvm/trunk/engines/agi/predictive.cpp
===================================================================
--- scummvm/trunk/engines/agi/predictive.cpp	2007-07-16 22:46:49 UTC (rev 28124)
+++ scummvm/trunk/engines/agi/predictive.cpp	2007-07-16 22:55:44 UTC (rev 28125)
@@ -30,6 +30,10 @@
 #include "common/func.h"
 #include "common/config-manager.h"
 
+#ifdef __DS__
+#include "wordcompletion.h"
+#endif
+
 namespace Agi {
 
 #define kModePre 0
@@ -521,6 +525,10 @@
 	while ((ptr = strchr(ptr, '\n'))) {
 		*ptr = 0;
 		ptr++;
+#ifdef __DS__
+		// Pass the line on to the DS word list
+		DS::addAutoCompleteLine(_predictiveDictLine[i - 1]);
+#endif
 		_predictiveDictLine[i++] = ptr;
 	}
 	if (_predictiveDictLine[lines - 1][0] == 0)
@@ -529,6 +537,11 @@
 	_predictiveDictLineCount = lines;
 	debug("Loaded %d lines", _predictiveDictLineCount);
 
+#ifdef __DS__
+	// Sort the DS word completion list, to allow for a binary chop later (in the ds backend)
+	DS::sortAutoCompleteWordList();
+#endif
+
 	uint32 time3 = _system->getMillis();
 	printf("Time to parse pred.dic: %d, total: %d\n", time3-time2, time3-time1);
 }


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