Commit a7875d7a authored by Maxym Borodenko's avatar Maxym Borodenko

Tile server: alpha channel

parent 9d14aecb
......@@ -51,6 +51,13 @@ public class MapColorsFilter extends PointFilter {
public int filterRGB(int x, int y, int rgb) {
if (rgb == oldColor) {
return newColor;
} else if (rgb != 0) {
int alpha = (rgb >> 24) & 0xFF; // isolate alpha
alpha &= 0xff; //keeps alpha in 0-255 range
int newRGB = newColor;
newRGB &= 0x00ffffff; //remove old alpha info
newRGB |= (alpha << 24); //add new alpha info
return newRGB;
}
return rgb;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment