diff options
author | Johannes Schickel | 2011-02-13 19:33:22 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-02-14 17:08:32 +0100 |
commit | 51c8871b9b5b5a5d16440eb3da043749d8b91a9c (patch) | |
tree | f7c5cb1f3cb6c8e88eeee899f77ea34b7548c3fc /engines/parallaction | |
parent | 3f8e860a2316d1a0e002324371ddc2aac76c1091 (diff) | |
download | scummvm-rg350-51c8871b9b5b5a5d16440eb3da043749d8b91a9c.tar.gz scummvm-rg350-51c8871b9b5b5a5d16440eb3da043749d8b91a9c.tar.bz2 scummvm-rg350-51c8871b9b5b5a5d16440eb3da043749d8b91a9c.zip |
PARALLACTION: Adapt to setPalette RGBA->RGB change.
This change is not tested, but should hopefully work fine.
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/graphics.cpp | 22 | ||||
-rw-r--r-- | engines/parallaction/graphics.h | 2 |
2 files changed, 11 insertions, 13 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 259ad84f69..020dcc9415 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -160,26 +160,24 @@ void Palette::fadeTo(const Palette& target, uint step) { return; } -uint Palette::fillRGBA(byte *rgba) { +uint Palette::fillRGB(byte *rgb) { byte r, g, b; - byte *hbPal = rgba + _colors * 4; + byte *hbPal = rgb + _colors * 4; for (uint32 i = 0; i < _colors; i++) { r = (_data[i*3] << 2) | (_data[i*3] >> 4); g = (_data[i*3+1] << 2) | (_data[i*3+1] >> 4); b = (_data[i*3+2] << 2) | (_data[i*3+2] >> 4); - rgba[i*4] = r; - rgba[i*4+1] = g; - rgba[i*4+2] = b; - rgba[i*4+3] = 0; + rgb[i*3] = r; + rgb[i*3+1] = g; + rgb[i*3+2] = b; if (_hb) { - hbPal[i*4] = r >> 1; - hbPal[i*4+1] = g >> 1; - hbPal[i*4+2] = b >> 1; - hbPal[i*4+3] = 0; + hbPal[i*3] = r >> 1; + hbPal[i*3+1] = g >> 1; + hbPal[i*3+2] = b >> 1; } } @@ -222,9 +220,9 @@ void Palette::rotate(uint first, uint last, bool forward) { void Gfx::setPalette(Palette pal) { - byte sysPal[256*4]; + byte sysPal[256*3]; - uint n = pal.fillRGBA(sysPal); + uint n = pal.fillRGB(sysPal); _vm->_system->getPaletteManager()->setPalette(sysPal, 0, n); } diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index afabcad21c..d6732e6fe4 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -250,7 +250,7 @@ public: void setEntry(uint index, int red, int green, int blue); void makeGrayscale(); void fadeTo(const Palette& target, uint step); - uint fillRGBA(byte *rgba); + uint fillRGB(byte *rgb); void rotate(uint first, uint last, bool forward); }; |