[Scummvm-cvs-logs] SF.net SVN: scummvm:[40858] scummvm/trunk/engines/cruise
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Sun May 24 13:37:24 CEST 2009
Revision: 40858
http://scummvm.svn.sourceforge.net/scummvm/?rev=40858&view=rev
Author: dreammaster
Date: 2009-05-24 11:37:24 +0000 (Sun, 24 May 2009)
Log Message:
-----------
Removed the line feed workaround, and added explicit int16 castings to the FROM_LE_16 macros in the font system - this fixes a bug in the engine, allowing it to properly handle all non-printable characters correctly
Modified Paths:
--------------
scummvm/trunk/engines/cruise/font.cpp
scummvm/trunk/engines/cruise/overlay.cpp
Modified: scummvm/trunk/engines/cruise/font.cpp
===================================================================
--- scummvm/trunk/engines/cruise/font.cpp 2009-05-24 10:08:39 UTC (rev 40857)
+++ scummvm/trunk/engines/cruise/font.cpp 2009-05-24 11:37:24 UTC (rev 40858)
@@ -72,7 +72,7 @@
lineLength = rightBorder_X;
localString = tempPtr;
} else if (charData >= 0) {
- lineLength += wordSpacingWidth + FROM_LE_16(fontData[charData].charWidth);
+ lineLength += wordSpacingWidth + (int16)FROM_LE_16(fontData[charData].charWidth);
} else if (ch == ' ') {
lineLength += wordSpacingWidth + 5;
localString = tempPtr;
@@ -258,7 +258,7 @@
} else {
if (charData) {
if (pixelCount + wordSpacingWidth +
- FROM_LE_16(fontData[charData].charWidth) >= inRightBorder_X) {
+ (int16)FROM_LE_16(fontData[charData].charWidth) >= inRightBorder_X) {
finish = 1;
if (temp_pc) {
pixelCount = temp_pc;
@@ -266,7 +266,7 @@
}
} else {
pixelCount += wordSpacingWidth +
- FROM_LE_16(fontData[charData].charWidth);
+ (int16)FROM_LE_16(fontData[charData].charWidth);
}
}
}
@@ -422,22 +422,17 @@
FROM_LE_16(fe.v1),
stringRenderBufferSize,
stringWidth / 2,
- FROM_LE_16(fe.charWidth));
+ (int16)FROM_LE_16(fe.charWidth));
drawPosPixel_X +=
- wordSpacingWidth + FROM_LE_16(fe.charWidth);
+ wordSpacingWidth + (int16)FROM_LE_16(fe.charWidth);
}
}
} else {
stringFinished = 1; // character = 0x00
}
+ } while ((string < ptrStringEnd) && !stringFinished);
- // check if string already reached the end
- if (ptrStringEnd <= string) {
- break;
- }
- } while (!stringFinished);
-
// var_8 = 0;
heightOffset += wordSpacingHeight + lineHeight;
} while (!stringFinished);
Modified: scummvm/trunk/engines/cruise/overlay.cpp
===================================================================
--- scummvm/trunk/engines/cruise/overlay.cpp 2009-05-24 10:08:39 UTC (rev 40857)
+++ scummvm/trunk/engines/cruise/overlay.cpp 2009-05-24 11:37:24 UTC (rev 40858)
@@ -567,16 +567,6 @@
}
s2.read(ovlData->stringTable[i].string, ovlData->stringTable[i].length);
-
- // WORKAROUND: English version, idx 16, num #60 has a line feed character
- // in the middle of a word
- if ((scriptIdx == 16) && (i == 60) && (_vm->getLanguage() == Common::EN_ANY)) {
- char *p = strchr(ovlData->stringTable[i].string, '\xa');
- if (p != NULL) {
- // Delete the line feed character by shifting remainder of message
- while ((*p = *(p + 1)) != '\0') ++p;
- }
- }
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list