From cef07f30d8fda37b5f03e7488f09aa0795dc57e1 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Fri, 1 Feb 2013 02:06:07 +0100 Subject: WINTERMUTE: Avoid applying color-keys to ALL images with bpp >= 3. --- engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp index 6e29a1f756..e3e4884fbb 100644 --- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp @@ -142,15 +142,19 @@ bool BaseSurfaceOSystem::finishLoad() { delete _surface; bool needsColorKey = false; + bool replaceAlpha = true; if (_filename.hasSuffix(".bmp") && image->getSurface()->format.bytesPerPixel == 4) { _surface = image->getSurface()->convertTo(g_system->getScreenFormat(), image->getPalette()); needsColorKey = true; + replaceAlpha = false; } else if (image->getSurface()->format.bytesPerPixel == 1 && image->getPalette()) { _surface = image->getSurface()->convertTo(g_system->getScreenFormat(), image->getPalette()); needsColorKey = true; } else if (image->getSurface()->format.bytesPerPixel >= 3 && image->getSurface()->format != g_system->getScreenFormat()) { _surface = image->getSurface()->convertTo(g_system->getScreenFormat()); - needsColorKey = true; + if (image->getSurface()->format.bytesPerPixel == 3) { + needsColorKey = true; + } } else { _surface = new Graphics::Surface(); _surface->copyFrom(*image->getSurface()); @@ -161,7 +165,7 @@ bool BaseSurfaceOSystem::finishLoad() { if (needsColorKey) { TransparentSurface trans(*_surface); - trans.applyColorKey(_ckRed, _ckGreen, _ckBlue, true); + trans.applyColorKey(_ckRed, _ckGreen, _ckBlue, replaceAlpha); } _hasAlpha = hasTransparency(_surface); -- cgit v1.2.3