[Scummvm-cvs-logs] CVS: scummvm/queen logic.cpp,1.196,1.197

Gregory Montoir cyx at users.sourceforge.net
Fri Mar 26 10:12:02 CET 2004


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19000/queen

Modified Files:
	logic.cpp 
Log Message:
does this fixes the journal issue for spanish version ?

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -d -r1.196 -r1.197
--- logic.cpp	23 Mar 2004 20:34:19 -0000	1.196
+++ logic.cpp	26 Mar 2004 18:00:13 -0000	1.197
@@ -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 @@
 	_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;





More information about the Scummvm-git-logs mailing list