aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNeil Millstone2007-07-16 22:55:44 +0000
committerNeil Millstone2007-07-16 22:55:44 +0000
commit91426f82c6f4e3edc8217e8c5122847f583095fa (patch)
tree60730f68667c9a49fd4c42c3dc92d873e82b30df /engines
parent1b5f06dce59c39458c12bfadd91286a00449c84d (diff)
downloadscummvm-rg350-91426f82c6f4e3edc8217e8c5122847f583095fa.tar.gz
scummvm-rg350-91426f82c6f4e3edc8217e8c5122847f583095fa.tar.bz2
scummvm-rg350-91426f82c6f4e3edc8217e8c5122847f583095fa.zip
Porting DS word completion keyboard changes from branch0-10-0.
svn-id: r28125
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/agi.cpp6
-rw-r--r--engines/agi/predictive.cpp13
2 files changed, 19 insertions, 0 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index a5aa7854ca..1c1c53dee7 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -448,6 +448,12 @@ int AgiEngine::agiInit() {
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;
}
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp
index 2db4b49396..eef4360cbf 100644
--- a/engines/agi/predictive.cpp
+++ b/engines/agi/predictive.cpp
@@ -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 @@ void AgiEngine::loadDict(void) {
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 @@ void AgiEngine::loadDict(void) {
_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);
}