diff options
author | Johannes Schickel | 2011-02-19 21:42:34 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-02-19 21:46:45 +0100 |
commit | e21d6e0d1120e917a4a019a4070ec4db5e988b9b (patch) | |
tree | 1142828b72ccf17d513c621e108d749f148fd32b /engines/parallaction | |
parent | 32d0e4c15fb33f80db194087850466664a43516a (diff) | |
parent | b26f30b98793c522265a3eeb48fb3b41034663c6 (diff) | |
download | scummvm-rg350-e21d6e0d1120e917a4a019a4070ec4db5e988b9b.tar.gz scummvm-rg350-e21d6e0d1120e917a4a019a4070ec4db5e988b9b.tar.bz2 scummvm-rg350-e21d6e0d1120e917a4a019a4070ec4db5e988b9b.zip |
Merge branch 'osystem-palette' of https://github.com/lordhoto/scummvm into master
Conflicts:
backends/platform/android/android.cpp
engines/sci/graphics/screen.cpp
engines/sci/graphics/transitions.cpp
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 79993a297a..35441d7e3e 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 * 3; 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); }; |