From cf3a6e0a915ca094b208d8da6a76d619a067ca4d Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 24 May 2005 02:14:55 +0000 Subject: [PATCH] Allow the reading of the display configuration to be overridden. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3571 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/jme/JmeApp.java | 34 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/java/com/threerings/jme/JmeApp.java b/src/java/com/threerings/jme/JmeApp.java index 94d938a11..d02c93cd3 100644 --- a/src/java/com/threerings/jme/JmeApp.java +++ b/src/java/com/threerings/jme/JmeApp.java @@ -91,18 +91,7 @@ public class JmeApp { // load up our renderer configuration _properties = new PropertiesIO(getConfigPath("jme.cfg")); - if (!_properties.load()) { - LWJGLPropertiesDialog dialog = - new LWJGLPropertiesDialog(_properties, (String)null); - while (dialog.isVisible()) { - try { - Thread.sleep(5); - } catch (InterruptedException e) { - Log.warning("Error waiting for dialog system, " + - "using defaults."); - } - } - } + readDisplayConfig(); // create an appropriate timer _timer = Timer.getTimer(_properties.getRenderer()); @@ -197,6 +186,27 @@ public class JmeApp return Thread.currentThread() == _dispatchThread; } + /** + * Reads in the contents of our display properties. Derivations may + * wish to override this and configure the display properties from + * some other source. + */ + protected void readDisplayConfig () + { + if (!_properties.load()) { + LWJGLPropertiesDialog dialog = + new LWJGLPropertiesDialog(_properties, (String)null); + while (dialog.isVisible()) { + try { + Thread.sleep(5); + } catch (InterruptedException e) { + Log.warning("Error waiting for dialog system, " + + "using defaults."); + } + } + } + } + /** * Initializes the underlying rendering system, creating a display of * the proper resolution and depth.