[Scummvm-cvs-logs] CVS: scummvm/sword1 logic.cpp,1.11,1.12 text.cpp,1.2,1.3
Robert G?ffringmann
lavosspawn at users.sourceforge.net
Thu Dec 18 04:46:01 CET 2003
Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1:/tmp/cvs-serv698/sword1
Modified Files:
logic.cpp text.cpp
Log Message:
SwordText big endian fixes
Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/logic.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- logic.cpp 18 Dec 2003 00:31:37 -0000 1.11
+++ logic.cpp 18 Dec 2003 12:45:40 -0000 1.12
@@ -1081,8 +1081,8 @@
textCpt->o_target = textCptId;
// the graphic is a property of SwordText, so we don't lock/unlock it.
- uint16 textSpriteWidth = _textMan->giveSpriteData(textCpt->o_target)->width;
- uint16 textSpriteHeight = _textMan->giveSpriteData(textCpt->o_target)->height;
+ uint16 textSpriteWidth = FROM_LE_16(_textMan->giveSpriteData(textCpt->o_target)->width);
+ uint16 textSpriteHeight = FROM_LE_16(_textMan->giveSpriteData(textCpt->o_target)->height);
cpt->o_text_id = textCptId;
Index: text.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/text.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- text.cpp 17 Dec 2003 01:47:47 -0000 1.2
+++ text.cpp 18 Dec 2003 12:45:40 -0000 1.3
@@ -44,8 +44,8 @@
else
_font = (uint8*)_resMan->openFetchRes(GAME_FONT);
_joinWidth = charWidth( SPACE ) - 2 * OVERLAP;
- _charHeight = _resMan->fetchFrame(_font, 0)->height; // all chars have the same height
- _textBlocks[0] = _textBlocks[1] = 0;
+ _charHeight = FROM_LE_16(_resMan->fetchFrame(_font, 0)->height); // all chars have the same height
+ _textBlocks[0] = _textBlocks[1] = NULL;
}
uint32 SwordText::lowTextManager(uint8 *ascii, int32 width, uint8 pen) {
@@ -79,8 +79,8 @@
memcpy( _textBlocks[slot]->runTimeComp, "Nu ", 4);
_textBlocks[slot]->compSize = 0;
- _textBlocks[slot]->width = sprWidth;
- _textBlocks[slot]->height = sprHeight;
+ _textBlocks[slot]->width = TO_LE_16(sprWidth);
+ _textBlocks[slot]->height = TO_LE_16(sprHeight);
_textBlocks[slot]->offsetX = 0;
_textBlocks[slot]->offsetY = 0;
@@ -98,7 +98,7 @@
uint16 SwordText::charWidth(uint8 ch) {
if (ch < SPACE)
ch = 64;
- return _resMan->fetchFrame(_font, ch - SPACE)->width;
+ return FROM_LE_16(_resMan->fetchFrame(_font, ch - SPACE)->width);
}
uint16 SwordText::analyzeSentence(uint8 *text, uint16 maxWidth, LineInfo *line) {
@@ -145,8 +145,8 @@
FrameHeader *chFrame = _resMan->fetchFrame(_font, ch - SPACE);
uint8 *chData = ((uint8*)chFrame) + sizeof(FrameHeader);
uint8 *dest = sprPtr;
- for (uint16 cnty = 0; cnty < chFrame->height; cnty++) {
- for (uint16 cntx = 0; cntx < chFrame->width; cntx++) {
+ for (uint16 cnty = 0; cnty < FROM_LE_16(chFrame->height); cnty++) {
+ for (uint16 cntx = 0; cntx < FROM_LE_16(chFrame->width); cntx++) {
if (*chData == LETTER_COL)
dest[cntx] = pen;
else if ((*chData == BORDER_COL) && (!dest[cntx])) // don't do a border if there's already a color underneath (chars can overlap)
More information about the Scummvm-git-logs
mailing list