From dd84867997b515e2e95b383b68ebc27b9cc45b42 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Fri, 10 Jan 2014 20:05:32 +0100 Subject: ANDROID: Set correct blending function Overlays with alpha channel in ScummVM use pre-multiplied alpha. Thus, is it necessary to set the source blend function to ONE, not SOURCE_ALPHA. While there is no firm decision on the texture format to be used to cursors, make sure to set the key color to R=G=B=A=0.0, so that it can be used with either pre-multiplied or non-pre-multiplied blending. --- backends/platform/android/gfx.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index 882dcff9a4..0ce95a3cfb 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -233,7 +233,7 @@ void OSystem_Android::initViewport() { GLCALL(glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST)); GLCALL(glEnable(GL_BLEND)); - GLCALL(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); + GLCALL(glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)); GLCALL(glEnableClientState(GL_VERTEX_ARRAY)); GLCALL(glEnableClientState(GL_TEXTURE_COORD_ARRAY)); @@ -726,7 +726,7 @@ void OSystem_Android::setMouseCursor(const void *buf, uint w, uint h, _mouse_keycolor = keycolor; p = _mouse_texture_palette->palette() + _mouse_keycolor * 2; - WRITE_UINT16(p, READ_UINT16(p) & ~1); + WRITE_UINT16(p, 0); } if (w == 0 || h == 0) @@ -779,7 +779,7 @@ void OSystem_Android::setCursorPaletteInternal(const byte *colors, WRITE_UINT16(p, pf.RGBToColor(colors[0], colors[1], colors[2])); p = _mouse_texture_palette->palette() + _mouse_keycolor * 2; - WRITE_UINT16(p, READ_UINT16(p) & ~1); + WRITE_UINT16(p, 0); } void OSystem_Android::setCursorPalette(const byte *colors, @@ -821,7 +821,7 @@ void OSystem_Android::disableCursorPalette() { } byte *p = _mouse_texture_palette->palette() + _mouse_keycolor * 2; - WRITE_UINT16(p, READ_UINT16(p) & ~1); + WRITE_UINT16(p, 0); } } -- cgit v1.2.3