aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2005-11-01 11:27:41 +0000
committerTravis Howell2005-11-01 11:27:41 +0000
commitbe1cf8c0e4865ca54c145a1ab7671a17e7e84d20 (patch)
tree7e8a3e96e01aed5774f11286f802c553e6627a29 /scumm
parent9b1c0e3326efa80f1935bcacc059dd6783dd99f0 (diff)
downloadscummvm-rg350-be1cf8c0e4865ca54c145a1ab7671a17e7e84d20.tar.gz
scummvm-rg350-be1cf8c0e4865ca54c145a1ab7671a17e7e84d20.tar.bz2
scummvm-rg350-be1cf8c0e4865ca54c145a1ab7671a17e7e84d20.zip
Wrap sentance lines in NES maniac.
svn-id: r19382
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v2.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index d66b454fb7..a298a21603 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -1053,21 +1053,29 @@ void ScummEngine_v2::o2_drawSentence() {
else
_string[2].color = 13;
+ byte string[80];
char *ptr = sentence;
- int n = 0;
+ int i = 0, len = 0;
- // Maximum length: 40 printable characters
+ // Maximum length of printable characters
+ int maxChars = (_platform == Common::kPlatformNES) ? 60: 40;
while (*ptr) {
if (*ptr != '@')
- n++;
- if (n > 40) {
- *ptr = 0;
+ len++;
+ if (len > maxChars) {
break;
}
- ptr++;
+
+ string[i++] = *ptr++;
+
+ if (_platform == Common::kPlatformNES && len == 30) {
+ string[i++] = 0xFF;
+ string[i++] = 8;
+ }
}
+ string[i] = 0;
- if (_platform == Common::kPlatformNES) { // TODO - get multiline sentences working
+ if (_platform == Common::kPlatformNES) {
sentenceline.top = virtscr[kVerbVirtScreen].topline;
sentenceline.bottom = virtscr[kVerbVirtScreen].topline + 16;
sentenceline.left = 16;
@@ -1080,7 +1088,7 @@ void ScummEngine_v2::o2_drawSentence() {
}
restoreBG(sentenceline);
- drawString(2, (byte*)sentence);
+ drawString(2, (byte*)string);
}
void ScummEngine_v2::o2_ifClassOfIs() {