diff options
-rw-r--r-- | engines/kyra/screen.cpp | 38 | ||||
-rw-r--r-- | engines/kyra/screen_lok.cpp | 9 | ||||
-rw-r--r-- | engines/kyra/screen_lol.cpp | 3 |
3 files changed, 23 insertions, 27 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index b8eac058fd..3eea7aab14 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -137,16 +137,15 @@ bool Screen::init() { // We setup the PC98 text mode palette at [16, 24], since that will be used // for KANJI characters in Lands of Lore. if (_use16ColorMode && _vm->gameFlags().platform == Common::kPlatformPC98) { - uint8 palette[8 * 4]; + uint8 palette[8 * 3]; for (int i = 0; i < 8; ++i) { - palette[i * 4 + 0] = ((i >> 1) & 1) * 0xFF; - palette[i * 4 + 1] = ((i >> 2) & 1) * 0xFF; - palette[i * 4 + 2] = ((i >> 0) & 1) * 0xFF; - palette[i * 4 + 3] = 0; - - _system->getPaletteManager()->setPalette(palette, 16, 8); + palette[i * 3 + 0] = ((i >> 1) & 1) * 0xFF; + palette[i * 3 + 1] = ((i >> 2) & 1) * 0xFF; + palette[i * 3 + 2] = ((i >> 0) & 1) * 0xFF; } + + _system->getPaletteManager()->setPalette(palette, 16, 8); } _curDim = 0; @@ -180,7 +179,7 @@ bool Screen::enableScreenDebug(bool enable) { } void Screen::setResolution() { - byte palette[4*256]; + byte palette[3*256]; _system->getPaletteManager()->grabPalette(palette, 0, 256); int width = 320, height = 200; @@ -700,14 +699,13 @@ void Screen::getRealPalette(int num, uint8 *dst) { } void Screen::setScreenPalette(const Palette &pal) { - uint8 screenPal[256 * 4]; + uint8 screenPal[256 * 3]; _screenPalette->copy(pal); for (int i = 0; i < pal.getNumColors(); ++i) { - screenPal[4 * i + 0] = (pal[i * 3 + 0] * 0xFF) / 0x3F; - screenPal[4 * i + 1] = (pal[i * 3 + 1] * 0xFF) / 0x3F; - screenPal[4 * i + 2] = (pal[i * 3 + 2] * 0xFF) / 0x3F; - screenPal[4 * i + 3] = 0; + screenPal[3 * i + 0] = (pal[i * 3 + 0] * 0xFF) / 0x3F; + screenPal[3 * i + 1] = (pal[i * 3 + 1] * 0xFF) / 0x3F; + screenPal[3 * i + 2] = (pal[i * 3 + 2] * 0xFF) / 0x3F; } _paletteChanged = true; @@ -729,19 +727,19 @@ void Screen::setInterfacePalette(const Palette &pal, uint8 r, uint8 g, uint8 b) if (!_isAmiga) return; - uint8 screenPal[32 * 4]; + uint8 screenPal[32 * 3]; assert(32 <= pal.getNumColors()); for (int i = 0; i < pal.getNumColors(); ++i) { if (i != 0x10) { - screenPal[4 * i + 0] = (pal[i * 3 + 0] * 0xFF) / 0x3F; - screenPal[4 * i + 1] = (pal[i * 3 + 1] * 0xFF) / 0x3F; - screenPal[4 * i + 2] = (pal[i * 3 + 2] * 0xFF) / 0x3F; + screenPal[3 * i + 0] = (pal[i * 3 + 0] * 0xFF) / 0x3F; + screenPal[3 * i + 1] = (pal[i * 3 + 1] * 0xFF) / 0x3F; + screenPal[3 * i + 2] = (pal[i * 3 + 2] * 0xFF) / 0x3F; } else { - screenPal[4 * i + 0] = (r * 0xFF) / 0x3F; - screenPal[4 * i + 1] = (g * 0xFF) / 0x3F; - screenPal[4 * i + 2] = (b * 0xFF) / 0x3F; + screenPal[3 * i + 0] = (r * 0xFF) / 0x3F; + screenPal[3 * i + 1] = (g * 0xFF) / 0x3F; + screenPal[3 * i + 2] = (b * 0xFF) / 0x3F; } screenPal[4 * i + 3] = 0; } diff --git a/engines/kyra/screen_lok.cpp b/engines/kyra/screen_lok.cpp index da96ea6821..227349754f 100644 --- a/engines/kyra/screen_lok.cpp +++ b/engines/kyra/screen_lok.cpp @@ -447,12 +447,11 @@ void Screen_LoK_16::mergeOverlay(int x, int y, int w, int h) { } void Screen_LoK_16::set16ColorPalette(const uint8 *pal) { - uint8 palette[16 * 4]; + uint8 palette[16 * 3]; for (int i = 0; i < 16; ++i) { - palette[i * 4 + 0] = (pal[i * 3 + 0] * 0xFF) / 0x0F; - palette[i * 4 + 1] = (pal[i * 3 + 1] * 0xFF) / 0x0F; - palette[i * 4 + 2] = (pal[i * 3 + 2] * 0xFF) / 0x0F; - palette[i * 4 + 3] = 0; + palette[i * 3 + 0] = (pal[i * 3 + 0] * 0xFF) / 0x0F; + palette[i * 3 + 1] = (pal[i * 3 + 1] * 0xFF) / 0x0F; + palette[i * 3 + 2] = (pal[i * 3 + 2] * 0xFF) / 0x0F; } _system->getPaletteManager()->setPalette(palette, 0, 16); diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index e85ea13371..ff35facbb5 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -795,11 +795,10 @@ void Screen_LoL::copyColor(int dstColorIndex, int srcColorIndex) { uint8 *d = _screenPalette->getData() + dstColorIndex * 3; memcpy(d, s, 3); - uint8 ci[4]; + uint8 ci[3]; ci[0] = (d[0] << 2) | (d[0] & 3); ci[1] = (d[1] << 2) | (d[1] & 3); ci[2] = (d[2] << 2) | (d[2] & 3); - ci[3] = 0; _system->getPaletteManager()->setPalette(ci, dstColorIndex, 1); } |