From aec7a1ece2003bf6824ab581303e3f2f9e6a3833 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 4 Apr 2006 03:22:24 +0000 Subject: [PATCH] Allow the resource manager to be run in "don't unpack yer bundles" mode. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3996 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/resource/ResourceManager.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/resource/ResourceManager.java b/src/java/com/threerings/resource/ResourceManager.java index 1b4bd34a7..0ed2069d4 100644 --- a/src/java/com/threerings/resource/ResourceManager.java +++ b/src/java/com/threerings/resource/ResourceManager.java @@ -226,6 +226,11 @@ public class ResourceManager } } + // check to see if we're in developer mode in which case we won't + // unpack our resources + _unpack = !"true".equalsIgnoreCase( + System.getProperty("no_unpack_resources")); + // make sure there's a trailing slash if (!resourceDir.endsWith(File.separator)) { resourceDir += File.separator; @@ -322,7 +327,7 @@ public class ResourceManager public boolean checkBundle (String path) { return new ResourceBundle( - getResourceFile(path), true, true).isUnpacked(); + getResourceFile(path), true, _unpack).isUnpacked(); } /** @@ -336,7 +341,7 @@ public class ResourceManager public void resolveBundle (String path, final ResultListener listener) { final ResourceBundle bundle = - new ResourceBundle(getResourceFile(path), true, true); + new ResourceBundle(getResourceFile(path), true, _unpack); if (bundle.isUnpacked()) { if (bundle.sourceIsReady()) { listener.requestCompleted(bundle); @@ -563,7 +568,7 @@ public class ResourceManager while (tok.hasMoreTokens()) { String path = tok.nextToken().trim(); ResourceBundle bundle = - new ResourceBundle(getResourceFile(path), true, true); + new ResourceBundle(getResourceFile(path), true, _unpack); set.add(bundle); if (bundle.isUnpacked() && bundle.sourceIsReady()) { continue; @@ -634,6 +639,9 @@ public class ResourceManager * them from the classpath. */ protected String _rootPath; + /** Whether or not to unpack our resource bundles. */ + protected boolean _unpack; + /** Our default resource set. */ protected ResourceBundle[] _default = new ResourceBundle[0];