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

agent-q at users.sourceforge.net agent-q at users.sourceforge.net
Sun Jul 15 16:27:45 CEST 2007


Revision: 28102
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28102&view=rev
Author:   agent-q
Date:     2007-07-15 07:27:45 -0700 (Sun, 15 Jul 2007)

Log Message:
-----------
Changing DS completion keyboard to use the predictive text dictionary

Modified Paths:
--------------
    scummvm/branches/branch-0-10-0/engines/agi/agi.cpp
    scummvm/branches/branch-0-10-0/engines/agi/predictive.cpp

Modified: scummvm/branches/branch-0-10-0/engines/agi/agi.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agi/agi.cpp	2007-07-15 14:26:42 UTC (rev 28101)
+++ scummvm/branches/branch-0-10-0/engines/agi/agi.cpp	2007-07-15 14:27:45 UTC (rev 28102)
@@ -443,6 +443,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/branches/branch-0-10-0/engines/agi/predictive.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agi/predictive.cpp	2007-07-15 14:26:42 UTC (rev 28101)
+++ scummvm/branches/branch-0-10-0/engines/agi/predictive.cpp	2007-07-15 14:27:45 UTC (rev 28102)
@@ -30,6 +30,10 @@
 #include "common/func.h"
 #include "common/config-manager.h"
 
+#ifdef __DS__
+#include "wordcompletion.h"
+#endif
+
 namespace Agi {
 
 #define kModePre 0
@@ -517,6 +521,9 @@
 	while ( (ptr = (char *) strchr(ptr, '\n')) != (char *) NULL ) {
 		*ptr = 0;
 		ptr++;
+#ifdef __DS__
+		DS::addAutoCompleteLine(_predictiveDictLine[i - 1]);
+#endif
 		_predictiveDictLine[i++] = ptr;
 	}
 	if (_predictiveDictLine[lines - 1][0] == 0)
@@ -525,6 +532,10 @@
 	_predictiveDictLines = lines;
 	debug("Loaded %d lines", _predictiveDictLines);
 
+#ifdef __DS__
+	DS::sortAutoCompleteWordList();
+#endif
+
 	uint32 time3 = _system->getMillis();
 	printf("Time to parse pred.dic: %d, total: %d\n", time3-time2, time3-time1);
 }
@@ -583,5 +594,5 @@
 		return false;
 	}
 }
-
+	
 } // End of namespace Agi


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