[Scummvm-cvs-logs] CVS: residual textobject.cpp,1.30,1.31
Pawel Kolodziejski
aquadran at users.sourceforge.net
Sun Aug 21 07:00:09 CEST 2005
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv445
Modified Files:
textobject.cpp
Log Message:
cleanup, remove char of id 13 from string
Index: textobject.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/textobject.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- textobject.cpp 10 Aug 2005 08:33:45 -0000 1.30
+++ textobject.cpp 21 Aug 2005 13:59:38 -0000 1.31
@@ -110,7 +110,11 @@
// remove spaces (NULL_TEXT) from the end of the string,
// while this helps make the string unique it screws up
// text justification
- for(int i = (int) msg.length() - 1; c[i] == TEXT_NULL; i--)
+ for (int i = (int)msg.length() - 1; c[i] == TEXT_NULL; i--)
+ msg.erase(msg.length() - 1, msg.length());
+
+ // remove char of id 13 from the end of the string,
+ for (int i = (int)msg.length() - 1; c[i] == 13; i--)
msg.erase(msg.length() - 1, msg.length());
// format the output message to incorporate line wrapping
@@ -120,7 +124,7 @@
for (int i = 0; msg[i] != '\0'; ++i) {
lineWidth += _font->getCharLogicalWidth(msg[i]);
if ((_width != 0 && lineWidth > (_width - _x))
- || (_justify == CENTER && (_x - lineWidth/2 < 0 || _x + lineWidth/2 > 640))
+ || (_justify == CENTER && (_x - lineWidth / 2 < 0 || _x + lineWidth / 2 > 640))
|| (_justify == LJUSTIFY && (_x + lineWidth > 640))
|| (_justify == RJUSTIFY && (_x - lineWidth < 0))) {
lineWidth = 0;
More information about the Scummvm-git-logs
mailing list