[Scummvm-cvs-logs] scummvm master -> cef07f30d8fda37b5f03e7488f09aa0795dc57e1
somaen
einarjohants at gmail.com
Fri Feb 1 02:06:44 CET 2013
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
cef07f30d8 WINTERMUTE: Avoid applying color-keys to ALL images with bpp >= 3.
Commit: cef07f30d8fda37b5f03e7488f09aa0795dc57e1
https://github.com/scummvm/scummvm/commit/cef07f30d8fda37b5f03e7488f09aa0795dc57e1
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2013-01-31T17:06:07-08:00
Commit Message:
WINTERMUTE: Avoid applying color-keys to ALL images with bpp >= 3.
Changed paths:
engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
index 6e29a1f..e3e4884 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);
More information about the Scummvm-git-logs
mailing list