From 3bfca1d20ac455001581b76e2032f2ed644b5422 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 20 Nov 2002 03:06:06 +0000 Subject: [PATCH] Not to complain if we can't load an image because we'll fall back to the classpath. Removed getImageSource() as calling through to the resource manager is simpler. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1972 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/media/image/ImageManager.java | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/src/java/com/threerings/media/image/ImageManager.java b/src/java/com/threerings/media/image/ImageManager.java index ea7f32cee..36486cdc4 100644 --- a/src/java/com/threerings/media/image/ImageManager.java +++ b/src/java/com/threerings/media/image/ImageManager.java @@ -1,5 +1,5 @@ // -// $Id: ImageManager.java,v 1.26 2002/11/20 02:15:05 mdb Exp $ +// $Id: ImageManager.java,v 1.27 2002/11/20 03:06:06 mdb Exp $ package com.threerings.media; @@ -75,7 +75,11 @@ public class ImageManager InputStream imgin = null; try { // first attempt to load the image from the specified resource set - imgin = getImageSource(rset, path); + try { + imgin = _rmgr.getResource(rset, path); + } catch (FileNotFoundException fnfe) { + // fall through and try the classpath + } // if that fails, attempt to load the image from the classpath if (imgin == null) { @@ -164,11 +168,7 @@ public class ImageManager public Image loadImage (String rset, String path) throws IOException { - InputStream imgin = getImageSource(rset, path); - if (imgin == null) { - throw new IOException("Image not in resource set " + - "[rset=" + rset + ", path=" + path + "]."); - } + InputStream imgin = _rmgr.getResource(rset, path); // load up the image try { @@ -181,22 +181,6 @@ public class ImageManager } } - /** - * Returns an input stream from which the requested image can be - * loaded or null if the image could not be located in any bundle in - * the specified resource set. - */ - protected InputStream getImageSource (String rset, String path) - throws IOException - { - try { - return _rmgr.getResource(rset, path); - } catch (FileNotFoundException fnfe) { - Log.warning(fnfe.getMessage()); - return null; - } - } - /** * Loads the image from the supplied input stream. Does no caching and * does not convert the image for optimized display on the target