From bc837ca2897f62157929f16dd99189e42f9548df Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 2 Mar 2005 04:35:43 +0000 Subject: [PATCH] The plot thickens. The resource manager prepends "rsrc/" to anything it loads, but the sound manager wants to load things directly from the classpath, so we need to allow it to use the classpath that the resource manager was configured with to ensure that it did the right thing. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3379 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/media/sound/SoundManager.java | 3 ++- src/java/com/threerings/resource/ResourceManager.java | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/media/sound/SoundManager.java b/src/java/com/threerings/media/sound/SoundManager.java index f64dc9de8..521d7c6cd 100644 --- a/src/java/com/threerings/media/sound/SoundManager.java +++ b/src/java/com/threerings/media/sound/SoundManager.java @@ -708,7 +708,8 @@ public class SoundManager String propPath = key.pkgPath + Sounds.PROP_NAME; Properties props = new Properties(); try { - props.load(_rmgr.getResource(propPath + ".properties")); + props.load(_rmgr.getClassLoader().getResourceAsStream( + propPath + ".properties")); } catch (IOException ioe) { Log.warning("Failed to load sound properties " + "[path=" + propPath + ", error=" + ioe + "]."); diff --git a/src/java/com/threerings/resource/ResourceManager.java b/src/java/com/threerings/resource/ResourceManager.java index 231d15c7a..d2a4a4633 100644 --- a/src/java/com/threerings/resource/ResourceManager.java +++ b/src/java/com/threerings/resource/ResourceManager.java @@ -363,6 +363,15 @@ public class ResourceManager unpack.start(); } + /** + * Returns the class loader being used to load resources if/when there + * are no resource bundles from which to load them. + */ + public ClassLoader getClassLoader () + { + return _loader; + } + /** * Fetches a resource from the local repository. *