diff options
author | Paul Gilbert | 2014-08-17 21:08:58 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-08-17 21:08:58 -0400 |
commit | c576b201f6638fa3702593cdb45cff64057d35ef (patch) | |
tree | c14014a8957eb28f4ddb85efe45e73a242bc6cea /engines | |
parent | be4639802c469c8b85e1f801a7cac1897a18863b (diff) | |
download | scummvm-rg350-c576b201f6638fa3702593cdb45cff64057d35ef.tar.gz scummvm-rg350-c576b201f6638fa3702593cdb45cff64057d35ef.tar.bz2 scummvm-rg350-c576b201f6638fa3702593cdb45cff64057d35ef.zip |
ACCESS: Fix decoding of font data
Diffstat (limited to 'engines')
-rw-r--r-- | engines/access/amazon/amazon_game.cpp | 2 | ||||
-rw-r--r-- | engines/access/data.cpp | 12 | ||||
-rw-r--r-- | engines/access/data.h | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp index 072675c55e..663d6996d2 100644 --- a/engines/access/amazon/amazon_game.cpp +++ b/engines/access/amazon/amazon_game.cpp @@ -173,8 +173,8 @@ void AmazonEngine::setupGame() { } // Miscellaenous - _fonts._font6x6.load(FONT6x6_INDEX, FONT6x6_DATA); _fonts._font2.load(FONT2_INDEX, FONT2_DATA); + _fonts._font6x6.load(FONT6x6_INDEX, FONT6x6_DATA); // Set player room and position _player->_roomNumber = 4; diff --git a/engines/access/data.cpp b/engines/access/data.cpp index 1fba854f19..36797b62ea 100644 --- a/engines/access/data.cpp +++ b/engines/access/data.cpp @@ -56,16 +56,16 @@ Font::~Font() { _chars[i].free(); } -void Font::load(const int *index, const byte *data) { +void Font::load(const int *fontIndex, const byte *fontData) { assert(_chars.size() == 0); - int count = index[0]; - _bitWidth = index[1]; - _height = index[2]; + int count = fontIndex[0]; + _bitWidth = fontIndex[1]; + _height = fontIndex[2]; _chars.resize(count); for (int i = 0; i < count; ++i) { - const byte *pData = data + index[i + 3]; + const byte *pData = fontData + fontIndex[i + 3]; _chars[i].create(*pData++, _height, Graphics::PixelFormat::createFormatCLUT8()); for (int y = 0; y < _height; ++y) { @@ -77,7 +77,7 @@ void Font::load(const int *index, const byte *data) { for (int x = 0; x < _chars[i].w; ++x, ++pDest) { // Get the pixel pixel = 0; - for (int pixelCtr = 0; pixelCtr < _bitWidth; ++pixelCtr) { + for (int pixelCtr = 0; pixelCtr < _bitWidth; ++pixelCtr, --bitsLeft) { // No bits in current byte left, so get next byte if (bitsLeft == 0) { bitsLeft = 8; diff --git a/engines/access/data.h b/engines/access/data.h index fd3c889ddb..7ddc5d610e 100644 --- a/engines/access/data.h +++ b/engines/access/data.h @@ -100,7 +100,7 @@ public: /** * Load the given font data */ - void load(const int *index, const byte *data); + void load(const int *fontIndex, const byte *fontData); /** * Get the width of a given character |