aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-04-10 06:18:39 +0000
committerTorbjörn Andersson2006-04-10 06:18:39 +0000
commit3bc5d5b5856167f44c1b54bdad235a5ad1b3d1b7 (patch)
tree81f086086354385b408c9479cfef2dc31e941d84 /engines
parent9c15dc06eb1470922a8037b9ead7c7d16f20693f (diff)
downloadscummvm-rg350-3bc5d5b5856167f44c1b54bdad235a5ad1b3d1b7.tar.gz
scummvm-rg350-3bc5d5b5856167f44c1b54bdad235a5ad1b3d1b7.tar.bz2
scummvm-rg350-3bc5d5b5856167f44c1b54bdad235a5ad1b3d1b7.zip
Slight change to make it easier to change the FF and Simon word-wrapping rules
individually. Changed the FF rule so that it doesn't matter whether or not the variables are signed or unsigned. This fixes missing line breaks in some of the Oracle articles. svn-id: r21742
Diffstat (limited to 'engines')
-rw-r--r--engines/simon/charset.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/engines/simon/charset.cpp b/engines/simon/charset.cpp
index cdc7753151..8e8e431dc6 100644
--- a/engines/simon/charset.cpp
+++ b/engines/simon/charset.cpp
@@ -317,8 +317,19 @@ void SimonEngine::showmessage_print_char(byte chr) {
print_char_helper_1(&chr, 1);
print_char_helper_5(_textWindow);
} else if (chr == 0 || chr == ' ' || chr == 10) {
- uint count = (getGameType() == GType_FF) ? _printCharPixelCount + 1 : _printCharPixelCount;
- if (_printCharMaxPos - _printCharCurPos >= count) {
+ bool fit;
+
+ // Note that in FF, _printCharCurPos may be greater than
+ // _printCharMaxPos. In Simon, that is probably prevented by
+ // testing if _printCharCurPos == _printCharMaxPos below.
+
+ if (getGameType() == GType_FF) {
+ fit = _printCharMaxPos > _printCharCurPos + _printCharPixelCount;
+ } else {
+ fit = _printCharMaxPos - _printCharCurPos >= _printCharPixelCount;
+ }
+
+ if (fit) {
_printCharCurPos += _printCharPixelCount;
print_char_helper_1(_lettersToPrintBuf, _numLettersToPrint);