* AndroidAssetManager no longer fails on missing plugin classes

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9406 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 13 years ago
parent e71f33ef7a
commit 05d5c611e1
  1. 25
      engine/src/android/com/jme3/asset/AndroidAssetManager.java

@ -59,9 +59,10 @@ public class AndroidAssetManager extends DesktopAssetManager {
this(null);
}
private void registerLoaderSafe(Class<? extends AssetLoader> loaderClass, String ... extensions) {
private void registerLoaderSafe(String loaderClass, String ... extensions) {
try {
registerLoader(loaderClass, extensions);
Class<? extends AssetLoader> loader = (Class<? extends AssetLoader>) Class.forName(loaderClass);
registerLoader(loader, extensions);
} catch (Exception e){
logger.log(Level.WARNING, "Failed to load AssetLoader", e);
}
@ -88,16 +89,16 @@ public class AndroidAssetManager extends DesktopAssetManager {
registerLoader(com.jme3.font.plugins.BitmapFontLoader.class, "fnt");
// Less common loaders (especially on Android)
registerLoaderSafe(com.jme3.texture.plugins.DDSLoader.class, "dds");
registerLoaderSafe(com.jme3.texture.plugins.PFMLoader.class, "pfm");
registerLoaderSafe(com.jme3.texture.plugins.HDRLoader.class, "hdr");
registerLoaderSafe(com.jme3.texture.plugins.TGALoader.class, "tga");
registerLoaderSafe(com.jme3.scene.plugins.OBJLoader.class, "obj");
registerLoaderSafe(com.jme3.scene.plugins.MTLLoader.class, "mtl");
registerLoaderSafe(com.jme3.scene.plugins.ogre.MeshLoader.class, "mesh.xml");
registerLoaderSafe(com.jme3.scene.plugins.ogre.SkeletonLoader.class, "skeleton.xml");
registerLoaderSafe(com.jme3.scene.plugins.ogre.MaterialLoader.class, "material");
registerLoaderSafe(com.jme3.scene.plugins.ogre.SceneLoader.class, "scene");
registerLoaderSafe("com.jme3.texture.plugins.DDSLoader", "dds");
registerLoaderSafe("com.jme3.texture.plugins.PFMLoader", "pfm");
registerLoaderSafe("com.jme3.texture.plugins.HDRLoader", "hdr");
registerLoaderSafe("com.jme3.texture.plugins.TGALoader", "tga");
registerLoaderSafe("com.jme3.scene.plugins.OBJLoader", "obj");
registerLoaderSafe("com.jme3.scene.plugins.MTLLoader", "mtl");
registerLoaderSafe("com.jme3.scene.plugins.ogre.MeshLoader", "mesh.xml");
registerLoaderSafe("com.jme3.scene.plugins.ogre.SkeletonLoader", "skeleton.xml");
registerLoaderSafe("com.jme3.scene.plugins.ogre.MaterialLoader", "material");
registerLoaderSafe("com.jme3.scene.plugins.ogre.SceneLoader", "scene");
logger.info("AndroidAssetManager created.");

Loading…
Cancel
Save