aboutsummaryrefslogtreecommitdiff
path: root/sword1/text.cpp
diff options
context:
space:
mode:
authorRobert Göffringmann2003-12-18 12:45:40 +0000
committerRobert Göffringmann2003-12-18 12:45:40 +0000
commit65583e28da225d6fc0e52f5525c0c81fa9e1117a (patch)
tree2778964477e3052a670db17751ff3673302f66fb /sword1/text.cpp
parent312abd748668ffca8122799993af438394df4826 (diff)
downloadscummvm-rg350-65583e28da225d6fc0e52f5525c0c81fa9e1117a.tar.gz
scummvm-rg350-65583e28da225d6fc0e52f5525c0c81fa9e1117a.tar.bz2
scummvm-rg350-65583e28da225d6fc0e52f5525c0c81fa9e1117a.zip
SwordText big endian fixes
svn-id: r11744
Diffstat (limited to 'sword1/text.cpp')
-rw-r--r--sword1/text.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/sword1/text.cpp b/sword1/text.cpp
index da920c298e..c0488d0464 100644
--- a/sword1/text.cpp
+++ b/sword1/text.cpp
@@ -44,8 +44,8 @@ SwordText::SwordText(ObjectMan *pObjMan, ResMan *pResMan, bool czechVersion) {
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 @@ void SwordText::makeTextSprite(uint8 slot, uint8 *text, uint16 maxWidth, uint8 p
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 @@ void SwordText::makeTextSprite(uint8 slot, uint8 *text, uint16 maxWidth, uint8 p
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 @@ uint16 SwordText::copyChar(uint8 ch, uint8 *sprPtr, uint16 sprWidth, uint8 pen)
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)