aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2012-10-23 22:20:52 +1100
committerPaul Gilbert2012-10-23 22:20:52 +1100
commit450114802a4a5bbb4f51a0e623e22b3abd498940 (patch)
treecd2e181157bd659c3ff976a31d29677aad581850
parent2bf5306353081ffaeba085e95cada37b8ecdfcb3 (diff)
downloadscummvm-rg350-450114802a4a5bbb4f51a0e623e22b3abd498940.tar.gz
scummvm-rg350-450114802a4a5bbb4f51a0e623e22b3abd498940.tar.bz2
scummvm-rg350-450114802a4a5bbb4f51a0e623e22b3abd498940.zip
HOPKINS: Add workaround to fix issue with text display showing one character too many.
-rw-r--r--engines/hopkins/font.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp
index 7612c9cb04..75354031c4 100644
--- a/engines/hopkins/font.cpp
+++ b/engines/hopkins/font.cpp
@@ -268,6 +268,7 @@ void FontManager::BOITE(int idx, int messageId, const Common::String &filename,
v59 = v59 + 1;
++v63;
} while (v63 < v69);
+
v60 = texte_tmp;
v64 = 0;
if (v69) {
@@ -337,8 +338,16 @@ LABEL_55:
LABEL_57:
v20 = lineCount;
v21 = v11;
- Txt[idx].lines[v20] = Common::String((const char *)v61 + v65, lineSize);
- TRIER_TEXT[lineCount++] = lineSize;
+
+ // WORKAROUND: Perhaps due to the usage of ScummVM strings here, recalculate what the
+ // actual length of the line to be copied will be. Otherwise, you can see artifacts,
+ // such as a single character beyond the end of string NULL.
+ int actualSize = 0;
+ while (actualSize < lineSize && *(v61 + v65 + actualSize))
+ ++actualSize;
+
+ Txt[idx].lines[v20] = Common::String((const char *)v61 + v65, actualSize);
+ TRIER_TEXT[lineCount++] = actualSize;
v65 += lineSize;
v11 = v21;