TINYGL: Expect colorKey in the same pixel format as surface.

So caller does not have to depend on the pixel format used internally to
BlitImage.
Update callers which do request for color keying (GRIM/EMI only).
Also, remove a special-casing of transparent color when converting image
format which sets a color in a packed format independent from actual
destination format.
Also, in GfxTinyGL::createTextObject, prefer changing invisible colorKey
value than actually-visible color.
This commit is contained in:
Vincent Pelletier 2016-07-21 16:17:32 +02:00
parent 31517c227c
commit 7c1a15c6e8
3 changed files with 11 additions and 18 deletions

View file

@ -52,7 +52,7 @@ public:
if (applyColorKey) {
for (int x = 0; x < surface.w; x++) {
for (int y = 0; y < surface.h; y++) {
uint32 pixel = dataBuffer.getValueAt(y * surface.w + x);
uint32 pixel = buffer.getValueAt(y * surface.w + x);
if (pixel == colorKey) {
// Color keyed pixels become transparent white.
dataBuffer.setPixelAt(y * surface.w + x, 0, 255, 255, 255);