diff options
author | Johannes Schickel | 2011-02-13 15:54:31 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-02-14 17:08:32 +0100 |
commit | c796dbe7c28b0375fa26ac0423b95b7b22eb9530 (patch) | |
tree | b755069f3ee2b9fc8f240531ab05a03924f4a9c7 | |
parent | 5d9e69146cef195c0b94e528bfc0a608956f34e3 (diff) | |
download | scummvm-rg350-c796dbe7c28b0375fa26ac0423b95b7b22eb9530.tar.gz scummvm-rg350-c796dbe7c28b0375fa26ac0423b95b7b22eb9530.tar.bz2 scummvm-rg350-c796dbe7c28b0375fa26ac0423b95b7b22eb9530.zip |
HUGO: Adapt to the setPalette RGBA->RGB change.
This is currently done by converting the internal palette from RGBA(?) to RGB
when setPalette / replaceCursorPalette is called.
This change is not tested, since I do not have any Hugo game.
-rw-r--r-- | engines/hugo/display.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp index a2902e3b9d..0c076f229e 100644 --- a/engines/hugo/display.cpp +++ b/engines/hugo/display.cpp @@ -111,10 +111,24 @@ Screen::~Screen() { void Screen::createPal() { debugC(1, kDebugDisplay, "createPal"); - g_system->getPaletteManager()->setPalette(_mainPalette, 0, _paletteSize / 4); + byte pal[3 * 256]; + for (uint i = 0; i < _paletteSize; ++i) { + pal[3 * i + 0] = _mainPalette[4 * i + 0]; + pal[3 * i + 1] = _mainPalette[4 * i + 1]; + pal[3 * i + 2] = _mainPalette[4 * i + 2]; + } + + g_system->getPaletteManager()->setPalette(pal, 0, _paletteSize / 4); } void Screen::setCursorPal() { + byte pal[3 * 256]; + for (uint i = 0; i < _paletteSize; ++i) { + pal[3 * i + 0] = _curPalette[4 * i + 0]; + pal[3 * i + 1] = _curPalette[4 * i + 1]; + pal[3 * i + 2] = _curPalette[4 * i + 2]; + } + CursorMan.replaceCursorPalette(_curPalette, 0, _paletteSize / 4); } @@ -171,12 +185,12 @@ void Screen::displayRect(const int16 x, const int16 y, const int16 dx, const int void Screen::remapPal(const uint16 oldIndex, const uint16 newIndex) { debugC(1, kDebugDisplay, "Remap_pal(%d, %d)", oldIndex, newIndex); - byte pal[4]; + byte pal[3]; pal[0] = _curPalette[4 * oldIndex + 0] = _mainPalette[newIndex * 4 + 0]; pal[1] = _curPalette[4 * oldIndex + 1] = _mainPalette[newIndex * 4 + 1]; pal[2] = _curPalette[4 * oldIndex + 2] = _mainPalette[newIndex * 4 + 2]; - pal[3] = _curPalette[4 * oldIndex + 3] = _mainPalette[newIndex * 4 + 3]; + //pal[3] = _curPalette[4 * oldIndex + 3] = _mainPalette[newIndex * 4 + 3]; g_system->getPaletteManager()->setPalette(pal, oldIndex, 1); } @@ -197,7 +211,7 @@ void Screen::savePal(Common::WriteStream *f) const { void Screen::restorePal(Common::SeekableReadStream *f) { debugC(1, kDebugDisplay, "restorePal()"); - byte pal[4]; + byte pal[3]; for (int i = 0; i < _paletteSize; i++) _curPalette[i] = f->readByte(); @@ -206,7 +220,7 @@ void Screen::restorePal(Common::SeekableReadStream *f) { pal[0] = _curPalette[i * 4 + 0]; pal[1] = _curPalette[i * 4 + 1]; pal[2] = _curPalette[i * 4 + 2]; - pal[3] = _curPalette[i * 4 + 3]; + //pal[3] = _curPalette[i * 4 + 3]; g_system->getPaletteManager()->setPalette(pal, i, 1); } } |