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.
This commit is contained in:
parent
4b81b1299d
commit
dd84867997
1 changed files with 4 additions and 4 deletions
|
@ -233,7 +233,7 @@ void OSystem_Android::initViewport() {
|
||||||
GLCALL(glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST));
|
GLCALL(glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST));
|
||||||
|
|
||||||
GLCALL(glEnable(GL_BLEND));
|
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_VERTEX_ARRAY));
|
||||||
GLCALL(glEnableClientState(GL_TEXTURE_COORD_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;
|
_mouse_keycolor = keycolor;
|
||||||
|
|
||||||
p = _mouse_texture_palette->palette() + _mouse_keycolor * 2;
|
p = _mouse_texture_palette->palette() + _mouse_keycolor * 2;
|
||||||
WRITE_UINT16(p, READ_UINT16(p) & ~1);
|
WRITE_UINT16(p, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w == 0 || h == 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]));
|
WRITE_UINT16(p, pf.RGBToColor(colors[0], colors[1], colors[2]));
|
||||||
|
|
||||||
p = _mouse_texture_palette->palette() + _mouse_keycolor * 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,
|
void OSystem_Android::setCursorPalette(const byte *colors,
|
||||||
|
@ -821,7 +821,7 @@ void OSystem_Android::disableCursorPalette() {
|
||||||
}
|
}
|
||||||
|
|
||||||
byte *p = _mouse_texture_palette->palette() + _mouse_keycolor * 2;
|
byte *p = _mouse_texture_palette->palette() + _mouse_keycolor * 2;
|
||||||
WRITE_UINT16(p, READ_UINT16(p) & ~1);
|
WRITE_UINT16(p, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue