changeset 147:0ec311706d3c

Clean up debug messages.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 26 Nov 2011 11:25:46 +0200
parents 351f20e09d48
children 5b25561855c3
files game/Engine.java
diffstat 1 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/game/Engine.java	Fri Nov 25 16:16:30 2011 +0200
+++ b/game/Engine.java	Sat Nov 26 11:25:46 2011 +0200
@@ -597,6 +597,11 @@
     IDMContainer widgets;
     AboutBox aboutBox;
 
+    public void dbg(String msg)
+    {
+        System.out.print("Engine: " + msg);
+    }
+
     public Engine()
     {
         // Initialize globals
@@ -622,7 +627,7 @@
             }
             catch (FontFormatException e)
             {
-                System.out.print("Could not initialize fonts.\n");
+                dbg("Could not initialize fonts.\n");
             }
 
             res = new ResourceLoader("sounds/gamemusic.wav");
@@ -635,7 +640,7 @@
                 "Initialization error",
                 JOptionPane.ERROR_MESSAGE);
 
-            System.out.print(e.getMessage());
+            dbg(e.getMessage());
         }
 
         // Create IDM GUI widgets
@@ -664,7 +669,7 @@
         // Get initial focus
         if (!hasFocus())
         {
-            System.out.print("Engine(): requesting focus\n");
+            dbg("Requesting focus.\n");
             requestFocus();
         }
 
@@ -701,14 +706,14 @@
             G.fonts[2] = G.fonts[0].deriveFont(64f * dw);
             G.fonts[3] = G.fonts[0].deriveFont(32f * dw);
 
-            System.out.print("scale changed\n");
+            dbg("Scale changed.\n");
             scaleChanged = true;
             updateBoard = true;
         }
         
         if (updateBoard)
         {
-//            System.out.print("updateBoard()\n");
+//            dbg("updateBoard()\n");
             G.lautaBGScaled = new BufferedImage(dim.width, dim.height, BufferedImage.TYPE_INT_RGB);
             Graphics2D gimg = G.lautaBGScaled.createGraphics();
             gimg.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
@@ -756,7 +761,7 @@
 
     public void startThreads()
     {
-        System.out.print("startThreads()\n");
+        dbg("startThreads()\n");
         if (animThread == null)
         {
             animThread = new Thread(this);
@@ -767,7 +772,7 @@
 
     public void stopThreads()
     {
-        System.out.print("stopThreads()\n");
+        dbg("stopThreads()\n");
 
         // Stop animations
         if (animThread != null)
@@ -810,7 +815,7 @@
     {
         if (!hasFocus())
         {
-            System.out.print("Requesting focus\n");
+            dbg("Requesting focus.\n");
             requestFocus();
         }
     }