From 92e08b1f2b70f2a81667debc54c80883055eeba6 Mon Sep 17 00:00:00 2001 From: shadowislord Date: Sat, 28 Feb 2015 19:05:48 -0500 Subject: [PATCH] Application: use JmeSystem to get asset config URL --- .../main/java/com/jme3/app/Application.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/app/Application.java b/jme3-core/src/main/java/com/jme3/app/Application.java index 8c05f2b18..2bcd6a4d9 100644 --- a/jme3-core/src/main/java/com/jme3/app/Application.java +++ b/jme3-core/src/main/java/com/jme3/app/Application.java @@ -174,28 +174,30 @@ public class Application implements SystemListener { } private void initAssetManager(){ + URL assetCfgUrl = null; + if (settings != null){ String assetCfg = settings.getString("AssetConfigURL"); if (assetCfg != null){ - URL url = null; try { - url = new URL(assetCfg); + assetCfgUrl = new URL(assetCfg); } catch (MalformedURLException ex) { } - if (url == null) { - url = Application.class.getClassLoader().getResource(assetCfg); - if (url == null) { + if (assetCfgUrl == null) { + assetCfgUrl = Application.class.getClassLoader().getResource(assetCfg); + if (assetCfgUrl == null) { logger.log(Level.SEVERE, "Unable to access AssetConfigURL in asset config:{0}", assetCfg); return; } } - assetManager = JmeSystem.newAssetManager(url); } } + if (assetCfgUrl == null) { + String assetCfg = JmeSystem.getPlatformAssetConfigPath(); + assetCfgUrl = Thread.currentThread().getContextClassLoader().getResource(assetCfg); + } if (assetManager == null){ - assetManager = JmeSystem.newAssetManager( - Thread.currentThread().getContextClassLoader() - .getResource("com/jme3/asset/Desktop.cfg")); + assetManager = JmeSystem.newAssetManager(assetCfgUrl); } }