aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMarcus Comstedt2014-01-10 20:05:32 +0100
committerMarcus Comstedt2014-01-10 20:05:32 +0100
commitdd84867997b515e2e95b383b68ebc27b9cc45b42 (patch)
treeead109dd16bd68bb3efc55cc00637f8520027d3b /backends
parent4b81b1299da2d81bf457b245b1f8cb3d21c8172f (diff)
downloadscummvm-rg350-dd84867997b515e2e95b383b68ebc27b9cc45b42.tar.gz
scummvm-rg350-dd84867997b515e2e95b383b68ebc27b9cc45b42.tar.bz2
scummvm-rg350-dd84867997b515e2e95b383b68ebc27b9cc45b42.zip
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.
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/android/gfx.cpp8
1 files changed, 4 insertions, 4 deletions
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);
}
}