Only load font when needed -- this allows the emulator to be more embeddable as a headless appliance

This commit is contained in:
Brendan Robert 2015-03-29 00:31:55 -05:00
parent 90e09ba53c
commit 905cba8ab7

View File

@ -30,11 +30,17 @@ import javax.imageio.ImageIO;
*/
public class Font {
static public int[][] font;
static public boolean initialized = false;
static public int getByte(int c, int yOffset) {
if (!initialized) {
initalize();
}
return font[c][yOffset];
}
static {
private static void initalize() {
font = new int[256][8];
initialized = true;
try {
InputStream in = ClassLoader.getSystemResourceAsStream("jace/data/font.gif");
BufferedImage fontImage = ImageIO.read(in);