So i’m trying to draw the pixels of a Bitmap to the screen with a modified colour. What i want, is for the image to be drawn with an offset colour but to not change the actual pixels stored for that image. Currently im having issues with this.
Here’s my method
public void renderWithColourOffset(Bitmap b,int xp,int yp,boolean xFlip,boolean yFlip,int col1[],int col2[]){
Bitmap b0 = new Bitmap(b);
for(int i=0;i<b0.pixels.length;i++){
for(int c=0;c<col1.length;c++){
if(b0.pixels[i]==col1[c]){
b0.pixels[i] = col2[c];
}
}
}
render(b0,xp,yp,xFlip,yFlip);
}
The issue is that when it does this it changes to pixels in the original Bitmap parsed to the function so it wont work whenever the function is called again.
This seems to be an issue with java referencing but i’ve tried a lot of things and simply can’t get it to work :S
Oh and by the way, Merry Christmas