[Scummvm-cvs-logs] scummvm master -> 41ba2433f57f064f3119b5b5c1247eadb32d5977

wjp wjp at usecode.org
Fri Jan 6 09:45:35 CET 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
41ba2433f5 AGI: Fix predictive input binary search


Commit: 41ba2433f57f064f3119b5b5c1247eadb32d5977
    https://github.com/scummvm/scummvm/commit/41ba2433f57f064f3119b5b5c1247eadb32d5977
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2012-01-06T00:45:11-08:00

Commit Message:
AGI: Fix predictive input binary search

Note that there are still issues with this input mode. If the binary
search hits a prefix match before finding the full match, it won't
recognize the full match. (Example: typing "buy" will show "buz"
because it's aiming for "buzzard" without realizing "buy" exists.)

Changed paths:
    engines/agi/predictive.cpp



diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp
index 3290068..56d9190 100644
--- a/engines/agi/predictive.cpp
+++ b/engines/agi/predictive.cpp
@@ -570,7 +570,7 @@ bool AgiEngine::matchWord() {
 	int hi = _predictiveDictLineCount - 1;
 	int lo = 0;
 	int line = 0;
-	while (lo < hi) {
+	while (lo <= hi) {
 		line = (lo + hi) / 2;
 		int cmpVal = strncmp(_predictiveDictLine[line], _currentCode.c_str(), _currentCode.size());
 		if (cmpVal > 0)






More information about the Scummvm-git-logs mailing list