aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--queen/logic.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/queen/logic.cpp b/queen/logic.cpp
index 5e8eeb0be7..ff5dd7a875 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -43,6 +43,17 @@
namespace Queen {
+static char *trim(char *str) {
+ char *p = str + strlen(str) - 1;
+ while (p != str && *p == ' ') {
+ *p-- = '\0';
+ }
+ while (str != p && *str == ' ') {
+ ++str;
+ }
+ return str;
+}
+
Logic::Logic(QueenEngine *vm)
: _queen2jas(NULL), _credits(NULL), _vm(vm) {
_joe.x = _joe.y = 0;
@@ -204,6 +215,15 @@ void Logic::initialise() {
_joeResponse[0] = 0;
for (i = 1; i <= JOE_RESPONSE_MAX; i++)
_joeResponse[i] = _queen2jas->nextLine();
+
+ // FIXME - the spanish version adds some space characters (0x20) at the
+ // beginning and the end of the journal button captions. As we don't need
+ // that 'trick' to center horizontally the texts, we simply trim them.
+ if (_vm->resource()->getLanguage() == SPANISH) {
+ for (i = 30; i <= 35; i++) {
+ _joeResponse[i] = trim(_joeResponse[i]);
+ }
+ }
_aAnim = new char*[_numAAnim + 1];
_aAnim[0] = 0;