[Scummvm-git-logs] scummvm master -> bc19f81d5621ecff138fc1584276e415142e3e5f
orgads
orgads at gmail.com
Mon Apr 5 19:04:19 UTC 2021
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:
bc19f81d56 GRIM: use unicode-bidi for hebrew (#2917)
Commit: bc19f81d5621ecff138fc1584276e415142e3e5f
https://github.com/scummvm/scummvm/commit/bc19f81d5621ecff138fc1584276e415142e3e5f
Author: Niv Baehr (bloop93 at gmail.com)
Date: 2021-04-05T22:04:16+03:00
Commit Message:
GRIM: use unicode-bidi for hebrew (#2917)
Co-authored-by: BLooperZ <blooperz at users.noreply.github.com>
Changed paths:
engines/grim/textobject.cpp
diff --git a/engines/grim/textobject.cpp b/engines/grim/textobject.cpp
index eb12615187..a29807365e 100644
--- a/engines/grim/textobject.cpp
+++ b/engines/grim/textobject.cpp
@@ -20,6 +20,7 @@
*
*/
+#include "common/unicode-bidi.h"
#include "engines/grim/debug.h"
#include "engines/grim/grim.h"
#include "engines/grim/textobject.h"
@@ -278,16 +279,11 @@ void TextObject::setupText() {
nextLinePos = message.size();
cutLen = nextLinePos;
}
- Common::String currentLine;
+ Common::String currentLine(message.c_str(), message.c_str() + nextLinePos);
- const char *start = message.c_str();
// Reverse the line for the Hebrew translation
- if (g_grim->getGameLanguage() == Common::HE_ISR) {
- for (const char *ch = start + nextLinePos - 1; ch > start; --ch)
- currentLine += *ch;
- } else {
- currentLine = Common::String(start, start + nextLinePos);
- }
+ if (g_grim->getGameLanguage() == Common::HE_ISR)
+ currentLine = Common::convertBiDiString(currentLine, Common::kWindows1255);
_lines[j] = currentLine;
int width = _font->getKernedStringLength(currentLine);
More information about the Scummvm-git-logs
mailing list