Hi,
OK, firstly, I did search the forums and try some stuff out from the information I gained as there seems to be a fair bit of stuff about scaling.
Well, I still have problem… ???
What i’ve basically written is a class that renders a 2d effects overlay in my game through int arrays.
If I render it 80x60 onto a 800x600 window it looks and runs perfectly in a little square.
If I call the g.drawImage so it scales the 80x60 bufferedimage to 800x600, the framerate completely collapses. So obviously there is some serious slowdown coming from scaling of the image. The image looks ok scaled up btw (slightly pixellated, kinda old school effect), which was the look I ideally wanted anyway
Anyone got any idea how I can improve the speed of the scaling operation in this code? I’ve tried turning the DD flags on and it didn’t seem to have any effect.
public FXLayer()
{
bi = new BufferedImage(80, 60, BufferedImage.TYPE_INT_ARGB);
DataBufferInt data = (DataBufferInt)bi.getRaster().getDataBuffer();
PixelIndex = data.getData() ;
}
public void paint (Graphics g)
{
g.drawImage(bi, 0, 0, 800, 600, null);
}
public void update()
{
// Only updating my int array here
}