diff --git a/SPD-classes/src/main/java/com/watabou/gltextures/SmartTexture.java b/SPD-classes/src/main/java/com/watabou/gltextures/SmartTexture.java index be1be4766..f2bc20e3c 100644 --- a/SPD-classes/src/main/java/com/watabou/gltextures/SmartTexture.java +++ b/SPD-classes/src/main/java/com/watabou/gltextures/SmartTexture.java @@ -89,7 +89,9 @@ public class SmartTexture extends Texture { } public int getPixel( int x, int y ){ - return bitmap.getPixel(x, y); + int color = bitmap.getPixel(x, y); + // convert from libGdx RGBA to Noosa ARGB + return ( (color << 24) | (color >>> 8) ); } public void reload() { diff --git a/SPD-classes/src/main/java/com/watabou/gltextures/TextureCache.java b/SPD-classes/src/main/java/com/watabou/gltextures/TextureCache.java index 1af6d58ba..5dfa605cf 100644 --- a/SPD-classes/src/main/java/com/watabou/gltextures/TextureCache.java +++ b/SPD-classes/src/main/java/com/watabou/gltextures/TextureCache.java @@ -42,7 +42,7 @@ public class TextureCache { } else { Pixmap pixmap =new Pixmap( 1, 1, Pixmap.Format.RGBA8888 ); - // In the rest of the code ARGB is used + // convert from Noosa ARGB to libGdx RGBA pixmap.setColor( (color << 8) | (color >>> 24) ); pixmap.fill(); @@ -65,7 +65,7 @@ public class TextureCache { Pixmap pixmap = new Pixmap( colors.length, 1, Pixmap.Format.RGBA8888); for (int i=0; i < colors.length; i++) { - // In the rest of the code ARGB is used + // convert from Noosa ARGB to libGdx RGBA pixmap.drawPixel( i, 0, (colors[i] << 8) | (colors[i] >>> 24) ); } SmartTexture tx = new SmartTexture( pixmap );