changeset 183:cf0256f13612

Remove global number of fonts static.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 16 Mar 2017 13:29:22 +0200
parents 88b364dfd501
children 996d332d87d1
files game/Engine.java game/G.java
diffstat 2 files changed, 3 insertions(+), 4 deletions(-) [+]
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
--- a/game/G.java	Thu Mar 16 12:23:17 2017 +0200
+++ b/game/G.java	Thu Mar 16 13:29:22 2017 +0200
@@ -22,7 +22,6 @@
 {
     public static final String version = "0.86";
 
-    public static final int numFonts = 4;
     public static Font baseFont;
     public static Font fonts[];
     public static FontMetrics metrics[];