[Scummvm-cvs-logs] scummvm master -> d12a0e142305d77a3850552a402a0f07343ea34b
somaen
einarjohants at gmail.com
Fri Feb 1 01:56:05 CET 2013
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0db8a0b3b1 GRAPHICS: Let JPEGs pixelformat state 0 alpha bits.
d12a0e1423 WINTERMUTE: Apply color-key if no alpha-channel is present
Commit: 0db8a0b3b15bd01ca5e02d4eaff5ce8798824b0a
https://github.com/scummvm/scummvm/commit/0db8a0b3b15bd01ca5e02d4eaff5ce8798824b0a
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2013-01-31T16:54:39-08:00
Commit Message:
GRAPHICS: Let JPEGs pixelformat state 0 alpha bits.
Changed paths:
graphics/decoders/jpeg.cpp
diff --git a/graphics/decoders/jpeg.cpp b/graphics/decoders/jpeg.cpp
index 5e926e6..8adbab1 100644
--- a/graphics/decoders/jpeg.cpp
+++ b/graphics/decoders/jpeg.cpp
@@ -74,7 +74,7 @@ const Surface *JPEGDecoder::getSurface() const {
// Create an RGBA8888 surface
_rgbSurface = new Graphics::Surface();
- _rgbSurface->create(_w, _h, Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
+ _rgbSurface->create(_w, _h, Graphics::PixelFormat(4, 8, 8, 8, 0, 24, 16, 8, 0));
// Get our component surfaces
const Graphics::Surface *yComponent = getComponent(1);
Commit: d12a0e142305d77a3850552a402a0f07343ea34b
https://github.com/scummvm/scummvm/commit/d12a0e142305d77a3850552a402a0f07343ea34b
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2013-01-31T16:55:16-08:00
Commit Message:
WINTERMUTE: Apply color-key if no alpha-channel is present
(Instead of using the bpp to detect it).
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 e00b347..6e29a1f 100644
--- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
@@ -140,23 +140,28 @@ bool BaseSurfaceOSystem::finishLoad() {
// Well, actually, we don't convert via 24-bit as the color-key application overwrites the Alpha-channel anyhow.
_surface->free();
delete _surface;
+
+ bool needsColorKey = false;
if (_filename.hasSuffix(".bmp") && image->getSurface()->format.bytesPerPixel == 4) {
_surface = image->getSurface()->convertTo(g_system->getScreenFormat(), image->getPalette());
- TransparentSurface trans(*_surface);
- trans.applyColorKey(_ckRed, _ckGreen, _ckBlue);
+ needsColorKey = true;
} else if (image->getSurface()->format.bytesPerPixel == 1 && image->getPalette()) {
_surface = image->getSurface()->convertTo(g_system->getScreenFormat(), image->getPalette());
- TransparentSurface trans(*_surface);
- trans.applyColorKey(_ckRed, _ckGreen, _ckBlue, true);
+ needsColorKey = true;
} else if (image->getSurface()->format.bytesPerPixel >= 3 && image->getSurface()->format != g_system->getScreenFormat()) {
_surface = image->getSurface()->convertTo(g_system->getScreenFormat());
- if (image->getSurface()->format.bytesPerPixel == 3) {
- TransparentSurface trans(*_surface);
- trans.applyColorKey(_ckRed, _ckGreen, _ckBlue, true);
- }
+ needsColorKey = true;
} else {
_surface = new Graphics::Surface();
_surface->copyFrom(*image->getSurface());
+ if (_surface->format.aBits() == 0) {
+ needsColorKey = true;
+ }
+ }
+
+ if (needsColorKey) {
+ TransparentSurface trans(*_surface);
+ trans.applyColorKey(_ckRed, _ckGreen, _ckBlue, true);
}
_hasAlpha = hasTransparency(_surface);
More information about the Scummvm-git-logs
mailing list