forked from SteamWar/SteamWar
Fix ColorInit and CustomMap deprecation warnings
This commit is contained in:
@@ -254,7 +254,8 @@ public class CustomMap implements Listener {
|
||||
int green = pixels[i2];
|
||||
int i3 = (y * width + x) * numBands + 2;
|
||||
int blue = pixels[i3];
|
||||
Color nearest = MapPalette.getColor(ColorInit.getColorByte(red, green, blue));
|
||||
int colorIndex = ColorInit.getColorByte(red, green, blue);
|
||||
Color nearest = MapPalette.colors[colorIndex >= 0 ? colorIndex : colorIndex + 256];
|
||||
|
||||
pixels[(y * width + x) * numBands] = nearest.getRed();
|
||||
pixels[i2] = nearest.getGreen();
|
||||
|
||||
Reference in New Issue
Block a user