From 33dc4ae1a6360d419abad8ef1097879edb305c25 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Fri, 26 Mar 2004 18:00:13 +0000 Subject: does this fixes the journal issue for spanish version ? svn-id: r13384 --- queen/logic.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'queen/logic.cpp') 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; -- cgit v1.2.3