subtitles: some fixes

svn-id: r4558
This commit is contained in:
Paweł Kołodziejski 2002-07-15 21:56:30 +00:00
parent 438bb248e0
commit eb3318e291

View file

@ -170,12 +170,11 @@ uint32 SmushPlayer::getFontHeight(uint8 c_font)
offset += 8; offset += 8;
if (READ_BE_UINT32(font + offset) == 'FOBJ') { if (READ_BE_UINT32(font + offset) == 'FOBJ') {
t_offset = offset + 8; t_offset = offset + 8;
offset += READ_BE_UINT32(font + offset + 4) + 8;
} }
else else
return 0; return 0;
} }
return *(uint16*)(font + t_offset + 8); return READ_LE_UINT16(font + t_offset + 8);
} }
uint32 SmushPlayer::getCharWidth(uint8 c_font, byte txt) uint32 SmushPlayer::getCharWidth(uint8 c_font, byte txt)
@ -203,7 +202,7 @@ uint32 SmushPlayer::getCharWidth(uint8 c_font, byte txt)
else else
return 0; return 0;
} }
return *(uint16*)(font + t_offset + 6); return READ_LE_UINT16(font + t_offset + 6);
} }
void SmushPlayer::drawStringTRES(uint32 x, uint32 y, byte * txt) void SmushPlayer::drawStringTRES(uint32 x, uint32 y, byte * txt)
@ -254,7 +253,6 @@ void SmushPlayer::drawStringTRES(uint32 x, uint32 y, byte * txt)
else else
{ {
y = 0; y = 0;
printf ("out of screen y\n");
} }
continue; continue;
} }
@ -282,7 +280,6 @@ void SmushPlayer::drawStringTRES(uint32 x, uint32 y, byte * txt)
} }
else { else {
y = 0; y = 0;
printf ("out of screen y\n");
} }
} }
} }