code /= 100;
int detailcode = code % 100;
// Base (body) layer
Sprite layer = getBaseSprite(basecode);
if (layer == null) {
throw new IllegalArgumentException("No base image found for outfit: " + basecode);
}
final ImageSprite sprite = new ImageSprite(layer);
final Graphics g = sprite.getGraphics();
// Dress layer
layer = getDressSprite(dresscode);
layer.draw(g, 0, 0);
// Head layer
layer = getHeadSprite(headcode);
layer.draw(g, 0, 0);
// Hair layer
layer = getHairSprite(haircode);
layer.draw(g, 0, 0);
// Item layer
layer = getDetailSprite(detailcode);
layer.draw(g, 0, 0);
return sprite;
}