aboutsummaryrefslogtreecommitdiff
path: root/queen/graphics.cpp
diff options
context:
space:
mode:
authorJoost Peters2004-02-13 22:33:21 +0000
committerJoost Peters2004-02-13 22:33:21 +0000
commitbf0d58fe8942bfc4fd38b751c922e88af5e3124d (patch)
tree339b2cdadc23e61d14a1a4e837148f1116465509 /queen/graphics.cpp
parenta4df55fbc1e474f9dad0ff3fa3fb8f89123a8d51 (diff)
downloadscummvm-rg350-bf0d58fe8942bfc4fd38b751c922e88af5e3124d.tar.gz
scummvm-rg350-bf0d58fe8942bfc4fd38b751c922e88af5e3124d.tar.bz2
scummvm-rg350-bf0d58fe8942bfc4fd38b751c922e88af5e3124d.zip
Applied patch #896726 (reversed hebrew text) and reduced overhead a little by introducing an _isReversed boolean
svn-id: r12860
Diffstat (limited to 'queen/graphics.cpp')
-rw-r--r--queen/graphics.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/queen/graphics.cpp b/queen/graphics.cpp
index aac0872abd..b12cdd2280 100644
--- a/queen/graphics.cpp
+++ b/queen/graphics.cpp
@@ -432,25 +432,35 @@ void Graphics::setBobText(
char lines[8][MAX_STRING_SIZE];
int lineCount = 0;
- int wordCount = 0;
int lineLength = 0;
int i;
- for (i = 0; i < length; i++) {
- if (textCopy[i] == ' ')
- wordCount++;
-
- lineLength++;
-
- if ((lineLength > 20 && textCopy[i] == ' ') || i == (length-1)) {
- memcpy(lines[lineCount], textCopy + i + 1 - lineLength, lineLength);
- lines[lineCount][lineLength] = '\0';
- lineCount++;
- lineLength = 0;
+ // Hebrew strings are written from right to left and should be cut
+ // to lines in reverse
+ if (_vm->resource()->getLanguage() == HEBREW) {
+ for (i = length - 1; i >= 0; i--) {
+ lineLength++;
+
+ if ((lineLength > 20 && textCopy[i] == ' ') || i == 0) {
+ memcpy(lines[lineCount], textCopy + i, lineLength);
+ lines[lineCount][lineLength] = '\0';
+ lineCount++;
+ lineLength = 0;
+ }
+ }
+ } else {
+ for (i = 0; i < length; i++) {
+ lineLength++;
+
+ if ((lineLength > 20 && textCopy[i] == ' ') || i == (length-1)) {
+ memcpy(lines[lineCount], textCopy + i + 1 - lineLength, lineLength);
+ lines[lineCount][lineLength] = '\0';
+ lineCount++;
+ lineLength = 0;
+ }
}
}
-
// Plan: write each line to Screen 2, put black outline around lines and
// pick them up as a BOB.