aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2013-02-01 02:06:07 +0100
committerEinar Johan Trøan Sømåen2013-02-01 02:06:07 +0100
commitcef07f30d8fda37b5f03e7488f09aa0795dc57e1 (patch)
tree7b37eeccfe6dc3a95c2de21d63190e3a4c357562 /engines/wintermute
parentd12a0e142305d77a3850552a402a0f07343ea34b (diff)
downloadscummvm-rg350-cef07f30d8fda37b5f03e7488f09aa0795dc57e1.tar.gz
scummvm-rg350-cef07f30d8fda37b5f03e7488f09aa0795dc57e1.tar.bz2
scummvm-rg350-cef07f30d8fda37b5f03e7488f09aa0795dc57e1.zip
WINTERMUTE: Avoid applying color-keys to ALL images with bpp >= 3.
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp8
1 files changed, 6 insertions, 2 deletions
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);