diff game/Engine.java @ 183:cf0256f13612

Remove global number of fonts static.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 16 Mar 2017 13:29:22 +0200
parents 2e033eced6e5
children 189cd8fe2304
line wrap: on
line diff
--- a/game/Engine.java	Thu Mar 16 12:23:17 2017 +0200
+++ b/game/Engine.java	Thu Mar 16 13:29:22 2017 +0200
@@ -591,7 +591,7 @@
             try {
                 res = new ResourceLoader("graphics/font.ttf");
 
-                G.fonts = new Font[G.numFonts];
+                G.fonts = new Font[4];
                 G.baseFont = Font.createFont(Font.TRUETYPE_FONT, res.getStream());
 
                 setupDerivedFonts(1.0f);
@@ -686,8 +686,8 @@
             setupDerivedFonts(dw);
 
             // Get font metrics against current Graphics2D context
-            G.metrics = new FontMetrics[G.numFonts];
-            for (int i = 0; i < G.numFonts; i++)
+            G.metrics = new FontMetrics[G.fonts.length];
+            for (int i = 0; i < G.fonts.length; i++)
                 G.metrics[i] = g2.getFontMetrics(G.fonts[i]);
 
             // Rescale IDM GUI widgets