We can't reliably make the decision as to how to load the image (FastImageIO/raw v normal) at the ResourceManager level - the path name by this point may be a file in the cache which will have lost its indicative extension. Instead, make the decision before we turn the resource path into an actual file name. This fixes YPP's current image loading issues.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@318 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Mike Thomas
2007-10-29 20:15:25 +00:00
parent e89f1dbe3b
commit b9d255b032
5 changed files with 25 additions and 15 deletions
@@ -30,6 +30,7 @@ import java.io.Serializable;
import java.util.Iterator;
import com.samskivert.util.HashIntMap;
import com.threerings.resource.FastImageIO;
import com.threerings.resource.ResourceBundle;
import com.threerings.media.image.ImageDataProvider;
@@ -93,7 +94,11 @@ public class TileSetBundle extends HashIntMap
public BufferedImage loadImage (String path)
throws IOException
{
return _bundle.getImageResource(path);
if (path.endsWith(FastImageIO.FILE_SUFFIX)) {
return _bundle.getImageResource(path, true);
} else {
return _bundle.getImageResource(path, false);
}
}
// custom serialization process
@@ -108,7 +113,7 @@ public class TileSetBundle extends HashIntMap
out.writeInt(entry.getIntKey());
out.writeObject(entry.getValue());
}
}
}
// custom unserialization process
private void readObject (ObjectInputStream in)