well first off, I don’t think Image’s are accelerated period. If you’re asking about the .get() and the type cast, I don’t think any optimization happens there. Even Generics which make it look better don’t even optimize (my biggest peeve) it. What I do with my stuff is something like this:
private static final int
Actor_001_d_1 = 0,
Actor_002_d_1 = 1,
Actor_003_d_1 = 2,
Actor_004_d_1 = 3;
public void loadImages() {
images = new BufferedImage[4];
for (int i = 0; i < images.length; i++)
images[i] = getResource("Actor_00" + (i+1) + "_d_1.png");
}
public void render(Graphics2D g2d) {
g2d.drawImage(images[index], x, y, null);
}
kinda like that
so that I can load them by ints from an array, but still have a uniqueness about them that’s easy for me to read.
EDIT: forgot a curly brace Coding in here is tough!