diff options
author | Nipun Garg | 2019-07-13 03:52:04 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:18 +0200 |
commit | 190b550caaa8b5070e9fdda78555b30e1a340af3 (patch) | |
tree | cd07b8936ea6cbfb133faaa737b7083379cc72a0 /engines/hdb/gfx.cpp | |
parent | 0bd8e53f88ef40318a90a0c8568d88762ee841a4 (diff) | |
download | scummvm-rg350-190b550caaa8b5070e9fdda78555b30e1a340af3.tar.gz scummvm-rg350-190b550caaa8b5070e9fdda78555b30e1a340af3.tar.bz2 scummvm-rg350-190b550caaa8b5070e9fdda78555b30e1a340af3.zip |
HDB: Replace original color functions
With the ones from Graphics::PixelFormat
Diffstat (limited to 'engines/hdb/gfx.cpp')
-rw-r--r-- | engines/hdb/gfx.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp index 4b2f7b6e21..1000d97694 100644 --- a/engines/hdb/gfx.cpp +++ b/engines/hdb/gfx.cpp @@ -243,7 +243,7 @@ void Gfx::setFade(bool fadeIn, bool black, int steps) { } void Gfx::updateFade() { - uint r, g, b; + uint8 r, g, b; static int waitAFrame = 0; if (!_fadeInfo.active && !_fadeInfo.stayFaded) @@ -271,11 +271,11 @@ void Gfx::updateFade() { for (int x = 0; x < kScreenWidth; x++) { value = *ptr; if (value) { - *ptr = rgbTo565( - (getR(value) * _fadeInfo.curStep) >> 8, - (getG(value) * _fadeInfo.curStep) >> 8, - (getB(value) * _fadeInfo.curStep) >> 8 - ); + g_hdb->_format.colorToRGB(value, r, g, b); + r = (r * _fadeInfo.curStep) >> 8; + g = (g * _fadeInfo.curStep) >> 8; + b = (b * _fadeInfo.curStep) >> 8; + *ptr = g_hdb->_format.RGBToColor(r, g, b); } ptr++; } @@ -287,13 +287,11 @@ void Gfx::updateFade() { ptr = (uint16 *)fadeBuffer1.getBasePtr(0, y); for (int x = 0; x < kScreenWidth; x++) { value = *ptr; - r = getR(value); - g = getG(value); - b = getB(value); + g_hdb->_format.colorToRGB(value, r, g, b); r += (255 - r) * (256 - _fadeInfo.curStep) / 256; g += (255 - g) * (256 - _fadeInfo.curStep) / 256; b += (255 - b) * (256 - _fadeInfo.curStep) / 256; - *ptr = rgbTo565(r, g, b); + *ptr = g_hdb->_format.RGBToColor(r, g, b); ptr++; } } |