diff options
-rw-r--r-- | engines/tucker/graphics.cpp | 32 | ||||
-rw-r--r-- | engines/tucker/graphics.h | 10 | ||||
-rw-r--r-- | engines/tucker/resource.cpp | 8 | ||||
-rw-r--r-- | engines/tucker/tucker.cpp | 6 |
4 files changed, 27 insertions, 29 deletions
diff --git a/engines/tucker/graphics.cpp b/engines/tucker/graphics.cpp index 5e3d989110..b9c184e2bb 100644 --- a/engines/tucker/graphics.cpp +++ b/engines/tucker/graphics.cpp @@ -163,13 +163,13 @@ void Graphics::copyRect(uint8 *dst, int dstPitch, uint8 *src, int srcPitch, int } void Graphics::drawStringChar(uint8 *dst, int xDst, int yDst, int pitch, uint8 chr, uint8 chrColor, const uint8 *src) { - if (chr < 32 || chr - 32 >= _charset.xCount * _charset.yCount) { + if (chr < 32 || chr - 32 >= _charset._xCount * _charset._yCount) { return; } - const int h = MIN(_charset.charH, 200 - yDst); - const int w = MIN(_charset.charW, pitch - xDst); + const int h = MIN(_charset._charH, 200 - yDst); + const int w = MIN(_charset._charW, pitch - xDst); dst += yDst * pitch + xDst; - int offset = (chr - 32) * _charset.charH * _charset.charW; + int offset = (chr - 32) * _charset._charH * _charset._charW; for (int y = 0; y < h; ++y) { for (int x = 0; x < w; ++x) { const int color = src[offset++]; @@ -189,22 +189,22 @@ void Graphics::setCharset(CharsetType type) { _charsetType = type; switch (type) { case kCharsetTypeDefault: - _charset.charW = 10; - _charset.charH = 10; - _charset.xCount = 32; - _charset.yCount = 7; + _charset._charW = 10; + _charset._charH = 10; + _charset._xCount = 32; + _charset._yCount = 7; break; case kCharsetTypeEng: - _charset.charW = 10; - _charset.charH = 8; - _charset.xCount = 32; - _charset.yCount = 3; + _charset._charW = 10; + _charset._charH = 8; + _charset._xCount = 32; + _charset._yCount = 3; break; case kCharsetTypeCredits: - _charset.charW = 19; - _charset.charH = 10; - _charset.xCount = 16; - _charset.yCount = 7; + _charset._charW = 19; + _charset._charH = 10; + _charset._xCount = 16; + _charset._yCount = 7; break; } } diff --git a/engines/tucker/graphics.h b/engines/tucker/graphics.h index 3e2745186c..3e48179a30 100644 --- a/engines/tucker/graphics.h +++ b/engines/tucker/graphics.h @@ -34,16 +34,14 @@ enum CharsetType { }; struct Charset { - int charW; - int charH; - int xCount; - int yCount; + int _charW; + int _charH; + int _xCount; + int _yCount; }; class Graphics { public: - - static int encodeRLE(const uint8 *src, uint8 *dst, int w, int h); static int encodeRAW(const uint8 *src, uint8 *dst, int w, int h); diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index b031152444..dfb5c9ba21 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -351,11 +351,11 @@ void TuckerEngine::loadCharset2() { } void TuckerEngine::loadCharsetHelper() { - const int charW = Graphics::_charset.charW; - const int charH = Graphics::_charset.charH; + const int charW = Graphics::_charset._charW; + const int charH = Graphics::_charset._charH; int offset = 0; - for (int y = 0; y < Graphics::_charset.yCount; ++y) { - for (int x = 0; x < Graphics::_charset.xCount; ++x) { + for (int y = 0; y < Graphics::_charset._yCount; ++y) { + for (int x = 0; x < Graphics::_charset._xCount; ++x) { offset += Graphics::encodeRAW(_loadTempBuf + (y * 320) * charH + x * charW, _charsetGfxBuf + offset, charW, charH); } } diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index 0fae8aa8cd..1d38d0f806 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -2849,7 +2849,7 @@ void TuckerEngine::drawStringInteger(int num, int x, int y, int digits) { Graphics::drawStringChar(_locationBackgroundGfxBuf, _scrollOffset + x, y, 640, numStr[i], 102, _charsetGfxBuf); x += 8; } - addDirtyRect(_scrollOffset + x, y, Graphics::_charset.charW * 3, Graphics::_charset.charH); + addDirtyRect(_scrollOffset + x, y, Graphics::_charset._charW * 3, Graphics::_charset._charH); } void TuckerEngine::drawStringAlt(int x, int y, int color, const uint8 *str, int strLen) { @@ -2861,7 +2861,7 @@ void TuckerEngine::drawStringAlt(int x, int y, int color, const uint8 *str, int x += _charWidthTable[chr]; ++pos; } - addDirtyRect(xStart, y, x - xStart, Graphics::_charset.charH); + addDirtyRect(xStart, y, x - xStart, Graphics::_charset._charH); } void TuckerEngine::drawItemString(int x, int num, const uint8 *str) { @@ -3824,7 +3824,7 @@ void TuckerEngine::drawSpeechTextLine(const uint8 *dataPtr, int pos, int count, x += _charWidthTable[dataPtr[pos]]; ++pos; } - addDirtyRect(xStart, y, x - xStart, Graphics::_charset.charH); + addDirtyRect(xStart, y, x - xStart, Graphics::_charset._charH); } void TuckerEngine::redrawScreen(int offset) { |