From 03ba1871f7392db32db09228878a2e148042f8c1 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sat, 18 Jun 2011 19:44:18 +0200 Subject: [PATCH] SCUMM: fixed messed up colors in 16bit HE games (regression from 068b4a5351a5574dbfac6acff5776a0071f3f2dd) --- engines/scumm/gfx.cpp | 4 ++-- engines/scumm/gfx.h | 4 ++-- engines/scumm/scumm.cpp | 15 ++++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index b78059bd94a..fd529b36fe6 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -251,7 +251,7 @@ GdiV2::~GdiV2() { } #ifdef USE_RGB_COLOR -Gdi16Bit::Gdi16Bit(ScummEngine *vm) : Gdi(vm) { +GdiHE16bit::GdiHE16bit(ScummEngine *vm) : GdiHE(vm) { } #endif @@ -3674,7 +3674,7 @@ void Gdi::unkDecode11(byte *dst, int dstPitch, const byte *src, int height) cons #undef READ_BIT_256 #ifdef USE_RGB_COLOR -void Gdi16Bit::writeRoomColor(byte *dst, byte color) const { +void GdiHE16bit::writeRoomColor(byte *dst, byte color) const { WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2)); } #endif diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h index 54ce724da1e..2e7111e78b9 100644 --- a/engines/scumm/gfx.h +++ b/engines/scumm/gfx.h @@ -430,11 +430,11 @@ public: }; #ifdef USE_RGB_COLOR -class Gdi16Bit : public Gdi { +class GdiHE16bit : public GdiHE { protected: virtual void writeRoomColor(byte *dst, byte color) const; public: - Gdi16Bit(ScummEngine *vm); + GdiHE16bit(ScummEngine *vm); }; #endif diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 362430d704c..4fd1f6b32dd 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -114,17 +114,18 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _rnd("scumm") { +#ifdef USE_RGB_COLOR + if (_game.features & GF_16BIT_COLOR) { + if (_game.platform == Common::kPlatformPCEngine) + _gdi = new GdiPCEngine(this); + else if (_game.heversion > 0) + _gdi = new GdiHE16bit(this); + } else +#endif if (_game.heversion > 0) { _gdi = new GdiHE(this); } else if (_game.platform == Common::kPlatformNES) { _gdi = new GdiNES(this); -#ifdef USE_RGB_COLOR - } else if (_game.features & GF_16BIT_COLOR) { - if (_game.platform == Common::kPlatformPCEngine) - _gdi = new GdiPCEngine(this); - else - _gdi = new Gdi16Bit(this); -#endif } else if (_game.version <= 1) { _gdi = new GdiV1(this); } else if (_game.version == 2) {