SCI: Fix SCI32 Mac fonts

svn-id: r55725
This commit is contained in:
Matthew Hoops 2011-02-02 16:22:58 +00:00
parent f1f86646de
commit d3e30f3038
3 changed files with 14 additions and 3 deletions

View File

@ -45,12 +45,12 @@ GfxFontFromResource::GfxFontFromResource(ResourceManager *resMan, GfxScreen *scr
}
_resourceData = _resource->data;
_numChars = READ_LE_UINT16(_resourceData + 2);
_fontHeight = READ_LE_UINT16(_resourceData + 4);
_numChars = READ_SCI32ENDIAN_UINT16(_resourceData + 2);
_fontHeight = READ_SCI32ENDIAN_UINT16(_resourceData + 4);
_chars = new Charinfo[_numChars];
// filling info for every char
for (int16 i = 0; i < _numChars; i++) {
_chars[i].offset = READ_LE_UINT16(_resourceData + 6 + i * 2);
_chars[i].offset = READ_SCI32ENDIAN_UINT16(_resourceData + 6 + i * 2);
_chars[i].w = _resourceData[_chars[i].offset];
_chars[i].h = _resourceData[_chars[i].offset + 1];
}

View File

@ -37,6 +37,13 @@ uint16 READ_SCI11ENDIAN_UINT16(const void *ptr) {
return READ_LE_UINT16(ptr);
}
uint16 READ_SCI32ENDIAN_UINT16(const void *ptr) {
if (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_2_1)
return READ_BE_UINT16(ptr);
return READ_LE_UINT16(ptr);
}
uint32 READ_SCI11ENDIAN_UINT32(const void *ptr) {
if (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_1_1)
return READ_BE_UINT32(ptr);

View File

@ -36,6 +36,10 @@ uint16 READ_SCI11ENDIAN_UINT16(const void *ptr);
uint32 READ_SCI11ENDIAN_UINT32(const void *ptr);
void WRITE_SCI11ENDIAN_UINT16(void *ptr, uint16 val);
// Wrappers for reading integer values in resources that are
// LE in SCI1.1 Mac, but BE in SCI32 Mac
uint16 READ_SCI32ENDIAN_UINT16(const void *ptr);
} // End of namespace Sci
#endif